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

Issue 1780673002: Simplify CullRect computation in LineBoxList::hitTest; fixing off-by-one (Closed)

Created:
4 years, 9 months ago by fs
Modified:
4 years, 9 months ago
CC:
blink-reviews, blink-reviews-layout_chromium.org, chromium-reviews, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, szager+layoutwatch_chromium.org, zoltan1, Rick Byers
Base URL:
https://chromium.googlesource.com/chromium/src.git@svg-text-hittest-no-floor
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Simplify CullRect computation in LineBoxList::hitTest; fixing off-by-one In the old formulation, we were essentially trying to "restore" the margins from the HitTestLocation bounding-box and point, to compute a "slice" to cull with. The "width" and "height" expressions for the slice however trivially simplify to just the corresponding dimension of the HitTestLocation bounding-box. For the "x" and "y" expressions however the left/top margin is computed using the rounded point - which for certain values of x/y will end up shifting the cullrect left/up by one additional "unit" (pixel). When the font size is small, one "unit" will be a lot, meaning that lines can be missed entirely. Change the computation of the cull rect to just use the bounding-box from directly rather than restoring it from the (re)computed margin. This gets rid of the last user of the HitTestLocation::*Padding() methods, so remove those. BUG=466617 Committed: https://crrev.com/cd159234dd394de40cb354fe71444b787b3b3bb7 Cr-Commit-Position: refs/heads/master@{#380194}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+24 lines, -10 lines) Patch
M third_party/WebKit/LayoutTests/svg/hittest/text-small-font-size-and-viewbox.html View 2 chunks +20 lines, -4 lines 0 comments Download
M third_party/WebKit/LayoutTests/svg/hittest/text-small-font-size-and-viewbox-expected.txt View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/HitTestLocation.h View 1 chunk +0 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/layout/line/LineBoxList.cpp View 1 chunk +3 lines, -2 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 9 (4 generated)
fs
4 years, 9 months ago (2016-03-09 17:36:33 UTC) #2
pdr.
LGTM
4 years, 9 months ago (2016-03-09 19:48:57 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1780673002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1780673002/1
4 years, 9 months ago (2016-03-09 20:05:50 UTC) #6
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 9 months ago (2016-03-09 20:11:52 UTC) #7
commit-bot: I haz the power
4 years, 9 months ago (2016-03-09 20:14:18 UTC) #9
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/cd159234dd394de40cb354fe71444b787b3b3bb7
Cr-Commit-Position: refs/heads/master@{#380194}

Powered by Google App Engine
This is Rietveld 408576698