Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Find the Window and Load the Document

How to Find the Content Window and Load the Document using MSAA/IAccessible2

Screen readers need to find the content window so that they know where to start grabbing the MSAA tree, in order to load the current document into a buffer in their own process. The content window always has the class MozillaContentWindowClass.

In total, Gecko supports the following window classes:

  • MozillaUIWindowClass - root UI window, at the root of the window hierarchy
  • MozillaContentWindowClass -- root document window
  • MozillaContentFrameWindowClass - root of a subdocument created by a <frame> or <iframe> element
  • MozillaHiddenWindowClass - ignore these windows, they are used to help manage other windows
  • MozillaWindowClass - general filler window, a catch all

However, please use the accessible relation NAVRELATION_EMBEDS to find the content window's root accessible from the top level UI window. Going forward, this may be the only way to find the content area, as Mozilla will begin to become a windowless application, with an exception for plugins which create their own window.

When you see the content window receive focus, first check the role. If it is ROLE_PANE or ROLE_DOCUMENT then this should be treated as a document for the default modality of the screen reader. If it is a ROLE_APPLICATION, ROLE_DIALOG or ROLE_ALERT then stay in focus tracking mode -- there is no need to parse the document. In addition, if it is a ROLE_ALERT, a screen reader should treat it as a message box -- that is, to read the entire contents. These roles can occur on content because of the new Accessible DHTML technology which allows the author to specify the type of document or container.

Gecko also helps determine when to load a new window by firing page load events:

  1. Two EVENT_STATE_CHANGE's on the root ROLE_DOCUMENT accessible -- the first state change indicates the document pane is now busy loading. The second state change indicates the document pane has finished. When handling the event, use get_accState() to check the STATE_BUSY flag. When the document has finished loading the busy flag will be cleared.
  2. The following IA2 events are also supported, starting in Firefox 3:
  • IA2_EVENT_DOCUMENT_LOAD_COMPLETE
  • IA2_EVENT_DOCUMENT_LOAD_STOPPED
  • IA2_EVENT_DOCUMENT_RELOAD

Document Tags and Contributors

 Contributors to this page: Sheppy, Aaronlev, Surkov.alexander
 Last updated by: Sheppy,