Title: [131972] trunk/Source/WebCore
Revision
131972
Author
[email protected]
Date
2012-10-19 18:49:10 -0700 (Fri, 19 Oct 2012)

Log Message

RenderFlexibleBox::preferredMainAxisContentExtentForChild can return a negative value
https://bugs.webkit.org/show_bug.cgi?id=97827

Reviewed by Ojan Vafai.

I'm pretty sure this isn't possible (logicalHeight and maxPreferredLogicalWidth should always include
border and padding), so just add an assert.

No new tests, the assert is for code clarity.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (131971 => 131972)


--- trunk/Source/WebCore/ChangeLog	2012-10-20 01:43:00 UTC (rev 131971)
+++ trunk/Source/WebCore/ChangeLog	2012-10-20 01:49:10 UTC (rev 131972)
@@ -1,5 +1,20 @@
 2012-10-19  Tony Chang  <[email protected]>
 
+        RenderFlexibleBox::preferredMainAxisContentExtentForChild can return a negative value
+        https://bugs.webkit.org/show_bug.cgi?id=97827
+
+        Reviewed by Ojan Vafai.
+
+        I'm pretty sure this isn't possible (logicalHeight and maxPreferredLogicalWidth should always include
+        border and padding), so just add an assert.
+
+        No new tests, the assert is for code clarity.
+
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild):
+
+2012-10-19  Tony Chang  <[email protected]>
+
         Replace calls to updateLogicalHeight with calls to computeLogicalHeight
         https://bugs.webkit.org/show_bug.cgi?id=99883
 

Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (131971 => 131972)


--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2012-10-20 01:43:00 UTC (rev 131971)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2012-10-20 01:49:10 UTC (rev 131972)
@@ -664,6 +664,7 @@
     Length flexBasis = flexBasisForChild(child);
     if (flexBasis.isAuto()) {
         LayoutUnit mainAxisExtent = hasOrthogonalFlow(child) ? child->logicalHeight() : child->maxPreferredLogicalWidth();
+        ASSERT(mainAxisExtent - mainAxisBorderAndPaddingExtentForChild(child) >= 0);
         return mainAxisExtent - mainAxisBorderAndPaddingExtentForChild(child);
     }
     return std::max(LayoutUnit(0), computeMainAxisExtentForChild(child, MainOrPreferredSize, flexBasis));
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to