| 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 NOBODY (OOPS!).
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-03  Chris Lord  <clord@igalia.com>
98
2021-05-03  Chris Lord  <clord@igalia.com>
2
99
3
        Decoding an SVG off the main thread causes a crash
100
        Decoding an SVG off the main thread causes a crash
- a/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp -30 / +43 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-1183 void GridTrackSizingAlgorithm::initializeTrackSizes() a/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp_sec5
1146
1148
1147
void GridTrackSizingAlgorithm::resolveIntrinsicTrackSizes()
1149
void GridTrackSizingAlgorithm::resolveIntrinsicTrackSizes()
1148
{
1150
{
1149
    Vector<GridItemWithSpan> itemsSortedByIncreasingSpan;
1150
    HashSet<RenderBox*> itemsSet;
1151
    Vector<GridTrack>& allTracks = tracks(m_direction);
1151
    Vector<GridTrack>& allTracks = tracks(m_direction);
1152
    if (m_grid.hasGridItems()) {
1152
    auto resolveIntrinsicTrackSizesFromChildren = [&]() {
1153
        for (auto trackIndex : m_contentSizedTracksIndex) {
1153
        Vector<GridItemWithSpan> itemsSortedByIncreasingSpan;
1154
            GridIterator iterator(m_grid, m_direction, trackIndex);
1154
        HashSet<RenderBox*> itemsSet;
1155
            GridTrack& track = allTracks[trackIndex];
1155
        if (m_grid.hasGridItems()) {
1156
1156
            for (auto trackIndex : m_contentSizedTracksIndex) {
1157
            while (auto* gridItem = iterator.nextGridItem()) {
1157
                GridIterator iterator(m_grid, m_direction, trackIndex);
1158
                if (itemsSet.add(gridItem).isNewEntry) {
1158
                GridTrack& track = allTracks[trackIndex];
1159
                    const GridSpan& span = m_grid.gridItemSpan(*gridItem, m_direction);
1159
1160
                    if (span.integerSpan() == 1)
1160
                while (auto* gridItem = iterator.nextGridItem()) {
1161
                        sizeTrackToFitNonSpanningItem(span, *gridItem, track);
1161
                    if (itemsSet.add(gridItem).isNewEntry) {
1162
                    else if (!spanningItemCrossesFlexibleSizedTracks(span))
1162
                        const GridSpan& span = m_grid.gridItemSpan(*gridItem, m_direction);
1163
                        itemsSortedByIncreasingSpan.append(GridItemWithSpan(*gridItem, span));
1163
                        if (span.integerSpan() == 1)
1164
                            sizeTrackToFitNonSpanningItem(span, *gridItem, track);
1165
                        else if (!spanningItemCrossesFlexibleSizedTracks(span))
1166
                            itemsSortedByIncreasingSpan.append(GridItemWithSpan(*gridItem, span));
1167
                    }
1164
                }
1168
                }
1165
            }
1169
            }
1170
            std::sort(itemsSortedByIncreasingSpan.begin(), itemsSortedByIncreasingSpan.end());
1166
        }
1171
        }
1167
        std::sort(itemsSortedByIncreasingSpan.begin(), itemsSortedByIncreasingSpan.end());
1168
    }
1169
1172
1170
    auto it = itemsSortedByIncreasingSpan.begin();
1173
        auto it = itemsSortedByIncreasingSpan.begin();
1171
    auto end = itemsSortedByIncreasingSpan.end();
1174
        auto end = itemsSortedByIncreasingSpan.end();
1172
    while (it != end) {
1175
        while (it != end) {
1173
        GridItemsSpanGroupRange spanGroupRange = { it, std::upper_bound(it, end, *it) };
1176
            GridItemsSpanGroupRange spanGroupRange = { it, std::upper_bound(it, end, *it) };
1174
        increaseSizesToAccommodateSpanningItems<ResolveIntrinsicMinimums>(spanGroupRange);
1177
            increaseSizesToAccommodateSpanningItems<ResolveIntrinsicMinimums>(spanGroupRange);
1175
        increaseSizesToAccommodateSpanningItems<ResolveContentBasedMinimums>(spanGroupRange);
1178
            increaseSizesToAccommodateSpanningItems<ResolveContentBasedMinimums>(spanGroupRange);
1176
        increaseSizesToAccommodateSpanningItems<ResolveMaxContentMinimums>(spanGroupRange);
1179
            increaseSizesToAccommodateSpanningItems<ResolveMaxContentMinimums>(spanGroupRange);
1177
        increaseSizesToAccommodateSpanningItems<ResolveIntrinsicMaximums>(spanGroupRange);
1180
            increaseSizesToAccommodateSpanningItems<ResolveIntrinsicMaximums>(spanGroupRange);
1178
        increaseSizesToAccommodateSpanningItems<ResolveMaxContentMaximums>(spanGroupRange);
1181
            increaseSizesToAccommodateSpanningItems<ResolveMaxContentMaximums>(spanGroupRange);
1179
        it = spanGroupRange.rangeEnd;
1182
            it = spanGroupRange.rangeEnd;
1180
    }
1183
        }
1184
    };
1185
1186
    if (!m_strategy->isComputingSizeContainment())
1187
        resolveIntrinsicTrackSizesFromChildren();
1181
1188
1182
    for (auto trackIndex : m_contentSizedTracksIndex) {
1189
    for (auto trackIndex : m_contentSizedTracksIndex) {
1183
        GridTrack& track = allTracks[trackIndex];
1190
        GridTrack& track = allTracks[trackIndex];
Lines 1239-1244 void GridTrackSizingAlgorithm::advanceNextState() a/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp_sec6
1239
        m_sizingState = RowSizingFirstIteration;
1246
        m_sizingState = RowSizingFirstIteration;
1240
        return;
1247
        return;
1241
    case RowSizingFirstIteration:
1248
    case RowSizingFirstIteration:
1249
        m_sizingState = m_strategy->isComputingSizeContainment() ? RowSizingExtraIterationForSizeContainment : ColumnSizingSecondIteration;
1250
        return;
1251
    case RowSizingExtraIterationForSizeContainment:
1242
        m_sizingState = ColumnSizingSecondIteration;
1252
        m_sizingState = ColumnSizingSecondIteration;
1243
        return;
1253
        return;
1244
    case ColumnSizingSecondIteration:
1254
    case ColumnSizingSecondIteration:
Lines 1259-1264 bool GridTrackSizingAlgorithm::isValidTransition() const a/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp_sec7
1259
    case ColumnSizingSecondIteration:
1269
    case ColumnSizingSecondIteration:
1260
        return m_direction == ForColumns;
1270
        return m_direction == ForColumns;
1261
    case RowSizingFirstIteration:
1271
    case RowSizingFirstIteration:
1272
    case RowSizingExtraIterationForSizeContainment:
1262
    case RowSizingSecondIteration:
1273
    case RowSizingSecondIteration:
1263
        return m_direction == ForRows;
1274
        return m_direction == ForRows;
1264
    }
1275
    }
Lines 1346-1351 void GridTrackSizingAlgorithm::run() a/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp_sec8
1346
1357
1347
    // Step 3.
1358
    // Step 3.
1348
    m_strategy->maximizeTracks(tracks(m_direction), m_direction == ForColumns ? m_freeSpaceColumns : m_freeSpaceRows);
1359
    m_strategy->maximizeTracks(tracks(m_direction), m_direction == ForColumns ? m_freeSpaceColumns : m_freeSpaceRows);
1360
    if (m_strategy->isComputingSizeContainment())
1361
        return;
1349
1362
1350
    // Step 4.
1363
    // Step 4.
1351
    stretchFlexibleTracks(initialFreeSpace);
1364
    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 / +8 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
        // If it is RenderBlock, borderAndPaddingLogicalHeight() contains intrinsicBorderForFieldset() which adds extra border for fieldset, so we can't use it directly.
2865
        auto borderAndPading = RenderBox::borderBefore() + RenderBox::paddingBefore() + RenderBox::borderAfter() + RenderBox::paddingAfter();
2866
        setLogicalHeight(borderAndPading + scrollbarLogicalHeight());
2867
    }
2868
2863
    cacheIntrinsicContentLogicalHeightForFlexItem(contentLogicalHeight());
2869
    cacheIntrinsicContentLogicalHeightForFlexItem(contentLogicalHeight());
2864
    auto computedValues = computeLogicalHeight(logicalHeight(), logicalTop());
2870
    auto computedValues = computeLogicalHeight(logicalHeight(), logicalTop());
2865
    setLogicalHeight(computedValues.m_extent);
2871
    setLogicalHeight(computedValues.m_extent);
Lines 4849-4855 bool RenderBox::isUnsplittableForPagination() const a/Source/WebCore/rendering/RenderBox.cpp_sec2
4849
    return isReplaced()
4855
    return isReplaced()
4850
        || hasUnsplittableScrollingOverflow()
4856
        || hasUnsplittableScrollingOverflow()
4851
        || (parent() && isWritingModeRoot())
4857
        || (parent() && isWritingModeRoot())
4852
        || (isFloating() && style().styleType() == PseudoId::FirstLetter && style().initialLetterDrop() > 0);
4858
        || (isFloating() && style().styleType() == PseudoId::FirstLetter && style().initialLetterDrop() > 0)
4859
        || shouldApplySizeContainment(*this);
4853
}
4860
}
4854
4861
4855
LayoutUnit RenderBox::lineHeight(bool /*firstLine*/, LineDirectionMode direction, LinePositionMode /*linePositionMode*/) const
4862
LayoutUnit RenderBox::lineHeight(bool /*firstLine*/, LineDirectionMode direction, LinePositionMode /*linePositionMode*/) const
- a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp -18 / +23 lines
Lines 187-214 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
    if (hasMultipleLines() || isVertical()) {
190
    auto computeIntrinsicLogicalWidthsFromChildren = [&]() {
191
        for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
191
        if (hasMultipleLines() || isVertical()) {
192
            if (childDoesNotAffectWidthOrFlexing(child))
192
            for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
193
                continue;
193
                if (childDoesNotAffectWidthOrFlexing(child))
194
                    continue;
194
195
195
            LayoutUnit margin = marginWidthForChild(child);
196
                LayoutUnit margin = marginWidthForChild(child);
196
            LayoutUnit width = child->minPreferredLogicalWidth() + margin;
197
                LayoutUnit width = child->minPreferredLogicalWidth() + margin;
197
            minLogicalWidth = std::max(width, minLogicalWidth);
198
                minLogicalWidth = std::max(width, minLogicalWidth);
198
199
199
            width = child->maxPreferredLogicalWidth() + margin;
200
                width = child->maxPreferredLogicalWidth() + margin;
200
            maxLogicalWidth = std::max(width, maxLogicalWidth);
201
                maxLogicalWidth = std::max(width, maxLogicalWidth);
201
        }
202
            }
202
    } else {
203
        } else {
203
        for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
204
            for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
204
            if (childDoesNotAffectWidthOrFlexing(child))
205
                if (childDoesNotAffectWidthOrFlexing(child))
205
                continue;
206
                    continue;
206
207
207
            LayoutUnit margin = marginWidthForChild(child);
208
                LayoutUnit margin = marginWidthForChild(child);
208
            minLogicalWidth += child->minPreferredLogicalWidth() + margin;
209
                minLogicalWidth += child->minPreferredLogicalWidth() + margin;
209
            maxLogicalWidth += child->maxPreferredLogicalWidth() + margin;
210
                maxLogicalWidth += child->maxPreferredLogicalWidth() + margin;
211
            }
