Skip to content

Commit

Permalink
Fix ordering issue within NGBlockLayoutAlgorithm::ComputeMinMaxSizes
Browse files Browse the repository at this point in the history
The DCHECK in the bug was caused by an order-of-operations issue.
Within the following calculation:
max_inline_contribution =
          child_sizes.max_size + line_left_inset + line_right_inset;

If:
child_sizes.max_size == LayoutUnit::Max()
line_left_inset == LayoutUnit(1)
line_right_inset == LayoutUnit(-1)

max_inline_contribution would be LayoutUnit::Max() - LayoutUnit(1);

This resulted in max_size < min_size.

Bug: 1004060
Change-Id: I3e439500f07a2cd1cf0cbe5528ece16090c9fa70
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2136885
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757094}
  • Loading branch information
bfgeek authored and chromium-wpt-export-bot committed Apr 7, 2020
1 parent 180976e commit 4b2037f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions css/css-sizing/min-content-negative-margin-crash.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!quirks-mode>
<link rel="help" href="https://crbug.com/1004060">
<style>
html, body {
width: min-content;
overflow: scroll;
}
</style>
<body style="margin-right: -1px;">
<div style="margin: 0 10000000000;"></div>
</body>

0 comments on commit 4b2037f

Please sign in to comment.