summaryrefslogtreecommitdiffstats
path: root/dom/base/FragmentOrElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/base/FragmentOrElement.cpp')
-rw-r--r--dom/base/FragmentOrElement.cpp25
1 files changed, 4 insertions, 21 deletions
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<nsIContent*>* 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();
}
}