This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27297 - DOM needs a way to get element's computed ARIA role and computed label string
Summary: DOM needs a way to get element's computed ARIA role and computed label string
Status: RESOLVED MOVED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on: 27294
Blocks:
  Show dependency treegraph
 
Reported: 2014-11-11 10:38 UTC by Simon Pieters
Modified: 2019-03-29 19:35 UTC (History)
9 users (show)

See Also:


Attachments

Description Simon Pieters 2014-11-11 10:38:11 UTC
+++ 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();
};
Comment 1 Ian 'Hixie' Hickson 2014-11-12 19:14:43 UTC
Wouldn't this be an ARIA bug?
Comment 2 Philip Jägenstedt 2014-12-17 21:44:32 UTC
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.
Comment 3 Ian 'Hixie' Hickson 2014-12-18 01:09:37 UTC
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.
Comment 4 Philip Jägenstedt 2014-12-18 08:32:42 UTC
OK, I'll suggest shopping around for another spec or writing a new one.
Comment 5 Philip Jägenstedt 2014-12-18 08:37:37 UTC
Anne, do you think this would make sense in DOM?
Comment 6 Anne 2015-09-02 08:43:06 UTC
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.
Comment 7 Anne 2017-07-21 10:44:36 UTC
Since HTML currently doesn't define either role or aria-* this seems out of scope for the moment.
Comment 8 James Craig 2017-07-21 11:25:10 UTC
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
Comment 9 Anne 2017-07-25 09:36:17 UTC
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.
Comment 10 Domenic Denicola 2019-03-29 19:35:40 UTC
https://github.com/WICG/aom