Bug 903187: Map HTML ins/del to accessible roles. r=MarcoZ

IA2 now has IA2_ROLE_CONTENT_INSERTION/DELETION.
Mac has AXInsert/DeleteStyleGroup subroles.
We now create accessibles for these elements and expose the appropriate role.
For ATK, there is no specific role for these, so we just use the generic ATK_ROLE_SECTION.

MozReview-Commit-ID: 2khzRa7BQ6z

--HG--
extra : rebase_source : e1c84bdef9a23b225e9870660050790df94c4beb
This commit is contained in:
James Teh 2018-07-27 16:40:50 +10:00
parent 7bd6d0d2a6
commit 2a45f8f49d
7 changed files with 61 additions and 12 deletions

View file

@ -34,6 +34,10 @@ MARKUPMAP(dd,
New_HTMLDtOrDd<HyperTextAccessibleWrap>,
roles::DEFINITION)
MARKUPMAP(del,
New_HyperText,
roles::CONTENT_DELETION)
MARKUPMAP(details,
New_HyperText,
roles::DETAILS)
@ -99,6 +103,10 @@ MARKUPMAP(input,
New_HTMLInput,
0)
MARKUPMAP(ins,
New_HyperText,
roles::CONTENT_INSERTION)
MARKUPMAP(label,
New_HTMLLabel,
roles::LABEL)

View file

@ -1025,7 +1025,19 @@ enum Role {
*/
BLOCKQUOTE = 175,
LAST_ROLE = BLOCKQUOTE
/**
* Content previously deleted or proposed for deletion, e.g. in revision
* history or a content view providing suggestions from reviewers.
*/
CONTENT_DELETION = 176,
/**
* Content previously inserted or proposed for insertion, e.g. in revision
* history or a content view providing suggestions from reviewers.
*/
CONTENT_INSERTION = 177,
LAST_ROLE = CONTENT_INSERTION
};
} // namespace role

View file

@ -1426,3 +1426,19 @@ ROLE(BLOCKQUOTE,
ROLE_SYSTEM_GROUPING,
IA2_ROLE_BLOCK_QUOTE,
eNoNameRule)
ROLE(CONTENT_DELETION,
"content deletion",
ATK_ROLE_SECTION,
NSAccessibilityGroupRole,
USE_ROLE_STRING,
IA2_ROLE_CONTENT_DELETION,
eNoNameRule)
ROLE(CONTENT_INSERTION,
"content insertion",
ATK_ROLE_SECTION,
NSAccessibilityGroupRole,
USE_ROLE_STRING,
IA2_ROLE_CONTENT_INSERTION,
eNoNameRule)

View file

@ -1019,4 +1019,17 @@ interface nsIAccessibleRole : nsISupports
* A section of content that is quoted from another source.
*/
const unsigned long ROLE_BLOCKQUOTE = 175;
/**
* Content previously deleted or proposed for deletion, e.g. in revision
* history or a content view providing suggestions from reviewers.
*/
const unsigned long ROLE_CONTENT_DELETION = 176;
/**
* Content previously inserted or proposed for insertion, e.g. in revision
* history or a content view providing suggestions from reviewers.
*/
const unsigned long ROLE_CONTENT_INSERTION = 177;
};

View file

@ -929,6 +929,12 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
return @"AXApplicationGroup";
break;
case roles::CONTENT_DELETION:
return @"AXDeleteStyleGroup";
case roles::CONTENT_INSERTION:
return @"AXInsertStyleGroup";
default:
break;
}

View file

@ -359,13 +359,9 @@
obj = {
role: ROLE_PARAGRAPH,
textAttrs: {
0: { },
6: { "text-line-through-style": "solid" }
},
children: [
{ role: ROLE_TEXT_LEAF }, // plain text
{ role: ROLE_TEXT_LEAF } // HTML:del text
{ role: ROLE_CONTENT_DELETION }
]
};
testElm("del_container", obj);
@ -880,13 +876,9 @@
obj = {
role: ROLE_PARAGRAPH,
textAttrs: {
0: { },
6: { "text-underline-style": "solid" }
},
children: [
{ role: ROLE_TEXT_LEAF }, // plain text
{ role: ROLE_TEXT_LEAF } // HTML:ins text
{ role: ROLE_CONTENT_INSERTION }
]
};
testElm("ins_container", obj);

View file

@ -15,10 +15,12 @@ const ROLE_CELL = nsIAccessibleRole.ROLE_CELL;
const ROLE_CHECKBUTTON = nsIAccessibleRole.ROLE_CHECKBUTTON;
const ROLE_CHECK_MENU_ITEM = nsIAccessibleRole.ROLE_CHECK_MENU_ITEM;
const ROLE_CHROME_WINDOW = nsIAccessibleRole.ROLE_CHROME_WINDOW;
const ROLE_COLUMNHEADER = nsIAccessibleRole.ROLE_COLUMNHEADER;
const ROLE_COMBOBOX = nsIAccessibleRole.ROLE_COMBOBOX;
const ROLE_COMBOBOX_LIST = nsIAccessibleRole.ROLE_COMBOBOX_LIST;
const ROLE_COMBOBOX_OPTION = nsIAccessibleRole.ROLE_COMBOBOX_OPTION;
const ROLE_COLUMNHEADER = nsIAccessibleRole.ROLE_COLUMNHEADER;
const ROLE_CONTENT_DELETION = nsIAccessibleRole.ROLE_CONTENT_DELETION;
const ROLE_CONTENT_INSERTION = nsIAccessibleRole.ROLE_CONTENT_INSERTION;
const ROLE_DATE_EDITOR = nsIAccessibleRole.ROLE_DATE_EDITOR;
const ROLE_DEFINITION = nsIAccessibleRole.ROLE_DEFINITION;
const ROLE_DEFINITION_LIST = nsIAccessibleRole.ROLE_DEFINITION_LIST;