Title: [192513] trunk
Revision
192513
Author
svil...@igalia.com
Date
2015-11-17 02:13:19 -0800 (Tue, 17 Nov 2015)

Log Message

ASSERTION FAILED: contentSize >= 0 in WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax
https://bugs.webkit.org/show_bug.cgi?id=151025

Reviewed by Darin Adler.

Source/WebCore:

Negative margins could make RenderFlexibleBox compute negative
intrinsic sizes. Clamp intrinsic sizes to 0.

Test: css3/flexbox/negative-margins-assert.html

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):

LayoutTests:

* css3/flexbox/negative-margins-assert-expected.txt: Added.
* css3/flexbox/negative-margins-assert.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (192512 => 192513)


--- trunk/LayoutTests/ChangeLog	2015-11-17 10:11:43 UTC (rev 192512)
+++ trunk/LayoutTests/ChangeLog	2015-11-17 10:13:19 UTC (rev 192513)
@@ -1,5 +1,15 @@
 2015-11-17  Sergio Villar Senin  <svil...@igalia.com>
 
+        ASSERTION FAILED: contentSize >= 0 in WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax
+        https://bugs.webkit.org/show_bug.cgi?id=151025
+
+        Reviewed by Darin Adler.
+
+        * css3/flexbox/negative-margins-assert-expected.txt: Added.
+        * css3/flexbox/negative-margins-assert.html: Added.
+
+2015-11-17  Sergio Villar Senin  <svil...@igalia.com>
+
         [css-grid] Fix alignment with gutters and negative free spaces
         https://bugs.webkit.org/show_bug.cgi?id=151307
 

Added: trunk/LayoutTests/css3/flexbox/negative-margins-assert-expected.txt (0 => 192513)


--- trunk/LayoutTests/css3/flexbox/negative-margins-assert-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/css3/flexbox/negative-margins-assert-expected.txt	2015-11-17 10:13:19 UTC (rev 192513)
@@ -0,0 +1 @@
+PASS if we don't assert

Added: trunk/LayoutTests/css3/flexbox/negative-margins-assert.html (0 => 192513)


--- trunk/LayoutTests/css3/flexbox/negative-margins-assert.html	                        (rev 0)
+++ trunk/LayoutTests/css3/flexbox/negative-margins-assert.html	2015-11-17 10:13:19 UTC (rev 192513)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<script>
+if (window.testRunner)
+    window.testRunner.dumpAsText();
+</script>
+<style>
+div {
+  display: flex;
+}
+
+.inner {
+  margin-left: -4em;
+}
+</style>
+
+<div>
+    <div>
+        <div class="inner">PASS if we don't assert</div>
+    </div>
+</div>

Modified: trunk/Source/WebCore/ChangeLog (192512 => 192513)


--- trunk/Source/WebCore/ChangeLog	2015-11-17 10:11:43 UTC (rev 192512)
+++ trunk/Source/WebCore/ChangeLog	2015-11-17 10:13:19 UTC (rev 192513)
@@ -1,5 +1,20 @@
 2015-11-17  Sergio Villar Senin  <svil...@igalia.com>
 
+        ASSERTION FAILED: contentSize >= 0 in WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax
+        https://bugs.webkit.org/show_bug.cgi?id=151025
+
+        Reviewed by Darin Adler.
+
+        Negative margins could make RenderFlexibleBox compute negative
+        intrinsic sizes. Clamp intrinsic sizes to 0.
+
+        Test: css3/flexbox/negative-margins-assert.html
+
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):
+
+2015-11-17  Sergio Villar Senin  <svil...@igalia.com>
+
         [css-grid] Fix alignment with gutters and negative free spaces
         https://bugs.webkit.org/show_bug.cgi?id=151307
 

Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (192512 => 192513)


--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2015-11-17 10:11:43 UTC (rev 192512)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2015-11-17 10:13:19 UTC (rev 192513)
@@ -123,6 +123,9 @@
         }
     }
 
+    // Due to negative margins, it is possible that we calculated a negative intrinsic width.
+    // Make sure that we never return a negative width.
+    minLogicalWidth = std::max(LayoutUnit(), minLogicalWidth);
     maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth);
 
     LayoutUnit scrollbarWidth = intrinsicScrollbarLogicalWidth();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to