Patch 6 -- Replace invalid use of legend tag #48

Closed
wants to merge 19 commits into
from

Conversation

Projects
None yet
2 participants
@jmjf
Contributor

jmjf commented Feb 8, 2013

Problem:
In the_bootstrap_comment_form_default a legend element styles the comment form title. W3C says the legend element should only be used as the first child of a fieldset element. http://www.w3.org/TR/html-markup/legend.html

Changes:
Replace the legend element with span.legend.
Add .legend to style.css (copied from Bootstrap legend element style).

Warnings:
My git-foo is weak, so I may have packaged this wrong. Make sure the only changes coming with this pull are to functions.php (the_bootstrap_comment_form_defaults) and style.css (add .legend in classes section).

People who customize Bootstrap.css with non-standard font-size, line-height, color, etc. will need to override the default .legend styles.

This could create some challenges with the included Bootswatchr themes.

It is possible that the full .legend styling is not needed. For example, testing suggests the width, padding, and color attributes don't affect appearance. Removing these may prevent some of the potential Bootswatchr problems.

jmjf added some commits Feb 5, 2013

Update index.php
Add HTML5.1 main tag in place of div for role="main"
Update templates/_full_width.php
Add HTML5.1 main tag in place of div for role="main"
Update archive.php
Add HTML5.1 main tag in place of div for role="main"
Update category.php
Add HTML5.1 main tag in place of div for role="main"
Update single.php
Add HTML5.1 main tag in place of div for role="main"
Update author.php
Add HTML5.1 main tag in place of div for role="main"
Update page.php
Add HTML5.1 main tag in place of div for role="main"
Update 404.php
Add HTML5.1 main tag in place of div for role="main"
Update search.php
Add HTML5.1 main tag in place of div for role="main"
Update image.php
Add HTML5.1 main tag in place of div for role="main"
Update tag.php
Add HTML5.1 main tag in place of div for role="main"
Update js/html5shiv.min.js
Add support for HTML5.1 main element
Update functions.php
Remove legend tag used outside fieldset.
Update style.css
Add legend class to apply to span in comment header (that replaced invalid use of legend tag).
Update functions.php
In the_bootstrap_comment_form_defaults, the legend element is used as a child of an h3 element (presumably for styling). According to W3C, legend is only valid as the first child of a fieldset. http://www.w3.org/TR/html-markup/legend.html The HTML it throwing validator errors as a result.

Replace the legend element with span.legend so it can be styled.
Update style.css
Add legend class so span on the comment form title can be styled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment