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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutGrid.cpp

Issue 2744593002: [css-grid] Protect against negative values in applyStretchAlignmentToChildIfNeeded() (Closed)
Patch Set: Simplify test to make issue even clearer Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-crash-huge-margins-and-min-height-max-content-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutGrid.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
index 554dd56f02e6a7f27964a87cb991eb8c92460a91..dea30d9373489093bfb81f862b24634064ba5966 100644
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -1473,7 +1473,8 @@ void LayoutGrid::applyStretchAlignmentToChildIfNeeded(LayoutBox& child) {
LayoutUnit desiredLogicalHeight = child.constrainLogicalHeightByMinMax(
stretchedLogicalHeight, LayoutUnit(-1));
child.setOverrideLogicalContentHeight(
- desiredLogicalHeight - child.borderAndPaddingLogicalHeight());
+ (desiredLogicalHeight - child.borderAndPaddingLogicalHeight())
+ .clampNegativeToZero());
if (desiredLogicalHeight != child.logicalHeight()) {
// TODO (lajava): Can avoid laying out here in some cases. See
// https://webkit.org/b/87905.
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-crash-huge-margins-and-min-height-max-content-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698