Why does a HTML import not need a doctype?

126 views
Skip to first unread message

Marcin Warpechowski

unread,
Feb 12, 2014, 6:10:38 AM2/12/14
to polym...@googlegroups.com
The HTML Imports spec ( http://w3c.github.io/webcomponents/spec/imports/ ) says that the imported documents "are HTML documents". Then there is a link to the HTML Living Standard ( http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html )

HTML Living Standard says "A DOCTYPE is a required preamble."

On a side note, HTML4 spec also said that "Every HTML document must have a TITLE element in the HEAD section.", but I think that requirement was dropped in HTML5 (please correct me if I'm wrong).

Still, what about the doctype? I would like to know what part of the spec regulates that the doctype can be omitted, which is the case for all the Polymer Element HTML Imports that I have seen.

I am asking to be sure that I have understood the current spec.

Thanks for clarification!

Hajime Morrita

unread,
Feb 12, 2014, 1:05:59 PM2/12/14
to Marcin Warpechowski, polym...@googlegroups.com
In practice, DOCTYPE declaration is needed for a compatibility reason. It triggers non-legacy/quirks behavior of HTML.

A feedback [1] from Polymer team says that HTML imports shouldn't have quirks mode (one triggered by lack of DOCTYPE declaration) and it should always be in non-quirks mode. This makes sense because there is no "legacy" imports. I yet to find good place for [1] to fit in the import spec. But it'll be in eventually. 

Does this answer your question?


--
morrita



Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/353a18b4-1423-4935-819a-890cc23d6ad5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
morrita
Message has been deleted

Marcin Warpechowski

unread,
Feb 13, 2014, 10:22:16 AM2/13/14
to polym...@googlegroups.com, Marcin Warpechowski
It does, thanks!
Reply all
Reply to author
Forward
0 new messages