w3c / epubcheck

The conformance checker for EPUB publications
https://www.w3.org/publishing/epubcheck/
BSD 3-Clause "New" or "Revised" License
1.66k stars 405 forks source link

epubcheck 4.2.0.-beta: class values for HTML5:link #989

Closed Doktorchen closed 1 year ago

Doktorchen commented 5 years ago

epubcheck 4.2.0.-beta reports about such content an error message:

" <link href="stil.css" type="text/css" media="all" title="dunkel auf hell" rel="Stylesheet" /> <link href="alt.css" type="text/css" media="all" title="hell auf dunkel" rel="Alternate Stylesheet" /> <link href="no.css" type="text/css" media="all" title="kein Stilvorlage" rel="Alternate Stylesheet" /> <link href="day.css" type="text/css" media="all" class="day" title="Tag" rel="Alternate Stylesheet" /> <link href="night.css" type="text/css" media="all" class="night" title="Nacht" rel="Alternate Stylesheet" /> <link href="grau.css" type="text/css" media="all" class="day horizontal allday" title="grau 1" rel="Alternate Stylesheet" /> <link href="grau.css" type="text/css" media="all" class="night vertical allday" title="grau 2" rel="Alternate Stylesheet" /> <link href="pogo.css" type="text/css" media="all" class="allday" title="Pogo" rel="Alternate Stylesheet" /> "

The error messages goes like this: " ERROR(OPF-027): CSS_ein.epub/Inhalt/test2.xhtml(17,51): Undefined property: 'allday'. ERROR(OPF-027): CSS_ein.epub/Inhalt/test2.xhtml(19,51): Undefined property: 'allday'. ERROR(OPF-027): CSS_ein.epub/Inhalt/test2.xhtml(21,49): Undefined property: 'allday'. "

Because epubcheck 4.2.0 checks HTML5.2 and EPUB 3.2, I had a look into these texts.

As for previous HTML5 versions, the class attribute still is a global attribute, the value is a set of space-separated tokens. This applies to the usage in the example. As always for class values - it is mainly the problem of the authors, what to indicate with it or for what to use it.

As far as I identified this in the EPUB 3.2 draft (it seems not to have a table of contents yet), there is no restriction mentioned for this attribute.

EPUB3.x mentions the usage, but it defines only a specific meaning of a few tokens, that may be used, it does not say, that authors must not use other tokens. A referenced recommendation http://www.idpf.org/epub/altss-tags/ indicates only mutually exclusive pairs of tokens, but does not exclude other tokens.

Additional problem of epubcheck: It is possible as well to note mutually exclusive tokens like class="day night", the recommendation only notes: 'If two style sheets within a style set are tagged with mutually exclusive tags, both tags are ignored.' (not mentioned at all, what to do, if one style sheet is tagged with mutually exclusive tags). My own interpretation would be, that the alternative style is applicable both for day and night, respectively horizontal or vertical alignment, but such a case is not considered yet, but it may apply, if there is a larger list of alternative styles, the audience may have the choice.

Error message from epubcheck goes like this: ERROR(CSS-005): CSS_ein.epub/Inhalt/test2.xhtml(11,61): Conflicting alternate style attributes found: day night.

Would be enough to provide an info, that the tagging state is undefined in such a situation.

Therefore these seem to be a bugs of epubcheck 4.2.0.-beta to report errors here, right?

rdeltour commented 5 years ago

Yes, looks like EPUBCheck is a tad overzealous here. @mattgarrish can you confirm?

mattgarrish commented 5 years ago

Yes, there was never a restriction on use, but I'd drop this in the very low priority bucket. We've stopped referencing alternate style tags as it's another of the mostly unimplemented technologies.