210
        }
212
        }
211
    }
213
    };
214
215
    if (!shouldApplySizeContainment(*this))
216
        computeIntrinsicLogicalWidthsFromChildren();
212
217
213
    maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth);
218
    maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth);
214
219
- 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 -50 / +55 lines
Lines 83-143 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
    LayoutUnit childMinWidth;
86
    auto computeIntrinsicLogicalWidthsFromChildren = [&]() {
87
    LayoutUnit childMaxWidth;
87
        LayoutUnit childMinWidth;
88
    bool hadExcludedChildren = computePreferredWidthsForExcludedChildren(childMinWidth, childMaxWidth);
88
        LayoutUnit childMaxWidth;
89
89
        bool hadExcludedChildren = computePreferredWidthsForExcludedChildren(childMinWidth, childMaxWidth);
90
    // FIXME: We're ignoring flex-basis here and we shouldn't. We can't start
90
91
    // honoring it though until the flex shorthand stops setting it to 0. See
91
        // FIXME: We're ignoring flex-basis here and we shouldn't. We can't start
92
    // https://bugs.webkit.org/show_bug.cgi?id=116117 and
92
        // honoring it though until the flex shorthand stops setting it to 0. See
93
    // https://crbug.com/240765.
93
        // https://bugs.webkit.org/show_bug.cgi?id=116117 and
94
    size_t numItemsWithNormalLayout = 0;
94
        // https://crbug.com/240765.
95
    for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
95
        size_t numItemsWithNormalLayout = 0;
96
        if (child->isOutOfFlowPositioned() || child->isExcludedFromNormalLayout())
96
        for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
97
            continue;
97
            if (child->isOutOfFlowPositioned() || child->isExcludedFromNormalLayout())
98
        ++numItemsWithNormalLayout;
98
                continue;
99
            ++numItemsWithNormalLayout;
100
101
            LayoutUnit margin = marginIntrinsicLogicalWidthForChild(*child);
102
            
103
            LayoutUnit minPreferredLogicalWidth;
104
            LayoutUnit maxPreferredLogicalWidth;
105
            computeChildPreferredLogicalWidths(*child, minPreferredLogicalWidth, maxPreferredLogicalWidth);
106
            
107
            minPreferredLogicalWidth += margin;
108
            maxPreferredLogicalWidth += margin;
109
110
            if (!isColumnFlow()) {
111
                maxLogicalWidth += maxPreferredLogicalWidth;
112
                if (isMultiline()) {
113
                    // For multiline, the min preferred width is if you put a break between
114
                    // each item.
115
                    minLogicalWidth = std::max(minLogicalWidth, minPreferredLogicalWidth);
116
                } else
117
                    minLogicalWidth += minPreferredLogicalWidth;
118
            } else {
119
                minLogicalWidth = std::max(minPreferredLogicalWidth, minLogicalWidth);
120
                maxLogicalWidth = std::max(maxPreferredLogicalWidth, maxLogicalWidth);
121
            }
122
        }
