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

Unified Diff: Source/core/layout/LayoutFlexibleBox.cpp

Issue 1154113004: Fix for ASSERTION FAILURE contentSize >=0 Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added testcase Created 5 years, 7 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
Index: Source/core/layout/LayoutFlexibleBox.cpp
diff --git a/Source/core/layout/LayoutFlexibleBox.cpp b/Source/core/layout/LayoutFlexibleBox.cpp
index 5de6becb21b9f66ef63b7ed635c9bea88309a265..2007f88f10c2df5dd3bed0cfa4fe3c4998264e0f 100644
--- a/Source/core/layout/LayoutFlexibleBox.cpp
+++ b/Source/core/layout/LayoutFlexibleBox.cpp
@@ -117,7 +117,9 @@ void LayoutFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidt
// For multiline, the min preferred width is if you put a break between each item.
minLogicalWidth = std::max(minLogicalWidth, minPreferredLogicalWidth);
} else {
- minLogicalWidth += minPreferredLogicalWidth;
+ // We add minPreferredLogicalWidth only if is positive. Adding negative widths does not make sense.
cbiesinger 2015/05/27 16:50:19 minPreferredLogicalWidth should not be negative. W
+ if (minPreferredLogicalWidth >= 0)
+ minLogicalWidth += minPreferredLogicalWidth;
}
} else {
minLogicalWidth = std::max(minPreferredLogicalWidth, minLogicalWidth);

Powered by Google App Engine
This is Rietveld 408576698