Title: [281662] trunk
Revision
281662
Author
[email protected]
Date
2021-08-26 15:29:02 -0700 (Thu, 26 Aug 2021)

Log Message

REGRESSION(r275754): Using MarkOnlyThis to make the preferred width dirty introduces unexpected state
https://bugs.webkit.org/show_bug.cgi?id=229586
<rdar://82141454>

LayoutTests/imported/w3c:

Unreviewed revert of r275754.


* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-002-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-002-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-rl-002-expected.txt:

Source/WebCore:

Unreviewed revert.


* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::recomputeLogicalWidth):
(WebCore::shouldRecalculateMinMaxWidthsAffectedByAncestor): Deleted.

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (281661 => 281662)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-08-26 22:07:30 UTC (rev 281661)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-08-26 22:29:02 UTC (rev 281662)
@@ -1,3 +1,15 @@
+2021-08-26  Alan Bujtas  <[email protected]>
+
+        REGRESSION(r275754): Using MarkOnlyThis to make the preferred width dirty introduces unexpected state
+        https://bugs.webkit.org/show_bug.cgi?id=229586
+        <rdar://82141454>
+
+        Unreviewed revert of r275754.
+
+        * web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-002-expected.txt:
+        * web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-002-expected.txt:
+        * web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-rl-002-expected.txt:
+
 2021-08-26  Commit Queue  <[email protected]>
 
         Unreviewed, reverting r281616.

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-002-expected.txt (281661 => 281662)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-002-expected.txt	2021-08-26 22:07:30 UTC (rev 281661)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-002-expected.txt	2021-08-26 22:29:02 UTC (rev 281662)
@@ -1,10 +1,30 @@
 
-PASS .grid 1
-PASS .grid 2
+FAIL .grid 1 assert_equals:
+<div class="grid">
+  <div class="paddingLeft50Percent" data-expected-padding-left="50" data-expected-width="60" data-expected-height="10">X</div>
+  <div data-offset-x="0" data-offset-y="10" data-expected-width="100" data-expected-height="10"></div>
+</div>
+width expected 60 but got 50
+FAIL .grid 2 assert_equals:
+<div class="grid">
+  <div class="paddingRight50Percent" data-expected-padding-right="50" data-expected-width="60" data-expected-height="10">X</div>
+  <div data-offset-x="0" data-offset-y="10" data-expected-width="100" data-expected-height="10"></div>
+</div>
+width expected 60 but got 50
 PASS .grid 3
 PASS .grid 4
-PASS .grid 5
-PASS .grid 6
+FAIL .grid 5 assert_equals:
+<div class="grid directionRTL">
+  <div class="paddingLeft50Percent" data-expected-padding-left="50" data-expected-width="60" data-expected-height="10">X</div>
+  <div data-offset-x="400" data-offset-y="10" data-expected-width="100" data-expected-height="10"></div>
+</div>
+width expected 60 but got 50
+FAIL .grid 6 assert_equals:
+<div class="grid directionRTL">
+  <div class="paddingRight50Percent" data-expected-padding-right="50" data-expected-width="60" data-expected-height="10">X</div>
+  <div data-offset-x="400" data-offset-y="10" data-expected-width="100" data-expected-height="10"></div>
+</div>
+width expected 60 but got 50
 PASS .grid 7
 PASS .grid 8
 Direction LTR

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-002-expected.txt (281661 => 281662)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-002-expected.txt	2021-08-26 22:07:30 UTC (rev 281661)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-002-expected.txt	2021-08-26 22:29:02 UTC (rev 281662)
@@ -1,12 +1,32 @@
 
 PASS .grid 1
 PASS .grid 2
-PASS .grid 3
-PASS .grid 4
+FAIL .grid 3 assert_equals:
+<div class="grid">
+  <div class="paddingTop50Percent" data-expected-padding-top="50" data-expected-width="10" data-expected-height="60">X</div>
+  <div data-offset-x="10" data-offset-y="0" data-expected-width="10" data-expected-height="100"></div>
+</div>
+height expected 60 but got 50
+FAIL .grid 4 assert_equals:
+<div class="grid">
+  <div class="paddingBottom50Percent" data-expected-padding-bottom="50" data-expected-width="10" data-expected-height="60">X</div>
+  <div data-offset-x="10" data-offset-y="0" data-expected-width="10" data-expected-height="100"></div>
+</div>
+height expected 60 but got 50
 PASS .grid 5
 PASS .grid 6
-PASS .grid 7
-PASS .grid 8
+FAIL .grid 7 assert_equals:
+<div class="grid directionRTL">
+  <div class="paddingTop50Percent" data-expected-padding-top="50" data-expected-width="10" data-expected-height="60">X</div>
+  <div data-offset-x="10" data-offset-y="400" data-expected-width="10" data-expected-height="100"></div>
+</div>
+height expected 60 but got 50
+FAIL .grid 8 assert_equals:
+<div class="grid directionRTL">
+  <div class="paddingBottom50Percent" data-expected-padding-bottom="50" data-expected-width="10" data-expected-height="60">X</div>
+  <div data-offset-x="10" data-offset-y="400" data-expected-width="10" data-expected-height="100"></div>
+</div>
+height expected 60 but got 50
 Direction LTR
 
 Item padding-left: 50%;

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-rl-002-expected.txt (281661 => 281662)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-rl-002-expected.txt	2021-08-26 22:07:30 UTC (rev 281661)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-rl-002-expected.txt	2021-08-26 22:29:02 UTC (rev 281662)
@@ -1,12 +1,32 @@
 
 PASS .grid 1
 PASS .grid 2
