Opened 7 years ago
Last modified 6 years ago
#43352 new feature request
Make html5 standard rather than opt in for theme development
Reported by: | kkalvaa | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Themes | Keywords: | |
Focuses: | template | Cc: |
Description
Currently when you want to have WordPress output valid HTML5 code for certain elements ('search-form', 'comment-form', 'comment-list', 'gallery', 'caption') you have to specifically add support in functions.php via add_theme_support( 'html5', […]) to opt in for use in your theme.
I propose to make these 5 elements HTML5 by default, HTML5 support in modern browsers are more than adequate and most, if not all, modern themes use HTML5 code. The HTML5 standard is also stable.
WordPress should output these elements in HTML5 by default rather than having developers opt in, by now the situation should be the other way around, you should opt out if you for some unknown reason would rather not have HTML5 code.
Change History (3)
#2
@
6 years ago
For existing themes that opt in WordPress could simply ignore the statement and load regardless. There shouldn't be any problem in this scenario.
The problem arises from themes that doesn't opt in and also asumes the code isn't HTML5. Strictly speaking html5 elements should work in modern browsers regardless of whether the theme declares support or not, and as long as the css use classes or id selectors rendering should still work as intended. If on the other hand the css specifically targets element structures then there's a problem with changing the default.
I guess the question becomes how many sites assume the old default in such a way that this change would be a render breaking change.
I like the idea, but what to do about all the existing themes that assume the old default?