Diff
Modified: trunk/LayoutTests/ChangeLog (97221 => 97222)
--- trunk/LayoutTests/ChangeLog 2011-10-12 03:00:57 UTC (rev 97221)
+++ trunk/LayoutTests/ChangeLog 2011-10-12 03:27:52 UTC (rev 97222)
@@ -1,3 +1,13 @@
+2011-10-11 Ojan Vafai <[email protected]>
+
+ margin-right is ignored with vertical writing mode
+ https://bugs.webkit.org/show_bug.cgi?id=69686
+
+ Reviewed by Darin Adler.
+
+ * fast/writing-mode/margins-expected.txt: Added.
+ * fast/writing-mode/margins.html: Added.
+
2011-10-11 Sheriff Bot <[email protected]>
Unreviewed, rolling out r97202, r97207, and r97215.
Added: trunk/LayoutTests/fast/writing-mode/margins-expected.txt (0 => 97222)
--- trunk/LayoutTests/fast/writing-mode/margins-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/writing-mode/margins-expected.txt 2011-10-12 03:27:52 UTC (rev 97222)
@@ -0,0 +1,24 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderText {#text} at (160,126) size 4x18
+ text run at (160,126) width 4: " "
+ RenderText {#text} at (324,126) size 4x18
+ text run at (324,126) width 4: " "
+ RenderText {#text} at (488,126) size 4x18
+ text run at (488,126) width 4: " "
+ RenderText {#text} at (0,0) size 0x0
+layer at (8,8) size 160x140
+ RenderBlock (relative positioned) {DIV} at (0,0) size 160x140 [bgcolor=#FFC0CB]
+ RenderBlock {DIV} at (40,10) size 100x100 [bgcolor=#808080]
+layer at (172,8) size 160x140
+ RenderBlock (relative positioned) {DIV} at (164,0) size 160x140 [bgcolor=#FFC0CB]
+ RenderBlock {DIV} at (40,10) size 100x100 [bgcolor=#808080]
+layer at (336,8) size 160x140
+ RenderBlock (relative positioned) {DIV} at (328,0) size 160x140 [bgcolor=#FFC0CB]
+ RenderBlock {DIV} at (40,10) size 100x100 [bgcolor=#808080]
+layer at (500,8) size 160x140
+ RenderBlock (relative positioned) {DIV} at (492,0) size 160x140 [bgcolor=#FFC0CB]
+ RenderBlock {DIV} at (40,10) size 100x100 [bgcolor=#808080]
Added: trunk/LayoutTests/fast/writing-mode/margins.html (0 => 97222)
--- trunk/LayoutTests/fast/writing-mode/margins.html (rev 0)
+++ trunk/LayoutTests/fast/writing-mode/margins.html 2011-10-12 03:27:52 UTC (rev 97222)
@@ -0,0 +1,32 @@
+<style>
+.container {
+ position: relative;
+ background-color: pink;
+ outline: 1px solid black;
+ display: inline-block;
+}
+.box {
+ background-color: grey;
+ width: 100px;
+ height: 100px;
+ margin: 10px 20px 30px 40px;
+}
+</style>
+
+<!--The four boxes below should look identical.-->
+
+<div class="container">
+ <div class="flexbox vertical-lr box" style="-webkit-writing-mode: horizontal-tb;"></div>
+</div>
+
+<div class="container">
+ <div class="flexbox vertical-lr box" style="-webkit-writing-mode: horitzontal-bt;"></div>
+</div>
+
+<div class="container">
+ <div class="flexbox vertical-lr box" style="-webkit-writing-mode: vertical-lr;"></div>
+</div>
+
+<div class="container">
+ <div class="flexbox vertical-lr box" style="-webkit-writing-mode: vertical-rl;"></div>
+</div>
Modified: trunk/Source/WebCore/ChangeLog (97221 => 97222)
--- trunk/Source/WebCore/ChangeLog 2011-10-12 03:00:57 UTC (rev 97221)
+++ trunk/Source/WebCore/ChangeLog 2011-10-12 03:27:52 UTC (rev 97222)
@@ -1,3 +1,20 @@
+2011-10-11 Ojan Vafai <[email protected]>
+
+ margin-right is ignored with vertical writing mode
+ https://bugs.webkit.org/show_bug.cgi?id=69686
+
+ Reviewed by Darin Adler.
+
+ We need to use the parent's writing mode when grabbing
+ the margin start/end for the purposes of computing the parent's
+ preferred widths.
+
+ Test: fast/writing-mode/margins.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
+ * rendering/RenderBlock.h:
+
2011-10-11 Sheriff Bot <[email protected]>
Unreviewed, rolling out r97202, r97207, and r97215.
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (97221 => 97222)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2011-10-12 03:00:57 UTC (rev 97221)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2011-10-12 03:27:52 UTC (rev 97222)
@@ -5184,7 +5184,7 @@
{
bool nowrap = style()->whiteSpace() == NOWRAP;
- RenderObject *child = firstChild();
+ RenderObject* child = firstChild();
RenderBlock* containingBlock = this->containingBlock();
LayoutUnit floatLeftWidth = 0, floatRightWidth = 0;
while (child) {
@@ -5209,8 +5209,8 @@
// A margin basically has three types: fixed, percentage, and auto (variable).
// Auto and percentage margins simply become 0 when computing min/max width.
// Fixed margins can be added in as is.
- Length startMarginLength = child->style()->marginStart();
- Length endMarginLength = child->style()->marginEnd();
+ Length startMarginLength = child->style()->marginStartUsing(style());
+ Length endMarginLength = child->style()->marginEndUsing(style());
LayoutUnit margin = 0;
LayoutUnit marginStart = 0;
LayoutUnit marginEnd = 0;