Title: [284773] trunk
Revision
284773
Author
[email protected]
Date
2021-10-25 01:35:23 -0700 (Mon, 25 Oct 2021)

Log Message

[css-writing-modes] Fix sizing of orthogonal elements with percentage margins
https://bugs.webkit.org/show_bug.cgi?id=231951

Reviewed by Manuel Rego Casasnovas.
Source/WebCore:

This is to modify RenderBox::FillAvailableMeasure() to handle the case of
orthogonal elements when computing the margins. Spec reference is at
https://www.w3.org/TR/css-writing-modes-3/#dimension-mapping

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

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

LayoutTests:

* TestExpectations: Unskipped 8 tests that are now passing.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (284772 => 284773)


--- trunk/LayoutTests/ChangeLog	2021-10-25 06:47:50 UTC (rev 284772)
+++ trunk/LayoutTests/ChangeLog	2021-10-25 08:35:23 UTC (rev 284773)
@@ -1,3 +1,12 @@
+2021-10-25  Ziran Sun  <[email protected]>
+
+        [css-writing-modes] Fix sizing of orthogonal elements with percentage margins
+        https://bugs.webkit.org/show_bug.cgi?id=231951
+
+        Reviewed by Manuel Rego Casasnovas.
+        
+        * TestExpectations: Unskipped 8 tests that are now passing.
+
 2021-10-24  Wenson Hsieh  <[email protected]>
 
         REGRESSION (iOS 15): Safari shows zoom callout even if -webkit-user-select is none

Modified: trunk/LayoutTests/TestExpectations (284772 => 284773)


--- trunk/LayoutTests/TestExpectations	2021-10-25 06:47:50 UTC (rev 284772)
+++ trunk/LayoutTests/TestExpectations	2021-10-25 08:35:23 UTC (rev 284773)
@@ -4229,14 +4229,6 @@
 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthog-vrl-in-htb-001.xht [ ImageOnlyFailure ]
 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthog-vrl-in-htb-004.xht [ ImageOnlyFailure ]
 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthog-vrl-in-htb-008.xht [ ImageOnlyFailure ]
-webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthogonal-percentage-margin-001.html [ ImageOnlyFailure ]
-webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthogonal-percentage-margin-002.html [ ImageOnlyFailure ]
-webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthogonal-percentage-margin-003.html [ ImageOnlyFailure ]
-webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthogonal-percentage-margin-004.html [ ImageOnlyFailure ]
-webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthogonal-percentage-margin-005.html [ ImageOnlyFailure ]
-webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthogonal-percentage-margin-006.html [ ImageOnlyFailure ]
-webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthogonal-percentage-margin-007.html [ ImageOnlyFailure ]
-webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthogonal-percentage-margin-008.html [ ImageOnlyFailure ]
 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/table-cell-001.html [ ImageOnlyFailure ]
 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/table-cell-002.html [ ImageOnlyFailure ]
 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/table-column-order-002.xht [ ImageOnlyFailure ]

Modified: trunk/Source/WebCore/ChangeLog (284772 => 284773)


--- trunk/Source/WebCore/ChangeLog	2021-10-25 06:47:50 UTC (rev 284772)
+++ trunk/Source/WebCore/ChangeLog	2021-10-25 08:35:23 UTC (rev 284773)
@@ -1,3 +1,20 @@
+2021-10-25  Ziran Sun  <[email protected]>
+
+        [css-writing-modes] Fix sizing of orthogonal elements with percentage margins
+        https://bugs.webkit.org/show_bug.cgi?id=231951
+
+        Reviewed by Manuel Rego Casasnovas.
+
+        This is to modify RenderBox::FillAvailableMeasure() to handle the case of
+        orthogonal elements when computing the margins. Spec reference is at        
+        https://www.w3.org/TR/css-writing-modes-3/#dimension-mapping
+
+        The change is an import of Chromium CL at
+        https://chromium-review.googlesource.com/c/chromium/src/+/968522/        
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::fillAvailableMeasure const):
+
 2021-10-24  Kimmo Kinnunen  <[email protected]>
 
         ImageBitmap should report its memory cost

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (284772 => 284773)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2021-10-25 06:47:50 UTC (rev 284772)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2021-10-25 08:35:23 UTC (rev 284773)
@@ -2694,8 +2694,10 @@
 
 LayoutUnit RenderBox::fillAvailableMeasure(LayoutUnit availableLogicalWidth, LayoutUnit& marginStart, LayoutUnit& marginEnd) const
 {
-    marginStart = minimumValueForLength(style().marginStart(), availableLogicalWidth);
-    marginEnd = minimumValueForLength(style().marginEnd(), availableLogicalWidth);
+    bool isOrthogonalElement = isHorizontalWritingMode() != containingBlock()->isHorizontalWritingMode();
+    LayoutUnit availableSizeForResolvingMargin = isOrthogonalElement ? containingBlockLogicalWidthForContent() : availableLogicalWidth;
+    marginStart = minimumValueForLength(style().marginStart(), availableSizeForResolvingMargin);
+    marginEnd = minimumValueForLength(style().marginEnd(), availableSizeForResolvingMargin);
     return availableLogicalWidth - marginStart - marginEnd;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to