[css-writing-modes] Use the correct margins in computeInlinePreferredLogicalWidths in orthogonal flows
https://bugs.webkit.org/show_bug.cgi?id=233562
<rdar://problem/86105904>
Reviewed by Rob Buis.
LayoutTests/imported/w3c:
* web-platform-tests/css/css-writing-modes/inline-box-orthogonal-child-with-margins-expected.html: Added.
* web-platform-tests/css/css-writing-modes/inline-box-orthogonal-child-with-margins.html: Added.
Source/WebCore:
In order to compute the preferred logical width of an inline element we must compute the preferred widths of
its children. More precisely we should compute the intrinsic size of the children in the inline direction of the
inline element. For parallel flows this means indeed computing the preferred logical width. Translated to
the margins, we should compute the margin-start and margin-end of each child.
However for orthogonal writing modes we should not use the margin-start & margin-end but margin-after and
margin-before. That's why in order to support orthogonal flows we should replace marginStart() usage by
marginStartUsing(parentStyle) (same for marginEnd).
Test: imported/w3c/web-platform-tests/css/css-writing-modes/inline-box-orthogonal-child-with-margins.html
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
LayoutTests:
* TestExpectations: Unksipped a flexbox test that is now passing.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@286952 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/rendering/RenderBlockFlow.cpp b/Source/WebCore/rendering/RenderBlockFlow.cpp
index e7df3d0..fbb53e0 100644
--- a/Source/WebCore/rendering/RenderBlockFlow.cpp
+++ b/Source/WebCore/rendering/RenderBlockFlow.cpp
@@ -4339,8 +4339,8 @@
if (!child->isFloating())
lastText = nullptr;
LayoutUnit margins;
- Length startMargin = childStyle.marginStart();
- Length endMargin = childStyle.marginEnd();
+ Length startMargin = childStyle.marginStartUsing(&style());
+ Length endMargin = childStyle.marginEndUsing(&style());
if (startMargin.isFixed())
margins += LayoutUnit::fromFloatCeil(startMargin.value());
if (endMargin.isFixed())