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

Side by Side 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: wip Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 if (referenceNode.isPseudoElement()) { 43 if (referenceNode.isPseudoElement()) {
44 ASSERT(referenceNode.parentNode()); 44 ASSERT(referenceNode.parentNode());
45 return referenceNode.parentNode(); 45 return referenceNode.parentNode();
46 } 46 }
47 47
48 return &referenceNode; 48 return &referenceNode;
49 } 49 }
50 50
51 static inline bool shouldStopAtShadowRoot(Event& event, ShadowRoot& shadowRoot, EventTarget& target) 51 static inline bool shouldStopAtShadowRoot(Event& event, ShadowRoot& shadowRoot, EventTarget& target)
52 { 52 {
53 // WebKit never allowed selectstart event to cross the the shadow DOM bounda ry. 53 if (shadowRoot.isV1()) {
54 // Changing this breaks existing sites. 54 // In v1, an event is scoped in default unless event.composed flag is se t.
kochi 2016/05/31 06:36:57 nit: s/in default/by default/
hayato 2016/05/31 07:12:24 Done
55 // See https://bugs.webkit.org/show_bug.cgi?id=52195 for details. 55 return !event.composed() && target.toNode() && target.toNode()->shadowHo st() == shadowRoot.host();
56 const AtomicString eventType = event.type(); 56 }
57 return target.toNode() && target.toNode()->shadowHost() == shadowRoot.host() 57 // Ignores event.composed() for v0.
58 && event.scoped(); 58 // Instead, use event.isScopedInV0() for backward compatibility.
59 return event.isScopedInV0() && target.toNode() && target.toNode()->shadowHos t() == shadowRoot.host();
59 } 60 }
60 61
61 EventPath::EventPath(Node& node, Event* event) 62 EventPath::EventPath(Node& node, Event* event)
62 : m_node(node) 63 : m_node(node)
63 , m_event(event) 64 , m_event(event)
64 { 65 {
65 initialize(); 66 initialize();
66 } 67 }
67 68
68 void EventPath::initializeWith(Node& node, Event* event) 69 void EventPath::initializeWith(Node& node, Event* event)
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 DEFINE_TRACE(EventPath) 367 DEFINE_TRACE(EventPath)
367 { 368 {
368 visitor->trace(m_nodeEventContexts); 369 visitor->trace(m_nodeEventContexts);
369 visitor->trace(m_node); 370 visitor->trace(m_node);
370 visitor->trace(m_event); 371 visitor->trace(m_event);
371 visitor->trace(m_treeScopeEventContexts); 372 visitor->trace(m_treeScopeEventContexts);
372 visitor->trace(m_windowEventContext); 373 visitor->trace(m_windowEventContext);
373 } 374 }
374 375
375 } // namespace blink 376 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698