| Differences between
and this patch
- a/Source/WebCore/ChangeLog +97 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2021-05-04  Cathie Chen  <cathiechen@igalia.com>
2
3
        [CSS contain] Support contain:size
4
        https://bugs.webkit.org/show_bug.cgi?id=223570
5
6
        Reviewed by Zalan Bujtas.
7
8
        This patch brings initial support of CSS contain:size according to [1].
9
        It adds shouldApplySizeContainment() to indicate whether the object is a size containment box.
10
        The intrinsic sizes of size containment box are determined as if it had no content.
11
        So the implementation need to cooperate with the layout steps:
12
          - Computing logical width: Size containment boxes skip handling children while computing minLogicalWidth
13
          and maxLogicalWidth in computeIntrinsicLogicalWidths. So the logical width is not affected by children.
14
          - Layout children: The logical height is changed after layout all children.
15
          - Computing logical height: At the beginning, size containment boxes need to reset logical height to the empty content height
16
          if it is not renderGrid. So the logical height is not affected by children.
17
        We also need to calculate the sizes according to the layout algorithms.
18
        - Grid layout:
19
          To calculate the minLogicalWidth and maxLogicalWidth for indefinite size RenderGrid.
20
          The widths are calculated by GridTrackSizingAlgorithm: m_minContentSize and m_maxContentSize which are the sum of
21
          m_baseSize/m_growthLimit of all GridTracks. The size containment RenderGrid skips handling content in resolveIntrinsicTrackSizes
22
          and the m_maxContentSize will be the sum of m_baseSize. The logical height is same to width, but after calculating
23
          RenderGrid's logical height, it needs to calculate the track sizes again, to make sure that they are distributed properly.
24
          We use computeTrackSizesForDefiniteSize(ForRows, trackBasedLogicalHeight) to recalculate it.
25
        - MultiColumn layout:
26
          According to the specification, size containment boxes should be monolithic, so we need to extend column height
27
          for overflow and positioned size containment boxes. m_spaceShortageForSizeContainment is added to indicate the shortage space
28
          that need to balance the column heights. adjustSizeContainmentChildForPagination() will calculate the shortage.
29
30
        [1] https://www.w3.org/TR/css-contain-1/#containment-size
31
32
        * rendering/GridTrackSizingAlgorithm.cpp: Add isComputingSizeContainment to indicate if it is calculating sizes
33
          for indefinite size RenderGrid which is size containment.
