Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(578)

Unified Diff: third_party/WebKit/Source/core/events/EventPath.cpp

Issue 2012423004: Rename Event.scoped to Event.composed and invert its meaning (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@event-composed-path
Patch Set: rebased Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/events/EventPath.cpp
diff --git a/third_party/WebKit/Source/core/events/EventPath.cpp b/third_party/WebKit/Source/core/events/EventPath.cpp
index 899b677f6eecfbe5538b82c2000b609972c29ba0..feb2f0976cd1f1e997177f04c0de2e9a5521e01b 100644
--- a/third_party/WebKit/Source/core/events/EventPath.cpp
+++ b/third_party/WebKit/Source/core/events/EventPath.cpp
@@ -50,12 +50,13 @@ EventTarget* EventPath::eventTargetRespectingTargetRules(Node& referenceNode)
static inline bool shouldStopAtShadowRoot(Event& event, ShadowRoot& shadowRoot, EventTarget& target)
{
- // WebKit never allowed selectstart event to cross the the shadow DOM boundary.
- // Changing this breaks existing sites.
- // See https://bugs.webkit.org/show_bug.cgi?id=52195 for details.
- const AtomicString eventType = event.type();
- return target.toNode() && target.toNode()->shadowHost() == shadowRoot.host()
- && event.scoped();
+ if (shadowRoot.isV1()) {
+ // In v1, an event is scoped by default unless event.composed flag is set.
+ return !event.composed() && target.toNode() && target.toNode()->shadowHost() == shadowRoot.host();
+ }
+ // Ignores event.composed() for v0.
+ // Instead, use event.isScopedInV0() for backward compatibility.
+ return event.isScopedInV0() && target.toNode() && target.toNode()->shadowHost() == shadowRoot.host();
}
EventPath::EventPath(Node& node, Event* event)
« no previous file with comments | « third_party/WebKit/Source/core/events/EventInit.idl ('k') | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698