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

Side by Side Diff: third_party/WebKit/Source/core/events/EventPath.cpp

Issue 1606153002: Implement v1 slot logic in EventPath (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modify the layout test Created 4 years, 11 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/shadow/event-path-with-slot.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 16 matching lines...) Expand all
27 #include "core/events/EventPath.h" 27 #include "core/events/EventPath.h"
28 28
29 #include "core/EventNames.h" 29 #include "core/EventNames.h"
30 #include "core/dom/Document.h" 30 #include "core/dom/Document.h"
31 #include "core/dom/Touch.h" 31 #include "core/dom/Touch.h"
32 #include "core/dom/TouchList.h" 32 #include "core/dom/TouchList.h"
33 #include "core/dom/shadow/InsertionPoint.h" 33 #include "core/dom/shadow/InsertionPoint.h"
34 #include "core/dom/shadow/ShadowRoot.h" 34 #include "core/dom/shadow/ShadowRoot.h"
35 #include "core/events/TouchEvent.h" 35 #include "core/events/TouchEvent.h"
36 #include "core/events/TouchEventContext.h" 36 #include "core/events/TouchEventContext.h"
37 #include "core/html/HTMLSlotElement.h"
37 38
38 namespace blink { 39 namespace blink {
39 40
40 EventTarget* EventPath::eventTargetRespectingTargetRules(Node& referenceNode) 41 EventTarget* EventPath::eventTargetRespectingTargetRules(Node& referenceNode)
41 { 42 {
42 if (referenceNode.isPseudoElement()) { 43 if (referenceNode.isPseudoElement()) {
43 ASSERT(referenceNode.parentNode()); 44 ASSERT(referenceNode.parentNode());
44 return referenceNode.parentNode(); 45 return referenceNode.parentNode();
45 } 46 }
46 47
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 ShadowRoot* containingShadowRoot = insertionPoint->containin gShadowRoot(); 121 ShadowRoot* containingShadowRoot = insertionPoint->containin gShadowRoot();
121 ASSERT(containingShadowRoot); 122 ASSERT(containingShadowRoot);
122 if (!containingShadowRoot->isOldest()) 123 if (!containingShadowRoot->isOldest())
123 nodesInPath.append(containingShadowRoot->olderShadowRoot ()); 124 nodesInPath.append(containingShadowRoot->olderShadowRoot ());
124 } 125 }
125 nodesInPath.append(insertionPoint); 126 nodesInPath.append(insertionPoint);
126 } 127 }
127 current = insertionPoints.last(); 128 current = insertionPoints.last();
128 continue; 129 continue;
129 } 130 }
131 if (current->isChildOfV1ShadowHost()) {
132 if (HTMLSlotElement* slot = current->assignedSlot()) {
133 current = slot;
134 nodesInPath.append(current);
135 continue;
136 }
137 }
130 if (current->isShadowRoot()) { 138 if (current->isShadowRoot()) {
131 if (m_event && shouldStopAtShadowRoot(*m_event, *toShadowRoot(curren t), *m_node)) 139 if (m_event && shouldStopAtShadowRoot(*m_event, *toShadowRoot(curren t), *m_node))
132 break; 140 break;
133 current = current->shadowHost(); 141 current = current->shadowHost();
134 #if !ENABLE(OILPAN) 142 #if !ENABLE(OILPAN)
135 // TODO(kochi): crbug.com/507413 This check is necessary when some a synchronous event 143 // TODO(kochi): crbug.com/507413 This check is necessary when some a synchronous event
136 // is queued while its shadow host is removed and the shadow root ge ts the event 144 // is queued while its shadow host is removed and the shadow root ge ts the event
137 // immediately after it. When Oilpan is enabled, this situation doe s not happen. 145 // immediately after it. When Oilpan is enabled, this situation doe s not happen.
138 // Except this case, shadow root's host is assumed to be non-null. 146 // Except this case, shadow root's host is assumed to be non-null.
139 if (current) 147 if (current)
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 #if ENABLE(OILPAN) 387 #if ENABLE(OILPAN)
380 visitor->trace(m_nodeEventContexts); 388 visitor->trace(m_nodeEventContexts);
381 visitor->trace(m_node); 389 visitor->trace(m_node);
382 visitor->trace(m_event); 390 visitor->trace(m_event);
383 visitor->trace(m_treeScopeEventContexts); 391 visitor->trace(m_treeScopeEventContexts);
384 visitor->trace(m_windowEventContext); 392 visitor->trace(m_windowEventContext);
385 #endif 393 #endif
386 } 394 }
387 395
388 } // namespace 396 } // namespace
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/shadow/event-path-with-slot.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698