Accessibility/DOMTreeMapping
What is this
This document describes the mapping between DOM and accessibles trees.
Current state
Existing problems are:
- Tree update bugs
- imagemap
- listbox
- Unoptimal tree update.
What we need that for?
We need to map DOM tree to accessible for following proposes:
- content insertion
- content removal
- DOM point to offset
Thoughts Heap
content insertion:
walker: find insertion point (walker move forward within container accessible subtree starting _after_ anchor, first accessible, if no entry then append as container child) bulder: find accessible from inserted content subtree including root (creator, walk anchor subtree)
content removal:
walker: find removal point (walker move forward within anchor subtree, all accessible siblings within DOM subtree)
GetFirstAvailableAccessible
walker: root, anchor, move forward
DOM point to offset
node, offset pair to DOMWalker anchor,position, (forward/backward walker within hypertext subtree)
image map: insertion/removal insertion point when accessibles with altered insertion point relative DOM are encountered
(within accessible or children of another accessible)
fire alert/menupopup events on insertion/removal shutdown the subtree (not after coalescence!)
insertion algorithm: 1) insertion notification: ignore if parent/container was changed (what about visibility changes?) 2) traverse subtree of insertion, get (assert)/create an accessible 3) where to insert? 3.1) parent accessible 3.1.1) child is adopted by other container (map element, checking tag name - area and primary frame - image) 3.1.2) child is kept by direct container 3.2) insertion point within parent accessible
if child is adopted then look for adopted sibling relative DOM tree otherwise get sibling relative DOM tree no sibling then insertion into the end
binding to parent
- if sibling is adopted
3.2.1) is insertion point altered 3.2.2) original insertion point