-
Notifications
You must be signed in to change notification settings - Fork 16
What should EPUBCheck do about CSS validation? #69
Comments
Note: this issue was mentioned in w3c/epub-specs#1185
|
Some random thoughts:
|
I don't think it does.
As long as we want to inspect anything in the CSS (
👍. Note btw that it is possible to provide overridden severity levels for EPUBCheck checks, so if anyone want to make that a warning or error in their production workflow they can.
👍. The big question IMO is whether we should better implement CSS Syntax, or instead ignore CSS validation altogether (as we do for JS, btw). |
I think it would be tremendously helpful for users. EPUB creators live in a world without dev tools, which is horrifying. Anything that can be done to help them understand what is going wrong in their books would be valuable. (although I don't have any information on how reading systems respond to malformed stylesheets, or if the community sees this as useful. Might be a useful discussion to have in the CG sometime soon.) |
I learn something every day! EPUBCheck is finding at least basic syntax errors in both internal and external stylesheets: body { color: red; }
}
p { color: green; } Excellent! |
Yes, EPUBCheck does include its own CSS parser (hat tip to Markus Gylling!). It's just that it's not fully compliant to CSS Syntax… (although I don't remember the details of the known false positives or false negatives). |
My 2¢ on this discussion and based on my issue w3c/epubcheck#935 (comment). While I do see the reasoning behind @dauwhe’s points above, I also see epubcheck as a tool for active development, not just passive post-process validation. As such I am very much interested in errors in a CSS file, even though a renderer has well-defined behavior to tolerate them. It is certainly not my intent to ship an invalid CSS file, so if a typo snuck in then I want to know about it. The renderer/e-reader will hide it from me well, and that’s certainly no use for me as the developer. (As pointed out in my original comment, W3C’s CSS validator does catch syntax errors so folks can fix them.) |
I mean, even well-formed stylesheets will become an issue as time passes and the CSS snapshot is updated accordingly. Some older SDKs – I won’t name but hey it’s still used by a lot of devices/apps – will ignore the entire stylesheet if they can’t parse a value e.g.
or
So I wouldn’t personally expect much from epubcheck or the W3C’s CSS validator in the longer term. OTOH, getting syntax errors is a nice-to-have because sometimes you’re in a rush and authoring can become sloppy, etc. But I’m a lot more worried about the adoption of new (and generally more robust/easier to author) CSS modules in EPUB-Land because even well-formed stylesheets can be an issue. |
Again, this would be eased if there was a notion of EPUB reading system "level" or "profile", a standardized classification of RS'es in the field. RS relying on web rendering engines will evolve in a natural way (because they use the OS native engine of the device or because new versions can easily be released each year, with a new version of the rendering engine). RS using a "home made" rendering engine are stuck with a given snapshot of CSS 2 / 3. |
Currently (v4.1.0), EPUBCheck has limited support for CSS validation, for instance:
but:
-epub
prefixed properties and valuesThe EPUBCheck team would like some guidance on what to do with CSS validation in future versions.
The options include (non-exhaustively):
The EPUBCheck team currently envisions to keep the existing changes, update them to 3.2 rules, and also add an on/off switch to be able to enable/disable the CSS checks.
Thoughts?
The text was updated successfully, but these errors were encountered: