Bug 1268069 - embeded object collection may be not updated on removals, r=yzen

This commit is contained in:
Alexander Surkov 2016-05-25 15:48:45 -04:00
parent 763f8a6b4d
commit 5cf0dfd35e
2 changed files with 34 additions and 4 deletions

View File

@ -156,10 +156,7 @@ TreeMutation::Done()
mParent->mChildren[idx]->mStateFlags |= Accessible::eGroupInfoDirty;
}
if (mStartIdx < mParent->mChildren.Length() - 1) {
mParent->mEmbeddedObjCollector = nullptr;
}
mParent->mEmbeddedObjCollector = nullptr;
mParent->mStateFlags |= mStateFlagsCopy & Accessible::eKidsMutating;
#ifdef DEBUG

View File

@ -151,6 +151,37 @@
}
}
function removeLastChild(aContainer)
{
this.ht = getAccessible(aContainer, [ nsIAccessibleHyperText ]);
this.eventSeq = [
new invokerChecker(EVENT_REORDER, aContainer)
];
this.invoke = function removeLastChild_invoke()
{
is(this.ht.linkCount, 1, "Wrong embedded objects count before removal");
getNode(aContainer).removeChild(getNode(aContainer).lastElementChild);
}
this.finalCheck = function removeLastChild_finalCheck()
{
is(this.ht.linkCount, 0, "Wrong embedded objects count after removal");
var link = null;
try {
link = this.ht.getLinkAt(0);
} catch (e) { }
ok(!link, "No embedded object is expected");
}
this.getID = function removeLastChild_getID()
{
return "Remove last child and try its embedded object";
}
}
//gA11yEventDumpToConsole = true; // debug stuff
var gQueue = null;
@ -162,6 +193,7 @@
gQueue.push(new removeChild("div1","div2",
"hello my good friend", "hello friend"));
gQueue.push(new removeFirstChild("c4"));
gQueue.push(new removeLastChild("c5"));
gQueue.invoke(); // Will call SimpleTest.finish();
}
@ -199,5 +231,6 @@
<label for="c4_input">label</label>
<input id="c4_input">
</form>
<div id="c5">TextLeaf<input id="c5_input"></div>
</body>
</html>