--
You received this message because you are subscribed to the Google Groups "Browser Accessibility Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to browser-accessibil...@googlegroups.com.
To post to this group, send email to browser-acce...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/browser-accessibility-dev/CAFz-FYxav8NWzSqmc_LSuvuJhmv--Vj4QLHH8A5HWZoFWTrLeA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
On Tue, Mar 10, 2015 at 4:33 PM, 'Dominic Mazzoni' via Browser
Accessibility Development <browser-accessibility-dev@googlegroups.com
<mailto:browser-accessibility-d...@googlegroups.com>> wrote:
<div role="listbox" aria-activedescendant="select([tabindex="0"])">
<div role="option" tabindex=0>Apple</div>
<div role="option" tabindex=-1>Orange</div>
<div role="option" tabindex=-1>Banana</div>
</div>
Now when the selected item changes, all I need to do is update the
tabindex, and the activedescendant changes automatically. The
browser would implement this using its existing style recalculation
logic
Just so we're all on the same page, this logic involves various cache data structures that are not particularly small. That's OK if they're basically per-page singletons, but if you have to have many of them per page that becomes a problem. Furthermore, this logic is designed for the styling case (so "find all the selectors this element matches"), not for the use case you have here ("find all elements this selector matches"). It would be quite a poor fit for this use case.
Browsers can probably get away with using a somewhat simpler and less memory-intensive setup here, subject to the following constraints:
1) Any change to the DOM inside the element with the aria-activedescendant attribute will require re-evaluation of the selector. If the active descendant is not required to update synchronously, this should be OK: just set a dirty bit and do the re-evaluation async. If the active descendant is required to update synchronously, this may be a problem depending on how easy it is to detect whether it has updated or not.
2) If the selector is not by-design scoped to the element with the aria-activedescendant attribute, then any change in the document might involve having to re-evaluate the selector. I strongly recommend scoping the selector.
We may have to add separate syntax for a query selector relative to
the current element, vs relative to the document.
I don't think you should have the latter at all.
* Web components: this provides a way to reference an element inside
shadow dom
This part is not clear yet, because the interaction of shadow DOM and selectors is kinda up in the air.
-Boris
On Tue, Mar 10, 2015 at 4:33 PM, 'Dominic Mazzoni' via Browser
Accessibility Development <browser-accessibility-dev@googlegroups.com
<mailto:browser-accessibility-d...@googlegroups.com>> wrote:
<div role="listbox" aria-activedescendant="select([tabindex="0"])">
<div role="option" tabindex=0>Apple</div>
<div role="option" tabindex=-1>Orange</div>
<div role="option" tabindex=-1>Banana</div>
</div>
Now when the selected item changes, all I need to do is update the
tabindex, and the activedescendant changes automatically. The
browser would implement this using its existing style recalculation
logic
Just so we're all on the same page, this logic involves various cache data structures that are not particularly small. That's OK if they're basically per-page singletons, but if you have to have many of them per page that becomes a problem. Furthermore, this logic is designed for the styling case (so "find all the selectors this element matches"), not for the use case you have here ("find all elements this selector matches"). It would be quite a poor fit for this use case.
Browsers can probably get away with using a somewhat simpler and less memory-intensive setup here, subject to the following constraints:
1) Any change to the DOM inside the element with the aria-activedescendant attribute will require re-evaluation of the selector. If the active descendant is not required to update synchronously, this should be OK: just set a dirty bit and do the re-evaluation async. If the active descendant is required to update synchronously, this may be a problem depending on how easy it is to detect whether it has updated or not.
2) If the selector is not by-design scoped to the element with the aria-activedescendant attribute, then any change in the document might involve having to re-evaluate the selector. I strongly recommend scoping the selector.
We may have to add separate syntax for a query selector relative to
the current element, vs relative to the document.
I don't think you should have the latter at all.
* Web components: this provides a way to reference an element inside
shadow dom
This part is not clear yet, because the interaction of shadow DOM and selectors is kinda up in the air.
On 3/11/15 9:26 AM, Alexander Surkov wrote:
I believe the processing can be async, but scope may be a document. I
assume the proposal is not restricted to aria-activedescendant attribute
and applicable to stuff like aria-owns, aria-labelledby etc that are not
scoped to their subtrees.
In that case, I would like to have a clearer understanding of what exactly would be being selected and under what conditions the selector would need to be re-evaluated before I can comment intelligently on this.
On 3/11/15 12:25 PM, Dominic Mazzoni wrote:
> aria-owns
OK, so for example for this one.
Say someone writes:
aria-owns="selector([foo='bar'])"
Just to make sure I understand, this would require reevaluating the selector whenever the "foo" attribute is changed to/from the value "bar" on any element in the document (as a mimimum), right?
What about:
aria-owns="selector(.mythings)"
On 3/11/15 12:10 PM, Dominic Mazzoni wrote:
1. This code *only* runs if accessibility is enabled - this is only 1%
of users
Do we have hard data on that? Because on recent Windows, all sorts of things will enable accessibility as I understand, starting with hooking up various input devices.
2. ARIA attributes that change
The issue is not the ARIA attribute changing. The issue is whatever is being selected on changing, no?
On 3/11/15 1:12 PM, Dominic Mazzoni wrote:
This would have to be re-evaluated if any element gains or loses the
class "mythings", or if an element with that class appears or disappears
from the page, right?
OK. So in other words, you either have to mark it dirty on all DOM mutations or you have to do a bunch of work on every DOM mutation to see whether it affects this selector.
Again, as long as it's OK to end up re-evaluating the selector (100% guaranteed, since DOM mutations _will_ happen) per frame or at whatever async frequency the ARIA state is supposed to get updated at, that seems to be fine. It'll be pretty easy to create selectors that take a long time to evaluate and blow out frame budgets, but there's not much we can do about that; people will just need to not do it.
On 3/11/15 1:25 PM, Dominic Mazzoni wrote:
I wonder if it would be safe to just spec that changes to ARIA
attributes with selectors are evaluated *asynchronously* and authors
should not depend on the sequence in which they are evaluated.
Do authors have a way to query the state (as in, see whether the set of elements being selected has been updated)?
If so, you need to specify exactly when this state is updated.