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

Issue 1016863002: Fix integer overflow in ComputedStyle::computedLineHeight (Closed)

Created:
5 years, 9 months ago by rwlbuis
Modified:
5 years, 8 months ago
CC:
blink-reviews, blink-reviews-rendering, blink-reviews-style_chromium.org, Dominik Röttsches, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Fix integer overflow in ComputedStyle::computedLineHeight When we compute huge values for line-height through percentage or CSS calc, we'll overflow the integer and later on ShapeOutsideInfo::computeDeltasForContainingBlockLine will ASSERT because it expects non-negative line height. So for the computed line height use an intermediate LayoutUnit because it internally clamps to intMaxForLayoutUnit and the int will not overflow. Note that the code path in computedLineHeight for percentages does the same. BUG=458461 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=193574

Patch Set 1 #

Patch Set 2 : Different approach #

Total comments: 1

Patch Set 3 : Retry patch set 1 #

Patch Set 4 : Add tests #

Total comments: 1

Patch Set 5 : Use intermediate LayoutUnit #

Patch Set 6 : Remove unrelated change #

Total comments: 1

Patch Set 7 : Clamp explicitly #

Messages

Total messages: 29 (6 generated)
rwlbuis
PTAL
5 years, 9 months ago (2015-03-17 22:31:32 UTC) #2
pdr.
https://codereview.chromium.org/1016863002/diff/20001/Source/core/layout/style/LayoutStyle.cpp File Source/core/layout/style/LayoutStyle.cpp (right): https://codereview.chromium.org/1016863002/diff/20001/Source/core/layout/style/LayoutStyle.cpp#newcode1257 Source/core/layout/style/LayoutStyle.cpp:1257: return LayoutUnit::clamp(minimumValueForLength(lh, fontSize())); This fix seems too deep if ...
5 years, 9 months ago (2015-03-18 03:49:42 UTC) #4
rwlbuis
On 2015/03/18 03:49:42, pdr wrote: > https://codereview.chromium.org/1016863002/diff/20001/Source/core/layout/style/LayoutStyle.cpp > File Source/core/layout/style/LayoutStyle.cpp (right): > > https://codereview.chromium.org/1016863002/diff/20001/Source/core/layout/style/LayoutStyle.cpp#newcode1257 > ...
5 years, 9 months ago (2015-03-18 15:03:44 UTC) #5
pdr.
On 2015/03/18 at 15:03:44, rob.buis wrote: > On 2015/03/18 03:49:42, pdr wrote: > > https://codereview.chromium.org/1016863002/diff/20001/Source/core/layout/style/LayoutStyle.cpp ...
5 years, 9 months ago (2015-03-18 19:36:10 UTC) #6
rwlbuis
On 2015/03/18 19:36:10, pdr wrote: > On 2015/03/18 at 15:03:44, rob.buis wrote: > > On ...
5 years, 9 months ago (2015-03-18 20:03:15 UTC) #7
Bem Jones-Bey (adobe)
On 2015/03/18 20:03:15, rwlbuis (OOO 1 apr) wrote: > On 2015/03/18 19:36:10, pdr wrote: > ...
5 years, 9 months ago (2015-03-27 16:30:17 UTC) #8
rwlbuis
On 2015/03/27 16:30:17, Bem Jones-Bey (adobe) wrote: > > I'd like to hear Bem's thoughts ...
5 years, 9 months ago (2015-03-27 19:15:14 UTC) #9
rwlbuis
PTAL folks, I think this is the way to go.
5 years, 8 months ago (2015-04-02 21:48:31 UTC) #12
Bem Jones-Bey (adobe)
https://codereview.chromium.org/1016863002/diff/80001/Source/core/style/ComputedStyle.cpp File Source/core/style/ComputedStyle.cpp (right): https://codereview.chromium.org/1016863002/diff/80001/Source/core/style/ComputedStyle.cpp#newcode1259 Source/core/style/ComputedStyle.cpp:1259: return truncf(lh.value()); Why do we have to explicitly truncf ...
5 years, 8 months ago (2015-04-02 21:53:14 UTC) #13
rwlbuis
On 2015/04/02 21:53:14, Bem Jones-Bey (adobe) wrote: > https://codereview.chromium.org/1016863002/diff/80001/Source/core/style/ComputedStyle.cpp > File Source/core/style/ComputedStyle.cpp (right): > > ...
5 years, 8 months ago (2015-04-02 21:54:58 UTC) #14
Bem Jones-Bey (adobe)
On 2015/04/02 21:54:58, rwlbuis wrote: > On 2015/04/02 21:53:14, Bem Jones-Bey (adobe) wrote: > > ...
5 years, 8 months ago (2015-04-02 21:56:57 UTC) #15
rwlbuis
On 2015/04/02 21:56:57, Bem Jones-Bey (adobe) wrote: > On 2015/04/02 21:54:58, rwlbuis wrote: > > ...
5 years, 8 months ago (2015-04-02 22:18:36 UTC) #16
Bem Jones-Bey (adobe)
On 2015/04/02 22:18:36, rwlbuis wrote: > On 2015/04/02 21:56:57, Bem Jones-Bey (adobe) wrote: > > ...
5 years, 8 months ago (2015-04-02 22:39:15 UTC) #17
leviw_travelin_and_unemployed
Once upon a time when sub-pixel layout was still cooling we tried to consistently use ...
5 years, 8 months ago (2015-04-03 18:35:00 UTC) #19
rwlbuis
On 2015/04/03 18:35:00, leviw wrote: > Once upon a time when sub-pixel layout was still ...
5 years, 8 months ago (2015-04-08 17:07:09 UTC) #20
eae
Like Levi said we need to ensure that the line-height doesn't change from line to ...
5 years, 8 months ago (2015-04-09 18:25:43 UTC) #21
rwlbuis
On 2015/04/09 18:25:43, eae wrote: > Like Levi said we need to ensure that the ...
5 years, 8 months ago (2015-04-09 23:26:06 UTC) #22
leviw_travelin_and_unemployed
https://codereview.chromium.org/1016863002/diff/120001/Source/core/style/ComputedStyle.cpp File Source/core/style/ComputedStyle.cpp (right): https://codereview.chromium.org/1016863002/diff/120001/Source/core/style/ComputedStyle.cpp#newcode1259 Source/core/style/ComputedStyle.cpp:1259: return LayoutUnit(lh.value()); I'd just use max(lh.value(), LayoutUnit::max()). That's clearer ...
5 years, 8 months ago (2015-04-09 23:29:16 UTC) #23
rwlbuis
On 2015/04/09 23:29:16, leviw wrote: > https://codereview.chromium.org/1016863002/diff/120001/Source/core/style/ComputedStyle.cpp > File Source/core/style/ComputedStyle.cpp (right): > > https://codereview.chromium.org/1016863002/diff/120001/Source/core/style/ComputedStyle.cpp#newcode1259 > ...
5 years, 8 months ago (2015-04-09 23:39:19 UTC) #24
rwlbuis
On 2015/04/09 23:29:16, leviw wrote: > https://codereview.chromium.org/1016863002/diff/120001/Source/core/style/ComputedStyle.cpp > File Source/core/style/ComputedStyle.cpp (right): > > https://codereview.chromium.org/1016863002/diff/120001/Source/core/style/ComputedStyle.cpp#newcode1259 > ...
5 years, 8 months ago (2015-04-09 23:50:01 UTC) #25
leviw_travelin_and_unemployed
LGTM
5 years, 8 months ago (2015-04-10 20:34:52 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1016863002/140001
5 years, 8 months ago (2015-04-10 20:35:50 UTC) #28
commit-bot: I haz the power
5 years, 8 months ago (2015-04-10 23:11:21 UTC) #29
Message was sent while issue was closed.
Committed patchset #7 (id:140001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=193574

Powered by Google App Engine
This is Rietveld 408576698