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

Issue 2744593002: [css-grid] Protect against negative values in applyStretchAlignmentToChildIfNeeded() (Closed)

Created:
3 years, 9 months ago by Manuel Rego
Modified:
3 years, 9 months ago
CC:
chromium-reviews, jfernandez, szager+layoutwatch_chromium.org, zoltan1, svillar, blink-reviews-layout_chromium.org, pdr+renderingwatchlist_chromium.org, leviw+renderwatch, jchaffraix+rendering, blink-reviews, eae+blinkwatch, tandrii(chromium)
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[css-grid] Protect against negative values in applyStretchAlignmentToChildIfNeeded() In LayoutGrid::applyStretchAlignmentToChildIfNeeded() we're subtracting the top and bottom border and padding to the desired height. If the height is 0px due to the margins on the item and not enough space on the cell, and the border or padding are not 0px, then we end up with negative values. In this patch we protect the call to setOverrideLogicalContentHeight() to avoid passing a negative value. BUG=697317 TEST=fast/css-grid-layout/grid-crash-huge-margins-and-min-height-max-content.html Review-Url: https://codereview.chromium.org/2744593002 Cr-Commit-Position: refs/heads/master@{#455728} Committed: https://chromium.googlesource.com/chromium/src/+/7c3cb4cb41c85b2de48a5ef82f40010b4b4f5040

Patch Set 1 #

Total comments: 2

Patch Set 2 : Use clampNegativeToZero() #

Patch Set 3 : Simplify test to make issue even clearer #

Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -1 line) Patch
A third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-crash-huge-margins-and-min-height-max-content.html View 1 2 1 chunk +21 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-crash-huge-margins-and-min-height-max-content-expected.txt View 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutGrid.cpp View 1 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 21 (13 generated)
Manuel Rego
3 years, 9 months ago (2017-03-09 10:14:10 UTC) #2
svillar
lgtm We need a better explanation about the potential issues that could make those values ...
3 years, 9 months ago (2017-03-09 10:29:15 UTC) #3
Manuel Rego
On 2017/03/09 10:29:15, svillar wrote: > lgtm Thanks for the review. > We need a ...
3 years, 9 months ago (2017-03-09 10:59:13 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2744593002/40001
3 years, 9 months ago (2017-03-09 13:06:33 UTC) #14
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/7c3cb4cb41c85b2de48a5ef82f40010b4b4f5040
3 years, 9 months ago (2017-03-09 13:21:07 UTC) #17
Michael Achenbach
Bizarre: Why did bugdroid mark this bug https://bugs.chromium.org/p/chromium/issues/detail?id=682617#c19 with this CL I wonder?
3 years, 9 months ago (2017-03-09 13:30:21 UTC) #19
Manuel Rego
On 2017/03/09 13:30:21, Michael Achenbach wrote: > Bizarre: Why did bugdroid mark this bug > ...
3 years, 9 months ago (2017-03-09 13:51:52 UTC) #20
Michael Achenbach
3 years, 9 months ago (2017-03-09 14:06:24 UTC) #21
Message was sent while issue was closed.
On 2017/03/09 13:51:52, Manuel Rego wrote:
> On 2017/03/09 13:30:21, Michael Achenbach wrote:
> > Bizarre: Why did bugdroid mark this bug
> > https://bugs.chromium.org/p/chromium/issues/detail?id=682617#c19 with this
CL
> I
> > wonder?
> 
> I don't know, I don't have access to that bug.

Bugdroid seems to have a bad time. File http://crbug.com/699987 for that (also
internal).

Powered by Google App Engine
This is Rietveld 408576698