Title: [146684] trunk
Revision
146684
Author
[email protected]
Date
2013-03-22 16:58:42 -0700 (Fri, 22 Mar 2013)

Log Message

REGRESSION (r146272): layout issues for flex boxes that have -webkit-flex-wrap: wrap
https://bugs.webkit.org/show_bug.cgi?id=113071

Reviewed by Ojan Vafai.

Source/WebCore:

The refactor in r139535 introduced this bug, where a variable name wasn't updated properly.
In combination with r146272, this bug became more visible when nesting multiline flexboxen.

Test: css3/flexbox/multiline-min-preferred-width.html

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths): We want the width of the widest
flexitem, the value in m_minPreferredWidth isn't relevant. Also update the comment for max
preferred width.

LayoutTests:

* css3/flexbox/multiline-min-preferred-width-expected.txt: Added.
* css3/flexbox/multiline-min-preferred-width.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (146683 => 146684)


--- trunk/LayoutTests/ChangeLog	2013-03-22 23:56:04 UTC (rev 146683)
+++ trunk/LayoutTests/ChangeLog	2013-03-22 23:58:42 UTC (rev 146684)
@@ -1,3 +1,13 @@
+2013-03-22  Tony Chang  <[email protected]>
+
+        REGRESSION (r146272): layout issues for flex boxes that have -webkit-flex-wrap: wrap
+        https://bugs.webkit.org/show_bug.cgi?id=113071
+
+        Reviewed by Ojan Vafai.
+
+        * css3/flexbox/multiline-min-preferred-width-expected.txt: Added.
+        * css3/flexbox/multiline-min-preferred-width.html: Added.
+
 2013-03-22  Max Vujovic  <[email protected]>
 
         [CSS Shaders] Clamp css_MixColor before the blending and compositing steps

Added: trunk/LayoutTests/css3/flexbox/multiline-min-preferred-width-expected.txt (0 => 146684)


--- trunk/LayoutTests/css3/flexbox/multiline-min-preferred-width-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/css3/flexbox/multiline-min-preferred-width-expected.txt	2013-03-22 23:58:42 UTC (rev 146684)
@@ -0,0 +1 @@
+PASS

Added: trunk/LayoutTests/css3/flexbox/multiline-min-preferred-width.html (0 => 146684)


--- trunk/LayoutTests/css3/flexbox/multiline-min-preferred-width.html	                        (rev 0)
+++ trunk/LayoutTests/css3/flexbox/multiline-min-preferred-width.html	2013-03-22 23:58:42 UTC (rev 146684)
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+<style>
+.item {
+    padding: 7px;
+    background-color: green;
+    border: 4px solid olive;
+    width: min-content;
+}
+
+.square {
+    background-color: lime;
+    width: 20px;
+    height: 20px;
+}
+</style>
+</head>
+<body _onload_="checkLayout('.container')">
+
+<div class="container flexbox wrap" data-expected-height=42>
+  <div class="item flexbox wrap" data-expected-width=42 data-expected-height=42>
+    <div class="square" data-expected-width=20 data-expected-height=20></div>
+  </div>
+</div>
+
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (146683 => 146684)


--- trunk/Source/WebCore/ChangeLog	2013-03-22 23:56:04 UTC (rev 146683)
+++ trunk/Source/WebCore/ChangeLog	2013-03-22 23:58:42 UTC (rev 146684)
@@ -1,3 +1,20 @@
+2013-03-22  Tony Chang  <[email protected]>
+
+        REGRESSION (r146272): layout issues for flex boxes that have -webkit-flex-wrap: wrap
+        https://bugs.webkit.org/show_bug.cgi?id=113071
+
+        Reviewed by Ojan Vafai.
+
+        The refactor in r139535 introduced this bug, where a variable name wasn't updated properly.
+        In combination with r146272, this bug became more visible when nesting multiline flexboxen.
+
+        Test: css3/flexbox/multiline-min-preferred-width.html
+
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths): We want the width of the widest
+        flexitem, the value in m_minPreferredWidth isn't relevant. Also update the comment for max
+        preferred width.
+
 2013-03-22  Max Vujovic  <[email protected]>
 
         [CSS Shaders] Clamp css_MixColor before the blending and compositing steps

Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (146683 => 146684)


--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2013-03-22 23:56:04 UTC (rev 146683)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2013-03-22 23:58:42 UTC (rev 146684)
@@ -178,13 +178,13 @@
             maxLogicalWidth += maxPreferredLogicalWidth;
             if (isMultiline()) {
                 // For multiline, the min preferred width is if you put a break between each item.
-                minLogicalWidth = std::max(m_minPreferredLogicalWidth, minPreferredLogicalWidth);
+                minLogicalWidth = std::max(minLogicalWidth, minPreferredLogicalWidth);
             } else
                 minLogicalWidth += minPreferredLogicalWidth;
         } else {
             minLogicalWidth = std::max(minPreferredLogicalWidth, minLogicalWidth);
             if (isMultiline()) {
-                // For multiline, the max preferred width is if you put a break between each item.
+                // For multiline, the max preferred width is if you never break between items.
                 maxLogicalWidth += maxPreferredLogicalWidth;
             } else
                 maxLogicalWidth = std::max(maxPreferredLogicalWidth, maxLogicalWidth);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to