From 79ec4018bba5c0e096c544b551985aa4e7777628 Mon Sep 17 00:00:00 2001 From: Alexander Surkov Date: Thu, 14 Apr 2016 13:45:16 -0400 Subject: [PATCH] Bug 1264526 - process ARIA owns relocations for in-the-document accessibles only, r=yzen --- accessible/base/NotificationController.cpp | 4 ++- .../mochitest/treeupdate/test_ariaowns.html | 29 +++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/accessible/base/NotificationController.cpp b/accessible/base/NotificationController.cpp index 9e67b2285dc2..2823171a90d8 100644 --- a/accessible/base/NotificationController.cpp +++ b/accessible/base/NotificationController.cpp @@ -390,7 +390,9 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime) // Process relocation list. for (uint32_t idx = 0; idx < mRelocations.Length(); idx++) { - mDocument->DoARIAOwnsRelocation(mRelocations[idx]); + if (mRelocations[idx]->IsInDocument()) { + mDocument->DoARIAOwnsRelocation(mRelocations[idx]); + } } mRelocations.Clear(); diff --git a/accessible/tests/mochitest/treeupdate/test_ariaowns.html b/accessible/tests/mochitest/treeupdate/test_ariaowns.html index 4131412b94ea..6d21bba205d6 100644 --- a/accessible/tests/mochitest/treeupdate/test_ariaowns.html +++ b/accessible/tests/mochitest/treeupdate/test_ariaowns.html @@ -480,7 +480,6 @@ this.invoke = function removeNotARIAOwnedEl_invoke() { - dumpTree(aContainer, "before"); var tree = { SECTION: [ { TEXT_LEAF: [ ] }, @@ -494,7 +493,6 @@ this.finalCheck = function removeNotARIAOwnedEl_finalCheck() { - dumpTree(aContainer, "after"); var tree = { SECTION: [ { GROUPING: [ ] } @@ -509,6 +507,25 @@ } } + function setARIAOwnsOnElToRemove(aParent, aChild) + { + this.eventSeq = [ + new invokerChecker(EVENT_HIDE, getAccessible(aParent)) + ]; + + this.invoke = function setARIAOwnsOnElToRemove_invoke() + { + getNode(aChild).setAttribute("aria-owns", "no_id"); + getNode(aParent).removeChild(getNode(aChild)); + getNode(aParent).parentNode.removeChild(getNode(aParent)); + } + + this.getID = function setARIAOwnsOnElToRemove_getID() + { + return `set ARIA owns on an element, and then remove it, and then remove its parent`; + } + } + //////////////////////////////////////////////////////////////////////////// // Test @@ -555,6 +572,8 @@ gQueue.push(new removeNotARIAOwnedEl("t6_container", "t6_span")); + gQueue.push(new setARIAOwnsOnElToRemove("t7_parent", "t7_child")); + gQueue.invoke(); // SimpleTest.finish() will be called in the end } @@ -607,6 +626,12 @@ hey
+ +
+
+
+
+