aom icon indicating copy to clipboard operation
aom copied to clipboard

Would like to author for accessibility and have that affect CSS

Open nigelmegitt opened this issue 6 years ago • 0 comments

As mentioned in the accessibility tree breakout session at TPAC today, (filing as an issue as requested by @alice ) I think there's a use case for information flowing from the accessibility tree up to the presentation layer, for example by modifying CSS.

This is a general architectural issue: my concrete example is the case of a video viewport (let's say it's full screen) on top of which various other elements get drawn, like controls, closed captions, floaty hearts, whatever. There's some prioritisation of those additional elements, and indeed of regions of the video (which vary over time) where some are more important for accessibility than others. Let's say the user wants to be able to read closed captions even when controls are visible, but they occupy the same pixels.

It would be useful to author the relative (semantic) importance of those elements in an accessibility hierarchy, and then use that data to modify the presentation for example so that when both video controls and closed captions are visible, the page author can say "hey, when these are both on screen at the same time, they are of equal importance, but the UX wins in positioning", and the CSS can be authored to respond to move the closed captions out of the way of the controls, as opposed to the controls just being drawn on top of the captions.

A further step here would be that the user might be able to specify a preference to override that semantic, and the presentation would then honour that, even if the preference itself is not available upstream to javascript code (to avoid adding fingerprinting vector).

If I've understood correctly the accessibility tree is currently derived from the DOM and CSS, so in that sense the information flows down to the accessibility tree rather than flowing back up from the accessibility tree to the CSS.

I'm not an expert in the AOM so would appreciate any feedback. The use case is genuine, the solution is a lot less clear to me!

nigelmegitt avatar Oct 24 '18 13:10 nigelmegitt