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

Unified Diff: third_party/WebKit/Source/core/layout/line/LineBoxList.cpp

Issue 1780673002: Simplify CullRect computation in LineBoxList::hitTest; fixing off-by-one (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@svg-text-hittest-no-floor
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/HitTestLocation.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/line/LineBoxList.cpp
diff --git a/third_party/WebKit/Source/core/layout/line/LineBoxList.cpp b/third_party/WebKit/Source/core/layout/line/LineBoxList.cpp
index c798d8107dbff4818a685654ec07b59c6d0557c6..045661e60448b806b255d3d0a5f49ea37004351b 100644
--- a/third_party/WebKit/Source/core/layout/line/LineBoxList.cpp
+++ b/third_party/WebKit/Source/core/layout/line/LineBoxList.cpp
@@ -202,10 +202,11 @@ bool LineBoxList::hitTest(LineLayoutBoxModel layoutObject, HitTestResult& result
return false;
LayoutPoint point = locationInContainer.point();
+ IntRect hitSearchBoundingBox = locationInContainer.boundingBox();
CullRect cullRect(firstLineBox()->isHorizontal() ?
- IntRect(point.x(), point.y() - locationInContainer.topPadding(), 1, locationInContainer.topPadding() + locationInContainer.bottomPadding() + 1) :
- IntRect(point.x() - locationInContainer.leftPadding(), point.y(), locationInContainer.rightPadding() + locationInContainer.leftPadding() + 1, 1));
+ IntRect(point.x(), hitSearchBoundingBox.y(), 1, hitSearchBoundingBox.height()) :
+ IntRect(hitSearchBoundingBox.x(), point.y(), hitSearchBoundingBox.width(), 1));
if (!anyLineIntersectsRect(layoutObject, cullRect, accumulatedOffset))
return false;
« no previous file with comments | « third_party/WebKit/Source/core/layout/HitTestLocation.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698