Opened 11 years ago
Closed 11 years ago
#24098 closed enhancement (fixed)
Support for HTML5 roles
Reported by: | aniketpant | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | normal | Version: | 3.5 |
Component: | Formatting | Keywords: | 2nd-opinion has-patch |
Focuses: | accessibility | Cc: |
Description
I was going through http://core.svn.wordpress.org/trunk/wp-includes/kses.php and I realized that most of the new HTML5 tags have been introduced but role
is a missing attribute.
I feel that since WordPress has already made a move towards HTML5 by supporting <article>
, <section>
and other tags, all attributes should be made available too. role
should be added to the required tags falling under $allowedposttags
.
Go through the link for more information on roles.
Attachments (1)
Change History (10)
#3
@
11 years ago
I added the the role attribute to all values. This seems a little ridiculous but but according to W3C Section 3.2.7.1 any HTML element should be able to use role. Perhaps this isn't realistic, and we should just apply it to the elements that commonly have a role defined. Thoughts?
#4
@
11 years ago
My apologies Mike if I led you astray on my last comment. If we're going to add it to all HTML, should it go in $global_attributes instead (in the _wp_add_global_attributes() at the end of kses.php instead?
It makes sense to me to add it there—you want to take it?
#5
@
11 years ago
I totally agree, that makes WAY more sense - I didn't even know that was there. See the updated diff, i've made the change.
I think this is better classified as a Accessibility component as the
role
attribute since it is in the HTML5 spec as coming from the WAI-ARIA spec. ( http://www.w3.org/TR/wai-aria/roles ).To that end, it should be added to $allowedposttags, likely in 3.7. I'll work up a patch when 3.6 drops, if no one else does before.