Title: [276445] trunk
Revision
276445
Author
[email protected]
Date
2021-04-22 10:12:25 -0700 (Thu, 22 Apr 2021)

Log Message

[css-grid] WPT Tests css/css-grid/grid-items/grid-item-percentage-sizes-*.html fail
https://bugs.webkit.org/show_bug.cgi?id=209650

Patch by Ziran Sun <[email protected]> on 2021-04-22
Reviewed by Sergio Villar Senin.

Source/WebCore:

We need to check child's writing mode in order to pick the correct dimension to resolve
percentage height against. Overriding containing block size should also be chosen in favour
of special code for orthogonal writing mode.

This change is an import of Chromium CL at
https://chromium-review.googlesource.com/c/chromium/src/+/1348055.

Three tests that failed are now passing.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computePercentageLogicalHeight const):

LayoutTests:

* TestExpectations: grid-item-percentage-sizes-00{1-3}.html are passing and unskipped now.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (276444 => 276445)


--- trunk/LayoutTests/ChangeLog	2021-04-22 16:52:20 UTC (rev 276444)
+++ trunk/LayoutTests/ChangeLog	2021-04-22 17:12:25 UTC (rev 276445)
@@ -1,3 +1,12 @@
+2021-04-22  Ziran Sun  <[email protected]>
+
+        [css-grid] WPT Tests css/css-grid/grid-items/grid-item-percentage-sizes-*.html fail
+        https://bugs.webkit.org/show_bug.cgi?id=209650
+
+        Reviewed by Sergio Villar Senin.
+
+        * TestExpectations: grid-item-percentage-sizes-00{1-3}.html are passing and unskipped now.
+
 2021-04-22  Imanol Fernandez  <[email protected]>
 
         Implement WebXR Input Sources

Modified: trunk/LayoutTests/TestExpectations (276444 => 276445)


--- trunk/LayoutTests/TestExpectations	2021-04-22 16:52:20 UTC (rev 276444)
+++ trunk/LayoutTests/TestExpectations	2021-04-22 17:12:25 UTC (rev 276445)
@@ -4059,9 +4059,6 @@
 webkit.org/b/209460 imported/w3c/web-platform-tests/css/css-grid/abspos/descendant-static-position-002.html [ ImageOnlyFailure ]
 webkit.org/b/209460 imported/w3c/web-platform-tests/css/css-grid/abspos/descendant-static-position-003.html [ ImageOnlyFailure ]
 webkit.org/b/209460 imported/w3c/web-platform-tests/css/css-grid/abspos/descendant-static-position-004.html [ ImageOnlyFailure ]
-webkit.org/b/209650 imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-percentage-sizes-001.html [ ImageOnlyFailure ]
-webkit.org/b/209650 imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-percentage-sizes-002.html [ ImageOnlyFailure ]
-webkit.org/b/209650 imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-percentage-sizes-003.html [ ImageOnlyFailure ]
 webkit.org/b/212201 imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-limits-001.html [ Skip ]
 webkit.org/b/209656 imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-button-001.html [ Failure ]
 webkit.org/b/212246 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-baseline-align-cycles-001.html [ ImageOnlyFailure ]

Modified: trunk/Source/WebCore/ChangeLog (276444 => 276445)


--- trunk/Source/WebCore/ChangeLog	2021-04-22 16:52:20 UTC (rev 276444)
+++ trunk/Source/WebCore/ChangeLog	2021-04-22 17:12:25 UTC (rev 276445)
@@ -1,3 +1,22 @@
+2021-04-22  Ziran Sun  <[email protected]>
+
+        [css-grid] WPT Tests css/css-grid/grid-items/grid-item-percentage-sizes-*.html fail
+        https://bugs.webkit.org/show_bug.cgi?id=209650
+
+        Reviewed by Sergio Villar Senin.
+
+        We need to check child's writing mode in order to pick the correct dimension to resolve
+        percentage height against. Overriding containing block size should also be chosen in favour
+        of special code for orthogonal writing mode.
+ 
+        This change is an import of Chromium CL at
+        https://chromium-review.googlesource.com/c/chromium/src/+/1348055.
+ 
+        Three tests that failed are now passing.
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::computePercentageLogicalHeight const):
+
 2021-04-22  Imanol Fernandez  <[email protected]>
 
         Implement WebXR Input Sources

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (276444 => 276445)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2021-04-22 16:52:20 UTC (rev 276444)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2021-04-22 17:12:25 UTC (rev 276445)
@@ -3121,10 +3121,13 @@
     if (updateDescendants == UpdatePercentageHeightDescendants::Yes)
         cb->addPercentHeightDescendant(const_cast<RenderBox&>(*this));
 
-    if (isHorizontal != cb->isHorizontalWritingMode())
+    bool isOrthogonal = isHorizontal != cb->isHorizontalWritingMode();
+    if (hasOverridingContainingBlockContentLogicalWidth() && isOrthogonal)
+        availableHeight = overridingContainingBlockContentLogicalWidth();
+    else if (hasOverridingContainingBlockContentLogicalHeight() && !isOrthogonal)
+        availableHeight = overridingContainingBlockContentLogicalHeight();
+    else if (isOrthogonal)
         availableHeight = containingBlockChild->containingBlockLogicalWidthForContent();
-    else if (hasOverridingContainingBlockContentLogicalHeight())
-        availableHeight = overridingContainingBlockContentLogicalHeight();
     else if (is<RenderTableCell>(*cb)) {
         if (!skippedAutoHeightContainingBlock) {
             // Table cells violate what the CSS spec says to do with heights. Basically we
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to