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

Unified Diff: third_party/WebKit/Source/core/layout/HitTestResult.cpp

Issue 2829553002: Remove the dup function (Closed)
Patch Set: Created 3 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/layout/HitTestResult.cpp
diff --git a/third_party/WebKit/Source/core/layout/HitTestResult.cpp b/third_party/WebKit/Source/core/layout/HitTestResult.cpp
index 3799c7b2c1507d31ddceae11a3b2f4903ec02271..3018bc34e3334d1ba96c7625249835a3ecc4fc6e 100644
--- a/third_party/WebKit/Source/core/layout/HitTestResult.cpp
+++ b/third_party/WebKit/Source/core/layout/HitTestResult.cpp
@@ -508,13 +508,11 @@ void HitTestResult::ResolveRectBasedTest(
}
Element* HitTestResult::InnerElement() const {
- for (Node* node = inner_node_.Get(); node;
- node = FlatTreeTraversal::Parent(*node)) {
- if (node->IsElementNode())
- return ToElement(node);
- }
-
- return nullptr;
+ if (!inner_node_)
+ return nullptr;
+ if (inner_node_->IsElementNode())
+ return ToElement(inner_node_);
+ return FlatTreeTraversal::ParentElement(*inner_node_);
}
Node* HitTestResult::InnerNodeOrImageMapImage() const {
« no previous file with comments | « third_party/WebKit/Source/core/input/GestureManager.cpp ('k') | third_party/WebKit/Source/core/page/EventWithHitTestResults.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698