123
124
        if (!isColumnFlow() && numItemsWithNormalLayout > 1) {
125
            LayoutUnit inlineGapSize = (numItemsWithNormalLayout - 1) * computeGap(GapType::BetweenItems);
126
            maxLogicalWidth += inlineGapSize;
127
            if (!isMultiline())
128
                minLogicalWidth += inlineGapSize;
129
        }
99
130
100
        LayoutUnit margin = marginIntrinsicLogicalWidthForChild(*child);
131
        maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth);
101
        
132
        
102
        LayoutUnit minPreferredLogicalWidth;
133
        // Due to negative margins, it is possible that we calculated a negative
103
        LayoutUnit maxPreferredLogicalWidth;
134
        // intrinsic width. Make sure that we never return a negative width.
104
        computeChildPreferredLogicalWidths(*child, minPreferredLogicalWidth, maxPreferredLogicalWidth);
135
        minLogicalWidth = std::max(0_lu, minLogicalWidth);
136
        maxLogicalWidth = std::max(0_lu, maxLogicalWidth);
105
        
137
        
106
        minPreferredLogicalWidth += margin;
138
        if (hadExcludedChildren) {
107
        maxPreferredLogicalWidth += margin;
139
            minLogicalWidth = std::max(minLogicalWidth, childMinWidth);
108
140
            maxLogicalWidth = std::max(maxLogicalWidth, childMaxWidth);
109
        if (!isColumnFlow()) {
110
            maxLogicalWidth += maxPreferredLogicalWidth;
111
            if (isMultiline()) {
112
                // For multiline, the min preferred width is if you put a break between
113
                // each item.
114
                minLogicalWidth = std::max(minLogicalWidth, minPreferredLogicalWidth);
115
            } else
116
                minLogicalWidth += minPreferredLogicalWidth;
117
        } else {
118
            minLogicalWidth = std::max(minPreferredLogicalWidth, minLogicalWidth);
119
            maxLogicalWidth = std::max(maxPreferredLogicalWidth, maxLogicalWidth);
120
        }
141
        }
