Opened 15 years ago
Closed 13 years ago
#11554 closed defect (bug) (fixed)
Calendar generated by WordPress is invalid HTML5
Reported by: | avcascade | Owned by: | ryan |
---|---|---|---|
Milestone: | 3.2 | Priority: | normal |
Severity: | minor | Version: | 2.9 |
Component: | Validation | Keywords: | has-patch |
Focuses: | Cc: |
Description
While building an HTML5 theme for WordPress (I don't use XHTML, this is why) I discovered that the calendar generated by WordPress' general-template is not valid HTML5.
Two attributes are causing problems: summary (which is obsolete) and abbr, which seems redundant since title contains the same information.
Removing the summary and abbr attributes from general-template causes a WordPress blog with an HTML5 theme to properly validate using the conformance checker. Since the summary and abbr attributes do not appear necessary for the display of the calendar, it seems like removing them would make the core leaner and meaner.
Line with summary:
echo '<table id="wp-calendar" summary="' . esc_attr__('Calendar') . '">
There are several lines with abbr, like:
echo "\n\t\t<th abbr=\"$wd\" scope=\"col\" title=\"$wd\">$day_name</th>";
Attachments (4)
Change History (18)
#2
@
15 years ago
WordPress does support any doctype. It can be configured. Mainly this is HTML and XHTML but this is configure-able.
HTML5 still is a draft, it makes no sense to validate against it right now.
But in any case, the reported redundant information should be removed. I would favor for the title attribute.
#3
@
15 years ago
- Keywords needs-patch added; dev-feedback removed
Some wise words: The referenced resource - which is a must read for any webdev - suggests to stick with HTML 4.01. Why not build a theme based on that standard. I would like to see WordPress to at least validate against that standard (plus ARIA maybe).
@
15 years ago
Removes the summary attribute from the calendar table element. Removes the abbr attribute from the calendar th and td elements. Calendar output validates as HTML5.
#7
@
13 years ago
- Component changed from Template to Widgets
- Resolution fixed deleted
- Status changed from closed to reopened
- Version changed from 2.9 to 3.2
Line 1149 of general-template.php in 3.2 "bleeding edge" just updated is still generating invalid html
<table id="wp-calendar" summary="Calendar"
The summary attribute is obsolete. Consider describing the structure of complex tables in <caption> or in a paragraph and pointing to the paragraph using the aria-describedby attribute.
Patch not applied?
#8
@
13 years ago
- Component changed from Widgets to Template
- Keywords needs-patch added; has-patch removed
- Milestone changed from 3.0 to 3.2
- Version changed from 3.2 to 2.9
Interesting, it was reverted with r13048 by mistake.
@
13 years ago
Ran a source dump of a clean install with one widget through the validator - checks clean.
#10
@
13 years ago
- Resolution set to worksforme
- Status changed from reopened to closed
- Version changed from 2.9 to 3.2
Patch applied, source ran through HTML5Validator (http://html5.validator.nu/) with clean validation.
WordPress itself does not output HTML5, instead, All functions will generally return HTML4/XHTML strings.
Theme authors may replace core strings via filters and/or registering their own widgets if WordPress's output doesnt conform to their Doctype specifications.
I'm setting this a dev-feedback, with the question of: What Doctypes does WordPress currently support, and what should it support?
Given that the attributes there at present are virtually useless to most people, i see no reason to not remove them, however, Future output may not conform to HTML5 spec either.