Bug 616940 - removed select option accessibles aren't removed until hide event is fired, r=fer, a=davidb

This commit is contained in:
Alexander Surkov 2010-12-15 13:23:10 -08:00
parent 7869a7e573
commit 40e97b68ff
2 changed files with 42 additions and 1 deletions

View File

@ -1979,7 +1979,13 @@ nsDocAccessible::UpdateTreeInternal(nsAccessible* aContainer,
}
} else {
// Update the tree for content removal.
aContainer->RemoveChild(accessible);
// The accessible parent may differ from container accessible if
// the parent doesn't have own DOM node like list accessible for HTML
// selects.
nsAccessible* parent = accessible->GetParent();
NS_ASSERTION(parent, "No accessible parent?!");
parent->RemoveChild(accessible);
UncacheChildrenInSubtree(accessible);
}
}

View File

@ -59,6 +59,36 @@
}
}
function removeOptions(aID)
{
this.selectNode = getNode(aID);
this.select = getAccessible(this.selectNode);
this.invoke = function removeOptions_invoke()
{
while (this.selectNode.length)
this.selectNode.remove(0);
}
this.eventSeq = [
new invokerChecker(EVENT_REORDER, this.select)
];
this.finalCheck = function removeOptions_finalCheck()
{
var tree =
{ COMBOBOX: [
{ COMBOBOX_LIST: [] }
] };
testAccessibleTree(this.select, tree);
}
this.getID = function removeptions_getID()
{
return "test elements removal from a select";
}
}
//gA11yEventDumpID = "debug";
function doTest()
@ -66,6 +96,7 @@
gQueue = new eventQueue();
gQueue.push(new addOptions("select"));
gQueue.push(new removeOptions("select"));
gQueue.invoke(); // Will call SimpleTest.finish();
@ -81,6 +112,10 @@
href="https://bugzilla.mozilla.org/show_bug.cgi?id=616452"
title="Bug 616452 - Dynamically inserted select options aren't reflected in accessible tree">
Mozilla Bug 616452</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=616940"
title="Removed select option accessibles aren't removed until hide event is fired">
Mozilla Bug 616940</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">