Accessibility/DOMTreeMapping: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Created page with "=What is this= This document describes the mapping between DOM and accessibles trees. =Current state= Existing problems are: #Tree update bugs ##imagemap ##listbox #Unoptimal tr...")
 
 
(6 intermediate revisions by the same user not shown)
Line 7: Line 7:
##imagemap
##imagemap
##listbox
##listbox
#Unoptimal tree update.
#Unoptimal tree update
#Due to coalescence tree may be not shutdown (cycle collector works)


=What we need that for?=
=Details=
We need to map DOM tree to accessible for following proposes:
==What we need that for?==
The mapping of DOM tree to accessible tree is performed for following proposes:
#content insertion
#content insertion
##find insertion point
##traverse extended DOM tree
#content removal
#content removal
##find removal point or find removed accessible
#DOM point to offset
#DOM point to offset
##convert DOM selection into accessible text selection and caret


=Thoughts Heap=
==Accessible tree==
content insertion:
Accessible object manages its children. There are several types of accessibles:
  walker: find insertion point (walker move forward within container accessible subtree starting _after_ anchor,
#Extended DOM tree traversal
                                              first accessible, if no entry then append as container child)
#Not based on DOM tree traversal
  bulder: find accessible from inserted content subtree including root (creator, walk anchor subtree)
##outerdoc accessible
content removal:
##leaf accessibles
  walker: find removal point (walker move forward within anchor subtree, all accessible siblings within DOM subtree)
##HTML combobox (combobox list accessible)
GetFirstAvailableAccessible
##XUL trees
  walker: root, anchor, move forward
#DOM nodes adoption
DOM point to offset
##imagemap
  node, offset pair to DOMWalker anchor,position, (forward/backward walker within hypertext subtree)
##HTML selects, get accessible from optgroups
#change insertion point relative DOM tree order
##HTML table moves HTML caption
#Based on DOM tree traversal and own accessible
##listitem (listbullet and listitem content)


image map: insertion/removal
==Notifications==
insertion point when accessibles with altered insertion point relative DOM are encountered
#standard notifications (standard processing)
  (within accessible or children of another accessible)
#XUL menu notifications (standard processing)
#XUL listbox notifications (needs to implement)
#XUL tree notifications (processed by XUL tree accessible)
#imagemap notification (needs to implement)


fire alert/menupopup events on insertion/removal
==Algorithms==
shutdown the subtree (not after coalescence!)


insertion algorithm:
===Content insertion===
1) insertion notification: ignore if parent/container was changed (what about visibility changes?)
Each accessible is responsible for their children.
2) traverse subtree of insertion, get (assert)/create an accessible
#How to find insertion point of the inserted subtree (DOM tree and accessible tree ordering is different)
3) where to insert?
#How to find adopted DOM nodes in the inserted subtree (DOM nodes adoption)
3.1) parent accessible
#Fire related events like menupopup_start/alert when tree is created
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
===Content removal===
otherwise get sibling relative DOM tree
#Traverse whole removed subtree to find adopted case? Should they have own mechanism to handle adopted things?
no sibling then insertion into the end
#Find root accessibles within removed subtree, unattach from tree, and shutdown (don't rely on events in this). Fire related events like menupopup_end, alert, hide, reorder events.


binding to parent
===DOM point to text offset===
 
How we should proceed the case of adopted children and changed order?
# if sibling is adopted  
3.2.1) is insertion point altered
3.2.2) original insertion point

Latest revision as of 09:01, 28 October 2011

What is this

This document describes the mapping between DOM and accessibles trees.

Current state

Existing problems are:

  1. Tree update bugs
    1. imagemap
    2. listbox
  2. Unoptimal tree update
  3. Due to coalescence tree may be not shutdown (cycle collector works)

Details

What we need that for?

The mapping of DOM tree to accessible tree is performed for following proposes:

  1. content insertion
    1. find insertion point
    2. traverse extended DOM tree
  2. content removal
    1. find removal point or find removed accessible
  3. DOM point to offset
    1. convert DOM selection into accessible text selection and caret

Accessible tree

Accessible object manages its children. There are several types of accessibles:

  1. Extended DOM tree traversal
  2. Not based on DOM tree traversal
    1. outerdoc accessible
    2. leaf accessibles
    3. HTML combobox (combobox list accessible)
    4. XUL trees
  3. DOM nodes adoption
    1. imagemap
    2. HTML selects, get accessible from optgroups
  4. change insertion point relative DOM tree order
    1. HTML table moves HTML caption
  5. Based on DOM tree traversal and own accessible
    1. listitem (listbullet and listitem content)

Notifications

  1. standard notifications (standard processing)
  2. XUL menu notifications (standard processing)
  3. XUL listbox notifications (needs to implement)
  4. XUL tree notifications (processed by XUL tree accessible)
  5. imagemap notification (needs to implement)

Algorithms

Content insertion

Each accessible is responsible for their children.

  1. How to find insertion point of the inserted subtree (DOM tree and accessible tree ordering is different)
  2. How to find adopted DOM nodes in the inserted subtree (DOM nodes adoption)
  3. Fire related events like menupopup_start/alert when tree is created

Content removal

  1. Traverse whole removed subtree to find adopted case? Should they have own mechanism to handle adopted things?
  2. Find root accessibles within removed subtree, unattach from tree, and shutdown (don't rely on events in this). Fire related events like menupopup_end, alert, hide, reorder events.

DOM point to text offset

How we should proceed the case of adopted children and changed order?