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

Issue 1154113004: Fix for ASSERTION FAILURE contentSize >=0

Created:
5 years, 7 months ago by Sunil Ratnu
Modified:
5 years, 6 months ago
Reviewers:
cbiesinger, tony, ojan
CC:
blink-reviews, pdr+renderingwatchlist_chromium.org, zoltan1, szager+layoutwatch_chromium.org, eae+blinkwatch, leviw+renderwatch, blink-reviews-rendering, jchaffraix+rendering
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Fix for ASSERTION FAILURE contentSize >=0 The codeflow here is as follows: adjustChildSizeForMinAndMax() -> computeMainAxisExtentForChild() -> computeLogicalWidthUsing() -> computeIntrinsicLogicalWidthUsing() -> computeIntrinsicLogicalWidths() In the final function we set the minPreferredLogicalWidth as minPreferredLogicalWidth = child->minPreferredLogicalWidth() Here, minPreferredLogicalWidth() returns a negative value, so minPreferredLogicalWidth is negative and we add this negative number to minLogicalWidth which does not make sense and makes minLogicalWidth negative. Hence, adding a check here not to add negative values (as they do not make sense). This fixes the assertion failure. BUG=492678

Patch Set 1 #

Patch Set 2 : Added testcase #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -4 lines) Patch
A + LayoutTests/css3/flexbox/content-size-crash.html View 1 1 chunk +7 lines, -3 lines 0 comments Download
A LayoutTests/css3/flexbox/content-size-crash-expected.txt View 1 1 chunk +18 lines, -0 lines 2 comments Download
M Source/core/layout/LayoutFlexibleBox.cpp View 1 chunk +3 lines, -1 line 1 comment Download

Messages

Total messages: 4 (1 generated)
Sunil Ratnu
Hi, Please take a look. Thanks, Sunil https://codereview.chromium.org/1154113004/diff/20001/LayoutTests/css3/flexbox/content-size-crash-expected.txt File LayoutTests/css3/flexbox/content-size-crash-expected.txt (right): https://codereview.chromium.org/1154113004/diff/20001/LayoutTests/css3/flexbox/content-size-crash-expected.txt#newcode18 LayoutTests/css3/flexbox/content-size-crash-expected.txt:18: description('This test ...
5 years, 7 months ago (2015-05-27 16:05:54 UTC) #2
cbiesinger
not lgtm https://codereview.chromium.org/1154113004/diff/20001/LayoutTests/css3/flexbox/content-size-crash-expected.txt File LayoutTests/css3/flexbox/content-size-crash-expected.txt (right): https://codereview.chromium.org/1154113004/diff/20001/LayoutTests/css3/flexbox/content-size-crash-expected.txt#newcode18 LayoutTests/css3/flexbox/content-size-crash-expected.txt:18: description('This test passes if it does not ...
5 years, 7 months ago (2015-05-27 16:50:20 UTC) #3
cbiesinger
5 years, 6 months ago (2015-05-27 21:22:53 UTC) #4
Turns out the immediate cause is this:
(gdb) p child->borderAndPaddingLogicalWidth()
$2 = -62.5px

So LayoutBlock::computePreferredLogicalWidths will turn this negative. However,
this value should not be negative either. Apparently the 84% padding gets
computed to a negative value:
(gdb) p child->paddingRight()
$7 = -62.5px

due to:
(gdb) p child->containingBlockLogicalWidthForContent()
$8 = -74.4219px

Gotta stop my investigation here, but hopefully that helps!

Powered by Google App Engine
This is Rietveld 408576698