34
        (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
35
        (WebCore::GridTrackSizingAlgorithm::computeGridContainerIntrinsicSizes):
36
          It skips resolveIntrinsicTrackSizes if isComputingSizeContainment, so growthLimit might be undefined,
37
          if so, use track.baseSize() instead.
38
        (WebCore::GridTrackSizingAlgorithm::resolveIntrinsicTrackSizes): Skip resolve the content if isComputingSizeContainment().
39
        (WebCore::GridTrackSizingAlgorithm::advanceNextState): Added RowSizingExtraIterationForSizeContainment.
40
        (WebCore::GridTrackSizingAlgorithm::isValidTransition const):
41
        (WebCore::GridTrackSizingAlgorithm::run): Do not stretch the track sizes if isComputingSizeContainment().
42
        * rendering/GridTrackSizingAlgorithm.h:
43
        * rendering/RenderBlock.cpp:
44
        (WebCore::RenderBlock::layoutPositionedObject): Calculate m_spaceShortageForSizeContainment for positioned size containment.
45
        (WebCore::RenderBlock::computeIntrinsicLogicalWidths const): Skip computeBlockPreferredLogicalWidths if shouldApplySizeContainment.
46
        * rendering/RenderBlockFlow.cpp:
47
        (WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths const): Skip handling the children for size containment box.
48
        (WebCore::RenderBlockFlow::adjustBlockChildForPagination): Calculate m_spaceShortageForSizeContainment for child.
49
        (WebCore::RenderBlockFlow::adjustSizeContainmentChildForPagination): m_spaceShortageForSizeContainment = childOverflowHeight - remainingLogicalHeight.
50
        * rendering/RenderBlockFlow.h:
51
        * rendering/RenderBox.cpp:
52
        (WebCore::RenderBox::updateLogicalHeight): Reset the logical height to empty content height for size containment box.
53
        (WebCore::RenderBox::isUnsplittableForPagination const): Size containment box is unsplittable.
54
        * rendering/RenderDeprecatedFlexibleBox.cpp:
55
        (WebCore::RenderDeprecatedFlexibleBox::computeIntrinsicLogicalWidths const): Ditto.
56
        * rendering/RenderFileUploadControl.cpp:
57
        (WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths const): Ditto.
58
        * rendering/RenderFlexibleBox.cpp:
59
        (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths const): Ditto.
60
        * rendering/RenderFragmentedFlow.h:
61
        * rendering/RenderGrid.cpp:
62
        (WebCore::RenderGrid::layoutBlock): If it is size containment with infiniteSize, using trackBasedLogicalHeight
63
        to compute track sizes again to make sure the height is distributed properly.
64
        (WebCore::RenderGrid::computeEmptyTracksForAutoRepeat const): Collapse if shouldApplySizeContainment.
65
        * rendering/RenderImage.cpp:
66
        (WebCore::RenderImage::computeIntrinsicRatioInformation const): This is handled in RenderReplaced::computeIntrinsicRatioInformation instead.
67
        * rendering/RenderListBox.cpp:
68
        (WebCore::RenderListBox::computeIntrinsicLogicalWidths const): The widths of size containment boxes are optionsSpacingHorizontal.
69
        * rendering/RenderMenuList.cpp:
70
        (RenderMenuList::computeIntrinsicLogicalWidths const): The widths of size containment box are theme.minimumMenuListSize.
71
        * rendering/RenderMultiColumnFlow.cpp:
72
        (WebCore::RenderMultiColumnFlow::updateSpaceShortageForSizeContainment): Set m_spaceShortageForSizeContainment.
73
        * rendering/RenderMultiColumnFlow.h:
74
        * rendering/RenderMultiColumnSet.cpp:
75
        (WebCore::RenderMultiColumnSet::RenderMultiColumnSet):
76
        (WebCore::RenderMultiColumnSet::calculateBalancedHeight const): Add m_spaceShortageForSizeContainment to the column height.
77
        (WebCore::RenderMultiColumnSet::prepareForLayout): Reset m_spaceShortageForSizeContainment.
78
        * rendering/RenderMultiColumnSet.h:
79
        * rendering/RenderObject.cpp:
80
        (WebCore::shouldApplySizeContainment): Check if the object is a size containment box.
81
        * rendering/RenderObject.h:
82
        (WebCore::RenderObject::isAtomicInlineLevelBox const):
83
        * rendering/RenderReplaced.cpp:
84
        (WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox const):
85
        (WebCore::RenderReplaced::computeIntrinsicRatioInformation const): Use the empty intrinsicSize.
86
        * rendering/RenderReplaced.h: The intrinsicSize of size containment is (0, 0).
87
        * rendering/RenderSlider.cpp:
88
        (WebCore::RenderSlider::computeIntrinsicLogicalWidths const): Ditto.
89
        * rendering/RenderTextControl.cpp:
90
        (WebCore::RenderTextControl::computeIntrinsicLogicalWidths const): Ditto.
91
        * rendering/RenderVideo.cpp:
92
        (WebCore::RenderVideo::calculateIntrinsicSize): Ditto.
93
        * rendering/style/RenderStyle.h:
94
        (WebCore::RenderStyle::containsSize const):
95
        * rendering/svg/RenderSVGRoot.cpp:
96
        (WebCore::RenderSVGRoot::computeIntrinsicRatioInformation const): Handled in RenderReplaced::computeIntrinsicRatioInformation instead.
97
1
2021-05-10  Wenson Hsieh  <wenson_hsieh@apple.com>
98
2021-05-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2
99
3
        [macOS] Allow immediate action gestures to begin when force clicking text inside image overlays
100
        [macOS] Allow immediate action gestures to begin when force clicking text inside image overlays
- a/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp -10 / +26 lines
Lines 580-586 Optional<LayoutUnit> GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild( a/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp_sec1
580
Optional<LayoutUnit> GridTrackSizingAlgorithm::gridAreaBreadthForChild(const RenderBox& child, GridTrackSizingDirection direction) const
580
Optional<LayoutUnit> GridTrackSizingAlgorithm::gridAreaBreadthForChild(const RenderBox& child, GridTrackSizingDirection direction) const
581
{
581
{
582
    bool addContentAlignmentOffset =
582
    bool addContentAlignmentOffset =
583
        direction == ForColumns && m_sizingState == RowSizingFirstIteration;
583
        direction == ForColumns && (m_sizingState == RowSizingFirstIteration || m_sizingState == RowSizingExtraIterationForSizeContainment);
584
    // To determine the column track's size based on an orthogonal grid item we need it's logical
584
    // To determine the column track's size based on an orthogonal grid item we need it's logical
585
    // height, which may depend on the row track's size. It's possible that the row tracks sizing
585
    // height, which may depend on the row track's size. It's possible that the row tracks sizing
586
    // logic has not been performed yet, so we will need to do an estimation.
586
    // logic has not been performed yet, so we will need to do an estimation.
Lines 736-744 void GridTrackSizingAlgorithm::computeGridContainerIntrinsicSizes() a/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp_sec2
736
736
737
    Vector<GridTrack>& allTracks = tracks(m_direction);
737
    Vector<GridTrack>& allTracks = tracks(m_direction);
738
    for (auto& track : allTracks) {
738
    for (auto& track : allTracks) {
739
        ASSERT(!track.infiniteGrowthPotential());
739
        ASSERT(m_strategy->isComputingSizeContainment() || !track.infiniteGrowthPotential());
740
        m_minContentSize += track.baseSize();
740
        m_minContentSize += track.baseSize();
741
        m_maxContentSize += track.growthLimit();
741
        m_maxContentSize += track.growthLimitIsInfinite() ? track.baseSize() : track.growthLimit();
742
        // The growth limit caps must be cleared now in order to properly sort
742
        // The growth limit caps must be cleared now in order to properly sort
743
        // tracks by growth potential on an eventual "Maximize Tracks".
743
        // tracks by growth potential on an eventual "Maximize Tracks".
744
        track.setGrowthLimitCap(WTF::nullopt);
744
        track.setGrowthLimitCap(WTF::nullopt);
Lines 932-937 private: a/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp_sec3
932
    double findUsedFlexFraction(Vector<unsigned>& flexibleSizedTracksIndex, GridTrackSizingDirection, Optional<LayoutUnit> freeSpace) const override;
932
    double findUsedFlexFraction(Vector<unsigned>& flexibleSizedTracksIndex, GridTrackSizingDirection, Optional<LayoutUnit> freeSpace) const override;
933
    bool recomputeUsedFlexFractionIfNeeded(double& flexFraction, LayoutUnit& totalGrowth) const override;
933
    bool recomputeUsedFlexFractionIfNeeded(double& flexFraction, LayoutUnit& totalGrowth) const override;
934
    LayoutUnit freeSpaceForStretchAutoTracksStep() const override;
934
    LayoutUnit freeSpaceForStretchAutoTracksStep() const override;
935
    bool isComputingSizeContainment() const override { return shouldApplySizeContainment(*renderGrid()); }
935
};
936
};
936
937
937
void IndefiniteSizeStrategy::layoutGridItemForMinSizeComputation(RenderBox& child, bool overrideSizeHasChanged) const
938
void IndefiniteSizeStrategy::layoutGridItemForMinSizeComputation(RenderBox& child, bool overrideSizeHasChanged) const
Lines 1030-1035 private: a/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp_sec4
1030
    LayoutUnit freeSpaceForStretchAutoTracksStep() const override;
1031
    LayoutUnit freeSpaceForStretchAutoTracksStep() const override;
1031
    LayoutUnit minContentForChild(RenderBox&) const override;
1032
    LayoutUnit minContentForChild(RenderBox&) const override;
1032
    LayoutUnit minLogicalSizeForChild(RenderBox&, const Length& childMinSize, Optional<LayoutUnit> availableSize) const override;
1033
    LayoutUnit minLogicalSizeForChild(RenderBox&, const Length& childMinSize, Optional<LayoutUnit> availableSize) const override;
1034
    bool isComputingSizeContainment() const override { return false; }
1033
};
1035
};
1034
1036
1035
LayoutUnit IndefiniteSizeStrategy::freeSpaceForStretchAutoTracksStep() const
1037
LayoutUnit IndefiniteSizeStrategy::freeSpaceForStretchAutoTracksStep() const
Lines 1146-1154 void GridTrackSizingAlgorithm::initializeTrackSizes() a/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp_sec5
1146
1148
1147
void GridTrackSizingAlgorithm::resolveIntrinsicTrackSizes()
1149
void GridTrackSizingAlgorithm::resolveIntrinsicTrackSizes()
1148
{
1150
{
1151
    Vector<GridTrack>& allTracks = tracks(m_direction);
1152
    auto handleInfinityGrowthLimit = [&]() {
1153
        for (auto trackIndex : m_contentSizedTracksIndex) {
1154
            GridTrack& track = allTracks[trackIndex];
1155
            if (track.growthLimit() == infinity)
1156
                track.setGrowthLimit(track.baseSize());
1157
        }
1158
    };
1159
1160
    if (m_strategy->isComputingSizeContainment()) {
1161
        handleInfinityGrowthLimit();
1162
        return;
1163
    }
1164
1149
    Vector<GridItemWithSpan> itemsSortedByIncreasingSpan;
1165
    Vector<GridItemWithSpan> itemsSortedByIncreasingSpan;
1150
    HashSet<RenderBox*> itemsSet;
1166
    HashSet<RenderBox*> itemsSet;
1151
    Vector<GridTrack>& allTracks = tracks(m_direction);
1152
    if (m_grid.hasGridItems()) {
1167
    if (m_grid.hasGridItems()) {
1153
        for (auto trackIndex : m_contentSizedTracksIndex) {
1168
        for (auto trackIndex : m_contentSizedTracksIndex) {
1154
            GridIterator iterator(m_grid, m_direction, trackIndex);
1169
            GridIterator iterator(m_grid, m_direction, trackIndex);
Lines 1178-1189 void GridTrackSizingAlgorithm::resolveIntrinsicTrackSizes() a/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp_sec6
1178
        increaseSizesToAccommodateSpanningItems<ResolveMaxContentMaximums>(spanGroupRange);
1193
        increaseSizesToAccommodateSpanningItems<ResolveMaxContentMaximums>(spanGroupRange);
1179
        it = spanGroupRange.rangeEnd;
1194
        it = spanGroupRange.rangeEnd;
1180
    }
1195
    }
1181
1196
    handleInfinityGrowthLimit();
1182
    for (auto trackIndex : m_contentSizedTracksIndex) {
1183
        GridTrack& track = allTracks[trackIndex];
1184
        if (track.growthLimit() == infinity)
1185
            track.setGrowthLimit(track.baseSize());
1186
    }
1187
}
1197
}
1188
1198
1189
void GridTrackSizingAlgorithm::stretchFlexibleTracks(Optional<LayoutUnit> freeSpace)
1199
void GridTrackSizingAlgorithm::stretchFlexibleTracks(Optional<LayoutUnit> freeSpace)
Lines 1239-1244 void GridTrackSizingAlgorithm::advanceNextState() a/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp_sec7
1239
        m_sizingState = RowSizingFirstIteration;
1249
        m_sizingState = RowSizingFirstIteration;
1240
        return;
1250
        return;
1241
    case RowSizingFirstIteration:
1251
    case RowSizingFirstIteration:
1252
        m_sizingState = m_strategy->isComputingSizeContainment() ? RowSizingExtraIterationForSizeContainment : ColumnSizingSecondIteration;
1253
        return;
1254
    case RowSizingExtraIterationForSizeContainment:
1242
        m_sizingState = ColumnSizingSecondIteration;
1255
        m_sizingState = ColumnSizingSecondIteration;
1243
        return;
1256
        return;
1244
    case ColumnSizingSecondIteration:
1257
    case ColumnSizingSecondIteration:
Lines 1259-1264 bool GridTrackSizingAlgorithm::isValidTransition() const a/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp_sec8
1259
    case ColumnSizingSecondIteration:
1272
    case ColumnSizingSecondIteration:
1260
        return m_direction == ForColumns;
1273
        return m_direction == ForColumns;
1261
    case RowSizingFirstIteration:
1274
    case RowSizingFirstIteration:
1275
    case RowSizingExtraIterationForSizeContainment:
1262
    case RowSizingSecondIteration:
1276
    case RowSizingSecondIteration:
1263
        return m_direction == ForRows;
1277
        return m_direction == ForRows;
1264
    }
1278
    }
Lines 1346-1351 void GridTrackSizingAlgorithm::run() a/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp_sec9
1346
1360
1347
    // Step 3.
1361
    // Step 3.
1348
    m_strategy->maximizeTracks(tracks(m_direction), m_direction == ForColumns ? m_freeSpaceColumns : m_freeSpaceRows);
1362
    m_strategy->maximizeTracks(tracks(m_direction), m_direction == ForColumns ? m_freeSpaceColumns : m_freeSpaceRows);
1363
    if (m_strategy->isComputingSizeContainment())
1364
        return;
1349
1365
1350
    // Step 4.
1366
    // Step 4.
1351
    stretchFlexibleTracks(initialFreeSpace);
1367
    stretchFlexibleTracks(initialFreeSpace);
- a/Source/WebCore/rendering/GridTrackSizingAlgorithm.h +2 lines
Lines 224-229 private: a/Source/WebCore/rendering/GridTrackSizingAlgorithm.h_sec1
224
    enum SizingState {
224
    enum SizingState {
225
        ColumnSizingFirstIteration,
225
        ColumnSizingFirstIteration,
226
        RowSizingFirstIteration,
226
        RowSizingFirstIteration,
227
        RowSizingExtraIterationForSizeContainment,
227
        ColumnSizingSecondIteration,
228
        ColumnSizingSecondIteration,
228
        RowSizingSecondIteration
229
        RowSizingSecondIteration
229
    };
230
    };
Lines 261-266 public: a/Source/WebCore/rendering/GridTrackSizingAlgorithm.h_sec2
261
    virtual double findUsedFlexFraction(Vector<unsigned>& flexibleSizedTracksIndex, GridTrackSizingDirection, Optional<LayoutUnit> initialFreeSpace) const = 0;
262
    virtual double findUsedFlexFraction(Vector<unsigned>& flexibleSizedTracksIndex, GridTrackSizingDirection, Optional<LayoutUnit> initialFreeSpace) const = 0;
262
    virtual bool recomputeUsedFlexFractionIfNeeded(double& flexFraction, LayoutUnit& totalGrowth) const = 0;
263
    virtual bool recomputeUsedFlexFractionIfNeeded(double& flexFraction, LayoutUnit& totalGrowth) const = 0;
263
    virtual LayoutUnit freeSpaceForStretchAutoTracksStep() const = 0;
264
    virtual LayoutUnit freeSpaceForStretchAutoTracksStep() const = 0;
265
    virtual bool isComputingSizeContainment() const = 0;
264
266
265
protected:
267
protected:
266
    GridTrackSizingAlgorithmStrategy(GridTrackSizingAlgorithm& algorithm)
268
    GridTrackSizingAlgorithmStrategy(GridTrackSizingAlgorithm& algorithm)
- a/Source/WebCore/rendering/RenderBlock.cpp -2 / +5 lines
Lines 1073-1078 void RenderBlock::layoutPositionedObject(RenderBox& r, bool relayoutChildren, bo a/Source/WebCore/rendering/RenderBlock.cpp_sec1
1073
        r.setNeedsLayout(MarkOnlyThis);
1073
        r.setNeedsLayout(MarkOnlyThis);
1074
        r.layoutIfNeeded();
1074
        r.layoutIfNeeded();
1075
    }
1075
    }
1076
    
1077
    if (view().frameView().layoutContext().layoutState()->isPaginated() && is<RenderBlockFlow>(*this))
1078
        downcast<RenderBlockFlow>(*this).adjustSizeContainmentChildForPagination(r, r.logicalTop());
1076
}
1079
}
1077
1080
1078
void RenderBlock::layoutPositionedObjects(bool relayoutChildren, bool fixedPositionObjectsOnly)
1081
void RenderBlock::layoutPositionedObjects(bool relayoutChildren, bool fixedPositionObjectsOnly)
Lines 2282-2289 void RenderBlock::offsetForContents(LayoutPoint& offset) const a/Source/WebCore/rendering/RenderBlock.cpp_sec2
2282
void RenderBlock::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
2285
void RenderBlock::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
2283
{
2286
{
2284
    ASSERT(!childrenInline());
2287
    ASSERT(!childrenInline());
2285
    
2288
    if (!shouldApplySizeContainment(*this))
2286
    computeBlockPreferredLogicalWidths(minLogicalWidth, maxLogicalWidth);
2289
        computeBlockPreferredLogicalWidths(minLogicalWidth, maxLogicalWidth);
2287
2290
2288
    maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth);
2291
    maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth);
2289
2292
- a/Source/WebCore/rendering/RenderBlockFlow.cpp -4 / +27 lines
Lines 339-348 void RenderBlockFlow::adjustIntrinsicLogicalWidthsForColumns(LayoutUnit& minLogi a/Source/WebCore/rendering/RenderBlockFlow.cpp_sec1
339
339
340
void RenderBlockFlow::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
340
void RenderBlockFlow::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
341
{
341
{
342
    if (childrenInline())
342
    if (!shouldApplySizeContainment(*this)) {
343
        computeInlinePreferredLogicalWidths(minLogicalWidth, maxLogicalWidth);
343
        if (childrenInline())
344
    else
344
            computeInlinePreferredLogicalWidths(minLogicalWidth, maxLogicalWidth);
345
        computeBlockPreferredLogicalWidths(minLogicalWidth, maxLogicalWidth);
345
        else
346
            computeBlockPreferredLogicalWidths(minLogicalWidth, maxLogicalWidth);
347
    }
346
348
347
    maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth);
349
    maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth);
348
350
Lines 1662-1667 LayoutUnit RenderBlockFlow::adjustBlockChildForPagination(LayoutUnit logicalTopA a/Source/WebCore/rendering/RenderBlockFlow.cpp_sec2
1662
        }
1664
        }
1663
    }
1665
    }