121
    }
142
    };
122
123
    if (!isColumnFlow() && numItemsWithNormalLayout > 1) {
124
        LayoutUnit inlineGapSize = (numItemsWithNormalLayout - 1) * computeGap(GapType::BetweenItems);
125
        maxLogicalWidth += inlineGapSize;
126
        if (!isMultiline())
127
            minLogicalWidth += inlineGapSize;
128
    }
129
143
130
    maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth);
144
    if (!shouldApplySizeContainment(*this))
131
    
145
        computeIntrinsicLogicalWidthsFromChildren();
132
    // Due to negative margins, it is possible that we calculated a negative
133
    // intrinsic width. Make sure that we never return a negative width.
134
    minLogicalWidth = std::max(0_lu, minLogicalWidth);
135
    maxLogicalWidth = std::max(0_lu, maxLogicalWidth);
136
    
137
    if (hadExcludedChildren) {
138
        minLogicalWidth = std::max(minLogicalWidth, childMinWidth);
139
        maxLogicalWidth = std::max(maxLogicalWidth, childMaxWidth);
140
    }
141
146
142
    LayoutUnit scrollbarWidth(scrollbarLogicalWidth());
147
    LayoutUnit scrollbarWidth(scrollbarLogicalWidth());
143
    maxLogicalWidth += scrollbarWidth;
