summaryrefslogtreecommitdiffstats
path: root/dom/base/FragmentOrElement.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-04-17 07:30:43 -0400
committerMatt A. Tobin <email@mattatobin.com>2020-04-17 07:30:43 -0400
commit7e506bd98dab604062bfe12a44c096eb287721bf (patch)
treeebea23264b1fa0f9c23935b253c23bdc0b41c25d /dom/base/FragmentOrElement.cpp
parent010f37f47b9c15935a6113cd82e43f0673122016 (diff)
downloadUXP-7e506bd98dab604062bfe12a44c096eb287721bf.tar
UXP-7e506bd98dab604062bfe12a44c096eb287721bf.tar.gz
UXP-7e506bd98dab604062bfe12a44c096eb287721bf.tar.lz
UXP-7e506bd98dab604062bfe12a44c096eb287721bf.tar.xz
UXP-7e506bd98dab604062bfe12a44c096eb287721bf.zip
Bug 1412775 - Implement Event.composedPath
Tag #1375
Diffstat (limited to 'dom/base/FragmentOrElement.cpp')
-rw-r--r--dom/base/FragmentOrElement.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp
index ecb18798f..5b2fabd8d 100644
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -813,6 +813,7 @@ nsIContent::GetEventTargetParent(EventChainPreVisitor& aVisitor)
// Don't propagate mouseover and mouseout events when mouse is moving
// inside chrome access only content.
bool isAnonForEvents = IsRootOfChromeAccessOnlySubtree();
+ aVisitor.mRootOfClosedTree = isAnonForEvents;
if ((aVisitor.mEvent->mMessage == eMouseOver ||
aVisitor.mEvent->mMessage == eMouseOut ||
aVisitor.mEvent->mMessage == ePointerOver ||
@@ -834,7 +835,7 @@ nsIContent::GetEventTargetParent(EventChainPreVisitor& aVisitor)
nsIContent* adjustedTarget =
Event::GetShadowRelatedTarget(this, relatedTarget);
if (this == adjustedTarget) {
- aVisitor.mParentTarget = nullptr;
+ aVisitor.SetParentTarget(nullptr, false);
aVisitor.mCanHandle = false;
return NS_OK;
}
@@ -891,7 +892,7 @@ nsIContent::GetEventTargetParent(EventChainPreVisitor& aVisitor)
originalTarget->FindFirstNonChromeOnlyAccessContent())
? "" : "Wrong event propagation!?!\n");
#endif
- aVisitor.mParentTarget = nullptr;
+ aVisitor.SetParentTarget(nullptr, false);
// Event should not propagate to non-anon content.
aVisitor.mCanHandle = isAnonForEvents;
return NS_OK;
@@ -943,11 +944,17 @@ nsIContent::GetEventTargetParent(EventChainPreVisitor& aVisitor)
if (!aVisitor.mEvent->mFlags.mComposedInNativeAnonymousContent &&
IsRootOfNativeAnonymousSubtree() && OwnerDoc() &&
OwnerDoc()->GetWindow()) {
- aVisitor.mParentTarget = OwnerDoc()->GetWindow()->GetParentTarget();
+ aVisitor.SetParentTarget(OwnerDoc()->GetWindow()->GetParentTarget(), true);
} else if (parent) {
- aVisitor.mParentTarget = parent;
+ aVisitor.SetParentTarget(parent, false);
+ if (slot) {
+ ShadowRoot* root = slot->GetContainingShadow();
+ if (root && root->IsClosed()) {
+ aVisitor.mParentIsSlotInClosedTree = true;
+ }
+ }
} else {
- aVisitor.mParentTarget = GetComposedDoc();
+ aVisitor.SetParentTarget(GetComposedDoc(), false);
}
return NS_OK;
}