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

Unified Diff: third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 1932523003: Introduce NodeTraversal::ancestorsOf() and inclusiveAncestors() for range-based for loop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-04-28T18:38:12 Created 4 years, 8 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/page/scrolling/ScrollingCoordinator.cpp
diff --git a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
index e83aa28dad889b145a83192548d9c98266b840a1..2cfaa70495e08ad5188deb5d2a5e32ec0628ffb1 100644
--- a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -827,8 +827,10 @@ static void accumulateDocumentTouchEventTargetRects(LayerHitTestRects& rects, co
// If the set also contains one of our ancestor nodes then processing
// this node would be redundant.
bool hasTouchEventTargetAncestor = false;
- for (Node* ancestor = node->parentNode(); ancestor && !hasTouchEventTargetAncestor; ancestor = ancestor->parentNode()) {
- if (targets->contains(ancestor))
+ for (Node& ancestor : NodeTraversal::ancestorsOf(*node)) {
+ if (hasTouchEventTargetAncestor)
+ break;
+ if (targets->contains(&ancestor))
hasTouchEventTargetAncestor = true;
}
if (!hasTouchEventTargetAncestor) {
« no previous file with comments | « third_party/WebKit/Source/core/page/TouchDisambiguation.cpp ('k') | third_party/WebKit/Source/core/svg/SVGElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698