148
    maxLogicalWidth += scrollbarWidth;
- 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 389-395 bool RenderReplaced::setNeedsLayoutIfNeededAfterIntrinsicSizeChange() a/Source/WebCore/rendering/RenderReplaced.cpp_sec1
389
void RenderReplaced::computeAspectRatioInformationForRenderBox(RenderBox* contentRenderer, FloatSize& constrainedSize, double& intrinsicRatio) const
389
void RenderReplaced::computeAspectRatioInformationForRenderBox(RenderBox* contentRenderer, FloatSize& constrainedSize, double& intrinsicRatio) const
390
{
390
{
391
    FloatSize intrinsicSize;
391
    FloatSize intrinsicSize;
392
    if (contentRenderer) {
392
    if (shouldApplySizeContainment(*this))
393
        RenderReplaced::computeIntrinsicRatioInformation(intrinsicSize, intrinsicRatio);
394
    else if (contentRenderer) {
393
        contentRenderer->computeIntrinsicRatioInformation(intrinsicSize, intrinsicRatio);
395
        contentRenderer->computeIntrinsicRatioInformation(intrinsicSize, intrinsicRatio);
394
396
395
        if (style().aspectRatioType() == AspectRatioType::Ratio || (style().aspectRatioType() == AspectRatioType::AutoAndRatio && !intrinsicRatio))
397
        if (style().aspectRatioType() == AspectRatioType::Ratio || (style().aspectRatioType() == AspectRatioType::AutoAndRatio && !intrinsicRatio))
Lines 494-500 Optional<double> RenderReplaced::intrinsicAspectRatioFromWidthHeight() const a/Source/WebCore/rendering/RenderReplaced.cpp_sec2
494
void RenderReplaced::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio) const
496
void RenderReplaced::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio) const
495
{
497
{
496
    // If there's an embeddedContentBox() of a remote, referenced document available, this code-path should never be used.
498
    // If there's an embeddedContentBox() of a remote, referenced document available, this code-path should never be used.
497
    ASSERT(!embeddedContentBox());
499
    ASSERT(!embeddedContentBox() || shouldApplySizeContainment(*this));
498
    intrinsicSize = FloatSize(intrinsicLogicalWidth(), intrinsicLogicalHeight());
500
    intrinsicSize = FloatSize(intrinsicLogicalWidth(), intrinsicLogicalHeight());
499
501
500
    if (style().hasAspectRatio()) {
502
    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 NOBODY (OOPS!).
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-03  Chris Lord  <clord@igalia.com>
13
2021-05-03  Chris Lord  <clord@igalia.com>
2
14
3
        Decoding an SVG off the main thread causes a crash
15
        Decoding an SVG off the main thread causes a crash
- 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 NOBODY (OOPS!).
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-03  Chris Lord  <clord@igalia.com>
18
2021-05-03  Chris Lord  <clord@igalia.com>
2
19
3
        Decoding an SVG off the main thread causes a crash
20
        Decoding an SVG off the main thread causes a crash
- a/LayoutTests/TestExpectations -62 / +25 lines
Lines 4589-4595 webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-014 a/LayoutTests/TestExpectations_sec1
4589
webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-015.html [ ImageOnlyFailure ] # Requires fallback (at parse time) support (unclear if this makes sense)
4589
webkit.org/b/220928 imported/w3c/web-platform-tests/css/css-color/predefined-015.html [ ImageOnlyFailure ] # Requires fallback (at parse time) support (unclear if this makes sense)
4590
4590
4591
# CSS containment tests that fail
4591
# CSS containment tests that fail
4592
imported/w3c/web-platform-tests/css/css-contain/contain-animation-001.html [ ImageOnlyFailure ]
4593
# webkit-ruby-text
4592
# webkit-ruby-text
4594
imported/w3c/web-platform-tests/css/css-contain/contain-layout-017.html [ ImageOnlyFailure ]
4593
imported/w3c/web-platform-tests/css/css-contain/contain-layout-017.html [ ImageOnlyFailure ]
4595
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-001.html [ ImageOnlyFailure ]
4594
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-001.html [ ImageOnlyFailure ]
Lines 4606-4612 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visib a/LayoutTests/TestExpectations_sec2
4606
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-020.html [ ImageOnlyFailure ]
4605
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-020.html [ ImageOnlyFailure ]
4607
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-021.html [ ImageOnlyFailure ]
4606
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-021.html [ ImageOnlyFailure ]
4608
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-022.html [ ImageOnlyFailure ]
4607
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-022.html [ ImageOnlyFailure ]
4609
imported/w3c/web-platform-tests/css/css-contain/contain-layout-size-003.html [ ImageOnlyFailure ]
4610
imported/w3c/web-platform-tests/css/css-contain/contain-paint-001.html [ ImageOnlyFailure ]
4608
imported/w3c/web-platform-tests/css/css-contain/contain-paint-001.html [ ImageOnlyFailure ]
4611
imported/w3c/web-platform-tests/css/css-contain/contain-paint-004.html [ ImageOnlyFailure ]
4609
imported/w3c/web-platform-tests/css/css-contain/contain-paint-004.html [ ImageOnlyFailure ]
4612
imported/w3c/web-platform-tests/css/css-contain/contain-paint-005.html [ ImageOnlyFailure ]
4610
imported/w3c/web-platform-tests/css/css-contain/contain-paint-005.html [ ImageOnlyFailure ]
Lines 4648-4715 imported/w3c/web-platform-tests/css/css-contain/contain-paint-stacking-context-0 a/LayoutTests/TestExpectations_sec3
4648
imported/w3c/web-platform-tests/css/css-contain/contain-paint-stacking-context-001b.html [ ImageOnlyFailure ]
4646
imported/w3c/web-platform-tests/css/css-contain/contain-paint-stacking-context-001b.html [ ImageOnlyFailure ]
4649
imported/w3c/web-platform-tests/css/css-contain/contain-paint-table-001.html [ ImageOnlyFailure ]
4647
imported/w3c/web-platform-tests/css/css-contain/contain-paint-table-001.html [ ImageOnlyFailure ]
4650
imported/w3c/web-platform-tests/css/css-contain/contain-paint-table-002.html [ ImageOnlyFailure ]
4648
imported/w3c/web-platform-tests/css/css-contain/contain-paint-table-002.html [ ImageOnlyFailure ]
4651
imported/w3c/web-platform-tests/css/css-contain/contain-size-011.html [ ImageOnlyFailure ]
4652
imported/w3c/web-platform-tests/css/css-contain/contain-size-013.html [ ImageOnlyFailure ]
4653
imported/w3c/web-platform-tests/css/css-contain/contain-size-021.html [ ImageOnlyFailure ]
4654
imported/w3c/web-platform-tests/css/css-contain/contain-size-023.html [ ImageOnlyFailure ]
4655
imported/w3c/web-platform-tests/css/css-contain/contain-size-025.html [ ImageOnlyFailure ]
4656
imported/w3c/web-platform-tests/css/css-contain/contain-size-027.html [ ImageOnlyFailure ]
4657
imported/w3c/web-platform-tests/css/css-contain/contain-size-041.html [ ImageOnlyFailure ]
4658
imported/w3c/web-platform-tests/css/css-contain/contain-size-042.html [ ImageOnlyFailure ]
4659
imported/w3c/web-platform-tests/css/css-contain/contain-size-056.html [ ImageOnlyFailure ]
4660
imported/w3c/web-platform-tests/css/css-contain/contain-size-061.html [ ImageOnlyFailure ]
4661
imported/w3c/web-platform-tests/css/css-contain/contain-size-062.html [ ImageOnlyFailure ]
4662
imported/w3c/web-platform-tests/css/css-contain/contain-size-063.html [ ImageOnlyFailure ]
4663
imported/w3c/web-platform-tests/css/css-contain/contain-size-064.html [ ImageOnlyFailure ]
4664
imported/w3c/web-platform-tests/css/css-contain/contain-size-block-001.html [ ImageOnlyFailure ]
4665
imported/w3c/web-platform-tests/css/css-contain/contain-size-block-002.html [ ImageOnlyFailure ]
4666
imported/w3c/web-platform-tests/css/css-contain/contain-size-block-003.html [ ImageOnlyFailure ]
4667
imported/w3c/web-platform-tests/css/css-contain/contain-size-block-004.html [ ImageOnlyFailure ]
4668
imported/w3c/web-platform-tests/css/css-contain/contain-size-borders.html [ ImageOnlyFailure ]
4669
imported/w3c/web-platform-tests/css/css-contain/contain-size-breaks-001.html [ ImageOnlyFailure ]
4670
imported/w3c/web-platform-tests/css/css-contain/contain-size-button-001.html [ ImageOnlyFailure ]
4671
imported/w3c/web-platform-tests/css/css-contain/contain-size-button-002.html [ ImageOnlyFailure ]
4672
imported/w3c/web-platform-tests/css/css-contain/contain-size-fieldset-001.html [ ImageOnlyFailure ]
4673
imported/w3c/web-platform-tests/css/css-contain/contain-size-fieldset-002.html [ ImageOnlyFailure ]
4674
imported/w3c/web-platform-tests/css/css-contain/contain-size-fieldset-003.html [ ImageOnlyFailure ]
4675
imported/w3c/web-platform-tests/css/css-contain/contain-size-fieldset-004.html [ ImageOnlyFailure ]
4676
imported/w3c/web-platform-tests/css/css-contain/contain-size-flex-001.html [ ImageOnlyFailure ]
4677
imported/w3c/web-platform-tests/css/css-contain/contain-size-flexbox-001.html [ ImageOnlyFailure ]
4678
imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-001.html [ ImageOnlyFailure ]
4679
imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-002.html [ ImageOnlyFailure ]
4680
imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-005.html [ ImageOnlyFailure ]
4681
imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-block-001.html [ ImageOnlyFailure ]
4682
imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-block-002.html [ ImageOnlyFailure ]
4683
imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-block-003.html [ ImageOnlyFailure ]
4684
imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-block-004.html [ ImageOnlyFailure ]
4685
imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-flex-001.html [ ImageOnlyFailure ]
4686
imported/w3c/web-platform-tests/css/css-contain/contain-size-monolithic-001.html [ ImageOnlyFailure ]
4687
imported/w3c/web-platform-tests/css/css-contain/contain-size-monolithic-002.html [ ImageOnlyFailure ]
4688
imported/w3c/web-platform-tests/css/css-contain/contain-size-multicol-001.html [ ImageOnlyFailure ]
4689
imported/w3c/web-platform-tests/css/css-contain/contain-size-multicol-002.html [ ImageOnlyFailure ]
4690
imported/w3c/web-platform-tests/css/css-contain/contain-size-multicol-003.html [ ImageOnlyFailure ]
4691
imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-001.html [ ImageOnlyFailure ]
4692
imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-002.html [ ImageOnlyFailure ]
4693
imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-003a.html [ ImageOnlyFailure ]
4694
imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-003b.html [ ImageOnlyFailure ]
4695
imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-003c.html [ ImageOnlyFailure ]
4696
imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-004.html [ ImageOnlyFailure ]
4697
imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-005.html [ ImageOnlyFailure ]
4698
imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-006.html [ ImageOnlyFailure ]
4699
imported/w3c/web-platform-tests/css/css-contain/contain-size-scrollbars-001.html [ ImageOnlyFailure ]
4700
imported/w3c/web-platform-tests/css/css-contain/contain-size-scrollbars-002.html [ ImageOnlyFailure ]
4701
imported/w3c/web-platform-tests/css/css-contain/contain-size-scrollbars-003.html [ ImageOnlyFailure ]
4702
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-001.html [ ImageOnlyFailure ]
4703
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-002.html [ ImageOnlyFailure ]
4704
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-001.html [ ImageOnlyFailure ]
4705
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-002.html [ ImageOnlyFailure ]
4706
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-003.html [ ImageOnlyFailure ]
4707
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-004.html [ ImageOnlyFailure ]
4708
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-005.html [ ImageOnlyFailure ]
4709
imported/w3c/web-platform-tests/css/css-contain/contain-size-table-caption-001.html [ ImageOnlyFailure ]
4710
imported/w3c/web-platform-tests/css/css-contain/contain-strict-001.html [ ImageOnlyFailure ]
4649
imported/w3c/web-platform-tests/css/css-contain/contain-strict-001.html [ ImageOnlyFailure ]
4711
imported/w3c/web-platform-tests/css/css-contain/contain-strict-002.html [ ImageOnlyFailure ]
4650
imported/w3c/web-platform-tests/css/css-contain/contain-strict-002.html [ ImageOnlyFailure ]
4712
imported/w3c/web-platform-tests/css/css-contain/contain-strict-003.html [ ImageOnlyFailure ]
4713
imported/w3c/web-platform-tests/css/css-contain/contain-strict-011.html [ ImageOnlyFailure ]
4651
imported/w3c/web-platform-tests/css/css-contain/contain-strict-011.html [ ImageOnlyFailure ]
4714
imported/w3c/web-platform-tests/css/css-contain/contain-style-counters-001.html [ ImageOnlyFailure ]
4652
imported/w3c/web-platform-tests/css/css-contain/contain-style-counters-001.html [ ImageOnlyFailure ]
4715
imported/w3c/web-platform-tests/css/css-contain/contain-style-counters-002.html [ ImageOnlyFailure ]
4653
imported/w3c/web-platform-tests/css/css-contain/contain-style-counters-002.html [ ImageOnlyFailure ]
Lines 4741-4746 imported/w3c/web-platform-tests/css/css-contain/quote-scoping-002.html [ ImageOn a/LayoutTests/TestExpectations_sec4
4741
imported/w3c/web-platform-tests/css/css-contain/quote-scoping-003.html [ ImageOnlyFailure ]
4679
imported/w3c/web-platform-tests/css/css-contain/quote-scoping-003.html [ ImageOnlyFailure ]
4742
imported/w3c/web-platform-tests/css/css-contain/quote-scoping-004.html [ ImageOnlyFailure ]
4680
imported/w3c/web-platform-tests/css/css-contain/quote-scoping-004.html [ ImageOnlyFailure ]
4743
4681
4682
# Canvas doesn't get default aspect-ratio for width and height attributes.
4683
webkit.org/b/217529 imported/w3c/web-platform-tests/css/css-flexbox/canvas-contain-size.html [ ImageOnlyFailure ]
4684
4685
# Content is painted on svg's padding area.
4686
webkit.org/b/425868 imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-002.html [ ImageOnlyFailure ]
4687
4688
# Multicolumn does not paint the horizontal overflow area of a relative child.
4689
webkit.org/b/41796 imported/w3c/web-platform-tests/css/css-contain/contain-size-monolithic-002.html [ ImageOnlyFailure ]
4690
4691
# Buttons with auto width and height has extra margins.
4692
imported/w3c/web-platform-tests/css/css-contain/contain-size-button-001.html [ ImageOnlyFailure ]
4693
imported/w3c/web-platform-tests/css/css-contain/contain-size-button-002.html [ ImageOnlyFailure ]
4694
4695
# Scrollbar displays are different.
4696
imported/w3c/web-platform-tests/css/css-contain/contain-size-block-003.html [ ImageOnlyFailure ]
4697
imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-block-003.html [ ImageOnlyFailure ]
4698
4699
# Select with empty content always has root linebox, so the heights are different.
4700
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-001.html [ ImageOnlyFailure ]
4701
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-002.html [ ImageOnlyFailure ]
4702
4703
# CSS property color is not working in select elements.
4704
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-001.html [ ImageOnlyFailure ]
4705
imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-002.html [ ImageOnlyFailure ]
4706
4744
# Tests that fail because they assume a vertical scrollbar in `writing-mode: vertical-rl` elements will be on the right-hand side
4707
# Tests that fail because they assume a vertical scrollbar in `writing-mode: vertical-rl` elements will be on the right-hand side
4745
webkit.org/b/224357 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthog-vrl-in-htb-013.xht [ ImageOnlyFailure ]
4708
webkit.org/b/224357 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthog-vrl-in-htb-013.xht [ ImageOnlyFailure ]
4746
webkit.org/b/224357 imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-vertical-rl.html [ ImageOnlyFailure ]
4709
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