-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
Revert back to <!doctype html>
?
#1522
Comments
I thought of this as soon as I read that compression article. |
Note that the “compresses better” argument is a generalization – it assumes that throughout the rest of the document, the lowercase “may spark the developer's curiosity” is subjective – you could say the same thing about Another reason pro uppercase is polyglot/XHTML compatibility (although XHTML is not something anyone actively wants to support). |
<!doctype html>
<!doctype html>
?
The compression of 'doctype' vs 'DOCTYPE' is never going to matter. |
Having DOCTYPE uppercase will keep it consistent with its mentions in docs on WHATWG. |
Having doctype lowercase will keep it consistent with @paulirish.
|
I would be in favor of leaving the doctype as it is, in upper case. There is not a lot of value for any other variant. |
@mathiasbynens I also think the uppercase variant has a slight advantage, as you said, probably not bc somebody wants to support polyglot/XHTML whatever =)...but any xml parser could parse a HTML document with an uppercase doctype while a lower or mixed case one would throw a parse error...not that a lot of people would extensively parse html documents with XML parsers (and also the rest of the tags should then be XHTML compatible, eg. self closing etc.) but who knows when you will, so I don't see anybody hurt due to an uppercase doctype but in the described case that would be possible...at least that's how I understood it =) |
Cant find evidence of this now, as I think it's been resolved. So given that, there are no serious reasons we would avoid lower-case. H5BP rejected supporting polyglot documents a long time ago, it's not worthwhile to try to support it at doctype level and then ignore support for the rest. I think the lowercase doctype is consistent with the lower-case of the html tags used. Beyond consistency, uppercase is loud, obnoxious and isn't a calm introduction into the HTML source. Google uses the lowercase doctype, along with hundreds of thousands of sites built with earlier h5bp versions. |
@exside that would make it inconsistent with some of the other decisions made by h5bp. You mentioned self-closing tags, for example; h5bp does not have self-closing tags. If doctype should be uppercase for the purpose of being compatible with xml, then everything else should be xml compatible as well. This isn't intended to say that there are zero reasons for using uppercase, only that the reason you've brought up is an invalid one, or at least inconsistent with some of the other decisions h5bp has made. |
@QWp6t from that point of view, you're definitely right =)...i use my "own" crafted base template which for sure got a good amount of best practices form h5bp, so I didn't have that "pure" h5bp thing in mind when writing that comment, but I liked the strictness of XHTML somehow and thus I'm still writing in an XHTML compliant way (e.g. with self closing tags etc.) |
What's the conclusion here? I still don't see reasons to change the doctype. |
@drublic for me, the main reason for this change is that it feels more consistent with the rest of the code. |
Considering the above comment from @paulirish I think I'll vote for the change. |
@alrra Yes, I'm a for |
And the other way around, the upper-case will differentiate DOCTYPE declaration string (preamble) from regular html tags. My 👍 for |
<!doctype html>
?<!doctype html>
?
<!doctype html>
?<!doctype html>
?
<!doctype html>
?<!doctype html>
?
Thank you all for your feedback! |
If anyone is interested in some stats: (:warning: please keep in mind that those numbers are not necessarily representative for actual pages with content, so treated them just as fun stats!)
|
Return back to the lowercase doctype in order to be more consistent with the lowercase of the html tags. References: * #1522 * http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#the-doctype Close #1522.
IE9 needs standards mode for standard implementation of document.querySelectorAll. - http://stackoverflow.com/a/18404789/319878 Modernise the doctype according to html5-boilerplate: - h5bp/html5-boilerplate#1522 - h5bp/html5-boilerplate@e67e9cc
HTML5 the doctype declaration is case-insensitive but here's some reason. Please check this issue h5bp/html5-boilerplate#1522 And some popular HTML boilerplate also use a lowercase doctype. - html5-boilerplate: https://github.com/h5bp/html5-boilerplate/blob/master/src/index.html#L1 - Web Starter Kit: https://github.com/google/web-starter-kit/blob/master/app/index.html#L1 and google.com too.
HTML5 the doctype declaration is case-insensitive but here's some reason. Please check this issue h5bp/html5-boilerplate#1522 And some popular HTML boilerplate also use a lowercase doctype. - html5-boilerplate: https://github.com/h5bp/html5-boilerplate/blob/master/src/index.html#L1 - Web Starter Kit: https://github.com/google/web-starter-kit/blob/master/app/index.html#L1 and google.com too.
HTML5 the doctype declaration is case-insensitive but here's some reason. Please check this issue h5bp/html5-boilerplate#1522 And some popular HTML boilerplate also use a lowercase doctype. - html5-boilerplate: https://github.com/h5bp/html5-boilerplate/blob/master/src/index.html#L1 - Web Starter Kit: https://github.com/google/web-starter-kit/blob/master/app/index.html#L1 and google.com too.
Standardized the HTML5 doctype declarations across the app. Lower case was chosen to stick to the standards in HTML5 boilerplate. HTML5 Boilerplate: https://github.com/h5bp/html5-boilerplate Doctype Discussion: h5bp/html5-boilerplate#1522
Return back to the lowercase doctype in order to be more consistent with the lowercase of the html tags. References: * h5bp/html5-boilerplate#1522 * http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#the-doctype Close h5bp/html5-boilerplate#1522.
Standardized the HTML5 doctype declarations across the app. Lower case was chosen to stick to the standards in HTML5 boilerplate. HTML5 Boilerplate: https://github.com/h5bp/html5-boilerplate Doctype Discussion: h5bp/html5-boilerplate#1522
Standardized the HTML5 doctype declarations across the app. Lower case was chosen to stick to the standards in HTML5 boilerplate. HTML5 Boilerplate: https://github.com/h5bp/html5-boilerplate Doctype Discussion: h5bp/html5-boilerplate#1522
Previous discussions
Commit in which the change was made: 7a2f9dc
Relevant issues: #335, #1059.
Specification, browsers and validators
From WHATWG
So, according to the specification, the case doesn't matter. Also, browsers (AFAIK) don't really care, and the W3C validator is fine with either case.
Pros and cons for using
<!doctype html>
Pros:
html
in thedoctype
declaration, or anything else for that matter)Cons:
Thoughts?
The text was updated successfully, but these errors were encountered: