Bug 621618 patch 4: Make conditions in Element::RemoveFromIdTable match those in AddToIdTable, to avoid asymmetric calls to the document's functions. r=bzbarsky

This commit is contained in:
L. David Baron 2014-03-04 20:13:20 -08:00
parent 2367771127
commit af015e471f
2 changed files with 2 additions and 9 deletions

View File

@ -736,7 +736,7 @@ Element::RemoveFromIdTable(nsIAtom* aId)
} }
} else { } else {
nsIDocument* doc = GetCurrentDoc(); nsIDocument* doc = GetCurrentDoc();
if (doc) { if (doc && (!IsInAnonymousSubtree() || doc->IsXUL())) {
// id can be null during mutation events evilness. Also, XUL elements // id can be null during mutation events evilness. Also, XUL elements
// loose their proto attributes during cc-unlink, so this can happen // loose their proto attributes during cc-unlink, so this can happen
// during cc-unlink too. // during cc-unlink too.

View File

@ -21,9 +21,6 @@ function f() {
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED); setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
// When the document is torn down or <svg> is removed, we hit bug 621618
SimpleTest.expectAssertions(1);
var frameLoadCount = 0; var frameLoadCount = 0;
function frameLoaded() { function frameLoaded() {
frameLoadCount++; frameLoadCount++;
@ -33,11 +30,7 @@ function frameLoaded() {
} else if (frameLoadCount == 2) { } else if (frameLoadCount == 2) {
isnot(SpecialPowers.wrap(window.frame1).location.href.indexOf('chrome://'), isnot(SpecialPowers.wrap(window.frame1).location.href.indexOf('chrome://'),
0, 'plugin shouldnt be able to cause navigation to chrome URLs'); 0, 'plugin shouldnt be able to cause navigation to chrome URLs');
SimpleTest.finish();
// Make sure we trigger bug 621618 before the test finishes so the assertion
// is attributed to this test.
document.body.removeChild(document.querySelector("svg"));
SimpleTest.executeSoon(function() { SimpleTest.finish(); });
} }
} }
</script> </script>