Bug 1502875 - Don't let GetElementById work across anonymous subtree boundaries in XUL documents. r=smaug
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 29 Oct 2018 17:31:02 +0100
changeset 499854 b7a966ea9ad3619106149944061abcb32c997cdd
parent 499853 8157760bbde188ee2ab5a1c93c6e6fbe57919335
child 499855 1c7d0042fc4afa47750926b5c63e75ffb9580d4c
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1502875
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1502875 - Don't let GetElementById work across anonymous subtree boundaries in XUL documents. r=smaug According to comment 3 the front-end no longer needs it. Differential Revision: https://phabricator.services.mozilla.com/D10076
dom/base/Element.cpp
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -1135,17 +1135,17 @@ void
 Element::AddToIdTable(nsAtom* aId)
 {
   NS_ASSERTION(HasID(), "Node doesn't have an ID?");
   if (IsInShadowTree()) {
     ShadowRoot* containingShadow = GetContainingShadow();
     containingShadow->AddToIdTable(this, aId);
   } else {
     nsIDocument* doc = GetUncomposedDoc();
-    if (doc && (!IsInAnonymousSubtree() || doc->IsXULDocument())) {
+    if (doc && !IsInAnonymousSubtree()) {
       doc->AddToIdTable(this, aId);
     }
   }
 }
 
 void
 Element::RemoveFromIdTable()
 {
@@ -1158,17 +1158,17 @@ Element::RemoveFromIdTable()
     ShadowRoot* containingShadow = GetContainingShadow();
     // Check for containingShadow because it may have
     // been deleted during unlinking.
     if (containingShadow) {
       containingShadow->RemoveFromIdTable(this, id);
     }
   } else {
     nsIDocument* doc = GetUncomposedDoc();
-    if (doc && (!IsInAnonymousSubtree() || doc->IsXULDocument())) {
+    if (doc && !IsInAnonymousSubtree()) {
       doc->RemoveFromIdTable(this, id);
     }
   }
 }
 
 void
 Element::SetSlot(const nsAString& aName, ErrorResult& aError)
 {