--
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-FYxDj1uyXwymOkdGuq%3Dkf8yjPQfXP2naY-cLQ5Q2sAQy9A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/browser-accessibility-dev/CAEvucx_p20c62LS%3DobYHRQqRgvU%2BfQBRWYUvTzuGc%3DqPOijrhg%40mail.gmail.com.
This is a complementary proposal to the querySelector one in that it provides an alternative to littering the HTML with lots of ARIA attributes.In a nutshell, the proposal is that we add JavaScript getters/setters for all ARIA attributes directly on the Element interface (or whatever is the proper interface that handles HTML and SVG elements and anything else where ARIA is allowed).For most attributes, this will be incredibly straightforward. Instead of:$('save_button').setAttribute('role', 'button');You can now write:$('save_button').role = 'button';
In the case of string attributes, these are reflected both ways, just like "id" and "value" - so if you inspect the DOM, you'd see the 'role' attribute there too.However, in the case of IDREF attributes, it'd be possible to specify a reference to another valid DOM element that doesn't necessarily have an id, for example:$('save_button').ariaLabelledBy = [$('save_label')];In this case, if there was any aria-labelledby attribute in the DOM, it would be deleted. There would not be a way to tell if aria-labelledby is set on this element simply by viewing the element's HTML attributes.This has a number of similar advantages of the querySelector idea:* Avoids the need to add ids to so many elements* Simpler JavaScript* Potentially helps with shadow DOM
The main difference is that JavaScript is required and there's no way to optimize this away if accessibility is not enabled - but that's not significantly different than how things are today, where apps need to keep updating ARIA attributes even though 99% of the time they're never used.One objection raised on PFWG was that this could break accessibility testing tools that assume ARIA is found in the HTML alone. Personally I think that's a terrible reason not to do this - any validator that's limited to HTML only and can't dynamically query the browser using a native accessibility API or using JavaScript is going to be out of date and wrong anyway.- Dominic
On Wed, Mar 11, 2015 at 10:35 AM, 'Dominic Mazzoni' via Browser Accessibility Development <browser-acce...@googlegroups.com> wrote:This is a complementary proposal to the querySelector one in that it provides an alternative to littering the HTML with lots of ARIA attributes.In a nutshell, the proposal is that we add JavaScript getters/setters for all ARIA attributes directly on the Element interface (or whatever is the proper interface that handles HTML and SVG elements and anything else where ARIA is allowed).For most attributes, this will be incredibly straightforward. Instead of:$('save_button').setAttribute('role', 'button');You can now write:$('save_button').role = 'button';I like this very much indeed. It will make our l10n implementation cleaner.In the case of string attributes, these are reflected both ways, just like "id" and "value" - so if you inspect the DOM, you'd see the 'role' attribute there too.However, in the case of IDREF attributes, it'd be possible to specify a reference to another valid DOM element that doesn't necessarily have an id, for example:$('save_button').ariaLabelledBy = [$('save_label')];In this case, if there was any aria-labelledby attribute in the DOM, it would be deleted. There would not be a way to tell if aria-labelledby is set on this element simply by viewing the element's HTML attributes.This has a number of similar advantages of the querySelector idea:* Avoids the need to add ids to so many elements* Simpler JavaScript* Potentially helps with shadow DOMAre there any precedents for this in the DOM API? I'm worried that developers who will be debugging their web apps won't know to look for this since it won't appear in the dev tools DOM inspector as an attribute.
--Furthermore, things like DOM mutation observers will probably misbehave. If there were a way to harmonize it, I would love to see this as well.--The main difference is that JavaScript is required and there's no way to optimize this away if accessibility is not enabled - but that's not significantly different than how things are today, where apps need to keep updating ARIA attributes even though 99% of the time they're never used.One objection raised on PFWG was that this could break accessibility testing tools that assume ARIA is found in the HTML alone. Personally I think that's a terrible reason not to do this - any validator that's limited to HTML only and can't dynamically query the browser using a native accessibility API or using JavaScript is going to be out of date and wrong anyway.- Dominic
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-FYxDj1uyXwymOkdGuq%3Dkf8yjPQfXP2naY-cLQ5Q2sAQy9A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
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/CAGJkVDEC5wDRSeLveKOpmRWTAqECm_K4fdCdF8SgZNwouHQsNQ%40mail.gmail.com.
Are there any precedents for this in the DOM API? I'm worried that developers who will be debugging their web apps won't know to look for this since it won't appear in the dev tools DOM inspector as an attribute.Sure: event listeners and styles from style sheets, off the top of my head.
Furthermore, things like DOM mutation observers will probably misbehave. If there were a way to harmonize it, I would love to see this as well.
On Wed, Mar 11, 2015 at 11:08 AM, Eitan Isaacson <eisa...@mozilla.com> wrote:On Wed, Mar 11, 2015 at 10:35 AM, 'Dominic Mazzoni' via Browser Accessibility Development <browser-acce...@googlegroups.com> wrote:This is a complementary proposal to the querySelector one in that it provides an alternative to littering the HTML with lots of ARIA attributes.In a nutshell, the proposal is that we add JavaScript getters/setters for all ARIA attributes directly on the Element interface (or whatever is the proper interface that handles HTML and SVG elements and anything else where ARIA is allowed).For most attributes, this will be incredibly straightforward. Instead of:$('save_button').setAttribute('role', 'button');You can now write:$('save_button').role = 'button';I like this very much indeed. It will make our l10n implementation cleaner.In the case of string attributes, these are reflected both ways, just like "id" and "value" - so if you inspect the DOM, you'd see the 'role' attribute there too.However, in the case of IDREF attributes, it'd be possible to specify a reference to another valid DOM element that doesn't necessarily have an id, for example:$('save_button').ariaLabelledBy = [$('save_label')];In this case, if there was any aria-labelledby attribute in the DOM, it would be deleted. There would not be a way to tell if aria-labelledby is set on this element simply by viewing the element's HTML attributes.This has a number of similar advantages of the querySelector idea:* Avoids the need to add ids to so many elements* Simpler JavaScript* Potentially helps with shadow DOMAre there any precedents for this in the DOM API? I'm worried that developers who will be debugging their web apps won't know to look for this since it won't appear in the dev tools DOM inspector as an attribute.Sure: event listeners and styles from style sheets, off the top of my head.
Sure: event listeners and styles from style sheets, off the top of my head.Styles will update the attribute, from what I can tell:$0.style.backgroundColor = 'red';and then $0.getAttribute('style') will return 'background-color: red;'.
As for events, do you mean clobbering the onclick attribute from markup? That behavior is strange!
I was thinking of web developers. The inconsistency could be confusing. For example, a l10n library could rely on dom mutations. If the developer starts referencing elements directly they might end up an out of sync translation.
Sure: event listeners and styles from style sheets, off the top of my head.Styles will update the attribute, from what I can tell:$0.style.backgroundColor = 'red';and then $0.getAttribute('style') will return 'background-color: red;'.Yes, but that style might be overridden by CSS, you have to call getComputedStyle on it to know the real style. That's why the inspector shows the computed style too.The solution here is for the inspector to show the computed accessibility attributes, that's what will really help developers.
As for events, do you mean clobbering the onclick attribute from markup? That behavior is strange!More generally, if I call element.addEventListener('click', onClick) there's no way to tell from the html or even from a JavaScript API that it has a click listener. The onclick attribute is an old deprecated way to do it; a lot of sites now use a content security policy that disallows all inline javascript to help mitigate against attacks.
I was thinking of web developers. The inconsistency could be confusing. For example, a l10n library could rely on dom mutations. If the developer starts referencing elements directly they might end up an out of sync translation.Only idref attributes would no longer be reflected. Does a l10n library care about things like aria-labelledby or aria-owns? String attributes like aria-label would continue to work fine and fire mutation events.
Also, the workaround for the author is simply to not set these ARIA attributes from JavaScript if they depend on a l10n library that doesn't support them. It's not deprecating any existing behavior, just allowing alternatives.
On Wed, Mar 11, 2015 at 12:10 PM, Dominic Mazzoni <dmaz...@google.com> wrote:Sure: event listeners and styles from style sheets, off the top of my head.Styles will update the attribute, from what I can tell:$0.style.backgroundColor = 'red';and then $0.getAttribute('style') will return 'background-color: red;'.Yes, but that style might be overridden by CSS, you have to call getComputedStyle on it to know the real style. That's why the inspector shows the computed style too.The solution here is for the inspector to show the computed accessibility attributes, that's what will really help developers.I agree that web developers should never rely on the style attribute for the computed style. And yes, exposing computed accessibility attributes would be a win.As for events, do you mean clobbering the onclick attribute from markup? That behavior is strange!More generally, if I call element.addEventListener('click', onClick) there's no way to tell from the html or even from a JavaScript API that it has a click listener. The onclick attribute is an old deprecated way to do it; a lot of sites now use a content security policy that disallows all inline javascript to help mitigate against attacks.That is exactly the issue. The earlier, deprecated, behavior is inconsistent. When you reassign onclick via js it expects a function as opposed to a string and then never updates the attribute in markup. I think that may be a cautionary tale for assigning non-primitive values programmatically.
Also, the workaround for the author is simply to not set these ARIA attributes from JavaScript if they depend on a l10n library that doesn't support them. It's not deprecating any existing behavior, just allowing alternatives.It's deprecating the ability to observe changes.
On Wed, Mar 11, 2015 at 1:21 PM, Eitan Isaacson <eisa...@mozilla.com> wrote:
On Wed, Mar 11, 2015 at 12:10 PM, Dominic Mazzoni <dmaz...@google.com> wrote:
Sure: event listeners and styles from style sheets, off the top of my head.
Styles will update the attribute, from what I can tell:
$0.style.backgroundColor = 'red';
and then $0.getAttribute('style') will return 'background-color: red;'.
Yes, but that style might be overridden by CSS, you have to call getComputedStyle on it to know the real style. That's why the inspector shows the computed style too.
The solution here is for the inspector to show the computed accessibility attributes, that's what will really help developers.
I agree that web developers should never rely on the style attribute for the computed style. And yes, exposing computed accessibility attributes would be a win.
As for events, do you mean clobbering the onclick attribute from markup? That behavior is strange!
More generally, if I call element.addEventListener('click', onClick) there's no way to tell from the html or even from a JavaScript API that it has a click listener. The onclick attribute is an old deprecated way to do it; a lot of sites now use a content security policy that disallows all inline javascript to help mitigate against attacks.
That is exactly the issue. The earlier, deprecated, behavior is inconsistent. When you reassign onclick via js it expects a function as opposed to a string and then never updates the attribute in markup. I think that may be a cautionary tale for assigning non-primitive values programmatically.
When you add an event listener programmatically, it doesn't override the event listener added in the attribute, so it's not a matter of not updating that attribute. You end up with both event listeners.
However, there is a valid question around what to do in this case:<div id="foo" aria-activedescendent="bar" role="menu"><div id="bar">Menu item 1</div><div class="selected">Menu item 2</div></div><script>$('#foo').aria.activeDescendant = $('#foo').querySelector('.selected');</script>- [how] do we reflect the aria-activedescendent attribute at that point? Unlike the event listener case, there can only be one activeDescendant.
For most attributes, this will be incredibly straightforward. Instead of:$('save_button').setAttribute('role', 'button');You can now write:$('save_button').role = 'button';
However, in the case of IDREF attributes, it'd be possible to specify a reference to another valid DOM element that doesn't necessarily have an id, for example:$('save_button').ariaLabelledBy = [$('save_label')];In this case, if there was any aria-labelledby attribute in the DOM, it would be deleted. There would not be a way to tell if aria-labelledby is set on this element simply by viewing the element's HTML attributes.
On Wednesday, March 11, 2015 at 6:35:54 PM UTC+1, Dominic Mazzoni wrote:For most attributes, this will be incredibly straightforward. Instead of:$('save_button').setAttribute('role', 'button');You can now write:$('save_button').role = 'button';
I think even here we'd want reflection to known values, probably computed values. Otherwise the value-add would be too low.
However, in the case of IDREF attributes, it'd be possible to specify a reference to another valid DOM element that doesn't necessarily have an id, for example:$('save_button').ariaLabelledBy = [$('save_label')];In this case, if there was any aria-labelledby attribute in the DOM, it would be deleted. There would not be a way to tell if aria-labelledby is set on this element simply by viewing the element's HTML attributes.
I think it would be better if this was a distinct feature. It doesn't really match any established precedent for HTML attributes.