bug 883708 - don't assert when parent of reorder event is shown later r=surkov

This commit is contained in:
Trevor Saunders 2013-12-12 15:08:29 -05:00
parent 44c105bc52
commit 8c661b3531
3 changed files with 41 additions and 6 deletions

View File

@ -226,9 +226,7 @@ EventQueue::CoalesceReorderEvents(AccEvent* aTailEvent)
// If tailEvent contains thisEvent
// then
// if show of tailEvent contains a grand parent of thisEvent
// then assert
// else if hide of tailEvent contains a grand parent of thisEvent
// if show or hide of tailEvent contains a grand parent of thisEvent
// then ignore thisEvent and its show and hide events
// otherwise ignore thisEvent but not its show and hide events
Accessible* thisParent = thisEvent->mAccessible;
@ -237,9 +235,12 @@ EventQueue::CoalesceReorderEvents(AccEvent* aTailEvent)
AccReorderEvent* tailReorder = downcast_accEvent(aTailEvent);
uint32_t eventType = tailReorder->IsShowHideEventTarget(thisParent);
if (eventType == nsIAccessibleEvent::EVENT_SHOW) {
NS_ERROR("Accessible tree was created after it was modified! Huh?");
} else if (eventType == nsIAccessibleEvent::EVENT_HIDE) {
// Sometimes InvalidateChildren() and
// DocAccessible::CacheChildrenInSubtree() can conspire to reparent an
// accessible in this case no need for mutation events. Se bug 883708
// for details.
if (eventType == nsIAccessibleEvent::EVENT_SHOW ||
eventType == nsIAccessibleEvent::EVENT_HIDE) {
AccReorderEvent* thisReorder = downcast_accEvent(thisEvent);
thisReorder->DoNotEmitAll();
} else {

View File

@ -2,6 +2,7 @@
[test_ariadialog.html]
[test_bug852150.xhtml]
[test_bug883708.xhtml]
[test_bug895082.html]
[test_canvas.html]
[test_colorpicker.xul]

View File

@ -0,0 +1,33 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script>
function boom()
{
var newSpan = document.createElementNS("http://www.w3.org/1999/xhtml", "span");
c.insertBefore(newSpan, d);
a.style.visibility = "visible";
ok(true, "test didn't crash or assert");
SimpleTest.finish();
}
</script>
</head>
<body onload="boom();">
<a target="_blank"
title="test reparenting accessible subtree when inaccessible element becomes accessible"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=883708">
Mozilla Bug 883708
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<div style="visibility: collapse;" id="a"><div style="float: right; visibility: visible;"><div id="c"><td id="d"></td></div></div></div></body>
</html>