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

Issue 237123002: Fix off-by-one error in RasterShape of CSS shapes (Closed)

Created:
6 years, 8 months ago by davve
Modified:
6 years, 8 months ago
CC:
blink-reviews, bemjb+rendering_chromium.org, dsinclair, zoltan1, eae+blinkwatch, leviw+renderwatch, jchaffraix+rendering, pdr., rune+blink
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Fix off-by-one error in RasterShape of CSS shapes Be consistent about using end-point exclusive intervals. Before this patch we created an end-point _inclusive_ interval when scanning to then end of the line, but an end-point _exclusive_ when ending an interval somewhere along the scan-line because of a triggered alpha channel threshold. Examples: 01234.. [XXXXXXXXXXXXXXXXXXXX] (X means above alpha channel threshold) would create the interval 0-19. Since we haven't triggered the alpha channel threshold, and x points at the last index (19) the end point is included in the interval and we're supposedly creating an end-point inclusive interval. But in the other case: 01234.. [XXXXXXXXXX..........] would create the interval 0-10, because when we notice that the alpha channel threshold doesn't hold, we're already outside the interval, and x is excluded from the interval meaning we supposedly want to create a end-point exclusive interval. To make up for the end-point inclusive intervals, RasterShape::getExcludedIntervals added an increment to get end-point exclusive intervals, since that is what the caller of getExcludedIntervals expects. This obviously broke the other case. We did have a test for the other case, but the off-by-one error was accounted for in the test. After this patch, Shape::createRasterShape always creates end-point exclusive intervals so we can remove the increment and fix the test. BUG=363126 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=171569

Patch Set 1 #

Patch Set 2 : Address review comment and rename variable for consistency #

Total comments: 2

Patch Set 3 : Add missing space #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -4 lines) Patch
M LayoutTests/fast/shapes/shape-outside-floats/shape-outside-insert-svg-shape.html View 2 chunks +1 line, -2 lines 0 comments Download
M Source/core/rendering/shapes/RasterShape.cpp View 1 1 chunk +4 lines, -1 line 0 comments Download
M Source/core/rendering/shapes/Shape.cpp View 1 2 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
davve
Fell into this one when working on SVG sizing. Not sure how to assign reviewers ...
6 years, 8 months ago (2014-04-14 14:36:02 UTC) #1
Hans Muller
On 2014/04/14 14:36:02, David Vest wrote: > Fell into this one when working on SVG ...
6 years, 8 months ago (2014-04-14 15:29:46 UTC) #2
philipj_slow
https://codereview.chromium.org/237123002/diff/20001/Source/core/rendering/shapes/Shape.cpp File Source/core/rendering/shapes/Shape.cpp (right): https://codereview.chromium.org/237123002/diff/20001/Source/core/rendering/shapes/Shape.cpp#newcode205 Source/core/rendering/shapes/Shape.cpp:205: int endX = alphaAboveThreshold ? x + 1: x; ...
6 years, 8 months ago (2014-04-15 11:37:06 UTC) #3
davve
https://codereview.chromium.org/237123002/diff/20001/Source/core/rendering/shapes/Shape.cpp File Source/core/rendering/shapes/Shape.cpp (right): https://codereview.chromium.org/237123002/diff/20001/Source/core/rendering/shapes/Shape.cpp#newcode205 Source/core/rendering/shapes/Shape.cpp:205: int endX = alphaAboveThreshold ? x + 1: x; ...
6 years, 8 months ago (2014-04-15 11:41:27 UTC) #4
philipj_slow
lgtm
6 years, 8 months ago (2014-04-15 11:41:51 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/davve@opera.com/237123002/40001
6 years, 8 months ago (2014-04-15 11:42:07 UTC) #6
commit-bot: I haz the power
6 years, 8 months ago (2014-04-15 12:43:44 UTC) #7
Message was sent while issue was closed.
Change committed as 171569

Powered by Google App Engine
This is Rietveld 408576698