Title: [295120] trunk
Revision
295120
Author
[email protected]
Date
2022-06-01 22:05:28 -0700 (Wed, 01 Jun 2022)

Log Message

text-align: match-parent on root handles direction incorrectly
https://bugs.webkit.org/show_bug.cgi?id=241164

Reviewed by Myles C. Maxfield.

The spec says the initial containing block's direction should be used when the element has no parent.

Regarding the computed value, Chrome & Firefox computes to `start` for this case.
This may change in https://github.com/w3c/csswg-drafts/issues/6542 to `left`/`right`.

Test: imported/w3c/web-platform-tests/css/css-text/text-align/text-align-match-parent-root-rtl.html

* LayoutTests/TestExpectations:
* Source/WebCore/style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertTextAlign):

Canonical link: https://commits.webkit.org/251211@main

Modified Paths

Diff

Modified: trunk/LayoutTests/TestExpectations (295119 => 295120)


--- trunk/LayoutTests/TestExpectations	2022-06-02 04:05:22 UTC (rev 295119)
+++ trunk/LayoutTests/TestExpectations	2022-06-02 05:05:28 UTC (rev 295120)
@@ -2645,7 +2645,6 @@
 webkit.org/b/183258 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-010.html [ ImageOnlyFailure ]
 webkit.org/b/183258 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-011.html [ ImageOnlyFailure ]
 webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-wins-001.html [ ImageOnlyFailure ]
-webkit.org/b/241164 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-match-parent-root-rtl.html [ ImageOnlyFailure ]
 webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/text-encoding/shaping-join-003.html [ ImageOnlyFailure ]
 webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/text-encoding/shaping-tatweel-002.html [ ImageOnlyFailure ]
 webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/text-encoding/shaping-tatweel-003.html [ ImageOnlyFailure ]

Modified: trunk/Source/WebCore/style/StyleBuilderConverter.h (295119 => 295120)


--- trunk/Source/WebCore/style/StyleBuilderConverter.h	2022-06-02 04:05:22 UTC (rev 295119)
+++ trunk/Source/WebCore/style/StyleBuilderConverter.h	2022-06-02 05:05:28 UTC (rev 295120)
@@ -614,6 +614,10 @@
     if (primitiveValue.valueID() != CSSValueWebkitMatchParent && primitiveValue.valueID() != CSSValueMatchParent)
         return primitiveValue;
 
+    auto* element = builderState.element();
+    if (element && element == builderState.document().documentElement())
+        return TextAlignMode::Start;
+
     auto& parentStyle = builderState.parentStyle();
     if (parentStyle.textAlign() == TextAlignMode::Start)
         return parentStyle.isLeftToRightDirection() ? TextAlignMode::Left : TextAlignMode::Right;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to