WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: Browsers and the accessibility tree

for

Number of posts in this thread: 4 (In chronological order)

From: Jackson, Derek J
Date: Mon, Mar 02 2020 2:01PM
Subject: Browsers and the accessibility tree
No previous message | Next message →

Hello,

I have a technical question about how a browser creates an accessibility tree. I am having a hard time finding anything that provides many details about how this works aside from it being a parallel structure to the DOM. I have found some references to the Accessibility tree getting built from the render tree, or based on the DOM, or as part of the layout/reflow process right before painting. Does anyone know of a resource they could point me to about the technical process that is used to build the accessibility tree in a browser? Or does anyone know off hand at what stage in the rendering engine the accessibility tree is created and from what model? Any help is greatly appreciated.

Thank you,
Derek

—

Derek Jackson

Digital Accessibility Developer | Digital Accessibility Services
Harvard University Information Technology
1430 Massachusetts Ave, 4th Floor
Cambridge, MA 02138

he/him/his

From: Bateman, Jill
Date: Mon, Mar 02 2020 2:26PM
Subject: Re: Browsers and the accessibility tree
← Previous message | Next message →

Hi Derek,

This video provided some big ah-ha moments for me for understanding the accessibility tree - I'll start you in about 5 minutes, but the whole thing is really good: https://youtu.be/z8xUCzToff8?t=289 - probably not everything you're asking here, but a good place to start.


Best regards,
Jill

OHIO UNIVERSITY
OIT Office of Information Security & Accessibility
Jill Bateman, MA '13
Digital Accessibility Coordinator
WUSOC 275
1 Ohio University Drive
Athens, OH 45701-2979

T: 740.597.5455
= EMAIL ADDRESS REMOVED =
www.ohio.edu/oit/accessibility<;https://www.ohio.edu/oit/accessibility>


<http://www.ohio.edu/oit/web>;


From: WebAIM-Forum < = EMAIL ADDRESS REMOVED = > on behalf of Jackson, Derek J < = EMAIL ADDRESS REMOVED = >
Sent: Monday, March 2, 2020 4:01 PM
To: = EMAIL ADDRESS REMOVED = < = EMAIL ADDRESS REMOVED = >
Subject: [WebAIM] Browsers and the accessibility tree

Hello,

I have a technical question about how a browser creates an accessibility tree. I am having a hard time finding anything that provides many details about how this works aside from it being a parallel structure to the DOM. I have found some references to the Accessibility tree getting built from the render tree, or based on the DOM, or as part of the layout/reflow process right before painting. Does anyone know of a resource they could point me to about the technical process that is used to build the accessibility tree in a browser? Or does anyone know off hand at what stage in the rendering engine the accessibility tree is created and from what model? Any help is greatly appreciated.

Thank you,
Derek

—

Derek Jackson

Digital Accessibility Developer | Digital Accessibility Services
Harvard University Information Technology
1430 Massachusetts Ave, 4th Floor
Cambridge, MA 02138

he/him/his

From: Mark Rogers
Date: Mon, Mar 02 2020 3:01PM
Subject: Re: Browsers and the accessibility tree
← Previous message | Next message →

Hi Derek

It varies quite a lot depending on the browser, AT and accessibility API.

Safari calculates a11y tree relations from the DOM when the platform API is called - there's no actual tree stored in memory. For example, a call to IAccessible2::get_Parent calls AccessibilityObject::parentObjectUnignored which follows DOM parent links to find the first ancestor exposed as an accessible object:
https://github.com/WebKit/webkit/blob/9029c43e695bf886fffb15eec951f0605e34509b/Source/WebCore/accessibility/AccessibilityObject.cpp#L466

I think the Chromium a111y layer is mostly inherited from WebKit but has diverged since the blink/webkit fork.

Firefox creates a completely parallel a11y tree to the DOM, and only does this when a screen reader is connected to the browser. The code for the generic a11y tree is here:
https://dxr.mozilla.org/mozilla-central/source/accessible/generic/
It looks like Firefox creates the tree on page load and keeps it updated by listening to DOM changes:
https://dxr.mozilla.org/mozilla-central/source/accessible/generic/DocAccessible.cpp#1536

With NVDA and IE11 the a11y tree is actually calculated by NVDA using a mashup of MSAA and DOM calls (MSAA was the first a11y API so is more primitive than later APIs). I think it's calculated on the load event, then re-recalculated on events like click (and is prone to getting out of sync with the DOM).

