Title: [285923] trunk
Revision
285923
Author
[email protected]
Date
2021-11-17 04:31:09 -0800 (Wed, 17 Nov 2021)

Log Message

Limit logical width over-constrained direction check
https://bugs.webkit.org/show_bug.cgi?id=233189

Patch by Rob Buis <[email protected]> on 2021-11-17
Reviewed by Sergio Villar Senin.

Source/WebCore:

In computePositionedLogicalWidthUsing the over-constrained case always checks for RTL
direction, but this should not be done if we are not dealing with left and right properties,
i.e. only when we are not orthogonal with the container.
Finally computeLogicalLeftPositionedOffset should not do the flipping logic in the over-constrained case.

* rendering/RenderBox.cpp:
(WebCore::computeLogicalLeftPositionedOffset):
(WebCore::RenderBox::computePositionedLogicalWidthUsing const):
(WebCore::RenderBox::computePositionedLogicalWidthReplaced const):

LayoutTests:

* TestExpectations: Removed 4 tests that are now passing.
* platform/ios/TestExpectations: Skipped several tests that show 1px diff in the result.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (285922 => 285923)


--- trunk/LayoutTests/ChangeLog	2021-11-17 10:38:22 UTC (rev 285922)
+++ trunk/LayoutTests/ChangeLog	2021-11-17 12:31:09 UTC (rev 285923)
@@ -1,3 +1,13 @@
+2021-11-17  Rob Buis  <[email protected]>
+
+        Limit logical width over-constrained direction check
+        https://bugs.webkit.org/show_bug.cgi?id=233189
+
+        Reviewed by Sergio Villar Senin.
+
+        * TestExpectations: Removed 4 tests that are now passing.
+        * platform/ios/TestExpectations: Skipped several tests that show 1px diff in the result.
+
 2021-11-17  Antti Koivisto  <[email protected]>
 
         Update web-platform-tests/css/selectors

Modified: trunk/LayoutTests/TestExpectations (285922 => 285923)


--- trunk/LayoutTests/TestExpectations	2021-11-17 10:38:22 UTC (rev 285922)
+++ trunk/LayoutTests/TestExpectations	2021-11-17 12:31:09 UTC (rev 285923)
@@ -4034,11 +4034,7 @@
 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-icb-vlr-033.xht [ ImageOnlyFailure ]
 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-icb-vrl-030.xht [ ImageOnlyFailure ]
 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vlr-095.xht [ ImageOnlyFailure ]
-webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vlr-225.xht [ ImageOnlyFailure ]
-webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vlr-229.xht [ ImageOnlyFailure ]
 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vrl-088.xht [ ImageOnlyFailure ]
-webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vrl-220.xht [ ImageOnlyFailure ]
-webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vrl-224.xht [ ImageOnlyFailure ]
 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/available-size-001.html [ ImageOnlyFailure ]
 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/available-size-002.html [ ImageOnlyFailure ]
 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/available-size-003.html [ ImageOnlyFailure ]

Modified: trunk/LayoutTests/platform/ios/TestExpectations (285922 => 285923)


--- trunk/LayoutTests/platform/ios/TestExpectations	2021-11-17 10:38:22 UTC (rev 285922)
+++ trunk/LayoutTests/platform/ios/TestExpectations	2021-11-17 12:31:09 UTC (rev 285923)
@@ -3532,6 +3532,10 @@
 webkit.org/b/229397 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vrl-192.xht [ ImageOnlyFailure ]
 webkit.org/b/229397 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vrl-204.xht [ ImageOnlyFailure ]
 webkit.org/b/229397 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vrl-208.xht [ ImageOnlyFailure ]
+webkit.org/b/229397 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vrl-220.xht [ ImageOnlyFailure ]
+webkit.org/b/229397 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vrl-224.xht [ ImageOnlyFailure ]
+webkit.org/b/229397 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vlr-225.xht [ ImageOnlyFailure ]
+webkit.org/b/229397 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vlr-229.xht [ ImageOnlyFailure ]
 webkit.org/b/229397 imported/w3c/web-platform-tests/css/css-writing-modes/clip-rect-vrl-002.xht [ ImageOnlyFailure ]
 webkit.org/b/229397 imported/w3c/web-platform-tests/css/css-writing-modes/clip-rect-vrl-004.xht [ ImageOnlyFailure ]
 webkit.org/b/229397 imported/w3c/web-platform-tests/css/css-writing-modes/clip-rect-vrl-006.xht [ ImageOnlyFailure ]

Modified: trunk/Source/WebCore/ChangeLog (285922 => 285923)


