Contact emails
abox...@chromium.org, dmaz...@chromium.org
Spec
PFWG bug/discussion: https://www.w3.org/WAI/PF/Group/track/issues/427
DOM bug: https://www.w3.org/Bugs/Public/show_bug.cgi?id=27294
Summary
Extend the Element interface as follows:
partial interface Element {
String computedRole();
String computedName();
}
This will be implemented behind the "experimental web platform features" flag in Chrome.
Motivation
Quoting from the PFWG bug:
"""
Since the role attribute accepts a whitespace-delimited set of token values for applicable roles, the web application needs a way to determine which of those roles has been applied to a particular element. For example, given the following markup:
<el role="NewRole button link">
We may be able to assume that "button" will override the "link" role in any ARIA-compliant browser, since both of those roles are standard in ARIA 1.0, but what if the example role "NewRole" is added to ARIA 2.0 or another spec. The web application needs to know which role has been applied so it can control the behavior accordingly.
"""
Regarding computedLabel, this will be useful for testing and debugging purposes, where it may be used to manually check what label a certain element exposes to accessibility, or in an automated testing context where assertions may be made about label content (e.g. non-empty, correctly localized, etc.)
Compatibility Risk
Low to moderate. The PFWG bug states that representatives from Chrome, IE and Mozilla have expressed interest (and the bug was filed by a Safari engineer). However, no full spec exists yet, nor any other implementation. The purpose of this implementation would be to explore use cases and help flesh out the spec.
Ongoing technical constraints
Requires core DOM code to be slightly more coupled to accessibility code (in order to retrieve the computed role/label).
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes.
OWP launch tracking bug?
Link to entry on the feature dashboard
https://www.chromestatus.com/features/5530552681627648
Requesting approval to ship?
No.
The case for computedName (or is it computedLabel?) seems weaker. If
the primary purpose is testing, debugging and automated testing,
exposing it in Internals would seem to suffice. There was less
discussion about it, so I'm not sure what it should do.
Can you describe in more detail what computedName/computedLabel shouldOn Thu, Dec 18, 2014 at 6:57 PM, Dominic Mazzoni <dmaz...@chromium.org> wrote:
> On Wed, Dec 17, 2014 at 2:07 AM, Philip Jägenstedt <phi...@opera.com>
> wrote:
>>
>> The case for computedName (or is it computedLabel?) seems weaker. If
>> the primary purpose is testing, debugging and automated testing,
>> exposing it in Internals would seem to suffice. There was less
>> discussion about it, so I'm not sure what it should do.
>
>
> I see this as potentially very useful for feature / capability detection and
> providing polyfills. As one example, there's a proposal that would allow you
> to specify a querySelector string in aria-labelledby instead of an IDREF. If
> that proposal ends up being implemented, an author would be able to detect
> if the feature is supported or not by using computedName/computedLabel.
do? Other than <label> elements associated with e.g. <input> and
aria-labelledby attributes, what other things have an influence?
Something like aria-labelledby="div > p" sounds curious, how would you
know whether to interpret "div > p" as a selector or as an id? It's
possible to have id="div > p" and getElementById("div > p") will find
that element, after all.
On Fri, Dec 19, 2014 at 10:04 AM, Philip Jägenstedt <phi...@opera.com> wrote:Can you describe in more detail what computedName/computedLabel shouldOn Thu, Dec 18, 2014 at 6:57 PM, Dominic Mazzoni <dmaz...@chromium.org> wrote:
> On Wed, Dec 17, 2014 at 2:07 AM, Philip Jägenstedt <phi...@opera.com>
> wrote:
>>
>> The case for computedName (or is it computedLabel?) seems weaker. If
>> the primary purpose is testing, debugging and automated testing,
>> exposing it in Internals would seem to suffice. There was less
>> discussion about it, so I'm not sure what it should do.
>
>
> I see this as potentially very useful for feature / capability detection and
> providing polyfills. As one example, there's a proposal that would allow you
> to specify a querySelector string in aria-labelledby instead of an IDREF. If
> that proposal ends up being implemented, an author would be able to detect
> if the feature is supported or not by using computedName/computedLabel.
do? Other than <label> elements associated with e.g. <input> and
aria-labelledby attributes, what other things have an influence?This is specced here: http://www.w3.org/TR/wai-aria/roles#namecalculationElement.computedName would return the name computed via this algorithm.