From 5f12940329ba496da5730863cae94cd8c0b145da Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 17 Apr 2020 06:34:38 -0400 Subject: Bug 1396584 - Remove support for multiple ShadowRoots Tag #1375 --- dom/base/FragmentOrElement.cpp | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) (limited to 'dom/base/FragmentOrElement.cpp') diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp index d7e7a78f4..592f5447d 100644 --- a/dom/base/FragmentOrElement.cpp +++ b/dom/base/FragmentOrElement.cpp @@ -861,23 +861,10 @@ nsIContent::GetEventTargetParent(EventChainPreVisitor& aVisitor) // for destination insertion points where nodes have been distributed. nsTArray* destPoints = GetExistingDestInsertionPoints(); if (destPoints && !destPoints->IsEmpty()) { - // Push destination insertion points to aVisitor.mDestInsertionPoints - // excluding shadow insertion points. - bool didPushNonShadowInsertionPoint = false; + // Push destination insertion points to aVisitor.mDestInsertionPoints. for (uint32_t i = 0; i < destPoints->Length(); i++) { nsIContent* point = destPoints->ElementAt(i); - if (!ShadowRoot::IsShadowInsertionPoint(point)) { - aVisitor.mDestInsertionPoints.AppendElement(point); - didPushNonShadowInsertionPoint = true; - } - } - - // Next node in the event path is the final destination - // (non-shadow) insertion point that was pushed. - if (didPushNonShadowInsertionPoint) { - parent = aVisitor.mDestInsertionPoints.LastElement(); - aVisitor.mDestInsertionPoints.SetLength( - aVisitor.mDestInsertionPoints.Length() - 1); + aVisitor.mDestInsertionPoints.AppendElement(point); } } @@ -901,10 +888,7 @@ nsIContent::GetEventTargetParent(EventChainPreVisitor& aVisitor) aVisitor.mDestInsertionPoints.SetLength( aVisitor.mDestInsertionPoints.Length() - 1); } else { - // The pool host for the youngest shadow root is shadow DOM host, - // for older shadow roots, it is the shadow insertion point - // where the shadow root is projected, nullptr if none exists. - parent = thisShadowRoot->GetPoolHost(); + parent = thisShadowRoot->GetHost(); } } @@ -2407,9 +2391,8 @@ FragmentOrElement::SetIsElementInStyleScopeFlagOnShadowTree(bool aInStyleScope) NS_ASSERTION(IsElement(), "calling SetIsElementInStyleScopeFlagOnShadowTree " "on a non-Element is useless"); ShadowRoot* shadowRoot = GetShadowRoot(); - while (shadowRoot) { + if (shadowRoot) { shadowRoot->SetIsElementInStyleScopeFlagOnSubtree(aInStyleScope); - shadowRoot = shadowRoot->GetOlderShadowRoot(); } } -- cgit v1.2.3