--- trunk/Source/WebCore/ChangeLog	2021-11-17 10:38:22 UTC (rev 285922)
+++ trunk/Source/WebCore/ChangeLog	2021-11-17 12:31:09 UTC (rev 285923)
@@ -1,3 +1,20 @@
+2021-11-17  Rob Buis  <[email protected]>
+
+        Limit logical width over-constrained direction check
+        https://bugs.webkit.org/show_bug.cgi?id=233189
+
+        Reviewed by Sergio Villar Senin.
+
+        In computePositionedLogicalWidthUsing the over-constrained case always checks for RTL
+        direction, but this should not be done if we are not dealing with left and right properties,
+        i.e. only when we are not orthogonal with the container.
+        Finally computeLogicalLeftPositionedOffset should not do the flipping logic in the over-constrained case.
+
+        * rendering/RenderBox.cpp:
+        (WebCore::computeLogicalLeftPositionedOffset):
+        (WebCore::RenderBox::computePositionedLogicalWidthUsing const):
+        (WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
+
 2021-11-17  Antoine Quint  <[email protected]>
 
         [Model] Create iOS ModelPlayer implementation

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (285922 => 285923)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2021-11-17 10:38:22 UTC (rev 285922)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2021-11-17 12:31:09 UTC (rev 285923)
@@ -3989,13 +3989,14 @@
     }
 }
 
-static void computeLogicalLeftPositionedOffset(LayoutUnit& logicalLeftPos, const RenderBox* child, LayoutUnit logicalWidthValue, const RenderBoxModelObject& containerBlock, LayoutUnit containerLogicalWidth)
+static void computeLogicalLeftPositionedOffset(LayoutUnit& logicalLeftPos, const RenderBox* child, LayoutUnit logicalWidthValue, const RenderBoxModelObject& containerBlock, LayoutUnit containerLogicalWidth, bool logicalLeftIsAuto, bool logicalRightIsAuto)
 {
-    auto logicalLeftAndRightAreAuto = child->style().logicalLeft().isAuto() && child->style().logicalRight().isAuto();
+    auto logicalLeftAndRightAreAuto = logicalLeftIsAuto && logicalRightIsAuto;
+    bool isOverconstrained = !logicalLeftIsAuto && !logicalRightIsAuto && !child->style().logicalWidth().isAuto();
     // Deal with differing writing modes here. Our offset needs to be in the containing block's coordinate space. If the containing block is flipped
     // along this axis, then we need to flip the coordinate. Auto positioned items do not need this correction as it was properly handled in
     // computeInlineStaticDistance().
-    if (isOrthogonal(*child, containerBlock) && !logicalLeftAndRightAreAuto && containerBlock.style().isFlippedBlocksWritingMode()) {
+    if (isOrthogonal(*child, containerBlock) && !logicalLeftAndRightAreAuto && !isOverconstrained && containerBlock.style().isFlippedBlocksWritingMode()) {
         logicalLeftPos = containerLogicalWidth - logicalWidthValue - logicalLeftPos;
         logicalLeftPos += (child->isHorizontalWritingMode() ? containerBlock.borderRight() : containerBlock.borderBottom());
     } else
@@ -4089,7 +4090,7 @@
 
             // Use the containing block's direction rather than the parent block's
             // per CSS 2.1 reference test abspos-non-replaced-width-margin-000.
-            if (containerDirection == TextDirection::RTL)
+            if (!isOrthogonal(*this, containerBlock) && containerDirection == TextDirection::RTL)
                 logicalLeftValue = (availableSpace + logicalLeftValue) - marginLogicalLeftValue - marginLogicalRightValue;
         }
     } else {
@@ -4193,7 +4194,7 @@
     }
 
     computedValues.m_position = logicalLeftValue + marginLogicalLeftValue;
-    computeLogicalLeftPositionedOffset(computedValues.m_position, this, computedValues.m_extent + bordersPlusPadding, containerBlock, containerLogicalWidth);
+    computeLogicalLeftPositionedOffset(computedValues.m_position, this, computedValues.m_extent + bordersPlusPadding, containerBlock, containerLogicalWidth, style().logicalLeft().isAuto(), style().logicalRight().isAuto());
 }
 
 static void computeBlockStaticDistance(Length& logicalTop, Length& logicalBottom, const RenderBox* child, const RenderBoxModelObject& containerBlock)
@@ -4673,7 +4674,7 @@
 
     LayoutUnit logicalLeftPos = logicalLeftValue + marginLogicalLeftAlias;
     // Border and padding have already been included in computedValues.m_extent.
-    computeLogicalLeftPositionedOffset(logicalLeftPos, this, computedValues.m_extent, containerBlock, containerLogicalWidth);
+    computeLogicalLeftPositionedOffset(logicalLeftPos, this, computedValues.m_extent, containerBlock, containerLogicalWidth, style().logicalLeft().isAuto(), style().logicalRight().isAuto());
     computedValues.m_position = logicalLeftPos;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to