diff --git a/accessible/base/ARIAMap.cpp b/accessible/base/ARIAMap.cpp index b4d90ca5ca27..4cc313e6db88 100644 --- a/accessible/base/ARIAMap.cpp +++ b/accessible/base/ARIAMap.cpp @@ -366,6 +366,16 @@ static nsRoleMapEntry sWAIRoleMaps[] = kNoReqStates, eARIACheckableBool }, + { // none + &nsGkAtoms::none, + roles::NOTHING, + kUseMapRole, + eNoValue, + eNoAction, + eNoLiveAttr, + kGenericAccType, + kNoReqStates + }, { // note &nsGkAtoms::note_, roles::NOTE, diff --git a/accessible/base/nsAccessibilityService.cpp b/accessible/base/nsAccessibilityService.cpp index 3065ca30164f..1d4fbacc4890 100644 --- a/accessible/base/nsAccessibilityService.cpp +++ b/accessible/base/nsAccessibilityService.cpp @@ -962,7 +962,9 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode, // If the element is focusable or global ARIA attribute is applied to it or // it is referenced by ARIA relationship then treat role="presentation" on // the element as the role is not there. - if (roleMapEntry && roleMapEntry->Is(nsGkAtoms::presentation)) { + if (roleMapEntry && + (roleMapEntry->Is(nsGkAtoms::presentation) || + roleMapEntry->Is(nsGkAtoms::none))) { if (!MustBeAccessible(content, document)) return nullptr; diff --git a/accessible/tests/mochitest/tree/test_aria_presentation.html b/accessible/tests/mochitest/tree/test_aria_presentation.html index 1d05128b1c81..f108339ba757 100644 --- a/accessible/tests/mochitest/tree/test_aria_presentation.html +++ b/accessible/tests/mochitest/tree/test_aria_presentation.html @@ -21,14 +21,18 @@ // Presentation role don't allow accessible. var tree = { SECTION: [ // container - { TEXT_LEAF: [ ] } // child text of presentation node + { TEXT_LEAF: [ ] }, // child text of 'presentation' node + { TEXT_LEAF: [ ] } // child text of 'none' node ] }; testAccessibleTree("div_cnt", tree); - // Focusable element, presentation role is ignored. + // Focusable element, 'presentation' and 'none' roles are ignored. tree = { SECTION: [ // container - { PUSHBUTTON: [ // button + { PUSHBUTTON: [ // button having 'presentation' role + { TEXT_LEAF: [ ] } + ] }, + { PUSHBUTTON: [ // button having 'none' role { TEXT_LEAF: [ ] } ] } ] }; @@ -37,18 +41,28 @@ // Presentation table, no table structure is exposed. tree = { SECTION: [ // container - { TEXT_CONTAINER: [ // td generic accessible + { TEXT_CONTAINER: [ // td generic accessible inside 'presentation' table + { TEXT_LEAF: [ ] } // cell text + ] }, + { TEXT_CONTAINER: [ // td generic accessible inside 'none' table { TEXT_LEAF: [ ] } // cell text ] } ] }; testAccessibleTree("tbl_cnt", tree); - // Focusable table, presentation role is ignored. + // Focusable table, 'presentation' and 'none' roles are ignored. tree = { SECTION: [ // container - { TABLE: [ // table + { TABLE: [ // table having 'presentation' role { ROW: [ // tr - { CELL: [ //td + { CELL: [ // td + { TEXT_LEAF: [ ] } + ] } + ] } + ] }, + { TABLE: [ // table having 'none' role + { ROW: [ // tr + { CELL: [ // td { TEXT_LEAF: [ ] } ] } ] } @@ -59,15 +73,27 @@ // Presentation list, expose generic accesisble for list items. tree = { SECTION: [ // container - { PARAGRAPH: [ // li generic accessible + { PARAGRAPH: [ // li generic accessible inside 'presentation' role + { TEXT_LEAF: [ ] } // li text + ] }, + { PARAGRAPH: [ // li generic accessible inside 'none' role { TEXT_LEAF: [ ] } // li text ] } ] }; testAccessibleTree("list_cnt", tree); - // Has ARIA globals or referred by ARIA relationship. + // Has ARIA globals or referred by ARIA relationship, role='presentation' + // and role='none' are ignored. tree = { SECTION: [ // container + { LABEL: [ // label, has aria-owns + { TEXT_LEAF: [ ] } + ] }, + { TEXT_LEAF: [ ] }, + { LABEL: [ // label, referenced by aria-owns + { TEXT_LEAF: [ ] } + ] }, + { TEXT_LEAF: [ ] }, { LABEL: [ // label, has aria-owns { TEXT_LEAF: [ ] } ] }, @@ -90,21 +116,26 @@ - Mozilla Bug 548291 + Bug 548291 - Mozilla Bug 666504 + Bug 666504 + + + Bug 971212

   
-
text
+
t
t
-
+
@@ -112,6 +143,11 @@
cell
+ + + + +
cell
@@ -120,17 +156,27 @@ cell + + + + +
cell
+
+ +