The basic plan is relatively simple:
We will also implement tweaks to the way individual types of items are exposed:
HTML allows almost anything, anywhere. For example, almost anything can have text inside and embedded objects within it (exception: images and some form controls), and thus would need to implement AtkText and AtkHypertext. In addition, almost anything can be embedded within another object that contains text, and thus can be an AtkHyperlink. Therefore these interfaces must be implemented in the base accessible (nsAccessible) or base HTML accessible (nsHTMLAccessible -- TBD) class. QueryInterface() will need to support interfaces based on tests of what attributes and children the object has, not what kind of accessible it is. Because the results of QueryInterface() must be constant for the lifetime of an object (according to the rules of XPCOM), if any of these factors change, the accessible object must be invalidated and recreated when needed.
The implementation for new-atk will move the code from nsAccessibleText and nsAccessibleHyperText into nsHTMLaccessible. The nsIAccessibleText and nsIAccessibleHypertext interfaces will be supported on this object, and the associated node will be the container node, not the first text node as it is now. This will simplyify the code by removing delegation and using inheritence to append functionality. Further delegation will be removed as we remove the unncessary nsMai classes and implement the callbacks and logic on ns*AccessibleWrap classes.
All ATK specialization interfaces will be moved out of mozilla/accessible/public/atk and into mozilla/accessible/public (bug 340822). The implementations for these interfaces will move to cross-platform classes, away from accessible/src/atk. This will enable future extensions across platforms to take advantage of these interfaces.
We will need a new nsHTMLContainerAccessible which inherits from nsAccessibleWrap. nsBlockAccessible and nsLinkableAccessible would inherit from it.
ATK interface | Mozilla XPCOM interface | Implementation |
---|---|---|
AtkText | nsIAccessibleText | nsHTMLContainerAccessible, covers xul:label and xul:description as well, those use HTML frames to contain the text (bug 340829) |
AtkEditableText | nsIAccessibleEditableText |
nsXULTextboxAccessible,
nsHTMLTextfieldAccessible, etc. (bug 340830) Wiith Midas, anything can be editable. For that part, we would need to handle it in nsHTMLContainerAccessible. |
AtkHypertext | nsIAccessibleHyperText | nsHTMLContainerAccessible, covers xul:label and xul:description as well (bug 340829, same as for AtkText) |
AtkHyperlink | nsIAccessibleHyperLink | nsAccessible -- Anything can be embedded in HTML, even something from another namespace (bug 340833) |
AtkValue | nsIAccessibleValue |
nsAccessible -- anything can have a value via aaa:valuenow (bug
340825) Also need to move atk/nsXULProgressMeterAccessibleWrap code into xul/nsXULProgressMeterAccessible |
AtkTable | nsIAccessibleTable | nsHTMLTableAccessible (bug 340827) |
HTML content | HTML source | ATK representation All objects support AtkObject and AtkComponent |
---|---|---|
This is a heading This is a paragraph with an This is another heading |
<h1>This is a heading</h1> |
{parent AtkText, role=ATK_ROLE_HEADING, objattr="xhtml:tag=h1", |
Hey! |
<p>Hey!<br>Tell me something.</p> |
{parent AtkText, role=ATK_ROLE_PARAGRAPH, attr="xhtml:tag=p"} |
Hey! Tell me something. |
<a href="http://www.google.com">Hey!
|
{parent AtkHyperlink, AtkText, role=ATK_ROLE_LINK |
Hey Tell me something |
<p>Hey</p><hr/>
|
{parent1 AtkText, role=ATK_ROLE_PARAGRAPH, text="Hey"} {parent2 role=ATK_ROLE_SEPARATOR, [note: AtkState doesn't include ATK_STATE_VERTICAL, to distinguish from vsep] } {parent3 AtkText, role=ATK_ROLE_PARAGRAPH, text="Tell me something"} |
You are a nice person. |
<p> |
{parent AtkText,
role=ATK_ROLE_PARAGRAPH, attr="html:tag=p", text="You are a nice person", attribute run for "are", with objattr="role = html:em", textattr="css:text-style=oblique"} |
Here is a bartending site. |
<p> |
{parent AtkHypertext,
role=ATK_ROLE_PARAGRAPH, attr="html:tag=p" text="Here is a *.", attribute run for "bartending site." with textattr="link=true, css:text-decoration=underline, css:color=(0,0,255)"} {child AtkText, AtkHyperlink, role=ATK_ROLE_LINK, attr="html:tag=a, link-type:anchor", text="bartending site", hyperlink-indices=[10,11] hyperlink-URI="http://foo.bar.com"} |
Here is a |
<p> |
{parent AtkHypertext,
role=ATK_ROLE_PARAGRAPH, attr="html:tag=p" text="Here is a *." attribute run for "bartending site." with textattr="link=true, css:text-decoration=underline, css:color=(0,0,255)"} {child AtkHypertext, AtkHyperlink, role=ATK_ROLE_LINK, text="*bartending site" hypertext-indices=[10,11], [not sure if we need to dup textattrs here, or add them to defaulttextattrs] , hypertext-URI="http://foo.bar.com"} {grandchild AtkImage, AtkHyperlink role=ATK_ROLE_IMAGE, attr="html:tag=img, link-type=image" AccName/ImageDescription="beer glass", hyperlink-indices=[0,1] URI="beerglass.GIF"} [don't know if the URIs should always be fully specified, or if omitting the base URI is OK At the moment, not planning to do this, instead plan to expose repair text in the name if no alt/title exists ] |
Here is a |
<p> |
{parent AtkHypertext,
role=ATK_ROLE_PARAGRAPH, attr="html:tag=p", text="Here is a **."} {child AtkImage, AtkHyperlink, role=ATK_ROLE_IMAGE, attr="html:tag=img, link-type=image" AccName/ImageDescription="beer glass", hyperlink-indices=[10,11] hyperlink-URI="beerglass.GIF"} {child AtkText, AtkHyperlink, AtkAction, AtkHypertext, role=ATK_ROLE_LINK, action-names="activate", [others?] attr="html:tag=a, link-type=anchor" text="bartending site", textattr= [as in above examples] hypertext-indices=[11,22], hypertext-URI="http://foo.bar.com"} |
<p> |
{parent AtkHypertext, role=ATK_ROLE_PARAGRAPH, |
|
|
<ul> |
[Bill: we should be able to support list-style=image, and "list-style-image=URL()", etc. this way. In the above example, it's not clear whether the bullet should be a unicode char or just omitted and implied by the list style.. my guess is the latter (i.e. bullets don't appear in the text)] |
|
<ol> |
{parent AtkObject, role=ATK_ROLE_LIST, attr="html:tag=ol, css:list-style-type:decimal"} |
|
<ul> |
|
<form> |
{parent AtkObject, role=ATK_ROLE_FORM, text=""} |
|
<form aaa:describedby="checkhelp"> |
{parent AtkObject, |
|
<form> |
{parent role=ATK_ROLE_FORM?} |
|
<form> |
{parent role=ATK_ROLE_FORM?} |
|
To do: HTML table example | ||
To do: DHTML role example |