-PASS .grid 3
-PASS .grid 4
+FAIL .grid 3 assert_equals:
+<div class="grid">
+  <div class="paddingTop50Percent" data-expected-padding-top="50" data-expected-width="10" data-expected-height="60">X</div>
+  <div data-offset-x="0" data-offset-y="0" data-expected-width="10" data-expected-height="100"></div>
+</div>
+height expected 60 but got 50
+FAIL .grid 4 assert_equals:
+<div class="grid">
+  <div class="paddingBottom50Percent" data-expected-padding-bottom="50" data-expected-width="10" data-expected-height="60">X</div>
+  <div data-offset-x="0" data-offset-y="0" data-expected-width="10" data-expected-height="100"></div>
+</div>
+height expected 60 but got 50
 PASS .grid 5
 PASS .grid 6
-PASS .grid 7
-PASS .grid 8
+FAIL .grid 7 assert_equals:
+<div class="grid directionRTL">
+  <div class="paddingTop50Percent" data-expected-padding-top="50" data-expected-width="10" data-expected-height="60">X</div>
+  <div data-offset-x="0" data-offset-y="400" data-expected-width="10" data-expected-height="100"></div>
+</div>
+height expected 60 but got 50
+FAIL .grid 8 assert_equals:
+<div class="grid directionRTL">
+  <div class="paddingBottom50Percent" data-expected-padding-bottom="50" data-expected-width="10" data-expected-height="60">X</div>
+  <div data-offset-x="0" data-offset-y="400" data-expected-width="10" data-expected-height="100"></div>
+</div>
+height expected 60 but got 50
 Direction LTR
 
 Item padding-left: 50%;

Modified: trunk/Source/WebCore/ChangeLog (281661 => 281662)


--- trunk/Source/WebCore/ChangeLog	2021-08-26 22:07:30 UTC (rev 281661)
+++ trunk/Source/WebCore/ChangeLog	2021-08-26 22:29:02 UTC (rev 281662)
@@ -1,3 +1,15 @@
+2021-08-26  Alan Bujtas  <[email protected]>
+
+        REGRESSION(r275754): Using MarkOnlyThis to make the preferred width dirty introduces unexpected state
+        https://bugs.webkit.org/show_bug.cgi?id=229586
+        <rdar://82141454>
+
+        Unreviewed revert.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::recomputeLogicalWidth):
+        (WebCore::shouldRecalculateMinMaxWidthsAffectedByAncestor): Deleted.
+
 2021-08-26  Myles C. Maxfield  <[email protected]>
 
         Drawing small caps web fonts into canvas causes the GPU process to hang

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (281661 => 281662)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2021-08-26 22:07:30 UTC (rev 281661)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2021-08-26 22:29:02 UTC (rev 281662)
@@ -629,31 +629,10 @@
         fragmentedFlow->logicalWidthChangedInFragmentsForBlock(this, relayoutChildren);
 }
 
-static bool shouldRecalculateMinMaxWidthsAffectedByAncestor(const RenderBox* box)
-{
-    // If the preferred widths are already dirty at this point (during layout), it actually means that we never need to calculate them, since that should
-    // have been carried out by an ancestor that's sized based on preferred widths (a shrink-to-fit container, for instance). In such cases the
-    // object will be left as dirty indefinitely, and it would just be a waste of time to calculate the preferred withs when nobody needs them.
-    if (box->preferredLogicalWidthsDirty())
-        return false;
-    // If our containing block also has min/max widths that are affected by the ancestry, we have already dealt with this object as well. Avoid
-    // unnecessary work and O(n^2) time complexity.
-    if (const RenderBox* cb = box->containingBlock()) {
-        if (cb->needsPreferredWidthsRecalculation() && !cb->preferredLogicalWidthsDirty())
-            return false;
-    }
-    return true;
-}
-
 bool RenderBlock::recomputeLogicalWidth()
 {
     LayoutUnit oldWidth = logicalWidth();
 
-    // Laying out this object means that its containing block is also being laid out. This object is special, in that its min/max widths depend on
-    // the ancestry (min/max width calculation should ideally be strictly bottom-up, but that's not always the case), so since the containing
-    // block size may have changed, we need to recalculate the min/max widths of this object, and every child that has the same issue, recursively.
-    if (needsPreferredWidthsRecalculation() && shouldRecalculateMinMaxWidthsAffectedByAncestor(this))
-        setPreferredLogicalWidthsDirty(true, MarkOnlyThis);
     updateLogicalWidth();
     
     bool hasBorderOrPaddingLogicalWidthChanged = this->hasBorderOrPaddingLogicalWidthChanged();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to