⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 281662 in webkit


Ignore:
Timestamp:
Aug 26, 2021, 3:29:02 PM (5 years ago)
Author:
Alan Bujtas
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.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r281631 r281662  
     12021-08-26  Alan Bujtas  <zalan@apple.com>
     2
     3        REGRESSION(r275754): Using MarkOnlyThis to make the preferred width dirty introduces unexpected state
     4        https://bugs.webkit.org/show_bug.cgi?id=229586
     5        <rdar://82141454>
     6
     7        Unreviewed revert of r275754.
     8
     9        * web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-002-expected.txt:
     10        * web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-002-expected.txt:
     11        * web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-rl-002-expected.txt:
     12
    1132021-08-26  Commit Queue  <commit-queue@webkit.org>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-002-expected.txt

    r275754 r281662  
    11
    2 PASS .grid 1
    3 PASS .grid 2
     2FAIL .grid 1 assert_equals:
     3<div class="grid">
     4  <div class="paddingLeft50Percent" data-expected-padding-left="50" data-expected-width="60" data-expected-height="10">X</div>
     5  <div data-offset-x="0" data-offset-y="10" data-expected-width="100" data-expected-height="10"></div>
     6</div>
     7width expected 60 but got 50
     8FAIL .grid 2 assert_equals:
     9<div class="grid">
     10  <div class="paddingRight50Percent" data-expected-padding-right="50" data-expected-width="60" data-expected-height="10">X</div>
     11  <div data-offset-x="0" data-offset-y="10" data-expected-width="100" data-expected-height="10"></div>
     12</div>
     13width expected 60 but got 50
    414PASS .grid 3
    515PASS .grid 4
    6 PASS .grid 5
    7 PASS .grid 6
     16FAIL .grid 5 assert_equals:
     17<div class="grid directionRTL">
     18  <div class="paddingLeft50Percent" data-expected-padding-left="50" data-expected-width="60" data-expected-height="10">X</div>
     19  <div data-offset-x="400" data-offset-y="10" data-expected-width="100" data-expected-height="10"></div>
     20</div>
     21width expected 60 but got 50
     22FAIL .grid 6 assert_equals:
     23<div class="grid directionRTL">
     24  <div class="paddingRight50Percent" data-expected-padding-right="50" data-expected-width="60" data-expected-height="10">X</div>
     25  <div data-offset-x="400" data-offset-y="10" data-expected-width="100" data-expected-height="10"></div>
     26</div>
     27width expected 60 but got 50
    828PASS .grid 7
    929PASS .grid 8
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-002-expected.txt

    r275754 r281662  
    22PASS .grid 1
    33PASS .grid 2
    4 PASS .grid 3
    5 PASS .grid 4
     4FAIL .grid 3 assert_equals:
     5<div class="grid">
     6  <div class="paddingTop50Percent" data-expected-padding-top="50" data-expected-width="10" data-expected-height="60">X</div>
     7  <div data-offset-x="10" data-offset-y="0" data-expected-width="10" data-expected-height="100"></div>
     8</div>
     9height expected 60 but got 50
     10FAIL .grid 4 assert_equals:
     11<div class="grid">
     12  <div class="paddingBottom50Percent" data-expected-padding-bottom="50" data-expected-width="10" data-expected-height="60">X</div>
     13  <div data-offset-x="10" data-offset-y="0" data-expected-width="10" data-expected-height="100"></div>
     14</div>
     15height expected 60 but got 50
    616PASS .grid 5
    717PASS .grid 6
    8 PASS .grid 7
    9 PASS .grid 8
     18FAIL .grid 7 assert_equals:
     19<div class="grid directionRTL">
     20  <div class="paddingTop50Percent" data-expected-padding-top="50" data-expected-width="10" data-expected-height="60">X</div>
     21  <div data-offset-x="10" data-offset-y="400" data-expected-width="10" data-expected-height="100"></div>
     22</div>
     23height expected 60 but got 50
     24FAIL .grid 8 assert_equals:
     25<div class="grid directionRTL">
     26  <div class="paddingBottom50Percent" data-expected-padding-bottom="50" data-expected-width="10" data-expected-height="60">X</div>
     27  <div data-offset-x="10" data-offset-y="400" data-expected-width="10" data-expected-height="100"></div>
     28</div>
     29height expected 60 but got 50
    1030Direction LTR
    1131
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-rl-002-expected.txt

    r275754 r281662  
    22PASS .grid 1
    33PASS .grid 2
    4 PASS .grid 3
    5 PASS .grid 4
     4FAIL .grid 3 assert_equals:
     5<div class="grid">
     6  <div class="paddingTop50Percent" data-expected-padding-top="50" data-expected-width="10" data-expected-height="60">X</div>
     7  <div data-offset-x="0" data-offset-y="0" data-expected-width="10" data-expected-height="100"></div>
     8</div>
     9height expected 60 but got 50
     10FAIL .grid 4 assert_equals:
     11<div class="grid">
     12  <div class="paddingBottom50Percent" data-expected-padding-bottom="50" data-expected-width="10" data-expected-height="60">X</div>
     13  <div data-offset-x="0" data-offset-y="0" data-expected-width="10" data-expected-height="100"></div>
     14</div>
     15height expected 60 but got 50
    616PASS .grid 5
    717PASS .grid 6
    8 PASS .grid 7
    9 PASS .grid 8
     18FAIL .grid 7 assert_equals:
     19<div class="grid directionRTL">
     20  <div class="paddingTop50Percent" data-expected-padding-top="50" data-expected-width="10" data-expected-height="60">X</div>
     21  <div data-offset-x="0" data-offset-y="400" data-expected-width="10" data-expected-height="100"></div>
     22</div>
     23height expected 60 but got 50
     24FAIL .grid 8 assert_equals:
     25<div class="grid directionRTL">
     26  <div class="paddingBottom50Percent" data-expected-padding-bottom="50" data-expected-width="10" data-expected-height="60">X</div>
     27  <div data-offset-x="0" data-offset-y="400" data-expected-width="10" data-expected-height="100"></div>
     28</div>
     29height expected 60 but got 50
    1030Direction LTR
    1131
  • trunk/Source/WebCore/ChangeLog

    r281650 r281662  
     12021-08-26  Alan Bujtas  <zalan@apple.com>
     2
     3        REGRESSION(r275754): Using MarkOnlyThis to make the preferred width dirty introduces unexpected state
     4        https://bugs.webkit.org/show_bug.cgi?id=229586
     5        <rdar://82141454>
     6
     7        Unreviewed revert.
     8
     9        * rendering/RenderBlock.cpp:
     10        (WebCore::RenderBlock::recomputeLogicalWidth):
     11        (WebCore::shouldRecalculateMinMaxWidthsAffectedByAncestor): Deleted.
     12
    1132021-08-26  Myles C. Maxfield  <mmaxfield@apple.com>
    214
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r280213 r281662  
    630630}
    631631
    632 static bool shouldRecalculateMinMaxWidthsAffectedByAncestor(const RenderBox* box)
    633 {
    634     // 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
    635     // 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
    636     // 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.
    637     if (box->preferredLogicalWidthsDirty())
    638         return false;
    639     // 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
    640     // unnecessary work and O(n^2) time complexity.
    641     if (const RenderBox* cb = box->containingBlock()) {
    642         if (cb->needsPreferredWidthsRecalculation() && !cb->preferredLogicalWidthsDirty())
    643             return false;
    644     }
    645     return true;
    646 }
    647 
    648632bool RenderBlock::recomputeLogicalWidth()
    649633{
    650634    LayoutUnit oldWidth = logicalWidth();
    651635
    652     // 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
    653     // the ancestry (min/max width calculation should ideally be strictly bottom-up, but that's not always the case), so since the containing
    654     // 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.
    655     if (needsPreferredWidthsRecalculation() && shouldRecalculateMinMaxWidthsAffectedByAncestor(this))
    656         setPreferredLogicalWidthsDirty(true, MarkOnlyThis);
    657636    updateLogicalWidth();
    658637   
Note: See TracChangeset for help on using the changeset viewer.