Title: [96769] trunk
- Revision
- 96769
- Author
- [email protected]
- Date
- 2011-10-05 17:01:28 -0700 (Wed, 05 Oct 2011)
Log Message
[flexbox] take marginBeforeForChild into account when positioning children
https://bugs.webkit.org/show_bug.cgi?id=69313
Reviewed by Tony Chang.
Source/WebCore:
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection):
LayoutTests:
* css3/flexbox/002.html:
* css3/flexbox/writing-modes.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (96768 => 96769)
--- trunk/LayoutTests/ChangeLog 2011-10-06 00:00:30 UTC (rev 96768)
+++ trunk/LayoutTests/ChangeLog 2011-10-06 00:01:28 UTC (rev 96769)
@@ -1,3 +1,13 @@
+2011-10-03 Ojan Vafai <[email protected]>
+
+ [flexbox] take marginBeforeForChild into account when positioning children
+ https://bugs.webkit.org/show_bug.cgi?id=69313
+
+ Reviewed by Tony Chang.
+
+ * css3/flexbox/002.html:
+ * css3/flexbox/writing-modes.html:
+
2011-10-05 James Simonsen <[email protected]>
[Chromium] Update test expectations after Skia roll.
Modified: trunk/LayoutTests/css3/flexbox/002-expected.txt (96768 => 96769)
--- trunk/LayoutTests/css3/flexbox/002-expected.txt 2011-10-06 00:00:30 UTC (rev 96768)
+++ trunk/LayoutTests/css3/flexbox/002-expected.txt 2011-10-06 00:01:28 UTC (rev 96769)
@@ -8,4 +8,5 @@
PASS
PASS
PASS
+PASS
Modified: trunk/LayoutTests/css3/flexbox/002.html (96768 => 96769)
--- trunk/LayoutTests/css3/flexbox/002.html 2011-10-06 00:00:30 UTC (rev 96768)
+++ trunk/LayoutTests/css3/flexbox/002.html 2011-10-06 00:01:28 UTC (rev 96769)
@@ -37,6 +37,12 @@
<div data-expected-width="200" data-offset-x="400" style="width: -webkit-flex(1 0 0)"></div>
</div>
+<div data-expected-height="120" class="flexbox">
+ <div data-expected-width="200" data-offset-y="50" style="width: -webkit-flex(1 0 0); margin: 50px 0;"></div>
+ <div data-expected-width="100" data-offset-x="250" style="width: 100px; margin: 0 50px;"></div>
+ <div data-expected-width="200" data-offset-x="400" style="width: -webkit-flex(1 0 0)"></div>
+</div>
+
<!-- Margins set to auto have a positive flex of 1. In this example, the left and right margin should each be 100px. -->
<div class="flexbox">
<div data-expected-width="100" style="width: -webkit-flex(1 0 0);"></div>
Modified: trunk/LayoutTests/css3/flexbox/writing-modes-expected.txt (96768 => 96769)
--- trunk/LayoutTests/css3/flexbox/writing-modes-expected.txt 2011-10-06 00:00:30 UTC (rev 96768)
+++ trunk/LayoutTests/css3/flexbox/writing-modes-expected.txt 2011-10-06 00:01:28 UTC (rev 96769)
@@ -16,4 +16,7 @@
PASS
PASS
PASS
+PASS
+PASS
+PASS
Modified: trunk/LayoutTests/css3/flexbox/writing-modes.html (96768 => 96769)
--- trunk/LayoutTests/css3/flexbox/writing-modes.html 2011-10-06 00:00:30 UTC (rev 96768)
+++ trunk/LayoutTests/css3/flexbox/writing-modes.html 2011-10-06 00:01:28 UTC (rev 96769)
@@ -83,6 +83,14 @@
<div style="position:relative">
<div class="flexbox vertical-lr">
+ <div data-expected-height="150" data-offset-y="0" data-offset-x="50" style="height: -webkit-flex(1 0 0); margin: 0 100px 0 50px;"></div>
+ <div data-expected-height="300" data-offset-y="150" style="height: -webkit-flex(2 0 0);"></div>
+ <div data-expected-height="150" data-offset-y="450" style="height: -webkit-flex(1 0 0);"></div>
+</div>
+</div>
+
+<div style="position:relative">
+<div class="flexbox vertical-lr">
<div data-expected-height="150" data-offset-y="0" style="height: -webkit-flex(1 0 0);"></div>
<div data-expected-height="300" data-offset-y="150" class="bt" style="height: -webkit-flex(2 0 0);"></div>
<div data-expected-height="150" data-offset-y="450" style="height: -webkit-flex(1 0 0);"></div>
@@ -168,6 +176,14 @@
</div>
<div style="position:relative">
+<div class="flexbox vertical-rl">
+ <div data-expected-height="150" data-offset-y="0" data-offset-x="480" style="height: -webkit-flex(1 0 0); margin: 0 100px 0 50px;"></div>
+ <div data-expected-height="300" data-offset-y="150" data-offset-x="580" style="height: -webkit-flex(2 0 0);"></div>
+ <div data-expected-height="150" data-offset-y="450" data-offset-x="580" style="height: -webkit-flex(1 0 0);"></div>
+</div>
+</div>
+
+<div style="position:relative">
<div class="flexbox bt" style="height:200px">
<div data-expected-width="150" data-offset-y="180" data-offset-x="0" style="width: -webkit-flex(1 0 0);"></div>
<div data-expected-width="300" data-offset-y="180" data-offset-x="150" style="width: -webkit-flex(2 0 0);"></div>
@@ -175,6 +191,14 @@
</div>
</div>
+<div style="position:relative">
+<div class="flexbox bt" style="height:200px">
+ <div data-expected-width="150" data-offset-y="130" data-offset-x="0" style="width: -webkit-flex(1 0 0); margin: 100px 0 50px 0;"></div>
+ <div data-expected-width="300" data-offset-y="180" data-offset-x="150" style="width: -webkit-flex(2 0 0);"></div>
+ <div data-expected-width="150" data-offset-y="180" data-offset-x="450" style="width: -webkit-flex(1 0 0);"></div>
+</div>
+</div>
+
<div style="position: relative;">
<div data-expected-width="600" style="direction: rtl; display: -webkit-flexbox; margin-left: 10px; margin-right:20px;" class="flexbox">
<div data-expected-width="50" data-offset-x="510" style="width: -webkit-flex(1 0 0); margin: 0 auto;"></div>
Modified: trunk/Source/WebCore/ChangeLog (96768 => 96769)
--- trunk/Source/WebCore/ChangeLog 2011-10-06 00:00:30 UTC (rev 96768)
+++ trunk/Source/WebCore/ChangeLog 2011-10-06 00:01:28 UTC (rev 96769)
@@ -1,3 +1,13 @@
+2011-10-03 Ojan Vafai <[email protected]>
+
+ [flexbox] take marginBeforeForChild into account when positioning children
+ https://bugs.webkit.org/show_bug.cgi?id=69313
+
+ Reviewed by Tony Chang.
+
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection):
+
2011-10-05 Vangelis Kokkevis <[email protected]>
Switching threaded compositor from a compile time option to a
Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (96768 => 96769)
--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp 2011-10-06 00:00:30 UTC (rev 96768)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp 2011-10-06 00:01:28 UTC (rev 96769)
@@ -497,7 +497,7 @@
LayoutUnit logicalLeft = isLeftToRightFlow() ? startEdge : totalLogicalWidth - startEdge - childLogicalWidth;
// FIXME: Do repaintDuringLayoutIfMoved.
// FIXME: Supporting layout deltas.
- setFlowAwareLogicalLocationForChild(child, IntPoint(logicalLeft, logicalTop));
+ setFlowAwareLogicalLocationForChild(child, IntPoint(logicalLeft, logicalTop + flowAwareMarginBeforeForChild(child)));
startEdge += childLogicalWidth + marginEndForChild(child);
if (hasPackingSpace(availableFreeSpace, totalPositiveFlexibility) && style()->flexPack() == PackJustify && childSizes.size() > 1)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes