It is currently Sat Dec 02, 2017 4:18 pm Advanced search
Right. Do you disagree? If so, why?JAB Creations wrote:Well for starters...
http://www.whatwg.org/specs/web-apps/cu ... he-doctype
I've also read a lot of posts on here where people either didn't want to use the doctype or thought a reduced doctype was the preferred way to go.
DOCTYPEs are required for legacy reasons. When omitted, [legacy] browsers tend to use a different rendering mode that is incompatible with some specifications [HTML 4?]. Including the DOCTYPE in a document ensures that the [legacy] browser makes a best-effort attempt at following the relevant specifications [HTML 4].
Triggering standards mode in HTML is done by a DOCTYPE
So the doctype is only there to trigger standards mode in legacy browsers (e.g. IE7). But what's the point in doing that? Such browsers won't display HTML 5 correctly anyway because of all the new elements (section, nav, etc.).
putting a version number in there doesn't make much sense.
Not only legacy, but also future. Browsers simply cannot remove quirks mode; the majority of the Web depends on it.bmcelwee wrote:"<!doctype html>" should not be part of HTML 5. The WD explains the spurious rationale; I have added clarifications in [brackets]:DOCTYPEs are required for legacy reasons. When omitted, [legacy]
More notably CSS.bmcelwee wrote:browsers tend to use a different rendering mode that is incompatible with some specifications [HTML 4?].
HTML5 browsers will have quirks mode as well.bmcelwee wrote:Including the DOCTYPE in a document ensures that the [legacy] browser makes a best-effort attempt at following the relevant specifications [HTML 4].
So the doctype is only there to trigger standards mode in legacy browsers (e.g. IE7). But what's the point in doing that? Such browsers won't display HTML 5 correctly anyway because of all the new elements (section, nav, etc.).
It does what it's supposed to do: trigger standards mode.bmcelwee wrote:If we really must have a doctype, why not make it do something useful?
Why is that useful information? How would you express this information in XHTML5? What about when you only have a fragment, e.g. in an Atom feed?bmcelwee wrote:"<!doctype html 5>" at least lets us see that the document claims to conform to the HTML 5 spec.
The latest version of a browser should be able to view all "versions" of HTML. Moreover, all "versions" of HTML should be viewable to some extent in all browsers.bmcelwee wrote:Otherwise, there is no way of knowing what browser should be used to view any given HTML file.
Unless I'm mistaken, Henri Sivonen (who develops Validator.nu) would disagree.haka wrote:A doctype with a version is important for HTML validators,
Could you elaborate on how they would benefit?haka wrote:HTML importers
Do you mean "HTML parsers" as in "build a tree from this byte stream" or general UAs? If the former, I don't think they would benefit; a HTML parser would simply just use the parsing rules defined in the latest HTML spec. If the latter, could you elaborate on which UAs those would be, and how they would benefit?haka wrote: or other HTML parsers
Not sure I follow here.haka wrote: to detect the elements fit with the version. I agree that the doctype should be simple as possible, but if HTML 5 is a success (what I realy believe) there may be some more versions like HTML5tiny, HTML5print, HTML6.
Surely, the MIME type says that the document is XML, not the contents of the file. No?haka wrote:And to say the parser that the document is XHTML would be nice to. I know there are a lot of mixed SGML/XML documents online.
Indeed, but can't they just assume the last version of HTML that they support?haka wrote:In the browser, the version definition wont make sense, but not only browsers works with HTML. There is a wide range of applications wich parses, checks or imports HTML.
I'm not sure I follow.haka wrote:So when I use an application that is HTML 5 compatible, but not HTML 6, it would be a hard work to find the unsupported elements. With a validation that detects the version by a document information its simple to find the unsupported elements.
zcorpan wrote:The latest version of a browser should be able to view all "versions" of HTML. Moreover, all "versions" of HTML should be viewable to some extent in all browsers.
bmcelwee wrote:But I see now that version 5 of the spec actually subsumes and replaces all previous versions. So as well as specifying what a valid HMTL file is, it also needs to allow old HTML files to continue to be renderable as far as is reasonably possible.
zcorpan wrote:So your app supports HTML5. It can validate a document according to HTML5.
zcorpan wrote:What makes it hard to find the unsupported elements, exactly?
Users browsing this forum: No registered users and 0 guests