This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
+++ This bug was initially created as a clone of Bug #27294 +++ DOM needs a way to get element's computed ARIA role and computed label string. For example: partial interface Element { // These might not need to be an accessors methods. // Could be string properties instead. String computedRole(); String computedLabel(); };
Wouldn't this be an ARIA bug?
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/WToTEn4lveY is what I've been able to figure out about this. If I'm correct in guessing that this would fall back to https://html.spec.whatwg.org/#wai-aria then the HTML spec seems like the natural place. Disclaimer: I know nothing about ARIA.
I don't see what HTML has to do with this. Sure, HTML defines some default semantics. So do, or might, SVG, MathML, HypotheticalRandomNewML, etc. The API has nothing to do with HTML itself as far as I can tell. It's either an ARIA feature, or maybe a DOM feature, or its own feature, IMHO.
OK, I'll suggest shopping around for another spec or writing a new one.
Anne, do you think this would make sense in DOM?
Ideally this would be defined in the same place that defines attribute ? role; I even think that for role they could be the same feature, using the "limited to known values" thingie.
Since HTML currently doesn't define either role or aria-* this seems out of scope for the moment.
The concept of computed role does not rely on the role content attribute. These aspected existed in web content before ARIA was conceived. For example: <h1> returns a computed role of "heading" in any browser. <a href> returns a role of link. The ARIA roles in the @role attribute can override the default: <a href> // link <a href role="button"> // button But it will be ignored in some contexts: <button role="foo"> // button Likewise, the fallbacks are computed: <button role="switch checkbox"> // 'switch' in an ARIA-1.1-capable engine, or 'checkbox' in an ARIA-1.0-capable engine
That's fair, but currently HTML doesn't define any of that. It arguably should, but we'd need someone to put in the time.
https://github.com/WICG/aom