Chromium Code Reviews| 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..0f8de8a2de01f1f438c48878d263aae19f020e39 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 in default unless event.composed flag is set. |
|
kochi
2016/05/31 06:36:57
nit: s/in default/by default/
hayato
2016/05/31 07:12:24
Done
|
| + 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) |