mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 752609 - [AccessFu] Shortening a11y event and role constant prefixes. r=eeejay
--- accessible/src/jsat/EventManager.jsm | 33 ++++-- accessible/src/jsat/OutputGenerator.jsm | 12 ++- accessible/src/jsat/TraversalRules.jsm | 161 ++++++++++++++++++------------- accessible/src/jsat/Utils.jsm | 21 +++-- accessible/src/jsat/content-script.js | 4 +- 5 files changed, 141 insertions(+), 90 deletions(-)
This commit is contained in:
parent
6f99bbbdaa
commit
3915b525a7
@ -7,6 +7,18 @@
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
|
||||
const EVENT_VIRTUALCURSOR_CHANGED = Ci.nsIAccessibleEvent.EVENT_VIRTUALCURSOR_CHANGED;
|
||||
const EVENT_STATE_CHANGE = Ci.nsIAccessibleEvent.EVENT_STATE_CHANGE;
|
||||
const EVENT_SCROLLING_START = Ci.nsIAccessibleEvent.EVENT_SCROLLING_START;
|
||||
const EVENT_TEXT_CARET_MOVED = Ci.nsIAccessibleEvent.EVENT_TEXT_CARET_MOVED;
|
||||
const EVENT_TEXT_INSERTED = Ci.nsIAccessibleEvent.EVENT_TEXT_INSERTED;
|
||||
const EVENT_TEXT_REMOVED = Ci.nsIAccessibleEvent.EVENT_TEXT_REMOVED;
|
||||
const EVENT_FOCUS = Ci.nsIAccessibleEvent.EVENT_FOCUS;
|
||||
|
||||
const ROLE_INTERNAL_FRAME = Ci.nsIAccessibleRole.ROLE_INTERNAL_FRAME;
|
||||
const ROLE_DOCUMENT = Ci.nsIAccessibleRole.ROLE_DOCUMENT;
|
||||
const ROLE_CHROME_WINDOW = Ci.nsIAccessibleRole.ROLE_CHROME_WINDOW;
|
||||
|
||||
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
|
||||
XPCOMUtils.defineLazyModuleGetter(this, 'Services',
|
||||
'resource://gre/modules/Services.jsm');
|
||||
@ -127,18 +139,18 @@ this.EventManager.prototype = {
|
||||
|
||||
// Don't bother with non-content events in firefox.
|
||||
if (Utils.MozBuildApp == 'browser' &&
|
||||
aEvent.eventType != Ci.nsIAccessibleEvent.EVENT_VIRTUALCURSOR_CHANGED &&
|
||||
aEvent.eventType != EVENT_VIRTUALCURSOR_CHANGED &&
|
||||
aEvent.accessibleDocument != Utils.CurrentContentDoc) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (aEvent.eventType) {
|
||||
case Ci.nsIAccessibleEvent.EVENT_VIRTUALCURSOR_CHANGED:
|
||||
case EVENT_VIRTUALCURSOR_CHANGED:
|
||||
{
|
||||
let pivot = aEvent.accessible.
|
||||
QueryInterface(Ci.nsIAccessibleDocument).virtualCursor;
|
||||
let position = pivot.position;
|
||||
if (position && position.role == Ci.nsIAccessibleRole.ROLE_INTERNAL_FRAME)
|
||||
if (position && position.role == ROLE_INTERNAL_FRAME)
|
||||
break;
|
||||
let event = aEvent.
|
||||
QueryInterface(Ci.nsIAccessibleVirtualCursorChangeEvent);
|
||||
@ -152,7 +164,7 @@ this.EventManager.prototype = {
|
||||
|
||||
break;
|
||||
}
|
||||
case Ci.nsIAccessibleEvent.EVENT_STATE_CHANGE:
|
||||
case EVENT_STATE_CHANGE:
|
||||
{
|
||||
let event = aEvent.QueryInterface(Ci.nsIAccessibleStateChangeEvent);
|
||||
if (event.state == Ci.nsIAccessibleStates.STATE_CHECKED &&
|
||||
@ -164,13 +176,13 @@ this.EventManager.prototype = {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Ci.nsIAccessibleEvent.EVENT_SCROLLING_START:
|
||||
case EVENT_SCROLLING_START:
|
||||
{
|
||||
let vc = Utils.getVirtualCursor(aEvent.accessibleDocument);
|
||||
vc.moveNext(TraversalRules.Simple, aEvent.accessible, true);
|
||||
break;
|
||||
}
|
||||
case Ci.nsIAccessibleEvent.EVENT_TEXT_CARET_MOVED:
|
||||
case EVENT_TEXT_CARET_MOVED:
|
||||
{
|
||||
let acc = aEvent.accessible;
|
||||
let characterCount = acc.
|
||||
@ -203,8 +215,8 @@ this.EventManager.prototype = {
|
||||
this.editState = editState;
|
||||
break;
|
||||
}
|
||||
case Ci.nsIAccessibleEvent.EVENT_TEXT_INSERTED:
|
||||
case Ci.nsIAccessibleEvent.EVENT_TEXT_REMOVED:
|
||||
case EVENT_TEXT_INSERTED:
|
||||
case EVENT_TEXT_REMOVED:
|
||||
{
|
||||
if (aEvent.isFromUserInput) {
|
||||
// XXX support live regions as well.
|
||||
@ -228,13 +240,12 @@ this.EventManager.prototype = {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Ci.nsIAccessibleEvent.EVENT_FOCUS:
|
||||
case EVENT_FOCUS:
|
||||
{
|
||||
// Put vc where the focus is at
|
||||
let acc = aEvent.accessible;
|
||||
let doc = aEvent.accessibleDocument;
|
||||
if (acc.role != Ci.nsIAccessibleRole.ROLE_DOCUMENT &&
|
||||
doc.role != Ci.nsIAccessibleRole.ROLE_CHROME_WINDOW) {
|
||||
if (acc.role != ROLE_DOCUMENT && doc.role != ROLE_CHROME_WINDOW) {
|
||||
let vc = Utils.getVirtualCursor(doc);
|
||||
vc.moveNext(TraversalRules.Simple, acc, true);
|
||||
}
|
||||
|
@ -17,6 +17,10 @@ const NAME_FROM_SUBTREE_RULE = 0x08;
|
||||
const OUTPUT_DESC_FIRST = 0;
|
||||
const OUTPUT_DESC_LAST = 1;
|
||||
|
||||
const ROLE_LISTITEM = Ci.nsIAccessibleRole.ROLE_LISTITEM;
|
||||
const ROLE_STATICTEXT = Ci.nsIAccessibleRole.ROLE_STATICTEXT;
|
||||
const ROLE_LINK = Ci.nsIAccessibleRole.ROLE_LINK;
|
||||
|
||||
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
|
||||
XPCOMUtils.defineLazyModuleGetter(this, 'Utils',
|
||||
'resource://gre/modules/accessibility/Utils.jsm');
|
||||
@ -566,8 +570,8 @@ this.BrailleGenerator = {
|
||||
let braille = this.objectOutputFunctions._generateBaseOutput.apply(this, arguments);
|
||||
|
||||
if (aAccessible.indexInParent === 1 &&
|
||||
aAccessible.parent.role == Ci.nsIAccessibleRole.ROLE_LISTITEM &&
|
||||
aAccessible.previousSibling.role == Ci.nsIAccessibleRole.ROLE_STATICTEXT) {
|
||||
aAccessible.parent.role == ROLE_LISTITEM &&
|
||||
aAccessible.previousSibling.role == ROLE_STATICTEXT) {
|
||||
if (aAccessible.parent.parent && aAccessible.parent.parent.DOMNode &&
|
||||
aAccessible.parent.parent.DOMNode.nodeName == 'UL') {
|
||||
braille.unshift('*');
|
||||
@ -622,7 +626,7 @@ this.BrailleGenerator = {
|
||||
statictext: function statictext(aAccessible, aRoleStr, aStates, aFlags) {
|
||||
// Since we customize the list bullet's output, we add the static
|
||||
// text from the first node in each listitem, so skip it here.
|
||||
if (aAccessible.parent.role == Ci.nsIAccessibleRole.ROLE_LISTITEM) {
|
||||
if (aAccessible.parent.role == ROLE_LISTITEM) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@ -654,7 +658,7 @@ this.BrailleGenerator = {
|
||||
},
|
||||
|
||||
_getContextStart: function _getContextStart(aContext) {
|
||||
if (aContext.accessible.parent.role == Ci.nsIAccessibleRole.ROLE_LINK) {
|
||||
if (aContext.accessible.parent.role == ROLE_LINK) {
|
||||
return [aContext.accessible.parent];
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,37 @@ const FILTER_IGNORE = Ci.nsIAccessibleTraversalRule.FILTER_IGNORE;
|
||||
const FILTER_MATCH = Ci.nsIAccessibleTraversalRule.FILTER_MATCH;
|
||||
const FILTER_IGNORE_SUBTREE = Ci.nsIAccessibleTraversalRule.FILTER_IGNORE_SUBTREE;
|
||||
|
||||
const ROLE_MENUITEM = Ci.nsIAccessibleRole.ROLE_MENUITEM;
|
||||
const ROLE_LINK = Ci.nsIAccessibleRole.ROLE_LINK;
|
||||
const ROLE_PAGETAB = Ci.nsIAccessibleRole.ROLE_PAGETAB;
|
||||
const ROLE_GRAPHIC = Ci.nsIAccessibleRole.ROLE_GRAPHIC;
|
||||
const ROLE_STATICTEXT = Ci.nsIAccessibleRole.ROLE_STATICTEXT;
|
||||
const ROLE_TEXT_LEAF = Ci.nsIAccessibleRole.ROLE_TEXT_LEAF;
|
||||
const ROLE_PUSHBUTTON = Ci.nsIAccessibleRole.ROLE_PUSHBUTTON;
|
||||
const ROLE_SPINBUTTON = Ci.nsIAccessibleRole.ROLE_SPINBUTTON;
|
||||
const ROLE_CHECKBUTTON = Ci.nsIAccessibleRole.ROLE_CHECKBUTTON;
|
||||
const ROLE_RADIOBUTTON = Ci.nsIAccessibleRole.ROLE_RADIOBUTTON;
|
||||
const ROLE_COMBOBOX = Ci.nsIAccessibleRole.ROLE_COMBOBOX;
|
||||
const ROLE_PROGRESSBAR = Ci.nsIAccessibleRole.ROLE_PROGRESSBAR;
|
||||
const ROLE_BUTTONDROPDOWN = Ci.nsIAccessibleRole.ROLE_BUTTONDROPDOWN;
|
||||
const ROLE_BUTTONMENU = Ci.nsIAccessibleRole.ROLE_BUTTONMENU;
|
||||
const ROLE_CHECK_MENU_ITEM = Ci.nsIAccessibleRole.ROLE_CHECK_MENU_ITEM;
|
||||
const ROLE_PASSWORD_TEXT = Ci.nsIAccessibleRole.ROLE_PASSWORD_TEXT;
|
||||
const ROLE_RADIO_MENU_ITEM = Ci.nsIAccessibleRole.ROLE_RADIO_MENU_ITEM;
|
||||
const ROLE_TOGGLE_BUTTON = Ci.nsIAccessibleRole.ROLE_TOGGLE_BUTTON;
|
||||
const ROLE_ENTRY = Ci.nsIAccessibleRole.ROLE_ENTRY;
|
||||
const ROLE_LIST = Ci.nsIAccessibleRole.ROLE_LIST;
|
||||
const ROLE_DEFINITION_LIST = Ci.nsIAccessibleRole.ROLE_DEFINITION_LIST;
|
||||
const ROLE_LISTITEM = Ci.nsIAccessibleRole.ROLE_LISTITEM;
|
||||
const ROLE_BUTTONDROPDOWNGRID = Ci.nsIAccessibleRole.ROLE_BUTTONDROPDOWNGRID;
|
||||
const ROLE_LISTBOX = Ci.nsIAccessibleRole.ROLE_LISTBOX;
|
||||
const ROLE_SLIDER = Ci.nsIAccessibleRole.ROLE_SLIDER;
|
||||
const ROLE_HEADING = Ci.nsIAccessibleRole.ROLE_HEADING;
|
||||
const ROLE_TERM = Ci.nsIAccessibleRole.ROLE_TERM;
|
||||
const ROLE_SEPARATOR = Ci.nsIAccessibleRole.ROLE_SEPARATOR;
|
||||
const ROLE_TABLE = Ci.nsIAccessibleRole.ROLE_TABLE;
|
||||
const ROLE_INTERNAL_FRAME = Ci.nsIAccessibleRole.ROLE_INTERNAL_FRAME;
|
||||
|
||||
this.EXPORTED_SYMBOLS = ['TraversalRules'];
|
||||
|
||||
Cu.import('resource://gre/modules/accessibility/Utils.jsm');
|
||||
@ -37,7 +68,7 @@ BaseTraversalRule.prototype = {
|
||||
|
||||
match: function BaseTraversalRule_match(aAccessible)
|
||||
{
|
||||
if (aAccessible.role == Ci.nsIAccessibleRole.ROLE_INTERNAL_FRAME) {
|
||||
if (aAccessible.role == ROLE_INTERNAL_FRAME) {
|
||||
return (Utils.getMessageManager(aAccessible.DOMNode)) ?
|
||||
FILTER_MATCH | FILTER_IGNORE_SUBTREE : FILTER_IGNORE;
|
||||
}
|
||||
@ -52,37 +83,37 @@ BaseTraversalRule.prototype = {
|
||||
};
|
||||
|
||||
var gSimpleTraversalRoles =
|
||||
[Ci.nsIAccessibleRole.ROLE_MENUITEM,
|
||||
Ci.nsIAccessibleRole.ROLE_LINK,
|
||||
Ci.nsIAccessibleRole.ROLE_PAGETAB,
|
||||
Ci.nsIAccessibleRole.ROLE_GRAPHIC,
|
||||
Ci.nsIAccessibleRole.ROLE_STATICTEXT,
|
||||
Ci.nsIAccessibleRole.ROLE_TEXT_LEAF,
|
||||
Ci.nsIAccessibleRole.ROLE_PUSHBUTTON,
|
||||
Ci.nsIAccessibleRole.ROLE_CHECKBUTTON,
|
||||
Ci.nsIAccessibleRole.ROLE_RADIOBUTTON,
|
||||
Ci.nsIAccessibleRole.ROLE_COMBOBOX,
|
||||
Ci.nsIAccessibleRole.ROLE_PROGRESSBAR,
|
||||
Ci.nsIAccessibleRole.ROLE_BUTTONDROPDOWN,
|
||||
Ci.nsIAccessibleRole.ROLE_BUTTONMENU,
|
||||
Ci.nsIAccessibleRole.ROLE_CHECK_MENU_ITEM,
|
||||
Ci.nsIAccessibleRole.ROLE_PASSWORD_TEXT,
|
||||
Ci.nsIAccessibleRole.ROLE_RADIO_MENU_ITEM,
|
||||
Ci.nsIAccessibleRole.ROLE_TOGGLE_BUTTON,
|
||||
Ci.nsIAccessibleRole.ROLE_ENTRY,
|
||||
[ROLE_MENUITEM,
|
||||
ROLE_LINK,
|
||||
ROLE_PAGETAB,
|
||||
ROLE_GRAPHIC,
|
||||
ROLE_STATICTEXT,
|
||||
ROLE_TEXT_LEAF,
|
||||
ROLE_PUSHBUTTON,
|
||||
ROLE_CHECKBUTTON,
|
||||
ROLE_RADIOBUTTON,
|
||||
ROLE_COMBOBOX,
|
||||
ROLE_PROGRESSBAR,
|
||||
ROLE_BUTTONDROPDOWN,
|
||||
ROLE_BUTTONMENU,
|
||||
ROLE_CHECK_MENU_ITEM,
|
||||
ROLE_PASSWORD_TEXT,
|
||||
ROLE_RADIO_MENU_ITEM,
|
||||
ROLE_TOGGLE_BUTTON,
|
||||
ROLE_ENTRY,
|
||||
// Used for traversing in to child OOP frames.
|
||||
Ci.nsIAccessibleRole.ROLE_INTERNAL_FRAME];
|
||||
ROLE_INTERNAL_FRAME];
|
||||
|
||||
this.TraversalRules = {
|
||||
Simple: new BaseTraversalRule(
|
||||
gSimpleTraversalRoles,
|
||||
function Simple_match(aAccessible) {
|
||||
switch (aAccessible.role) {
|
||||
case Ci.nsIAccessibleRole.ROLE_COMBOBOX:
|
||||
case ROLE_COMBOBOX:
|
||||
// We don't want to ignore the subtree because this is often
|
||||
// where the list box hangs out.
|
||||
return FILTER_MATCH;
|
||||
case Ci.nsIAccessibleRole.ROLE_TEXT_LEAF:
|
||||
case ROLE_TEXT_LEAF:
|
||||
{
|
||||
// Nameless text leaves are boring, skip them.
|
||||
let name = aAccessible.name;
|
||||
@ -91,24 +122,24 @@ this.TraversalRules = {
|
||||
else
|
||||
return FILTER_IGNORE;
|
||||
}
|
||||
case Ci.nsIAccessibleRole.ROLE_LINK:
|
||||
case ROLE_LINK:
|
||||
// If the link has children we should land on them instead.
|
||||
// Image map links don't have children so we need to match those.
|
||||
if (aAccessible.childCount == 0)
|
||||
return FILTER_MATCH;
|
||||
else
|
||||
return FILTER_IGNORE;
|
||||
case Ci.nsIAccessibleRole.ROLE_STATICTEXT:
|
||||
case ROLE_STATICTEXT:
|
||||
{
|
||||
let parent = aAccessible.parent;
|
||||
// Ignore prefix static text in list items. They are typically bullets or numbers.
|
||||
if (parent.childCount > 1 && aAccessible.indexInParent == 0 &&
|
||||
parent.role == Ci.nsIAccessibleRole.ROLE_LISTITEM)
|
||||
parent.role == ROLE_LISTITEM)
|
||||
return FILTER_IGNORE;
|
||||
|
||||
return FILTER_MATCH;
|
||||
}
|
||||
case Ci.nsIAccessibleRole.ROLE_GRAPHIC:
|
||||
case ROLE_GRAPHIC:
|
||||
return TraversalRules._shouldSkipImage(aAccessible);
|
||||
default:
|
||||
// Ignore the subtree, if there is one. So that we don't land on
|
||||
@ -128,7 +159,7 @@ this.TraversalRules = {
|
||||
),
|
||||
|
||||
Anchor: new BaseTraversalRule(
|
||||
[Ci.nsIAccessibleRole.ROLE_LINK],
|
||||
[ROLE_LINK],
|
||||
function Anchor_match(aAccessible)
|
||||
{
|
||||
// We want to ignore links, only focus named anchors.
|
||||
@ -143,52 +174,52 @@ this.TraversalRules = {
|
||||
}),
|
||||
|
||||
Button: new BaseTraversalRule(
|
||||
[Ci.nsIAccessibleRole.ROLE_PUSHBUTTON,
|
||||
Ci.nsIAccessibleRole.ROLE_SPINBUTTON,
|
||||
Ci.nsIAccessibleRole.ROLE_TOGGLE_BUTTON,
|
||||
Ci.nsIAccessibleRole.ROLE_BUTTONDROPDOWN,
|
||||
Ci.nsIAccessibleRole.ROLE_BUTTONDROPDOWNGRID]),
|
||||
[ROLE_PUSHBUTTON,
|
||||
ROLE_SPINBUTTON,
|
||||
ROLE_TOGGLE_BUTTON,
|
||||
ROLE_BUTTONDROPDOWN,
|
||||
ROLE_BUTTONDROPDOWNGRID]),
|
||||
|
||||
Combobox: new BaseTraversalRule(
|
||||
[Ci.nsIAccessibleRole.ROLE_COMBOBOX,
|
||||
Ci.nsIAccessibleRole.ROLE_LISTBOX]),
|
||||
[ROLE_COMBOBOX,
|
||||
ROLE_LISTBOX]),
|
||||
|
||||
Entry: new BaseTraversalRule(
|
||||
[Ci.nsIAccessibleRole.ROLE_ENTRY,
|
||||
Ci.nsIAccessibleRole.ROLE_PASSWORD_TEXT]),
|
||||
[ROLE_ENTRY,
|
||||
ROLE_PASSWORD_TEXT]),
|
||||
|
||||
FormElement: new BaseTraversalRule(
|
||||
[Ci.nsIAccessibleRole.ROLE_PUSHBUTTON,
|
||||
Ci.nsIAccessibleRole.ROLE_SPINBUTTON,
|
||||
Ci.nsIAccessibleRole.ROLE_TOGGLE_BUTTON,
|
||||
Ci.nsIAccessibleRole.ROLE_BUTTONDROPDOWN,
|
||||
Ci.nsIAccessibleRole.ROLE_BUTTONDROPDOWNGRID,
|
||||
Ci.nsIAccessibleRole.ROLE_COMBOBOX,
|
||||
Ci.nsIAccessibleRole.ROLE_LISTBOX,
|
||||
Ci.nsIAccessibleRole.ROLE_ENTRY,
|
||||
Ci.nsIAccessibleRole.ROLE_PASSWORD_TEXT,
|
||||
Ci.nsIAccessibleRole.ROLE_PAGETAB,
|
||||
Ci.nsIAccessibleRole.ROLE_RADIOBUTTON,
|
||||
Ci.nsIAccessibleRole.ROLE_RADIO_MENU_ITEM,
|
||||
Ci.nsIAccessibleRole.ROLE_SLIDER,
|
||||
Ci.nsIAccessibleRole.ROLE_CHECKBUTTON,
|
||||
Ci.nsIAccessibleRole.ROLE_CHECK_MENU_ITEM]),
|
||||
[ROLE_PUSHBUTTON,
|
||||
ROLE_SPINBUTTON,
|
||||
ROLE_TOGGLE_BUTTON,
|
||||
ROLE_BUTTONDROPDOWN,
|
||||
ROLE_BUTTONDROPDOWNGRID,
|
||||
ROLE_COMBOBOX,
|
||||
ROLE_LISTBOX,
|
||||
ROLE_ENTRY,
|
||||
ROLE_PASSWORD_TEXT,
|
||||
ROLE_PAGETAB,
|
||||
ROLE_RADIOBUTTON,
|
||||
ROLE_RADIO_MENU_ITEM,
|
||||
ROLE_SLIDER,
|
||||
ROLE_CHECKBUTTON,
|
||||
ROLE_CHECK_MENU_ITEM]),
|
||||
|
||||
Graphic: new BaseTraversalRule(
|
||||
[Ci.nsIAccessibleRole.ROLE_GRAPHIC],
|
||||
[ROLE_GRAPHIC],
|
||||
function Graphic_match(aAccessible) {
|
||||
return TraversalRules._shouldSkipImage(aAccessible);
|
||||
}),
|
||||
|
||||
Heading: new BaseTraversalRule(
|
||||
[Ci.nsIAccessibleRole.ROLE_HEADING]),
|
||||
[ROLE_HEADING]),
|
||||
|
||||
ListItem: new BaseTraversalRule(
|
||||
[Ci.nsIAccessibleRole.ROLE_LISTITEM,
|
||||
Ci.nsIAccessibleRole.ROLE_TERM]),
|
||||
[ROLE_LISTITEM,
|
||||
ROLE_TERM]),
|
||||
|
||||
Link: new BaseTraversalRule(
|
||||
[Ci.nsIAccessibleRole.ROLE_LINK],
|
||||
[ROLE_LINK],
|
||||
function Link_match(aAccessible)
|
||||
{
|
||||
// We want to ignore anchors, only focus real links.
|
||||
@ -203,25 +234,25 @@ this.TraversalRules = {
|
||||
}),
|
||||
|
||||
List: new BaseTraversalRule(
|
||||
[Ci.nsIAccessibleRole.ROLE_LIST,
|
||||
Ci.nsIAccessibleRole.ROLE_DEFINITION_LIST]),
|
||||
[ROLE_LIST,
|
||||
ROLE_DEFINITION_LIST]),
|
||||
|
||||
PageTab: new BaseTraversalRule(
|
||||
[Ci.nsIAccessibleRole.ROLE_PAGETAB]),
|
||||
[ROLE_PAGETAB]),
|
||||
|
||||
RadioButton: new BaseTraversalRule(
|
||||
[Ci.nsIAccessibleRole.ROLE_RADIOBUTTON,
|
||||
Ci.nsIAccessibleRole.ROLE_RADIO_MENU_ITEM]),
|
||||
[ROLE_RADIOBUTTON,
|
||||
ROLE_RADIO_MENU_ITEM]),
|
||||
|
||||
Separator: new BaseTraversalRule(
|
||||
[Ci.nsIAccessibleRole.ROLE_SEPARATOR]),
|
||||
[ROLE_SEPARATOR]),
|
||||
|
||||
Table: new BaseTraversalRule(
|
||||
[Ci.nsIAccessibleRole.ROLE_TABLE]),
|
||||
[ROLE_TABLE]),
|
||||
|
||||
Checkbox: new BaseTraversalRule(
|
||||
[Ci.nsIAccessibleRole.ROLE_CHECKBUTTON,
|
||||
Ci.nsIAccessibleRole.ROLE_CHECK_MENU_ITEM]),
|
||||
[ROLE_CHECKBUTTON,
|
||||
ROLE_CHECK_MENU_ITEM]),
|
||||
|
||||
_shouldSkipImage: function _shouldSkipImage(aAccessible) {
|
||||
if (gSkipEmptyImages.value && aAccessible.name === '') {
|
||||
|
@ -8,6 +8,12 @@ const Cu = Components.utils;
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
const EVENT_STATE_CHANGE = Ci.nsIAccessibleEvent.EVENT_STATE_CHANGE;
|
||||
|
||||
const ROLE_CELL = Ci.nsIAccessibleRole.ROLE_CELL;
|
||||
const ROLE_COLUMNHEADER = Ci.nsIAccessibleRole.ROLE_COLUMNHEADER;
|
||||
const ROLE_ROWHEADER = Ci.nsIAccessibleRole.ROLE_ROWHEADER;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, 'Services',
|
||||
'resource://gre/modules/Services.jsm');
|
||||
@ -310,7 +316,7 @@ this.Logger = {
|
||||
|
||||
eventToString: function eventToString(aEvent) {
|
||||
let str = Utils.AccRetrieval.getStringEventType(aEvent.eventType);
|
||||
if (aEvent.eventType == Ci.nsIAccessibleEvent.EVENT_STATE_CHANGE) {
|
||||
if (aEvent.eventType == EVENT_STATE_CHANGE) {
|
||||
let event = aEvent.QueryInterface(Ci.nsIAccessibleStateChangeEvent);
|
||||
let stateStrings = event.isExtraState ?
|
||||
Utils.AccRetrieval.getStringStates(0, event.state) :
|
||||
@ -476,11 +482,9 @@ PivotContext.prototype = {
|
||||
if (!aAccessible) {
|
||||
return null;
|
||||
}
|
||||
if ([Ci.nsIAccessibleRole.ROLE_CELL,
|
||||
Ci.nsIAccessibleRole.ROLE_COLUMNHEADER,
|
||||
Ci.nsIAccessibleRole.ROLE_ROWHEADER].indexOf(
|
||||
aAccessible.role) < 0) {
|
||||
return null;
|
||||
if ([ROLE_CELL, ROLE_COLUMNHEADER, ROLE_ROWHEADER].indexOf(
|
||||
aAccessible.role) < 0) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return aAccessible.QueryInterface(Ci.nsIAccessibleTableCell);
|
||||
@ -539,13 +543,12 @@ PivotContext.prototype = {
|
||||
|
||||
cellInfo.columnHeaders = [];
|
||||
if (cellInfo.columnChanged && cellInfo.current.role !==
|
||||
Ci.nsIAccessibleRole.ROLE_COLUMNHEADER) {
|
||||
ROLE_COLUMNHEADER) {
|
||||
cellInfo.columnHeaders = [headers for (headers of getHeaders(
|
||||
cellInfo.current.columnHeaderCells))];
|
||||
}
|
||||
cellInfo.rowHeaders = [];
|
||||
if (cellInfo.rowChanged && cellInfo.current.role ===
|
||||
Ci.nsIAccessibleRole.ROLE_CELL) {
|
||||
if (cellInfo.rowChanged && cellInfo.current.role === ROLE_CELL) {
|
||||
cellInfo.rowHeaders = [headers for (headers of getHeaders(
|
||||
cellInfo.current.rowHeaderCells))];
|
||||
}
|
||||
|
@ -5,6 +5,8 @@
|
||||
let Ci = Components.interfaces;
|
||||
let Cu = Components.utils;
|
||||
|
||||
const ROLE_INTERNAL_FRAME = Ci.nsIAccessibleRole.ROLE_INTERNAL_FRAME;
|
||||
|
||||
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
|
||||
XPCOMUtils.defineLazyModuleGetter(this, 'Logger',
|
||||
'resource://gre/modules/accessibility/Utils.jsm');
|
||||
@ -100,7 +102,7 @@ function virtualCursorControl(aMessage) {
|
||||
function forwardMessage(aVirtualCursor, aMessage) {
|
||||
try {
|
||||
let acc = aVirtualCursor.position;
|
||||
if (acc && acc.role == Ci.nsIAccessibleRole.ROLE_INTERNAL_FRAME) {
|
||||
if (acc && acc.role == ROLE_INTERNAL_FRAME) {
|
||||
let mm = Utils.getMessageManager(acc.DOMNode);
|
||||
mm.addMessageListener(aMessage.name, virtualCursorControl);
|
||||
aMessage.json.origin = 'parent';
|
||||
|
Loading…
Reference in New Issue
Block a user