Chromium Code Reviews
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 #
Messages
Total messages: 21 (13 generated)
|
|||||||||||||||||||||||||||||||||||||