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

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

Issue 210753002: Remove EventPath::parent() in favor of NodeRenderingTraversal::parent(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/events/EventPath.h ('k') | Source/core/page/EventHandler.cpp » ('j') | 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 27 matching lines...) Expand all
38 #include "core/events/FocusEvent.h" 38 #include "core/events/FocusEvent.h"
39 #include "core/events/MouseEvent.h" 39 #include "core/events/MouseEvent.h"
40 #include "core/events/TouchEvent.h" 40 #include "core/events/TouchEvent.h"
41 #include "core/events/TouchEventContext.h" 41 #include "core/events/TouchEventContext.h"
42 #include "core/html/HTMLMediaElement.h" 42 #include "core/html/HTMLMediaElement.h"
43 #include "core/svg/SVGElementInstance.h" 43 #include "core/svg/SVGElementInstance.h"
44 #include "core/svg/SVGUseElement.h" 44 #include "core/svg/SVGUseElement.h"
45 45
46 namespace WebCore { 46 namespace WebCore {
47 47
48 Node* EventPath::parent(Node* node)
49 {
50 EventPath eventPath(node);
51 return eventPath.size() > 1 ? eventPath[1].node() : 0;
52 }
53
54 EventTarget* EventPath::eventTargetRespectingTargetRules(Node* referenceNode) 48 EventTarget* EventPath::eventTargetRespectingTargetRules(Node* referenceNode)
55 { 49 {
56 ASSERT(referenceNode); 50 ASSERT(referenceNode);
57 51
58 if (referenceNode->isPseudoElement()) 52 if (referenceNode->isPseudoElement())
59 return referenceNode->parentNode(); 53 return referenceNode->parentNode();
60 54
61 if (!referenceNode->isSVGElement() || !referenceNode->isInShadowTree()) 55 if (!referenceNode->isSVGElement() || !referenceNode->isInShadowTree())
62 return referenceNode; 56 return referenceNode;
63 57
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 369
376 #ifndef NDEBUG 370 #ifndef NDEBUG
377 void EventPath::checkReachability(TreeScope& treeScope, TouchList& touchList) 371 void EventPath::checkReachability(TreeScope& treeScope, TouchList& touchList)
378 { 372 {
379 for (size_t i = 0; i < touchList.length(); ++i) 373 for (size_t i = 0; i < touchList.length(); ++i)
380 ASSERT(touchList.item(i)->target()->toNode()->treeScope().isInclusiveOld erSiblingShadowRootOrAncestorTreeScopeOf(treeScope)); 374 ASSERT(touchList.item(i)->target()->toNode()->treeScope().isInclusiveOld erSiblingShadowRootOrAncestorTreeScopeOf(treeScope));
381 } 375 }
382 #endif 376 #endif
383 377
384 } // namespace 378 } // namespace
OLDNEW
« no previous file with comments | « Source/core/events/EventPath.h ('k') | Source/core/page/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698