Does that help?

Best Regards
Mark

--
Mark Rogers - = EMAIL ADDRESS REMOVED =
PowerMapper Software Ltd - www.powermapper.com
Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL





On 02/03/2020, 21:02, "WebAIM-Forum on behalf of Jackson, Derek J" < = EMAIL ADDRESS REMOVED = on behalf of = EMAIL ADDRESS REMOVED = > wrote:

Hello,

I have a technical question about how a browser creates an accessibility tree. I am having a hard time finding anything that provides many details about how this works aside from it being a parallel structure to the DOM. I have found some references to the Accessibility tree getting built from the render tree, or based on the DOM, or as part of the layout/reflow process right before painting. Does anyone know of a resource they could point me to about the technical process that is used to build the accessibility tree in a browser? Or does anyone know off hand at what stage in the rendering engine the accessibility tree is created and from what model? Any help is greatly appreciated.

Thank you,
Derek

—

Derek Jackson

Digital Accessibility Developer | Digital Accessibility Services
Harvard University Information Technology
1430 Massachusetts Ave, 4th Floor
Cambridge, MA 02138

he/him/his

From: Jackson, Derek J
Date: Tue, Mar 03 2020 7:02AM
Subject: Re: Browsers and the accessibility tree
← Previous message | No next message

Thank you! Both of these replies help a lot! The Rob Dodson a11y cast is a great overview, and the look at the code is exactly the technical detail I needed. I really appreciate the help!

All the Best,
Derek

—

Derek Jackson

Digital Accessibility Developer | Digital Accessibility Services
Harvard University Information Technology
1430 Massachusetts Ave, 4th Floor
Cambridge, MA 02138

he/him/his

On 3/2/20, 5:01 PM, "WebAIM-Forum on behalf of Mark Rogers" < = EMAIL ADDRESS REMOVED = on behalf of = EMAIL ADDRESS REMOVED = > wrote:

Hi Derek

It varies quite a lot depending on the browser, AT and accessibility API.

Safari calculates a11y tree relations from the DOM when the platform API is called - there's no actual tree stored in memory. For example, a call to IAccessible2::get_Parent calls AccessibilityObject::parentObjectUnignored which follows DOM parent links to find the first ancestor exposed as an accessible object:
https://github.com/WebKit/webkit/blob/9029c43e695bf886fffb15eec951f0605e34509b/Source/WebCore/accessibility/AccessibilityObject.cpp#L466

I think the Chromium a111y layer is mostly inherited from WebKit but has diverged since the blink/webkit fork.

Firefox creates a completely parallel a11y tree to the DOM, and only does this when a screen reader is connected to the browser. The code for the generic a11y tree is here:
https://dxr.mozilla.org/mozilla-central/source/accessible/generic/
It looks like Firefox creates the tree on page load and keeps it updated by listening to DOM changes:
https://dxr.mozilla.org/mozilla-central/source/accessible/generic/DocAccessible.cpp#1536

With NVDA and IE11 the a11y tree is actually calculated by NVDA using a mashup of MSAA and DOM calls (MSAA was the first a11y API so is more primitive than later APIs). I think it's calculated on the load event, then re-recalculated on events like click (and is prone to getting out of sync with the DOM).

Does that help?

Best Regards
Mark

--
Mark Rogers - = EMAIL ADDRESS REMOVED =
PowerMapper Software Ltd - www.powermapper.com
Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL





On 02/03/2020, 21:02, "WebAIM-Forum on behalf of Jackson, Derek J" < = EMAIL ADDRESS REMOVED = on behalf of = EMAIL ADDRESS REMOVED = > wrote:

Hello,

I have a technical question about how a browser creates an accessibility tree. I am having a hard time finding anything that provides many details about how this works aside from it being a parallel structure to the DOM. I have found some references to the Accessibility tree getting built from the render tree, or based on the DOM, or as part of the layout/reflow process right before painting. Does anyone know of a resource they could point me to about the technical process that is used to build the accessibility tree in a browser? Or does anyone know off hand at what stage in the rendering engine the accessibility tree is created and from what model? Any help is greatly appreciated.

Thank you,
Derek

—

Derek Jackson

Digital Accessibility Developer | Digital Accessibility Services
Harvard University Information Technology
1430 Massachusetts Ave, 4th Floor
Cambridge, MA 02138

he/him/his