Bug 1175164 - Do not expose MathML semantics element in the accessibility tree. r=surkov

This commit is contained in:
Frédéric Wang 2015-06-16 16:15:00 +02:00
parent 7815fe3f89
commit 3b2ca0dbb5
7 changed files with 29 additions and 113 deletions

View File

@ -237,18 +237,6 @@ MARKUPMAP(merror_,
New_HyperText,
roles::MATHML_ERROR)
MARKUPMAP(semantics_,
New_HyperText,
roles::MATHML_SEMANTICS)
MARKUPMAP(annotation_,
New_HyperText,
roles::MATHML_ANNOTATION)
MARKUPMAP(annotation_xml_,
New_HyperText,
roles::MATHML_XML_ANNOTATION)
MARKUPMAP(mstack_,
New_HyperText,
roles::MATHML_STACK,

View File

@ -926,66 +926,51 @@ enum Role {
*/
MATHML_ERROR = 157,
/**
* A MathML semantics annotation element (semantics in MathML).
*/
MATHML_SEMANTICS = 158,
/**
* A MathML annotation (annotation in MathML).
*/
MATHML_ANNOTATION = 159,
/**
* A MathML XML annotation (annotation-xml in MathML).
*/
MATHML_XML_ANNOTATION = 160,
/**
* A MathML stacked (rows of numbers) element (mstack in MathML).
*/
MATHML_STACK = 161,
MATHML_STACK = 158,
/**
* A MathML long division element (mlongdiv in MathML).
*/
MATHML_LONG_DIVISION = 162,
MATHML_LONG_DIVISION = 159,
/**
* A MathML stack group (msgroup in MathML).
*/
MATHML_STACK_GROUP = 163,
MATHML_STACK_GROUP = 160,
/**
* A MathML stack row (msrow in MathML).
*/
MATHML_STACK_ROW = 164,
MATHML_STACK_ROW = 161,
/**
* MathML carries, borrows, or crossouts for a row (mscarries in MathML).
*/
MATHML_STACK_CARRIES = 165,
MATHML_STACK_CARRIES = 162,
/**
* A MathML carry, borrow, or crossout for a column (mscarry in MathML).
*/
MATHML_STACK_CARRY = 166,
MATHML_STACK_CARRY = 163,
/**
* A MathML line in a stack (msline in MathML).
*/
MATHML_STACK_LINE = 167,
MATHML_STACK_LINE = 164,
/**
* A group containing radio buttons
*/
RADIO_GROUP = 168,
RADIO_GROUP = 165,
/**
* A text container exposing brief amount of information. See related
* TEXT_CONTAINER role.
*/
TEXT = 169,
TEXT = 166,
LAST_ROLE = TEXT
};

View File

@ -1280,30 +1280,6 @@ ROLE(MATHML_ERROR,
IA2_ROLE_UNKNOWN,
eNoNameRule)
ROLE(MATHML_SEMANTICS,
"mathml semantics",
ATK_ROLE_UNKNOWN,
NSAccessibilityUnknownRole,
0,
IA2_ROLE_UNKNOWN,
eNoNameRule)
ROLE(MATHML_ANNOTATION,
"mathml annotation",
ATK_ROLE_UNKNOWN,
NSAccessibilityUnknownRole,
0,
IA2_ROLE_UNKNOWN,
eNoNameRule)
ROLE(MATHML_XML_ANNOTATION,
"mathml xml annotation",
ATK_ROLE_UNKNOWN,
NSAccessibilityUnknownRole,
0,
IA2_ROLE_UNKNOWN,
eNoNameRule)
ROLE(MATHML_STACK,
"mathml stack",
ATK_ROLE_UNKNOWN,

View File

@ -1191,12 +1191,15 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
newAcc = markupMap->new_func(content, aContext);
// Fall back to text when encountering Content MathML.
if (!newAcc && !content->IsAnyOfMathMLElements(nsGkAtoms::mpadded_,
if (!newAcc && !content->IsAnyOfMathMLElements(nsGkAtoms::annotation_,
nsGkAtoms::annotation_xml_,
nsGkAtoms::mpadded_,
nsGkAtoms::mphantom_,
nsGkAtoms::maligngroup_,
nsGkAtoms::malignmark_,
nsGkAtoms::mspace_)) {
newAcc = new HyperTextAccessible(content, document);
nsGkAtoms::mspace_,
nsGkAtoms::semantics_)) {
newAcc = new HyperTextAccessible(content, document);
}
}
}

View File

@ -8,7 +8,7 @@
/**
* Defines cross platform (Gecko) roles.
*/
[scriptable, uuid(94add87a-190c-443e-9549-d11131affb2a)]
[scriptable, uuid(da0c7824-147c-11e5-917c-60a44c717042)]
interface nsIAccessibleRole : nsISupports
{
/**
@ -920,64 +920,49 @@ interface nsIAccessibleRole : nsISupports
*/
const unsigned long ROLE_MATHML_ERROR = 157;
/**
* A MathML semantics annotation element (semantics in MathML).
*/
const unsigned long ROLE_MATHML_SEMANTICS = 158;
/**
* A MathML annotation (annotation in MathML).
*/
const unsigned long ROLE_MATHML_ANNOTATION = 159;
/**
* A MathML XML annotation (annotation-xml in MathML).
*/
const unsigned long ROLE_MATHML_XML_ANNOTATION = 160;
/**
* A MathML stacked (rows of numbers) element (mstack in MathML).
*/
const unsigned long ROLE_MATHML_STACK = 161;
const unsigned long ROLE_MATHML_STACK = 158;
/**
* A MathML long division element (mlongdiv in MathML).
*/
const unsigned long ROLE_MATHML_LONG_DIVISION = 162;
const unsigned long ROLE_MATHML_LONG_DIVISION = 159;
/**
* A MathML stack group (msgroup in MathML).
*/
const unsigned long ROLE_MATHML_STACK_GROUP = 163;
const unsigned long ROLE_MATHML_STACK_GROUP = 160;
/**
* A MathML stack row (msrow in MathML).
*/
const unsigned long ROLE_MATHML_STACK_ROW = 164;
const unsigned long ROLE_MATHML_STACK_ROW = 161;
/**
* MathML carries, borrows, or crossouts for a row (mscarries in MathML).
*/
const unsigned long ROLE_MATHML_STACK_CARRIES = 165;
const unsigned long ROLE_MATHML_STACK_CARRIES = 162;
/**
* A MathML carry, borrow, or crossout for a column (mscarry in MathML).
*/
const unsigned long ROLE_MATHML_STACK_CARRY = 166;
const unsigned long ROLE_MATHML_STACK_CARRY = 163;
/**
* A MathML line in a stack (msline in MathML).
*/
const unsigned long ROLE_MATHML_STACK_LINE = 167;
const unsigned long ROLE_MATHML_STACK_LINE = 164;
/**
* A group containing radio buttons
*/
const unsigned long ROLE_RADIO_GROUP = 168;
const unsigned long ROLE_RADIO_GROUP = 165;
/**
* A text container exposing brief amount of information. See related
* TEXT_CONTAINER role.
*/
const unsigned long ROLE_TEXT = 169;
const unsigned long ROLE_TEXT = 166;
};

View File

@ -267,28 +267,10 @@
testElm("merror", obj);
//////////////////////////////////////////////////////////////////////////
// semantics
obj = {
role: ROLE_MATHML_SEMANTICS,
};
testElm("semantics", obj);
//////////////////////////////////////////////////////////////////////////
// annotation
obj = {
role: ROLE_MATHML_ANNOTATION,
};
testElm("annotation", obj);
//////////////////////////////////////////////////////////////////////////
// annotation-xml
obj = {
role: ROLE_MATHML_XML_ANNOTATION,
};
testElm("annotation-xml", obj);
// semantics, annotation, annotation-xml
ok(!isAccessible("semantics"), "semantics should not have accessible");
ok(!isAccessible("annotation"), "annotation should not have accessible");
ok(!isAccessible("annotation-xml"), "annotation-xml should not have accessible");
//////////////////////////////////////////////////////////////////////////
// mstack

View File

@ -68,9 +68,6 @@ const ROLE_MATHML_TABLE_ROW = nsIAccessibleRole.ROLE_MATHML_TABLE_ROW;
const ROLE_MATHML_CELL = nsIAccessibleRole.ROLE_MATHML_CELL;
const ROLE_MATHML_ACTION = nsIAccessibleRole.ROLE_MATHML_ACTION;
const ROLE_MATHML_ERROR = nsIAccessibleRole.ROLE_MATHML_ERROR;
const ROLE_MATHML_SEMANTICS = nsIAccessibleRole.ROLE_MATHML_SEMANTICS;
const ROLE_MATHML_ANNOTATION = nsIAccessibleRole.ROLE_MATHML_ANNOTATION;
const ROLE_MATHML_XML_ANNOTATION = nsIAccessibleRole.ROLE_MATHML_XML_ANNOTATION;
const ROLE_MATHML_STACK = nsIAccessibleRole.ROLE_MATHML_STACK;
const ROLE_MATHML_LONG_DIVISION = nsIAccessibleRole.ROLE_MATHML_LONG_DIVISION;
const ROLE_MATHML_STACK_GROUP = nsIAccessibleRole.ROLE_MATHML_STACK_GROUP;