Title: [191336] trunk
Revision
191336
Author
[email protected]
Date
2015-10-20 02:57:23 -0700 (Tue, 20 Oct 2015)

Log Message

ASSERTION FAILED: computeMainAxisExtentForChild(child, MainOrPreferredSize, mainSize) in WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax
https://bugs.webkit.org/show_bug.cgi?id=149459

Reviewed by Darin Adler.

Source/WebCore:

This was regressed after 189567 where min-height|width:auto
support was added to flex items. The merge from Blink changes
was not correctly done for assertions. In particular we were
asserting if the resolved main size was not strictly greater
than 0, but 0 is actually a valid value.

Test: fast/flexbox/crash-resolved-main-size-zero.html

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

LayoutTests:

* fast/flexbox/crash-resolved-main-size-zero-expected.txt: Added.
* fast/flexbox/crash-resolved-main-size-zero.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (191335 => 191336)


--- trunk/LayoutTests/ChangeLog	2015-10-20 09:51:09 UTC (rev 191335)
+++ trunk/LayoutTests/ChangeLog	2015-10-20 09:57:23 UTC (rev 191336)
@@ -1,3 +1,13 @@
+2015-10-13  Sergio Villar Senin  <[email protected]>
+
+        ASSERTION FAILED: computeMainAxisExtentForChild(child, MainOrPreferredSize, mainSize) in WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax
+        https://bugs.webkit.org/show_bug.cgi?id=149459
+
+        Reviewed by Darin Adler.
+
+        * fast/flexbox/crash-resolved-main-size-zero-expected.txt: Added.
+        * fast/flexbox/crash-resolved-main-size-zero.html: Added.
+
 2015-10-19  Myles C. Maxfield  <[email protected]>
 
         FontCascade::typesettingFeatures() is not privy to font-variant-* nor font-feature-settings

Added: trunk/LayoutTests/fast/flexbox/crash-resolved-main-size-zero-expected.txt (0 => 191336)


--- trunk/LayoutTests/fast/flexbox/crash-resolved-main-size-zero-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/flexbox/crash-resolved-main-size-zero-expected.txt	2015-10-20 09:57:23 UTC (rev 191336)
@@ -0,0 +1,3 @@
+* { flex-direction: column-reverse; display: flex; height: 0%; }
+if (window.testRunner) testRunner.dumpAsText();
+This test PASSES if it does not CRASH on Debug builds.
Property changes on: trunk/LayoutTests/fast/flexbox/crash-resolved-main-size-zero-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/fast/flexbox/crash-resolved-main-size-zero.html (0 => 191336)


--- trunk/LayoutTests/fast/flexbox/crash-resolved-main-size-zero.html	                        (rev 0)
+++ trunk/LayoutTests/fast/flexbox/crash-resolved-main-size-zero.html	2015-10-20 09:57:23 UTC (rev 191336)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<style>
+* {
+    flex-direction: column-reverse;
+    display: flex;
+    height: 0%;
+}
+</style>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+<body>
+<p>This test PASSES if it does not CRASH on Debug builds.</p>
+</body>
Property changes on: trunk/LayoutTests/fast/flexbox/crash-resolved-main-size-zero.html
___________________________________________________________________

Added: svn:mime-type

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (191335 => 191336)


--- trunk/Source/WebCore/ChangeLog	2015-10-20 09:51:09 UTC (rev 191335)
+++ trunk/Source/WebCore/ChangeLog	2015-10-20 09:57:23 UTC (rev 191336)
@@ -1,3 +1,21 @@
+2015-10-13  Sergio Villar Senin  <[email protected]>
+
+        ASSERTION FAILED: computeMainAxisExtentForChild(child, MainOrPreferredSize, mainSize) in WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax
+        https://bugs.webkit.org/show_bug.cgi?id=149459
+
+        Reviewed by Darin Adler.
+
+        This was regressed after 189567 where min-height|width:auto
+        support was added to flex items. The merge from Blink changes
+        was not correctly done for assertions. In particular we were
+        asserting if the resolved main size was not strictly greater
+        than 0, but 0 is actually a valid value.
+
+        Test: fast/flexbox/crash-resolved-main-size-zero.html
+
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
+
 2015-10-20  Xabier Rodriguez Calvar  <[email protected]>
 
         [Streams API] Rework some readable stream internals that can be common to writable streams

Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (191335 => 191336)


--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2015-10-20 09:51:09 UTC (rev 191335)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2015-10-20 09:57:23 UTC (rev 191336)
@@ -869,14 +869,14 @@
         // This is the implementation of CSS flexbox section 4.5 which defines the minimum size of "pure" flex
         // items. For any other item the value should be 0, this also includes RenderFlexibleBox's derived clases
         // (RenderButton, RenderFullScreen...) because that's just an implementation detail.
-        LayoutUnit contentSize = computeMainAxisExtentForChild(child, MinSize, Length(MinContent)).valueOr(0);
-        ASSERT(computeMainAxisExtentForChild(child, MinSize, Length(MinContent)));
+        LayoutUnit contentSize = computeMainAxisExtentForChild(child, MinSize, Length(MinContent)).value();
+        ASSERT(contentSize >= 0);
         contentSize = std::min(contentSize, maxExtent.valueOr(contentSize));
 
         Length mainSize = isHorizontalFlow() ? child.style().width() : child.style().height();
         if (!mainAxisLengthIsIndefinite(mainSize)) {
-            LayoutUnit resolvedMainSize = computeMainAxisExtentForChild(child, MainOrPreferredSize, mainSize).valueOr(0);
-            ASSERT(computeMainAxisExtentForChild(child, MainOrPreferredSize, mainSize));
+            LayoutUnit resolvedMainSize = computeMainAxisExtentForChild(child, MainOrPreferredSize, mainSize).value();
+            ASSERT(resolvedMainSize >= 0);
             LayoutUnit specifiedSize = std::min(resolvedMainSize, maxExtent.valueOr(resolvedMainSize));
 
             return std::max(childSize, std::min(specifiedSize, contentSize));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to