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

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

Issue 1630793002: Stop hit testing culled inlines when a match is found (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simpler approach, but duplicated code 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutInline.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutInline.cpp b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
index 618a4ed3f0ee1d13d6e8071ab24d4b3a9c8a3319..51843d184d292bb7dad71ca025c1079df842a50f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutInline.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
@@ -801,20 +801,16 @@ bool LayoutInline::hitTestCulledInline(HitTestResult& result, const HitTestLocat
if (!visibleToHitTestRequest(result.hitTestRequest()))
return false;
- HitTestLocation tmpLocation(locationInContainer, -toLayoutSize(accumulatedOffset));
+ HitTestLocation adjustedLocation(locationInContainer, -toLayoutSize(accumulatedOffset));
Region regionResult;
- HitTestCulledInlinesGeneratorContext context(regionResult, tmpLocation);
+ HitTestCulledInlinesGeneratorContext context(regionResult, adjustedLocation);
generateCulledLineBoxRects(context, this);
if (context.intersected()) {
- updateHitTestResult(result, tmpLocation.point());
- // We can not use addNodeToListBasedTestResult to determine if we fully enclose the hit-test area
- // because it can only handle rectangular targets.
- result.addNodeToListBasedTestResult(node(), locationInContainer);
- // We check if using list-based hit-test to continue hit testing.
- if (!result.hitTestRequest().penetratingList())
- return regionResult.contains(tmpLocation.boundingBox());
+ updateHitTestResult(result, adjustedLocation.point());
+ if (result.addNodeToListBasedTestResult(node(), adjustedLocation, regionResult) == StopHitTesting)
+ return true;
}
return false;
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698