1664
1666
1667
    if (shouldApplySizeContainment(child))
1668
        adjustSizeContainmentChildForPagination(child, result);
1669
1665
    // For replaced elements and scrolled elements, we want to shift them to the next page if they don't fit on the current one.
1670
    // For replaced elements and scrolled elements, we want to shift them to the next page if they don't fit on the current one.
1666
    LayoutUnit logicalTopBeforeUnsplittableAdjustment = result;
1671
    LayoutUnit logicalTopBeforeUnsplittableAdjustment = result;
1667
    LayoutUnit logicalTopAfterUnsplittableAdjustment = adjustForUnsplittableChild(child, result);
1672
    LayoutUnit logicalTopAfterUnsplittableAdjustment = adjustForUnsplittableChild(child, result);
Lines 2047-2052 LayoutUnit RenderBlockFlow::logicalHeightForChildForFragmentation(const RenderBo a/Source/WebCore/rendering/RenderBlockFlow.cpp_sec3
2047
    return logicalHeightForChild(child);
2052
    return logicalHeightForChild(child);
2048
}
2053
}
2049
2054
2055
void RenderBlockFlow::adjustSizeContainmentChildForPagination(RenderBox& child, LayoutUnit offset)
2056
{
2057
    if (!shouldApplySizeContainment(child))
2058
        return;
2059
2060
    LayoutUnit childOverflowHeight = child.isHorizontalWritingMode() ? child.layoutOverflowRect().maxY() : child.layoutOverflowRect().maxX();
2061
    LayoutUnit childLogicalHeight = std::max(child.logicalHeight(), childOverflowHeight);
2062
2063
    LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(offset, ExcludePageBoundary);
2064
2065
    LayoutUnit spaceShortage = childLogicalHeight - remainingLogicalHeight;
2066
    if (spaceShortage <= 0)
2067
        return;
2068
2069
    if (RenderFragmentedFlow* fragmentedFlow = enclosingFragmentedFlow())
2070
        fragmentedFlow->updateSpaceShortageForSizeContainment(this, offsetFromLogicalTopOfFirstPage() + offset, spaceShortage);
2071
}
2072
2050
void RenderBlockFlow::layoutLineGridBox()
2073
void RenderBlockFlow::layoutLineGridBox()
2051
{
2074
{
2052
    if (style().lineGrid() == RenderStyle::initialLineGrid()) {
2075
    if (style().lineGrid() == RenderStyle::initialLineGrid()) {
- a/Source/WebCore/rendering/RenderBlockFlow.h +2 lines
Lines 398-403 public: a/Source/WebCore/rendering/RenderBlockFlow.h_sec1
398
    // column balancer to help set a good minimum column height.
398
    // column balancer to help set a good minimum column height.
399
    void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight);
399
    void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight);
400
400
401
    void adjustSizeContainmentChildForPagination(RenderBox& child, LayoutUnit offset);
402
401
    void addFloatsToNewParent(RenderBlockFlow& toBlockFlow) const;
403
    void addFloatsToNewParent(RenderBlockFlow& toBlockFlow) const;
402
    
404
    
403
    LayoutUnit endPaddingWidthForCaret() const;
405
    LayoutUnit endPaddingWidthForCaret() const;
- a/Source/WebCore/rendering/RenderBox.cpp -1 / +10 lines
Lines 2860-2865 void RenderBox::cacheIntrinsicContentLogicalHeightForFlexItem(LayoutUnit height) a/Source/WebCore/rendering/RenderBox.cpp_sec1
2860
2860
2861
void RenderBox::updateLogicalHeight()
2861
void RenderBox::updateLogicalHeight()
2862
{
2862
{
2863
    if (shouldApplySizeContainment(*this) && !isRenderGrid()) {
2864
        // We need the exact width of border and padding here, yet we can't use borderAndPadding* interfaces.
2865
        // Because these interfaces evetually call borderAfter/Before, and RenderBlock::borderBefore
2866
        // adds extra border to fieldset by adding intrinsicBorderForFieldset which is not needed here.
2867
        auto borderAndPadding = RenderBox::borderBefore() + RenderBox::paddingBefore() + RenderBox::borderAfter() + RenderBox::paddingAfter();
2868
        setLogicalHeight(borderAndPadding + scrollbarLogicalHeight());
2869
    }
2870
2863
    cacheIntrinsicContentLogicalHeightForFlexItem(contentLogicalHeight());
2871
    cacheIntrinsicContentLogicalHeightForFlexItem(contentLogicalHeight());
2864
    auto computedValues = computeLogicalHeight(logicalHeight(), logicalTop());
2872
    auto computedValues = computeLogicalHeight(logicalHeight(), logicalTop());
2865
    setLogicalHeight(computedValues.m_extent);
2873
    setLogicalHeight(computedValues.m_extent);
Lines 4857-4863 bool RenderBox::isUnsplittableForPagination() const a/Source/WebCore/rendering/RenderBox.cpp_sec2
4857
    return isReplaced()
4865
    return isReplaced()
4858
        || hasUnsplittableScrollingOverflow()
4866
        || hasUnsplittableScrollingOverflow()
4859
        || (parent() && isWritingModeRoot())
4867
        || (parent() && isWritingModeRoot())
4860
        || (isFloating() && style().styleType() == PseudoId::FirstLetter && style().initialLetterDrop() > 0);
4868
        || (isFloating() && style().styleType() == PseudoId::FirstLetter && style().initialLetterDrop() > 0)
4869
        || shouldApplySizeContainment(*this);
4861
}
4870
}
4862
4871
4863
LayoutUnit RenderBox::lineHeight(bool /*firstLine*/, LineDirectionMode direction, LinePositionMode /*linePositionMode*/) const
4872
LayoutUnit RenderBox::lineHeight(bool /*firstLine*/, LineDirectionMode direction, LinePositionMode /*linePositionMode*/) const
- a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp -4 / +12 lines
Lines 187-192 void RenderDeprecatedFlexibleBox::styleWillChange(StyleDifference diff, const Re a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp_sec1
187
187
188
void RenderDeprecatedFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
188
void RenderDeprecatedFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
189
{
189
{
190
    auto addScrollbarWidth = [&]() {
191
        LayoutUnit scrollbarWidth = intrinsicScrollbarLogicalWidth();
192
        maxLogicalWidth += scrollbarWidth;
193
        minLogicalWidth += scrollbarWidth;
194
    };
195
196
    if (shouldApplySizeContainment(*this)) {
197
        addScrollbarWidth();
198
        return;
199
    }
200
190
    if (hasMultipleLines() || isVertical()) {
201
    if (hasMultipleLines() || isVertical()) {
191
        for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
202
        for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
192
            if (childDoesNotAffectWidthOrFlexing(child))
203
            if (childDoesNotAffectWidthOrFlexing(child))
Lines 211-220 void RenderDeprecatedFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minL a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp_sec2
211
    }
222
    }
212
223
213
    maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth);
224
    maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth);
214
225
    addScrollbarWidth();
215
    LayoutUnit scrollbarWidth = intrinsicScrollbarLogicalWidth();
216
    maxLogicalWidth += scrollbarWidth;
217
    minLogicalWidth += scrollbarWidth;
218
}
226
}
219
227
220
void RenderDeprecatedFlexibleBox::computePreferredLogicalWidths()
228
void RenderDeprecatedFlexibleBox::computePreferredLogicalWidths()
- a/Source/WebCore/rendering/RenderFileUploadControl.cpp +2 lines
Lines 197-202 void RenderFileUploadControl::paintObject(PaintInfo& paintInfo, const LayoutPoin a/Source/WebCore/rendering/RenderFileUploadControl.cpp_sec1
197
197
198
void RenderFileUploadControl::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
198
void RenderFileUploadControl::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
199
{
199
{
200
    if (shouldApplySizeContainment(*this))
201
        return;
200
    // Figure out how big the filename space needs to be for a given number of characters
202
    // Figure out how big the filename space needs to be for a given number of characters
201
    // (using "0" as the nominal character).
203
    // (using "0" as the nominal character).
202
    const UChar character = '0';
204
    const UChar character = '0';
- a/Source/WebCore/rendering/RenderFlexibleBox.cpp -5 / +14 lines
Lines 83-88 const char* RenderFlexibleBox::renderName() const a/Source/WebCore/rendering/RenderFlexibleBox.cpp_sec1
83
83
84
void RenderFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
84
void RenderFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
85
{
85
{
86
    auto addScrollbarWidth = [&]() {
87
        LayoutUnit scrollbarWidth(scrollbarLogicalWidth());
88
        maxLogicalWidth += scrollbarWidth;
89
        minLogicalWidth += scrollbarWidth;
90
    };
91
92
    if (shouldApplySizeContainment(*this)) {
93
        addScrollbarWidth();
94
        return;
95
    }
96
86
    LayoutUnit childMinWidth;
97
    LayoutUnit childMinWidth;
87
    LayoutUnit childMaxWidth;
98
    LayoutUnit childMaxWidth;
88
    bool hadExcludedChildren = computePreferredWidthsForExcludedChildren(childMinWidth, childMaxWidth);
99
    bool hadExcludedChildren = computePreferredWidthsForExcludedChildren(childMinWidth, childMaxWidth);
Lines 98-108 void RenderFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidt a/Source/WebCore/rendering/RenderFlexibleBox.cpp_sec2
98
        ++numItemsWithNormalLayout;
109
        ++numItemsWithNormalLayout;
99
110
100
        LayoutUnit margin = marginIntrinsicLogicalWidthForChild(*child);
111
        LayoutUnit margin = marginIntrinsicLogicalWidthForChild(*child);
101
        
112
102
        LayoutUnit minPreferredLogicalWidth;
113
        LayoutUnit minPreferredLogicalWidth;
103
        LayoutUnit maxPreferredLogicalWidth;
114
        LayoutUnit maxPreferredLogicalWidth;
104
        computeChildPreferredLogicalWidths(*child, minPreferredLogicalWidth, maxPreferredLogicalWidth);
115
        computeChildPreferredLogicalWidths(*child, minPreferredLogicalWidth, maxPreferredLogicalWidth);
105
        
116
106
        minPreferredLogicalWidth += margin;
117
        minPreferredLogicalWidth += margin;
107
        maxPreferredLogicalWidth += margin;
118
        maxPreferredLogicalWidth += margin;
108
119
Lines 139-147 void RenderFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidt a/Source/WebCore/rendering/RenderFlexibleBox.cpp_sec3
139
        maxLogicalWidth = std::max(maxLogicalWidth, childMaxWidth);
150
        maxLogicalWidth = std::max(maxLogicalWidth, childMaxWidth);
140
    }
151
    }
141
152
142
    LayoutUnit scrollbarWidth(scrollbarLogicalWidth());
153
    addScrollbarWidth();
143
    maxLogicalWidth += scrollbarWidth;
144
    minLogicalWidth += scrollbarWidth;
145
}
154
}
146
155
147
LayoutUnit RenderFlexibleBox::baselinePosition(FontBaseline, bool, LineDirectionMode direction, LinePositionMode) const
156
LayoutUnit RenderFlexibleBox::baselinePosition(FontBaseline, bool, LineDirectionMode direction, LinePositionMode) const
- a/Source/WebCore/rendering/RenderFragmentedFlow.h +2 lines
Lines 102-107 public: a/Source/WebCore/rendering/RenderFragmentedFlow.h_sec1
102
    virtual void setPageBreak(const RenderBlock*, LayoutUnit /*offset*/, LayoutUnit /*spaceShortage*/) { }
102
    virtual void setPageBreak(const RenderBlock*, LayoutUnit /*offset*/, LayoutUnit /*spaceShortage*/) { }
103
    virtual void updateMinimumPageHeight(const RenderBlock*, LayoutUnit /*offset*/, LayoutUnit /*minHeight*/) { }
103
    virtual void updateMinimumPageHeight(const RenderBlock*, LayoutUnit /*offset*/, LayoutUnit /*minHeight*/) { }
104
104
105
    virtual void updateSpaceShortageForSizeContainment(const RenderBlock*, LayoutUnit /*offset*/, LayoutUnit /*shortage*/) { }
106
105
    virtual RenderFragmentContainer* fragmentAtBlockOffset(const RenderBox*, LayoutUnit, bool extendLastFragment = false) const;
107
    virtual RenderFragmentContainer* fragmentAtBlockOffset(const RenderBox*, LayoutUnit, bool extendLastFragment = false) const;
106
108
107
    bool fragmentsHaveUniformLogicalWidth() const { return m_fragmentsHaveUniformLogicalWidth; }
109
    bool fragmentsHaveUniformLogicalWidth() const { return m_fragmentsHaveUniformLogicalWidth; }
- a/Source/WebCore/rendering/RenderGrid.cpp -3 / +9 lines
Lines 250-260 void RenderGrid::layoutBlock(bool relayoutChildren, LayoutUnit) a/Source/WebCore/rendering/RenderGrid.cpp_sec1
250
250
251
        // 2- Next, the track sizing algorithm resolves the sizes of the grid rows,
251
        // 2- Next, the track sizing algorithm resolves the sizes of the grid rows,
252
        // using the grid column sizes calculated in the previous step.
252
        // using the grid column sizes calculated in the previous step.
253
        if (!hasDefiniteLogicalHeight)
253
        bool shouldRecomputeHeight = false;
254
        if (!hasDefiniteLogicalHeight) {
254
            computeTrackSizesForIndefiniteSize(m_trackSizingAlgorithm, ForRows);
255
            computeTrackSizesForIndefiniteSize(m_trackSizingAlgorithm, ForRows);
255
        else
256
            if (shouldApplySizeContainment(*this))
257
                shouldRecomputeHeight = true;
258
        } else
256
            computeTrackSizesForDefiniteSize(ForRows, availableLogicalHeight(ExcludeMarginBorderPadding));
259
            computeTrackSizesForDefiniteSize(ForRows, availableLogicalHeight(ExcludeMarginBorderPadding));
257
        LayoutUnit trackBasedLogicalHeight = m_trackSizingAlgorithm.computeTrackBasedSize() + borderAndPaddingLogicalHeight() + scrollbarLogicalHeight();
260
        LayoutUnit trackBasedLogicalHeight = m_trackSizingAlgorithm.computeTrackBasedSize() + borderAndPaddingLogicalHeight() + scrollbarLogicalHeight();
261
        if (shouldRecomputeHeight)
262
            computeTrackSizesForDefiniteSize(ForRows, trackBasedLogicalHeight);
263
258
        setLogicalHeight(trackBasedLogicalHeight);
264
        setLogicalHeight(trackBasedLogicalHeight);
259
265
260
        LayoutUnit oldClientAfterEdge = clientLogicalBottom();
266
        LayoutUnit oldClientAfterEdge = clientLogicalBottom();
Lines 548-554 std::unique_ptr<OrderedTrackIndexSet> RenderGrid::computeEmptyTracksForAutoRepea a/Source/WebCore/rendering/RenderGrid.cpp_sec2
548
    unsigned firstAutoRepeatTrack = insertionPoint + grid.explicitGridStart(direction);
554
    unsigned firstAutoRepeatTrack = insertionPoint + grid.explicitGridStart(direction);
549
    unsigned lastAutoRepeatTrack = firstAutoRepeatTrack + grid.autoRepeatTracks(direction);
555
    unsigned lastAutoRepeatTrack = firstAutoRepeatTrack + grid.autoRepeatTracks(direction);
550
556
551
    if (!grid.hasGridItems()) {
557
    if (!grid.hasGridItems() || shouldApplySizeContainment(*this)) {
552
        emptyTrackIndexes = makeUnique<OrderedTrackIndexSet>();
558
        emptyTrackIndexes = makeUnique<OrderedTrackIndexSet>();
553
        for (unsigned trackIndex = firstAutoRepeatTrack; trackIndex < lastAutoRepeatTrack; ++trackIndex)
559
        for (unsigned trackIndex = firstAutoRepeatTrack; trackIndex < lastAutoRepeatTrack; ++trackIndex)
554
            emptyTrackIndexes->add(trackIndex);
560
            emptyTrackIndexes->add(trackIndex);
- a/Source/WebCore/rendering/RenderImage.cpp +1 lines
Lines 850-855 bool RenderImage::canMapWidthHeightToAspectRatio() const a/Source/WebCore/rendering/RenderImage.cpp_sec1
850
850
851
void RenderImage::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio) const
851
void RenderImage::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio) const
852
{
852
{
853
    ASSERT(!shouldApplySizeContainment(*this));
853
    RenderReplaced::computeIntrinsicRatioInformation(intrinsicSize, intrinsicRatio);
854
    RenderReplaced::computeIntrinsicRatioInformation(intrinsicSize, intrinsicRatio);
854
855
855
    // Our intrinsicSize is empty if we're rendering generated images with relative width/height. Figure out the right intrinsic size to use.
856
    // Our intrinsicSize is empty if we're rendering generated images with relative width/height. Figure out the right intrinsic size to use.
- a/Source/WebCore/rendering/RenderListBox.cpp -1 / +1 lines
Lines 211-217 void RenderListBox::scrollToRevealSelection() a/Source/WebCore/rendering/RenderListBox.cpp_sec1
211
211
212
void RenderListBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
212
void RenderListBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
213
{
213
{
214
    maxLogicalWidth = m_optionsWidth + 2 * optionsSpacingHorizontal;
214
    maxLogicalWidth = shouldApplySizeContainment(*this) ? 2 * optionsSpacingHorizontal : m_optionsWidth + 2 * optionsSpacingHorizontal;
215
    if (m_vBar)
215
    if (m_vBar)
216
        maxLogicalWidth += m_vBar->width();
216
        maxLogicalWidth += m_vBar->width();
217
    if (!style().width().isPercentOrCalculated())
217
    if (!style().width().isPercentOrCalculated())
- a/Source/WebCore/rendering/RenderMenuList.cpp -1 / +2 lines
Lines 315-321 LayoutRect RenderMenuList::controlClipRect(const LayoutPoint& additionalOffset) a/Source/WebCore/rendering/RenderMenuList.cpp_sec1
315
315
316
void RenderMenuList::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
316
void RenderMenuList::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
317
{
317
{
318
    maxLogicalWidth = std::max(m_optionsWidth, theme().minimumMenuListSize(style())) + m_innerBlock->paddingLeft() + m_innerBlock->paddingRight();
318
    maxLogicalWidth = shouldApplySizeContainment(*this) ? theme().minimumMenuListSize(style()) : std::max(m_optionsWidth, theme().minimumMenuListSize(style()));
319
    maxLogicalWidth += m_innerBlock->paddingLeft() + m_innerBlock->paddingRight();
319
    if (!style().width().isPercentOrCalculated())
320
    if (!style().width().isPercentOrCalculated())
320
        minLogicalWidth = maxLogicalWidth;
321
        minLogicalWidth = maxLogicalWidth;
321
}
322
}
- a/Source/WebCore/rendering/RenderMultiColumnFlow.cpp +6 lines
Lines 203-208 void RenderMultiColumnFlow::updateMinimumPageHeight(const RenderBlock* block, La a/Source/WebCore/rendering/RenderMultiColumnFlow.cpp_sec1
203
        multicolSet->updateMinimumColumnHeight(minHeight);
203
        multicolSet->updateMinimumColumnHeight(minHeight);
204
}
204
}
205
205
206
void RenderMultiColumnFlow::updateSpaceShortageForSizeContainment(const RenderBlock* block, LayoutUnit offset, LayoutUnit shortage)
207
{
208
    if (auto* multicolSet = downcast<RenderMultiColumnSet>(fragmentAtBlockOffset(block, offset)))
209
        multicolSet->updateSpaceShortageForSizeContainment(shortage);
210
}
211
206
RenderFragmentContainer* RenderMultiColumnFlow::fragmentAtBlockOffset(const RenderBox* box, LayoutUnit offset, bool extendLastFragment) const
212
RenderFragmentContainer* RenderMultiColumnFlow::fragmentAtBlockOffset(const RenderBox* box, LayoutUnit offset, bool extendLastFragment) const
207
{
213
{
208
    if (!m_inLayout)
214
    if (!m_inLayout)
- a/Source/WebCore/rendering/RenderMultiColumnFlow.h +1 lines
Lines 108-113 private: a/Source/WebCore/rendering/RenderMultiColumnFlow.h_sec1
108
    LayoutUnit initialLogicalWidth() const override;
108
    LayoutUnit initialLogicalWidth() const override;
109
    void setPageBreak(const RenderBlock*, LayoutUnit offset, LayoutUnit spaceShortage) override;
109
    void setPageBreak(const RenderBlock*, LayoutUnit offset, LayoutUnit spaceShortage) override;
110
    void updateMinimumPageHeight(const RenderBlock*, LayoutUnit offset, LayoutUnit minHeight) override;
110
    void updateMinimumPageHeight(const RenderBlock*, LayoutUnit offset, LayoutUnit minHeight) override;
111
    void updateSpaceShortageForSizeContainment(const RenderBlock*, LayoutUnit offset, LayoutUnit shortage) override;
111
    RenderFragmentContainer* fragmentAtBlockOffset(const RenderBox*, LayoutUnit, bool extendLastFragment = false) const override;
112
    RenderFragmentContainer* fragmentAtBlockOffset(const RenderBox*, LayoutUnit, bool extendLastFragment = false) const override;
112
    void setFragmentRangeForBox(const RenderBox&, RenderFragmentContainer*, RenderFragmentContainer*) override;
113
    void setFragmentRangeForBox(const RenderBox&, RenderFragmentContainer*, RenderFragmentContainer*) override;
113
    bool addForcedFragmentBreak(const RenderBlock*, LayoutUnit, RenderBox* breakChild, bool isBefore, LayoutUnit* offsetBreakAdjustment = 0) override;
114
    bool addForcedFragmentBreak(const RenderBlock*, LayoutUnit, RenderBox* breakChild, bool isBefore, LayoutUnit* offsetBreakAdjustment = 0) override;
- a/Source/WebCore/rendering/RenderMultiColumnSet.cpp -4 / +9 lines
Lines 50-55 RenderMultiColumnSet::RenderMultiColumnSet(RenderFragmentedFlow& fragmentedFlow, a/Source/WebCore/rendering/RenderMultiColumnSet.cpp_sec1
50
    , m_maxColumnHeight(RenderFragmentedFlow::maxLogicalHeight())
50
    , m_maxColumnHeight(RenderFragmentedFlow::maxLogicalHeight())
51
    , m_minSpaceShortage(RenderFragmentedFlow::maxLogicalHeight())
51
    , m_minSpaceShortage(RenderFragmentedFlow::maxLogicalHeight())
52
    , m_minimumColumnHeight(0)
52
    , m_minimumColumnHeight(0)
53
    , m_spaceShortageForSizeContainment(0)
53
{
54
{
54
}
55
}
55
56
Lines 235-249 LayoutUnit RenderMultiColumnSet::calculateBalancedHeight(bool initial) const a/Source/WebCore/rendering/RenderMultiColumnSet.cpp_sec2
235
        return std::max<LayoutUnit>(m_contentRuns[index].columnLogicalHeight(startOffset), m_minimumColumnHeight);
236
        return std::max<LayoutUnit>(m_contentRuns[index].columnLogicalHeight(startOffset), m_minimumColumnHeight);
236
    }
237
    }
237
238
239
    LayoutUnit sizeContainmentShortage = std::max<LayoutUnit>(LayoutUnit(), m_spaceShortageForSizeContainment);
238
    if (columnCount() <= computedColumnCount()) {
240
    if (columnCount() <= computedColumnCount()) {
239
        // With the current column height, the content fits without creating overflowing columns. We're done.
241
        // With the current column height, the content fits without creating overflowing columns. We're done.
240
        return m_computedColumnHeight;
242
        return m_computedColumnHeight + sizeContainmentShortage;
241
    }
243
    }
242
244
243
    if (forcedBreaksCount() >= computedColumnCount()) {
245
    if (forcedBreaksCount() >= computedColumnCount()) {
244
        // Too many forced breaks to allow any implicit breaks. Initial balancing should already
246
        // Too many forced breaks to allow any implicit breaks. Initial balancing should already
245
        // have set a good height. There's nothing more we should do.
247
        // have set a good height. There's nothing more we should do.
246
        return m_computedColumnHeight;
248
        return m_computedColumnHeight + sizeContainmentShortage;
247
    }
249
    }
248
250
249
    // If the initial guessed column height wasn't enough, stretch it now. Stretch by the lowest
251
    // If the initial guessed column height wasn't enough, stretch it now. Stretch by the lowest
Lines 252-260 LayoutUnit RenderMultiColumnSet::calculateBalancedHeight(bool initial) const a/Source/WebCore/rendering/RenderMultiColumnSet.cpp_sec3
252
    ASSERT(m_minSpaceShortage > 0); // We should never _shrink_ the height!
254
    ASSERT(m_minSpaceShortage > 0); // We should never _shrink_ the height!
253
    // ASSERT(m_minSpaceShortage != RenderFragmentedFlow::maxLogicalHeight()); // If this happens, we probably have a bug.
255
    // ASSERT(m_minSpaceShortage != RenderFragmentedFlow::maxLogicalHeight()); // If this happens, we probably have a bug.
254
    if (m_minSpaceShortage == RenderFragmentedFlow::maxLogicalHeight())
256
    if (m_minSpaceShortage == RenderFragmentedFlow::maxLogicalHeight())
255
        return m_computedColumnHeight; // So bail out rather than looping infinitely.
257
        return m_computedColumnHeight + sizeContainmentShortage; // So bail out rather than looping infinitely.
256
258
257
    return m_computedColumnHeight + m_minSpaceShortage;
259
    auto toAdd = std::max<LayoutUnit>(sizeContainmentShortage, m_minSpaceShortage);
260
    return m_computedColumnHeight + toAdd;
258
}
261
}
259
262
260
void RenderMultiColumnSet::clearForcedBreaks()
263
void RenderMultiColumnSet::clearForcedBreaks()
Lines 365-370 void RenderMultiColumnSet::prepareForLayout(bool initial) a/Source/WebCore/rendering/RenderMultiColumnSet.cpp_sec4
365
    // Nuke previously stored minimum column height. Contents may have changed for all we know.
368
    // Nuke previously stored minimum column height. Contents may have changed for all we know.
366
    m_minimumColumnHeight = 0;
369
    m_minimumColumnHeight = 0;
367
370
371
    m_spaceShortageForSizeContainment = 0;
372
368
    // Start with "infinite" flow thread portion height until height is known.
373
    // Start with "infinite" flow thread portion height until height is known.
369
    setLogicalBottomInFragmentedFlow(RenderFragmentedFlow::maxLogicalHeight());
374
    setLogicalBottomInFragmentedFlow(RenderFragmentedFlow::maxLogicalHeight());
370
375
- a/Source/WebCore/rendering/RenderMultiColumnSet.h +10 lines
Lines 83-88 public: a/Source/WebCore/rendering/RenderMultiColumnSet.h_sec1
83
    void updateMinimumColumnHeight(LayoutUnit height) { m_minimumColumnHeight = std::max(height, m_minimumColumnHeight); }
83
    void updateMinimumColumnHeight(LayoutUnit height) { m_minimumColumnHeight = std::max(height, m_minimumColumnHeight); }
84
    LayoutUnit minimumColumnHeight() const { return m_minimumColumnHeight; }
84
    LayoutUnit minimumColumnHeight() const { return m_minimumColumnHeight; }
85
85
86
    void updateSpaceShortageForSizeContainment(LayoutUnit shortage)
87
    {
88
        if (m_spaceShortageForSizeContainment <= 0) {
89
            m_spaceShortageForSizeContainment = shortage;
90
            return;
91
        }
92
        m_spaceShortageForSizeContainment = std::min(shortage, m_spaceShortageForSizeContainment);
93
    }
94
86
    unsigned forcedBreaksCount() const { return m_contentRuns.size(); }
95
    unsigned forcedBreaksCount() const { return m_contentRuns.size(); }
87
    void clearForcedBreaks();
96
    void clearForcedBreaks();
88
    void addForcedBreak(LayoutUnit offsetFromFirstPage);
97
    void addForcedBreak(LayoutUnit offsetFromFirstPage);
Lines 198-203 private: a/Source/WebCore/rendering/RenderMultiColumnSet.h_sec2
198
    LayoutUnit m_maxColumnHeight; // Maximum column height allowed.
207
    LayoutUnit m_maxColumnHeight; // Maximum column height allowed.
199
    LayoutUnit m_minSpaceShortage; // The smallest amout of space shortage that caused a column break.
208
    LayoutUnit m_minSpaceShortage; // The smallest amout of space shortage that caused a column break.
200
    LayoutUnit m_minimumColumnHeight;
209
    LayoutUnit m_minimumColumnHeight;
210
    LayoutUnit m_spaceShortageForSizeContainment; // The shortage space that keeps size containment monolithic.
201
211
202
    // A run of content without explicit (forced) breaks; i.e. a flow thread portion between two
212
    // A run of content without explicit (forced) breaks; i.e. a flow thread portion between two
203
    // explicit breaks, between flow thread start and an explicit break, between an explicit break
213
    // explicit breaks, between flow thread start and an explicit break, between an explicit break
- a/Source/WebCore/rendering/RenderObject.cpp +5 lines
Lines 2498-2500 bool WebCore::shouldApplyLayoutContainment(const WebCore::RenderObject& renderer a/Source/WebCore/rendering/RenderObject.cpp_sec1
2498
{
2498
{
2499
    return renderer.style().containsLayout() && (!renderer.isInline() || renderer.isAtomicInlineLevelBox()) && !renderer.isRubyText() && (!renderer.isTablePart() || renderer.isRenderBlockFlow());
2499
    return renderer.style().containsLayout() && (!renderer.isInline() || renderer.isAtomicInlineLevelBox()) && !renderer.isRubyText() && (!renderer.isTablePart() || renderer.isRenderBlockFlow());
2500
}
2500
}
2501
2502
bool WebCore::shouldApplySizeContainment(const WebCore::RenderObject& renderer)
2503
{
2504
    return renderer.style().containsSize() && (!renderer.isInline() || renderer.isAtomicInlineLevelBox()) && !renderer.isRubyText() && (!renderer.isTablePart() || renderer.isTableCaption()) && !renderer.isTable();
2505
}
- a/Source/WebCore/rendering/RenderObject.h -2 / +3 lines
Lines 201-207 public: a/Source/WebCore/rendering/RenderObject.h_sec1
201
    bool isRenderInline() const;
201
    bool isRenderInline() const;
202
    bool isRenderLayerModelObject() const;
202
    bool isRenderLayerModelObject() const;
203
203
204
    inline bool isAtomicInlineLevelBox() const;
204
    bool isAtomicInlineLevelBox() const;
205
205
206
    virtual bool isCounter() const { return false; }
206
    virtual bool isCounter() const { return false; }
207
    virtual bool isQuote() const { return false; }
207
    virtual bool isQuote() const { return false; }
Lines 1173-1179 inline RenderObject* RenderObject::nextInFlowSibling() const a/Source/WebCore/rendering/RenderObject.h_sec2
1173
    return nextSibling;
1173
    return nextSibling;
1174
}
1174
}
1175
1175
1176
bool RenderObject::isAtomicInlineLevelBox() const
1176
inline bool RenderObject::isAtomicInlineLevelBox() const
1177
{
1177
{
1178
    return style().isDisplayInlineType() && !(style().display() == DisplayType::Inline && !isReplaced());
1178
    return style().isDisplayInlineType() && !(style().display() == DisplayType::Inline && !isReplaced());
1179
}
1179
}
Lines 1187-1192 void printGraphicsLayerTreeForLiveDocuments(); a/Source/WebCore/rendering/RenderObject.h_sec3
1187
#endif
1187
#endif
1188
1188
1189
bool shouldApplyLayoutContainment(const RenderObject&);
1189
bool shouldApplyLayoutContainment(const RenderObject&);
1190
bool shouldApplySizeContainment(const RenderObject&);
1190
1191
1191
} // namespace WebCore
1192
} // namespace WebCore
1192
1193
- a/Source/WebCore/rendering/RenderReplaced.cpp -2 / +4 lines
Lines 391-397 bool RenderReplaced::setNeedsLayoutIfNeededAfterIntrinsicSizeChange() a/Source/WebCore/rendering/RenderReplaced.cpp_sec1
391
void RenderReplaced::computeAspectRatioInformationForRenderBox(RenderBox* contentRenderer, FloatSize& constrainedSize, double& intrinsicRatio) const
391
void RenderReplaced::computeAspectRatioInformationForRenderBox(RenderBox* contentRenderer, FloatSize& constrainedSize, double& intrinsicRatio) const
392
{
392
{
393
    FloatSize intrinsicSize;
393
    FloatSize intrinsicSize;
394
    if (contentRenderer) {
394
    if (shouldApplySizeContainment(*this))
395
        RenderReplaced::computeIntrinsicRatioInformation(intrinsicSize, intrinsicRatio);
396
    else if (contentRenderer) {
395
        contentRenderer->computeIntrinsicRatioInformation(intrinsicSize, intrinsicRatio);
397
        contentRenderer->computeIntrinsicRatioInformation(intrinsicSize, intrinsicRatio);
396
398
397
        if (style().aspectRatioType() == AspectRatioType::Ratio || (style().aspectRatioType() == AspectRatioType::AutoAndRatio && !intrinsicRatio))
399
        if (style().aspectRatioType() == AspectRatioType::Ratio || (style().aspectRatioType() == AspectRatioType::AutoAndRatio && !intrinsicRatio))
Lines 496-502 Optional<double> RenderReplaced::intrinsicAspectRatioFromWidthHeight() const a/Source/WebCore/rendering/RenderReplaced.cpp_sec2
496
void RenderReplaced::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio) const
498
void RenderReplaced::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio) const
497
{
499
{
498
    // If there's an embeddedContentBox() of a remote, referenced document available, this code-path should never be used.
500
    // If there's an embeddedContentBox() of a remote, referenced document available, this code-path should never be used.
499
    ASSERT(!embeddedContentBox());
501
    ASSERT(!embeddedContentBox() || shouldApplySizeContainment(*this));
500
    intrinsicSize = FloatSize(intrinsicLogicalWidth(), intrinsicLogicalHeight());
502
    intrinsicSize = FloatSize(intrinsicLogicalWidth(), intrinsicLogicalHeight());
501
503
502
    if (style().hasAspectRatio()) {
504
    if (style().hasAspectRatio()) {
- a/Source/WebCore/rendering/RenderReplaced.h -1 / +6 lines
Lines 40-46 public: a/Source/WebCore/rendering/RenderReplaced.h_sec1
40
    bool hasReplacedLogicalHeight() const;
40
    bool hasReplacedLogicalHeight() const;
41
    bool setNeedsLayoutIfNeededAfterIntrinsicSizeChange();
41
    bool setNeedsLayoutIfNeededAfterIntrinsicSizeChange();
42
42
43
    LayoutSize intrinsicSize() const final { return m_intrinsicSize; }
43
    LayoutSize intrinsicSize() const final
44
    {
45
        if (shouldApplySizeContainment(*this))
46
            return LayoutSize();
47
        return m_intrinsicSize;
48
    }
44
    
49
    
45
    RoundedRect roundedContentBoxRect() const;
50
    RoundedRect roundedContentBoxRect() const;
46
    
51
    
- a/Source/WebCore/rendering/RenderSlider.cpp +2 lines
Lines 69-74 LayoutUnit RenderSlider::baselinePosition(FontBaseline, bool /*firstLine*/, Line a/Source/WebCore/rendering/RenderSlider.cpp_sec1
69
69
70
void RenderSlider::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
70
void RenderSlider::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
71
{
71
{
72
    if (shouldApplySizeContainment(*this))
73
        return;
72
    maxLogicalWidth = defaultTrackLength * style().effectiveZoom();
74
    maxLogicalWidth = defaultTrackLength * style().effectiveZoom();
73
    if (!style().width().isPercentOrCalculated())
75
    if (!style().width().isPercentOrCalculated())
74
        minLogicalWidth = maxLogicalWidth;
76
        minLogicalWidth = maxLogicalWidth;
- a/Source/WebCore/rendering/RenderTextControl.cpp +2 lines
Lines 156-161 float RenderTextControl::scaleEmToUnits(int x) const a/Source/WebCore/rendering/RenderTextControl.cpp_sec1
156
156
157
void RenderTextControl::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
157
void RenderTextControl::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
158
{
158
{
159
    if (shouldApplySizeContainment(*this))
160
        return;
159
    // Use average character width. Matches IE.
161
    // Use average character width. Matches IE.
160
    maxLogicalWidth = preferredContentLogicalWidth(const_cast<RenderTextControl*>(this)->getAverageCharWidth());
162
    maxLogicalWidth = preferredContentLogicalWidth(const_cast<RenderTextControl*>(this)->getAverageCharWidth());
161
    if (RenderBox* innerTextRenderBox = innerTextElement()->renderBox())
163
    if (RenderBox* innerTextRenderBox = innerTextElement()->renderBox())
- a/Source/WebCore/rendering/RenderVideo.cpp +3 lines
Lines 123-128 bool RenderVideo::updateIntrinsicSize() a/Source/WebCore/rendering/RenderVideo.cpp_sec1
123
123
124
LayoutSize RenderVideo::calculateIntrinsicSize()
124
LayoutSize RenderVideo::calculateIntrinsicSize()
125
{
125
{
126
    if (shouldApplySizeContainment(*this))
127
        return LayoutSize();
128
126
    // Spec text from 4.8.6
129
    // Spec text from 4.8.6
127
    //
130
    //
128
    // The intrinsic width of a video element's playback area is the intrinsic width 
131
    // The intrinsic width of a video element's playback area is the intrinsic width 
- a/Source/WebCore/rendering/style/RenderStyle.h +1 lines
Lines 527-532 public: a/Source/WebCore/rendering/style/RenderStyle.h_sec1
527
    bool hasAspectRatio() const { return aspectRatioType() == AspectRatioType::Ratio || aspectRatioType() == AspectRatioType::AutoAndRatio; }
527
    bool hasAspectRatio() const { return aspectRatioType() == AspectRatioType::Ratio || aspectRatioType() == AspectRatioType::AutoAndRatio; }
528
    OptionSet<Containment> contain() const { return m_rareNonInheritedData->contain; }
528
    OptionSet<Containment> contain() const { return m_rareNonInheritedData->contain; }
529
    bool containsLayout() const { return m_rareNonInheritedData->contain.contains(Containment::Layout); }
529
    bool containsLayout() const { return m_rareNonInheritedData->contain.contains(Containment::Layout); }
530
    bool containsSize() const { return m_rareNonInheritedData->contain.contains(Containment::Size); }
530
    BoxAlignment boxAlign() const { return static_cast<BoxAlignment>(m_rareNonInheritedData->deprecatedFlexibleBox->align); }
531
    BoxAlignment boxAlign() const { return static_cast<BoxAlignment>(m_rareNonInheritedData->deprecatedFlexibleBox->align); }
531
    BoxDirection boxDirection() const { return static_cast<BoxDirection>(m_inheritedFlags.boxDirection); }
532
    BoxDirection boxDirection() const { return static_cast<BoxDirection>(m_inheritedFlags.boxDirection); }
532
    float boxFlex() const { return m_rareNonInheritedData->deprecatedFlexibleBox->flex; }
533
    float boxFlex() const { return m_rareNonInheritedData->deprecatedFlexibleBox->flex; }
- a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp +2 lines
Lines 70-75 SVGSVGElement& RenderSVGRoot::svgSVGElement() const a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp_sec1
70
70
71
void RenderSVGRoot::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio) const
71
void RenderSVGRoot::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio) const
72
{
72
{
73
    ASSERT(!shouldApplySizeContainment(*this));
74
73
    // Spec: http://www.w3.org/TR/SVG/coords.html#IntrinsicSizing
75
    // Spec: http://www.w3.org/TR/SVG/coords.html#IntrinsicSizing
74
    // SVG needs to specify how to calculate some intrinsic sizing properties to enable inclusion within other languages.
76
    // SVG needs to specify how to calculate some intrinsic sizing properties to enable inclusion within other languages.
75
77
- a/LayoutTests/ChangeLog +12 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2021-05-04  Cathie Chen  <cathiechen@igalia.com>
2
3
        [CSS contain] Support contain:size
4
        https://bugs.webkit.org/show_bug.cgi?id=223570
5
6
        Reviewed by Zalan Bujtas.
7
8
        Update the test result for size containment. Added explanations for size containment tests
9
        that depended on other features.
10
11
        * TestExpectations:
12
1
2021-05-10  Chris Dumez  <cdumez@apple.com>
13
2021-05-10  Chris Dumez  <cdumez@apple.com>
2
14
3
        [ macOS Release wk2 ] http/tests/cache-storage/cache-records-persistency.https.html is flaky crashing
15
        [ macOS Release wk2 ] http/tests/cache-storage/cache-records-persistency.https.html is flaky crashing
- a/LayoutTests/imported/w3c/ChangeLog +17 lines
Lines 1-3 a/LayoutTests/imported/w3c/ChangeLog_sec1
1
2021-05-04  Cathie Chen  <cathiechen@igalia.com>
2
3
        [CSS contain] Support contain:size
4
        https://bugs.webkit.org/show_bug.cgi?id=223570
5
6
        Reviewed by Zalan Bujtas.
7
8
        <canvas> and <video> don't support computing aspect ratio from width and height attributes yet,
9
        so the heights are zero when they are with "contain: size".
10
11
        * web-platform-tests/css/css-contain/contain-size-grid-003-expected.txt:
12
        * web-platform-tests/css/css-contain/contain-size-grid-004-expected.txt:
13
        * web-platform-tests/css/css-contain/contain-size-multicol-as-flex-item-expected.txt:
14
        * web-platform-tests/css/css-flexbox/flex-item-contains-strict-expected.txt:
15
        * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio-expected.txt:
16
        * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio-expected.txt:
17
1
2021-05-10  Rob Buis  <rbuis@igalia.com>
18
2021-05-10  Rob Buis  <rbuis@igalia.com>
2
19
3
        Implement <form>.requestSubmit()
20
        Implement <form>.requestSubmit()
- a/LayoutTests/TestExpectations -62 / +25 lines
Lines 4646-4652 webanimations/transform-property-and-transform-animation-with-delay-on-forced-la a/LayoutTests/TestExpectations_sec1
4646
webanimations/translate-property-and-translate-animation-with-delay-on-forced-layer.html [ Skip ]
4646
webanimations/translate-property-and-translate-animation-with-delay-on-forced-layer.html [ Skip ]
4647
4647
4648
# CSS containment tests that fail
4648
# CSS containment tests that fail
4649
imported/w3c/web-platform-tests/css/css-contain/contain-animation-001.html [ ImageOnlyFailure ]
4650
# webkit-ruby-text
4649
# webkit-ruby-text
4651
imported/w3c/web-platform-tests/css/css-contain/contain-layout-017.html [ ImageOnlyFailure ]
4650
imported/w3c/web-platform-tests/css/css-contain/contain-layout-017.html [ ImageOnlyFailure ]
4652
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-001.html [ ImageOnlyFailure ]
4651
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-001.html [ ImageOnlyFailure ]
Lines 4663-4669 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visib a/LayoutTests/TestExpectations_sec2
4663
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-020.html [ ImageOnlyFailure ]
4662
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-020.html [ ImageOnlyFailure ]
4664
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-021.html [ ImageOnlyFailure ]
4663
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-021.html [ ImageOnlyFailure ]
4665
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-022.html [ ImageOnlyFailure ]
4664
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-022.html [ ImageOnlyFailure ]
4666
imported/w3c/web-platform-tests/css/css-contain/contain-layout-size-003.html [ ImageOnlyFailure ]
4667
imported/w3c/web-platform-tests/css/css-contain/contain-paint-001.html [ ImageOnlyFailure ]
4665
imported/w3c/web-platform-tests/css/css-contain/contain-paint-001.html [ ImageOnlyFailure ]
4668
imported/w3c/web-platform-tests/css/css-contain/contain-paint-004.html [ ImageOnlyFailure ]
4666
imported/w3c/web-platform-tests/css/css-contain/contain-paint-004.html [ ImageOnlyFailure ]
4669
imported/w3c/web-platform-tests/css/css-contain/contain-paint-005.html [ ImageOnlyFailure ]
4667
imported/w3c/web-platform-tests/css/css-contain/contain-paint-005.html [ ImageOnlyFailure ]
Lines 4705-4772 imported/w3c/web-platform-tests/css/css-contain/contain-paint-stacking-context-0 a/LayoutTests/TestExpectations_sec3
4705
imported/w3c/web-platform-tests/css/css-contain/contain-paint-stacking-context-001b.html [ ImageOnlyFailure ]
4703
imported/w3c/web-platform-tests/css/css-contain/contain-paint-stacking-context-001b.html [ ImageOnlyFailure ]
4706
imported/w3c/web-platform-tests/css/css-contain/contain-paint-table-001.html [ ImageOnlyFailure ]
4704
imported/w3c/web-platform-tests/css/css-contain/contain-paint-table-001.html [ ImageOnlyFailure ]
4707
imported/w3c/web-platform-tests/css/css-contain/contain-paint-table-002.html [ ImageOnlyFailure ]
4705
imported/w3c/web-platform-tests/css/css-contain/contain-paint-table-002.html [ ImageOnlyFailure ]
4708
imported/w3c/web-platform-tests/css/css-contain/contain-size-011.html [ ImageOnlyFailure ]
4709
imported/w3c/web-platform-tests/css/css-contain/contain-size-013.html [ ImageOnlyFailure ]
4710
imported/w3c/web-platform-tests/css/css-contain/contain-size-021.html [ ImageOnlyFailure ]
4711
imported/w3c/web-platform-tests/css/css-contain/contain-size-023.html [ ImageOnlyFailure ]
4712
imported/w3c/web-platform-tests/css/css-contain/contain-size-025.html [ ImageOnlyFailure ]
4713
imported/w3c/web-platform-tests/css/css-contain/contain-size-027.html [ ImageOnlyFailure ]
4714
imported/w3c/web-platform-tests/css/css-contain/contain-size-041.html [ ImageOnlyFailure ]
4715
imported/w3c/web-platform-tests/css/css-contain/contain-size-042.html [ ImageOnlyFailure ]
4716
imported/w3c/web-platform-tests/css/css-contain/contain-size-056.html [ ImageOnlyFailure ]
4717
imported/w3c/web-platform-tests/css/css-contain/contain-size-061.html [ ImageOnlyFailure ]
4718
imported/w3c/web-platform-tests/css/css-contain/contain-size-062.html [ ImageOnlyFailure ]
4719
imported/w3c/web-platform-tests/css/css-contain/contain-size-063.html [ ImageOnlyFailure ]
4720
imported/w3c/web-platform-tests/css/css-contain/contain-size-064.html [ ImageOnlyFailure ]
4721
imported/w3c/web-platform-tests/css/css-contain/contain-size-block-001.html [ ImageOnlyFailure ]
4722
imported/w3c/web-platform-tests/css/css-contain/contain-size-block-002.html [ ImageOnlyFailure ]
4723
imported/w3c/web-platform-tests/css/css-contain/contain-size-block-003.html [ ImageOnlyFailure ]
4724
imported/w3c/web-platform-tests/css/css-contain/contain-size-block-004.html [ ImageOnlyFailure ]
4725
imported/w3c/web-platform-tests/css/css-contain/contain-size-borders.html [ ImageOnlyFailure ]
4726
imported/w3c/web-platform-tests/css/css-contain/contain-size-breaks-001.html [ ImageOnlyFailure ]
4727
imported/w3c/web-platform-tests/css/css-contain/contain-size-button-001.html [ ImageOnlyFailure ]
4728
imported/w3c/web-platform-tests/css/css-contain/contain-size-button-002.html [ ImageOnlyFailure ]
4729
imported/w3c/web-platform-tests/css/css-contain/contain-size-fieldset-001.html [ ImageOnlyFailure ]
4730
imported/w3c/web-platform-tests/css/css-contain/contain-size-fieldset-002.html [ ImageOnlyFailure ]
4731
imported/w3c/web-platform-tests/css/css-contain/contain-size-fieldset-003.html [ ImageOnlyFailure ]
4732
imported/w3c/web-platform-tests/css/css-contain/contain-size-fieldset-004.html [ ImageOnlyFailure ]
4733
imported/w3c/web-platform-tests/css/css-contain/contain-size-flex-001.html [ ImageOnlyFailure ]
4734
imported/w3c/web-platform-tests/css/css-contain/contain-size-flexbox-001.html [ ImageOnlyFailure ]
4735
imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-001.html [ ImageOnlyFailure ]
4736
imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-002.html [ ImageOnlyFailure ]
4737
imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-005.html [ ImageOnlyFailure ]
4738
imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-block-001.html [ ImageOnlyFailure ]
4739
imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-block-002.html [ ImageOnlyFailure ]
4740
imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-block-003.html [ ImageOnlyFailure ]
4741
imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-block-004.html [ ImageOnlyFailure ]
4742
imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-flex-001.html [ ImageOnlyFailure ]
4743
imported/w3c/web-platform-tests/css/css-contain/contain-size-monolithic-001.html [ ImageOnlyFailure ]
4744
imported/w3c/web-platform-tests/css/css-contain/contain-size-monolithic-002.html [ ImageOnlyFailure ]
4745
imported/w3c/web-platform-tests/css/css-contain/contain-size-multicol-001.html [ ImageOnlyFailure ]
4746
imported/w3c/web-platform-tests/css/css-contain/contain-size-multicol-002.html [ ImageOnlyFailure ]
4747
imported/w3c/web-platform-tests/css/css-contain/contain-size-multicol-003.html [ ImageOnlyFailure ]
4748
imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-001.html [ ImageOnlyFailure ]
4749
imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-002.html [ ImageOnlyFailure ]
4750
imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-003a.html [ ImageOnlyFailure ]
4751
imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-003b.html [ ImageOnlyFailure ]
4752
imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-003c.html [ ImageOnlyFailure ]
4753
imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-004.html [ ImageOnlyFailure ]
4754
imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-005.html [ ImageOnlyFailure ]
4755
imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-006.html [ ImageOnlyFailure ]
4756
imported/w3c/web-platform-tests/css/css-contain/contain-size-scrollbars-001.html [ ImageOnlyFailure ]
4757
imported/w3c/web-platform-tests/css/css-contain/contain-size-scrollbars-002.html [ ImageOnlyFailure ]
4758
imported/w3c/web-platform-tests/css/css-contain/contain-size-scrollbars-003.html [ ImageOnlyFailure ]
4759
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-001.html [ ImageOnlyFailure ]
4760
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-002.html [ ImageOnlyFailure ]
4761
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-001.html [ ImageOnlyFailure ]
4762
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-002.html [ ImageOnlyFailure ]
4763
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-003.html [ ImageOnlyFailure ]
4764
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-004.html [ ImageOnlyFailure ]
4765
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-005.html [ ImageOnlyFailure ]
4766
imported/w3c/web-platform-tests/css/css-contain/contain-size-table-caption-001.html [ ImageOnlyFailure ]
4767
imported/w3c/web-platform-tests/css/css-contain/contain-strict-001.html [ ImageOnlyFailure ]
4706
imported/w3c/web-platform-tests/css/css-contain/contain-strict-001.html [ ImageOnlyFailure ]
4768
imported/w3c/web-platform-tests/css/css-contain/contain-strict-002.html [ ImageOnlyFailure ]
4707
imported/w3c/web-platform-tests/css/css-contain/contain-strict-002.html [ ImageOnlyFailure ]
4769
imported/w3c/web-platform-tests/css/css-contain/contain-strict-003.html [ ImageOnlyFailure ]
4770
imported/w3c/web-platform-tests/css/css-contain/contain-strict-011.html [ ImageOnlyFailure ]
4708
imported/w3c/web-platform-tests/css/css-contain/contain-strict-011.html [ ImageOnlyFailure ]
4771
imported/w3c/web-platform-tests/css/css-contain/contain-style-counters-001.html [ ImageOnlyFailure ]
4709
imported/w3c/web-platform-tests/css/css-contain/contain-style-counters-001.html [ ImageOnlyFailure ]
4772
imported/w3c/web-platform-tests/css/css-contain/contain-style-counters-002.html [ ImageOnlyFailure ]
4710
imported/w3c/web-platform-tests/css/css-contain/contain-style-counters-002.html [ ImageOnlyFailure ]
Lines 4802-4807 imported/w3c/web-platform-tests/css/css-contain/quote-scoping-004.html [ ImageOn a/LayoutTests/TestExpectations_sec4
4802
# Flaky css-contain test
4740
# Flaky css-contain test
4803
imported/w3c/web-platform-tests/css/css-contain/content-visibility/animation-display-lock.html [ Failure Pass ]
4741
imported/w3c/web-platform-tests/css/css-contain/content-visibility/animation-display-lock.html [ Failure Pass ]
4804
4742
4743
# Canvas doesn't get default aspect-ratio for width and height attributes.
4744
webkit.org/b/217529 imported/w3c/web-platform-tests/css/css-flexbox/canvas-contain-size.html [ ImageOnlyFailure ]
4745
4746
# Content is painted on svg's padding area.
4747
webkit.org/b/425868 imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-002.html [ ImageOnlyFailure ]
4748
4749
# Multicolumn does not paint the horizontal overflow area of a relative child.
4750
webkit.org/b/41796 imported/w3c/web-platform-tests/css/css-contain/contain-size-monolithic-002.html [ ImageOnlyFailure ]
4751
4752
# Buttons with auto width and height has extra margins.
4753
imported/w3c/web-platform-tests/css/css-contain/contain-size-button-001.html [ ImageOnlyFailure ]
4754
imported/w3c/web-platform-tests/css/css-contain/contain-size-button-002.html [ ImageOnlyFailure ]
4755
4756
# Scrollbar displays are different.
4757
imported/w3c/web-platform-tests/css/css-contain/contain-size-block-003.html [ ImageOnlyFailure ]
4758
imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-block-003.html [ ImageOnlyFailure ]
4759
4760
# Select with empty content always has root linebox, so the heights are different.
4761
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-001.html [ ImageOnlyFailure ]
4762
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-002.html [ ImageOnlyFailure ]
4763
4764
# CSS property color is not working in select elements.
4765
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-001.html [ ImageOnlyFailure ]
4766
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-002.html [ ImageOnlyFailure ]
4767
4805
# Tests that fail because they assume a vertical scrollbar in `writing-mode: vertical-rl` elements will be on the right-hand side
4768
# Tests that fail because they assume a vertical scrollbar in `writing-mode: vertical-rl` elements will be on the right-hand side
4806
webkit.org/b/224357 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthog-vrl-in-htb-013.xht [ ImageOnlyFailure ]
4769
webkit.org/b/224357 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthog-vrl-in-htb-013.xht [ ImageOnlyFailure ]
4807
webkit.org/b/224357 imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-vertical-rl.html [ ImageOnlyFailure ]
4770
webkit.org/b/224357 imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-vertical-rl.html [ ImageOnlyFailure ]
- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-003-expected.txt -13 / +2 lines
Lines 36-54 PASS .grid 34 a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-003-expected.txt_sec1
36
PASS .grid 35
36
PASS .grid 35
37
PASS .grid 36
37
PASS .grid 36
38
PASS .grid 37
38
PASS .grid 37
39
FAIL .grid 38 assert_equals:
39
PASS .grid 38
40
<div class="grid" style="grid: repeat(auto-fit, 75px) / repeat(auto-fit, 100px);" data-expected-width="0" data-expected-height="0">
40
PASS .grid 39
41
    <div></div>
42
  </div>
43
width expected 0 but got 100
44
FAIL .grid 39 assert_equals:
45
<div class="grid" style="grid: auto 50px / 100px auto;" data-expected-width="100" data-expected-height="50">
46
  <div data-expected-width="100" data-expected-height="10" data-offset-x="0" data-offset-y="0">X</div>
47
  <div data-expected-width="40" data-expected-height="10" data-offset-x="100" data-offset-y="0">XX</div>
48
  <div data-expected-width="100" data-expected-height="50" data-offset-x="0" data-offset-y="10">XXX</div>
49
  <div data-expected-width="40" data-expected-height="50" data-offset-x="100" data-offset-y="10">XXXX</div>
50
</div>
51
width expected 100 but got 140
52
41
53
X
42
X
54
XX
43
XX
- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-004-expected.txt -70 / +14 lines
Lines 1-38 a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-004-expected.txt_sec1
1
1
2
PASS .grid 1
2
PASS .grid 1
3
FAIL .grid 2 assert_equals:
3
PASS .grid 2
4
<div class="grid percent min-content" data-expected-height="0" data-expected-width="0">
5
  <div data-expected-height="0" data-expected-width="0">XXXX</div>
6
</div>
7
width expected 0 but got 300
8
PASS .grid 3
4
PASS .grid 3
9
FAIL .grid 4 assert_equals:
5
PASS .grid 4
10
<div class="grid percent max-content" data-expected-height="0" data-expected-width="0">
11
  <div data-expected-height="0" data-expected-width="0">XXXX</div>
12
</div>
13
width expected 0 but got 300
14
PASS .grid 5
6
PASS .grid 5
15
PASS .grid 6
7
PASS .grid 6
16
PASS .grid 7
8
PASS .grid 7
17
FAIL .grid 8 assert_equals:
9
PASS .grid 8
18
<div class="grid calc min-content" data-expected-height="0" data-expected-width="0">
19
  <div data-expected-height="100" data-expected-width="100">XXXX</div>
20
</div>
21
width expected 0 but got 300
22
PASS .grid 9
10
PASS .grid 9
23
FAIL .grid 10 assert_equals:
11
PASS .grid 10
24
<div class="grid calc max-content" data-expected-height="0" data-expected-width="0">
25
  <div data-expected-height="100" data-expected-width="100">XXXX</div>
26
</div>
27
width expected 0 but got 300
28
PASS .grid 11
12
PASS .grid 11
29
PASS .grid 12
13
PASS .grid 12
30
PASS .grid 13
14
PASS .grid 13
31
FAIL .grid 14 assert_equals:
15
PASS .grid 14
32
<div class="grid minmax-percent-fixed min-content" data-expected-height="100" data-expected-width="0">
33
  <div data-expected-height="100" data-expected-width="0">XXXX</div>
34
</div>
35
width expected 0 but got 100
36
PASS .grid 15
16
PASS .grid 15
37
PASS .grid 16
17
PASS .grid 16
38
PASS .grid 17
18
PASS .grid 17
Lines 40-106 PASS .grid 18 a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-004-expected.txt_sec2
40
PASS .grid 19
20
PASS .grid 19
41
PASS .grid 20
21
PASS .grid 20
42
PASS .grid 21
22
PASS .grid 21
43
FAIL .grid 22 assert_equals:
23
PASS .grid 22
44
<div class="grid minmax-fixed-percent max-content" data-expected-height="100" data-expected-width="100">
45
  <div data-expected-height="100" data-expected-width="100">XXXX</div>
46
</div>
47
width expected 100 but got 300
48
PASS .grid 23
24
PASS .grid 23
49
PASS .grid 24
25
PASS .grid 24
50
PASS .grid 25
26
PASS .grid 25
51
FAIL .grid 26 assert_equals:
27
PASS .grid 26
52
<div class="grid minmax-percent-flex min-content" data-expected-height="0" data-expected-width="0">
53
  <div data-expected-height="0" data-expected-width="0">XXXX</div>
54
</div>
55
width expected 0 but got 300
56
PASS .grid 27
28
PASS .grid 27
57
FAIL .grid 28 assert_equals:
29
PASS .grid 28
58
<div class="grid minmax-percent-flex max-content" data-expected-height="0" data-expected-width="0">
59
  <div data-expected-height="0" data-expected-width="0">XXXX</div>
60
</div>
61
width expected 0 but got 300
62
PASS .grid 29
30
PASS .grid 29
63
PASS .grid 30
31
PASS .grid 30
64
PASS .grid 31
32
PASS .grid 31
65
FAIL .grid 32 assert_equals:
33
PASS .grid 32
66
<div class="grid minmax-intrinsic-percent min-content" data-expected-height="0" data-expected-width="0">
67
  <div data-expected-height="75" data-expected-width="300">XXXX</div>
68
</div>
69
width expected 0 but got 300
70
PASS .grid 33
34
PASS .grid 33
71
FAIL .grid 34 assert_equals:
35
PASS .grid 34
72
<div class="grid minmax-intrinsic-percent max-content" data-expected-height="0" data-expected-width="0">
73
  <div data-expected-height="75" data-expected-width="300">XXXX</div>
74
</div>
75
width expected 0 but got 300
76
PASS .grid 35
36
PASS .grid 35
77
PASS .grid 36
37
PASS .grid 36
78
PASS .grid 37
38
PASS .grid 37
79
FAIL .grid 38 assert_equals:
39
PASS .grid 38
80
<div class="grid minmax-percent-intrinsic min-content" data-expected-height="0" data-expected-width="0">
81
  <div data-expected-height="0" data-expected-width="0">XXXX</div>
82
</div>
83
width expected 0 but got 300
84
PASS .grid 39
40
PASS .grid 39
85
FAIL .grid 40 assert_equals:
41
PASS .grid 40
86
<div class="grid minmax-percent-intrinsic max-content" data-expected-height="0" data-expected-width="0">
87
  <div data-expected-height="0" data-expected-width="0">XXXX</div>
88
</div>
89
width expected 0 but got 300
90
PASS .grid 41
42
PASS .grid 41
91
PASS .grid 42
43
PASS .grid 42
92
PASS .grid 43
44
PASS .grid 43
93
FAIL .grid 44 assert_equals:
45
PASS .grid 44
94
<div class="grid fit-content min-content" data-expected-height="0" data-expected-width="0">
95
  <div data-expected-height="75" data-expected-width="300">XXXX</div>
96
</div>
97
width expected 0 but got 300
98
PASS .grid 45
46
PASS .grid 45
99
FAIL .grid 46 assert_equals:
47
PASS .grid 46
100
<div class="grid fit-content max-content" data-expected-height="0" data-expected-width="0">
101
  <div data-expected-height="75" data-expected-width="300">XXXX</div>
102
</div>
103
width expected 0 but got 300
104
PASS .grid 47
48
PASS .grid 47
105
PASS .grid 48
49
PASS .grid 48
106
XXXX
50
XXXX
- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-multicol-as-flex-item-expected.txt -7 / +1 lines
Lines 1-11 a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-multicol-as-flex-item-expected.txt_sec1
1
There should be a green square below.
1
There should be a green square below.
2
2
3
3
4
FAIL #flex 1 assert_equals:
4
PASS #flex 1
5
<div id="flex">
6
  <div id="multicol" data-expected-width="100" data-expected-height="100">
7
    <div style="width:1000px; height:1px;"></div>
8
  </div>
9
</div>
10
width expected 100 but got 784
11
5
- a/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-item-contains-strict-expected.txt -20 / +4 lines
Lines 17-44 Column a/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-item-contains-strict-expected.txt_sec1
17
17
18
Row
18
Row
19
19
20
FAIL .inline-flex 1 assert_equals:
20
PASS .inline-flex 1
21
<div class="inline-flex" style="display: inline-flex; flex-direction: column;" data-expected-width="0" data-expected-height="0">
21
PASS .inline-flex 2
22
  <div style="contain: strict;" data-expected-width="0" data-expected-height="0">Column</div>
23
</div>
24
width expected 0 but got 52
25
FAIL .inline-flex 2 assert_equals:
26
<div class="inline-flex" data-expected-width="0" data-expected-height="0">
27
  <div style="contain: strict;" data-expected-width="0" data-expected-height="0">Row</div>
28
</div>
29
width expected 0 but got 30
30
PASS .inline-flex 3
22
PASS .inline-flex 3
31
PASS .inline-flex 4
23
PASS .inline-flex 4
32
FAIL .inline-flex 5 assert_equals:
24
PASS .inline-flex 5
33
<div class="inline-flex" style="flex-direction: column; align-items: flex-start;" data-expected-width="0" data-expected-height="0">
25
PASS .inline-flex 6
34
  <div style="contain: strict;" data-expected-width="0" data-expected-height="0">Column</div>
35
</div>
36
width expected 0 but got 52
37
FAIL .inline-flex 6 assert_equals:
38
<div class="inline-flex" style="align-items: flex-start;" data-expected-width="0" data-expected-height="0">
39
  <div style="contain: strict;" data-expected-width="0" data-expected-height="0">Row</div>
40
</div>
41
width expected 0 but got 30
42
PASS .inline-flex 7
26
PASS .inline-flex 7
43
PASS .inline-flex 8
27
PASS .inline-flex 8
44
28
- a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio-expected.txt -1 / +1 lines
Lines 1-6 a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio-expected.txt_sec1
1
1
2
2
3
PASS Canvas width and height attributes are used as the surface size with contain:size
3
FAIL Canvas width and height attributes are used as the surface size with contain:size assert_approx_equals: expected 2.5 +/- 0.001 but got Infinity
4
PASS Canvas width and height attributes are used as the surface size
4
PASS Canvas width and height attributes are used as the surface size
5
FAIL Computed style test: canvas with {"width":"10","height":"20"} assert_equals: expected "auto 10 / 20" but got "auto"
5
FAIL Computed style test: canvas with {"width":"10","height":"20"} assert_equals: expected "auto 10 / 20" but got "auto"
6
PASS Computed style test: canvas with {"width":"0","height":"1"}
6
PASS Computed style test: canvas with {"width":"0","height":"1"}
- a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio-expected.txt -1 / +1 lines
Lines 1-6 a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio-expected.txt_sec1
1
1
2
2
3
FAIL Video width and height attributes are not used to infer aspect-ratio assert_approx_equals: expected 2.5 +/- 0.001 but got 2
3
FAIL Video width and height attributes are not used to infer aspect-ratio assert_approx_equals: expected 2.5 +/- 0.001 but got Infinity
4
FAIL Computed style test: video with {"width":"10","height":"20"} assert_equals: expected "auto 10 / 20" but got "auto"
4
FAIL Computed style test: video with {"width":"10","height":"20"} assert_equals: expected "auto 10 / 20" but got "auto"
5
FAIL Computed style test: video with {"width":"0.5","height":"1.5"} assert_equals: expected "auto 0.5 / 1.5" but got "auto"
5
FAIL Computed style test: video with {"width":"0.5","height":"1.5"} assert_equals: expected "auto 0.5 / 1.5" but got "auto"
6
PASS Computed style test: video with {"width":"0","height":"1"}
6
PASS Computed style test: video with {"width":"0","height":"1"}

Return to Bug 223570