Title: [130553] trunk
Revision
130553
Author
t...@chromium.org
Date
2012-10-05 14:39:15 -0700 (Fri, 05 Oct 2012)

Log Message

Fix margin box ascent computation in flexbox
https://bugs.webkit.org/show_bug.cgi?id=98540

Reviewed by Ojan Vafai.

Source/WebCore:

The margin box ascent doesn't depend on the margin below the box.

Tests: css3/flexbox/flex-align.html: Fixed a test case and removed a FIXME.
       css3/flexbox/flex-align-vertical-writing-mode.html: Similar test case.

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

LayoutTests:

Remove a FIXME and update the results.

* css3/flexbox/flex-align-vertical-writing-mode.html:
* css3/flexbox/flex-align.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (130552 => 130553)


--- trunk/LayoutTests/ChangeLog	2012-10-05 21:38:27 UTC (rev 130552)
+++ trunk/LayoutTests/ChangeLog	2012-10-05 21:39:15 UTC (rev 130553)
@@ -1,3 +1,15 @@
+2012-10-05  Tony Chang  <t...@chromium.org>
+
+        Fix margin box ascent computation in flexbox
+        https://bugs.webkit.org/show_bug.cgi?id=98540
+
+        Reviewed by Ojan Vafai.
+
+        Remove a FIXME and update the results.
+
+        * css3/flexbox/flex-align-vertical-writing-mode.html:
+        * css3/flexbox/flex-align.html:
+
 2012-10-05  W. James MacLean  <wjmacl...@chromium.org>
 
         [chromium] Enhance support for transforms in LinkHighlight.

Modified: trunk/LayoutTests/css3/flexbox/flex-align-vertical-writing-mode.html (130552 => 130553)


--- trunk/LayoutTests/css3/flexbox/flex-align-vertical-writing-mode.html	2012-10-05 21:38:27 UTC (rev 130552)
+++ trunk/LayoutTests/css3/flexbox/flex-align-vertical-writing-mode.html	2012-10-05 21:39:15 UTC (rev 130553)
@@ -141,9 +141,9 @@
 </div>
 
 <div class="flexbox">
-  <div data-expected-width="20" data-offset-x="60" style="-webkit-flex: 1 0 0; -webkit-align-self: baseline; width: 20px;"></div>
+  <div data-expected-width="20" data-offset-x="70" style="-webkit-flex: 1 0 0; -webkit-align-self: baseline; width: 20px;"></div>
   <div data-expected-width="10" data-offset-x="70" style="-webkit-flex: 1 0 0; -webkit-align-self: baseline; width: 10px; margin: 0 20px 0 10px;"></div>
-  <div data-expected-width="10" data-offset-x="60" style="-webkit-flex: 1 0 0; -webkit-align-self: baseline; width: 10px; margin: 0 20px 0 0;"></div>
+  <div data-expected-width="10" data-offset-x="70" style="-webkit-flex: 1 0 0; -webkit-align-self: baseline; width: 10px; margin: 0 20px 0 0;"></div>
   <div data-expected-width="100" data-offset-x="0" style="-webkit-flex: 1 0 0; width: 100px;"></div>
 </div>
 

Modified: trunk/LayoutTests/css3/flexbox/flex-align.html (130552 => 130553)


--- trunk/LayoutTests/css3/flexbox/flex-align.html	2012-10-05 21:38:27 UTC (rev 130552)
+++ trunk/LayoutTests/css3/flexbox/flex-align.html	2012-10-05 21:39:15 UTC (rev 130553)
@@ -237,8 +237,7 @@
 
 <div class="flexbox">
   <div data-expected-height="20" data-offset-y="20" style="-webkit-flex: 1 0 0; -webkit-align-self: baseline; height: 20px;"></div>
-  <!-- FIXME: This looks like it might be positioned 10 pixels too high due the margin-bottom. All the boxes should have their bottoms aligned I think. -->
-  <div data-expected-height="10" data-offset-y="20" style="-webkit-flex: 1 0 0; -webkit-align-self: baseline; height: 10px; margin: 20px 0 10px;"></div>
+  <div data-expected-height="10" data-offset-y="30" style="-webkit-flex: 1 0 0; -webkit-align-self: baseline; height: 10px; margin: 30px 0 10px;"></div>
   <div data-expected-height="10" data-offset-y="30" style="-webkit-flex: 1 0 0; -webkit-align-self: baseline; height: 10px; margin: 20px 0 0;"></div>
   <div data-expected-height="100" data-offset-y="0" style="-webkit-flex: 1 0 0; height: 100px;"></div>
 </div>

Modified: trunk/Source/WebCore/ChangeLog (130552 => 130553)


--- trunk/Source/WebCore/ChangeLog	2012-10-05 21:38:27 UTC (rev 130552)
+++ trunk/Source/WebCore/ChangeLog	2012-10-05 21:39:15 UTC (rev 130553)
@@ -1,3 +1,18 @@
+2012-10-05  Tony Chang  <t...@chromium.org>
+
+        Fix margin box ascent computation in flexbox
+        https://bugs.webkit.org/show_bug.cgi?id=98540
+
+        Reviewed by Ojan Vafai.
+
+        The margin box ascent doesn't depend on the margin below the box.
+
+        Tests: css3/flexbox/flex-align.html: Fixed a test case and removed a FIXME.
+               css3/flexbox/flex-align-vertical-writing-mode.html: Similar test case.
+
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::marginBoxAscentForChild):
+
 2012-10-05  Ojan Vafai  <o...@chromium.org>
 
         Deprecated flexboxes subtract scrollbar width/height twice

Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (130552 => 130553)


--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2012-10-05 21:38:27 UTC (rev 130552)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2012-10-05 21:39:15 UTC (rev 130553)
@@ -785,7 +785,7 @@
 {
     LayoutUnit ascent = child->firstLineBoxBaseline();
     if (ascent == -1)
-        ascent = crossAxisExtentForChild(child) + flowAwareMarginAfterForChild(child);
+        ascent = crossAxisExtentForChild(child);
     return ascent + flowAwareMarginBeforeForChild(child);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to