From 3e9bbd265b795a651acd134f6e38d4cd343578d4 Mon Sep 17 00:00:00 2001 From: Marco Zehe Date: Tue, 5 Sep 2017 15:15:09 +0200 Subject: [PATCH] Bug 1396626 - Expose aria-haspopup tokens dialog, listbox, menu and tree as object attributes. r=surkov MozReview-Commit-ID: 7iuo89tuGOu --HG-- extra : rebase_source : 044da8a2ce31a6e894bb205bae6b86d6fce9976a --- accessible/base/ARIAMap.cpp | 4 ++-- accessible/generic/Accessible.cpp | 4 ---- accessible/tests/mochitest/attributes/test_obj.html | 8 ++++++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/accessible/base/ARIAMap.cpp b/accessible/base/ARIAMap.cpp index 1054bdc5d08c..32644c927d7d 100644 --- a/accessible/base/ARIAMap.cpp +++ b/accessible/base/ARIAMap.cpp @@ -1215,7 +1215,7 @@ static const EStateRule sWAIUnivStateMap[] = { eARIACurrent, eARIADisabled, eARIAExpanded, // Currently under spec review but precedent exists - eARIAHasPopup, // Note this is technically a "property" + eARIAHasPopup, // Note this is a tokenised attribute starting in ARIA 1.1 eARIAInvalid, eARIAModal, eARIARequired, // XXX not global, Bug 553117 @@ -1248,7 +1248,7 @@ static const AttrCharacteristics gWAIUnivAttrMap[] = { {&nsGkAtoms::aria_expanded, ATTR_BYPASSOBJ | ATTR_VALTOKEN }, {&nsGkAtoms::aria_flowto, ATTR_BYPASSOBJ | ATTR_GLOBAL }, {&nsGkAtoms::aria_grabbed, ATTR_VALTOKEN | ATTR_GLOBAL }, - {&nsGkAtoms::aria_haspopup, ATTR_BYPASSOBJ | ATTR_VALTOKEN | ATTR_GLOBAL }, + {&nsGkAtoms::aria_haspopup, ATTR_BYPASSOBJ_IF_FALSE | ATTR_VALTOKEN | ATTR_GLOBAL }, {&nsGkAtoms::aria_hidden, ATTR_BYPASSOBJ | ATTR_VALTOKEN | ATTR_GLOBAL }, /* handled special way */ {&nsGkAtoms::aria_invalid, ATTR_BYPASSOBJ | ATTR_VALTOKEN | ATTR_GLOBAL }, {&nsGkAtoms::aria_label, ATTR_BYPASSOBJ | ATTR_GLOBAL }, diff --git a/accessible/generic/Accessible.cpp b/accessible/generic/Accessible.cpp index 0f28f0698fb7..1db01178724e 100644 --- a/accessible/generic/Accessible.cpp +++ b/accessible/generic/Accessible.cpp @@ -956,10 +956,6 @@ Accessible::Attributes() NS_LITERAL_STRING("true")); } - // XXX: In ARIA 1.1, the value of aria-haspopup became a token (bug 1355449). - if (aria::UniversalStatesFor(mContent->AsElement()) & states::HASPOPUP) - nsAccUtils::SetAccAttr(attributes, nsGkAtoms::haspopup, NS_LITERAL_STRING("true")); - // If there is no aria-live attribute then expose default value of 'live' // object attribute used for ARIA role of this accessible. const nsRoleMapEntry* roleMapEntry = ARIARoleMap(); diff --git a/accessible/tests/mochitest/attributes/test_obj.html b/accessible/tests/mochitest/attributes/test_obj.html index 68278d990c8b..15d0223dcea5 100644 --- a/accessible/tests/mochitest/attributes/test_obj.html +++ b/accessible/tests/mochitest/attributes/test_obj.html @@ -40,6 +40,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=558036 testAttrs("haspopupTrue", { "haspopup": "true" }, true); testAbsentAttrs("haspopupFalse", { "haspopup": "false" }); testAbsentAttrs("haspopupEmpty", { "haspopup": "" }); + testAttrs("haspopupDialog", { "haspopup": "dialog" }, true); + testAttrs("haspopupListbox", { "haspopup": "listbox" }, true); + testAttrs("haspopupMenu", { "haspopup": "menu" }, true); + testAttrs("haspopupTree", { "haspopup": "tree" }, true); testAttrs("hidden", {"hidden": "true"}, true); testAbsentAttrs("hidden_false", { "hidden": "false" }); testAbsentAttrs("modal", {"modal": "true"}); @@ -218,6 +222,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=558036
+
+
+
+