Skip to content

Instantly share code, notes, and snippets.

@robdodson
Created October 4, 2017 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robdodson/637a89d9367620f94a0852b1a08cded0 to your computer and use it in GitHub Desktop.
Save robdodson/637a89d9367620f94a0852b1a08cded0 to your computer and use it in GitHub Desktop.
// default role is "slider"
// set using private accessibleNode by the element author
<custom-slider id="mySlider">
// element consumer changes role to "button"
mySlider.accessibleNode.role = "button"
// element consumer nulls role
mySlider.accessibleNode.role = null
// element falls back to default role
getComputedAccessibility(mySlider.accessibleNode).role // 'slider'
// note: the ability to compute the accessibility tree is
// a phase 4 AOM proposal. The line above is pseudo code :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment