From af015e471f98c371263714c798bfe309b3f1282b Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Tue, 4 Mar 2014 20:13:20 -0800 Subject: [PATCH] Bug 621618 patch 4: Make conditions in Element::RemoveFromIdTable match those in AddToIdTable, to avoid asymmetric calls to the document's functions. r=bzbarsky --- content/base/src/Element.cpp | 2 +- dom/plugins/test/mochitest/test_bug813906.html | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/content/base/src/Element.cpp b/content/base/src/Element.cpp index df679b6c370..95bce4bd6fa 100644 --- a/content/base/src/Element.cpp +++ b/content/base/src/Element.cpp @@ -736,7 +736,7 @@ Element::RemoveFromIdTable(nsIAtom* aId) } } else { nsIDocument* doc = GetCurrentDoc(); - if (doc) { + if (doc && (!IsInAnonymousSubtree() || doc->IsXUL())) { // id can be null during mutation events evilness. Also, XUL elements // loose their proto attributes during cc-unlink, so this can happen // during cc-unlink too. diff --git a/dom/plugins/test/mochitest/test_bug813906.html b/dom/plugins/test/mochitest/test_bug813906.html index 0cd95e15dc9..a059cc28b17 100644 --- a/dom/plugins/test/mochitest/test_bug813906.html +++ b/dom/plugins/test/mochitest/test_bug813906.html @@ -21,9 +21,6 @@ function f() { SimpleTest.waitForExplicitFinish(); setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED); -// When the document is torn down or is removed, we hit bug 621618 -SimpleTest.expectAssertions(1); - var frameLoadCount = 0; function frameLoaded() { frameLoadCount++; @@ -33,11 +30,7 @@ function frameLoaded() { } else if (frameLoadCount == 2) { isnot(SpecialPowers.wrap(window.frame1).location.href.indexOf('chrome://'), 0, 'plugin shouldnt be able to cause navigation to chrome URLs'); - - // 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(); }); + SimpleTest.finish(); } }