Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some problems with (X)HTML 5 specification #274

Closed
rdeltour opened this issue Oct 15, 2013 · 6 comments
Closed

Some problems with (X)HTML 5 specification #274

rdeltour opened this issue Oct 15, 2013 · 6 comments
Assignees
Labels
type: not an issue The issue is rejected (not an actual issue or not relevant)

Comments

@rdeltour
Copy link
Member

From [email protected] on May 30, 2013 13:15:26

VERSION:
3.0

STEPS TO REPRODUCE:

  1. check with epubcheck the attached file (it's the printable version of the "autism" page of wikipedia, converted to epub with Calibre)
  2. read the errors ^^

RESULT: epubcheck reports the errors:
a. attribute "class" not allowed here [in "html" tags]
b. element "script" missing required attribute "type"
c. value of attribute "dir" is invalid ["auto"]
d. attribute "srcset" not allowed here [in "img" tags]
e. attribute "role" not allowed here [in "div" tags]

EXPECTED: None of these errors should be displayed. In (X)HTML 5:
a. "class" attribute is allowed in any tag
b. attribute "type" is no longer required for "script" tags
c. attribute "dir" can have value "auto"
d. "srcset" is a proposed html extension for images: http://www.w3.org/html/wg/drafts/srcset/w3c-srcset/ e. "role" attribute seems to be reintroduced in HTML 5: http://www.w3.org/TR/role-attribute/

Attachment: autism.epub

Original issue: http://code.google.com/p/epubcheck/issues/detail?id=274

@rdeltour
Copy link
Member Author

From [email protected] on June 24, 2013 19:16:09

You generated an EPUB 2 containing XHTML 1.1 content using Calibre, so all the errors are valid.

You need to convert the content to EPUB3/XHTML5 if you want it to validate as such.

@rdeltour
Copy link
Member Author

From [email protected] on June 25, 2013 00:13:42

Right. In this case epubcheck, I think, should alert about the inconsistency between the epub version and the doctype of XHTML files, since it's preferable that you'll convert the epub 2 to an epub 3 instead of convert all xhtml 5 documents to a previous xhtml specification.

In theory this is another issue, you can close this bug and open another one if you want :)

@rdeltour
Copy link
Member Author

From [email protected] on June 25, 2013 05:19:58

But no doctype was specified in these files that I found, so epubcheck is doing exactly what it should for an epub declared as 2.0 in the OPF.

If the html5 doctype had been specified, then I agree it would be useful to at least report an unexpected doctype.

@rdeltour
Copy link
Member Author

From [email protected] on July 07, 2013 04:23:30

Well, the fact the doctype is removed is a calibre bug. Anyway I think epubcheck should alert you the doctype is missing, since html 5 specs requires it: http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#the-doctype

@mattgarrish
Copy link
Member

The doctype requirement only applies to the HTML serialization in HTML5:

XML documents may contain a DOCTYPE if desired, but this is not required to conform to this specification. This specification does not define a public or system identifier, nor provide a format DTD.
http://www.w3.org/TR/html5/the-xhtml-syntax.html#writing-xhtml-documents

And technically there is a set of obsolete DTDs that can be used with HTML5 as defined in that doctype section, one of which is the XHTML 1.1 doctype epub 2 uses.

XHTML 1.1, on the other hand, does require a doctype:

There MUST be a DOCTYPE declaration in the document prior to the root element.
http://www.w3.org/TR/xhtml11/conformance.html#s_conform

But I don't think it's invalid to use the HTML5 doctype in an XHTML 1.1 file from what I see. The XHTML 1.1 specification doesn't require any specific doctype, only that one be present.

So, long story short, epubcheck should have emitted a warning that no doctype was present for the epub 2 content documents, but had doctypes been inserted I still think it would have resulted in confusion since the doctype isn't used for validation.

@rdeltour
Copy link
Member Author

Closing as invalid. The part about EPUBCheck checking the XHTML 1.1 doctype declaration can be tracked in #982.

@rdeltour rdeltour added type: not an issue The issue is rejected (not an actual issue or not relevant) and removed status: needs review Needs to be reviewed by a team member before further processing labels Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: not an issue The issue is rejected (not an actual issue or not relevant)
Projects
None yet
Development

No branches or pull requests

2 participants