WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-223570-20210511201155.patch (text/plain), 68.33 KB, created by
cathiechen
on 2021-05-11 05:12:04 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
cathiechen
Created:
2021-05-11 05:12:04 PDT
Size:
68.33 KB
patch
obsolete
>Subversion Revision: 277317 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index e395e3f387c61864cb53f70eb4bde166c4e9fbf7..ca25820902066e5593d1e355a2bc081ac9fde676 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,100 @@ >+2021-05-04 Cathie Chen <cathiechen@igalia.com> >+ >+ [CSS contain] Support contain:size >+ https://bugs.webkit.org/show_bug.cgi?id=223570 >+ >+ Reviewed by Alan Bujtas. >+ >+ This patch brings initial support of CSS contain:size according to [1]. >+ It adds shouldApplySizeContainment() to indicate whether the object is a size containment box. >+ The intrinsic sizes of size containment box are determined as if it had no content. >+ So the implementation need to cooperate with the layout steps: >+ - Computing logical width: Size containment boxes skip handling children while computing minLogicalWidth >+ and maxLogicalWidth in computeIntrinsicLogicalWidths. So the logical width is not affected by children. >+ - Layout children: The logical height is changed after layout all children. >+ - Computing logical height: At the beginning, size containment boxes need to reset logical height to the empty content height >+ if it is not renderGrid. So the logical height is not affected by children. >+ We also need to calculate the sizes according to the layout algorithms. >+ - Grid layout: >+ To calculate the minLogicalWidth and maxLogicalWidth for indefinite size RenderGrid. >+ The widths are calculated by GridTrackSizingAlgorithm: m_minContentSize and m_maxContentSize which are the sum of >+ m_baseSize/m_growthLimit of all GridTracks. The size containment RenderGrid skips handling content in resolveIntrinsicTrackSizes >+ and the m_maxContentSize will be the sum of m_baseSize. The logical height is same to width, but after calculating >+ RenderGrid's logical height, it needs to calculate the track sizes again, to make sure that they are distributed properly. >+ We use computeTrackSizesForDefiniteSize(ForRows, trackBasedLogicalHeight) to recalculate it. >+ - MultiColumn layout: >+ According to the specification, size containment boxes should be monolithic, so we need to extend column height >+ for overflow and positioned size containment boxes. m_spaceShortageForSizeContainment is added to indicate the shortage space >+ that need to balance the column heights. adjustSizeContainmentChildForPagination() will calculate the shortage. >+ >+ [1] https://www.w3.org/TR/css-contain-1/#containment-size >+ >+ * rendering/GridTrackSizingAlgorithm.cpp: Add isComputingSizeContainment to indicate if it is calculating sizes >+ for indefinite size RenderGrid which is size containment. >+ (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const): >+ (WebCore::GridTrackSizingAlgorithm::computeGridContainerIntrinsicSizes): >+ It skips resolveIntrinsicTrackSizes if isComputingSizeContainment, so growthLimit might be undefined, >+ if so, use track.baseSize() instead. >+ (WebCore::GridTrackSizingAlgorithm::resolveIntrinsicTrackSizes): Skip resolve the content if isComputingSizeContainment(). >+ (WebCore::GridTrackSizingAlgorithm::advanceNextState): Added RowSizingExtraIterationForSizeContainment. >+ (WebCore::GridTrackSizingAlgorithm::isValidTransition const): >+ (WebCore::GridTrackSizingAlgorithm::run): Do not stretch the track sizes if isComputingSizeContainment(). >+ * rendering/GridTrackSizingAlgorithm.h: >+ * rendering/RenderBlock.cpp: >+ (WebCore::RenderBlock::layoutPositionedObject): Calculate m_spaceShortageForSizeContainment for positioned size containment. >+ (WebCore::RenderBlock::computeIntrinsicLogicalWidths const): Skip computeBlockPreferredLogicalWidths if shouldApplySizeContainment. >+ * rendering/RenderBlockFlow.cpp: >+ (WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths const): Skip handling the children for size containment box. >+ (WebCore::RenderBlockFlow::adjustBlockChildForPagination): Calculate m_spaceShortageForSizeContainment for child. >+ (WebCore::RenderBlockFlow::adjustSizeContainmentChildForPagination): m_spaceShortageForSizeContainment = childOverflowHeight - remainingLogicalHeight. >+ * rendering/RenderBlockFlow.h: >+ * rendering/RenderBox.cpp: >+ (WebCore::RenderBox::updateLogicalHeight): Reset the logical height to empty content height for size containment box. >+ (WebCore::RenderBox::isUnsplittableForPagination const): Size containment box is unsplittable. >+ * rendering/RenderDeprecatedFlexibleBox.cpp: >+ (WebCore::RenderDeprecatedFlexibleBox::computeIntrinsicLogicalWidths const): Ditto. >+ * rendering/RenderFileUploadControl.cpp: >+ (WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths const): Ditto. >+ * rendering/RenderFlexibleBox.cpp: >+ (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths const): Ditto. >+ * rendering/RenderFragmentedFlow.h: >+ * rendering/RenderGrid.cpp: >+ (WebCore::RenderGrid::layoutBlock): If it is size containment with infiniteSize, using trackBasedLogicalHeight >+ to compute track sizes again to make sure the height is distributed properly. >+ (WebCore::RenderGrid::computeEmptyTracksForAutoRepeat const): Collapse if shouldApplySizeContainment. >+ * rendering/RenderImage.cpp: >+ (WebCore::RenderImage::computeIntrinsicRatioInformation const): This is handled in RenderReplaced::computeIntrinsicRatioInformation instead. >+ * rendering/RenderListBox.cpp: >+ (WebCore::RenderListBox::computeIntrinsicLogicalWidths const): The widths of size containment boxes are optionsSpacingHorizontal. >+ * rendering/RenderMenuList.cpp: >+ (RenderMenuList::computeIntrinsicLogicalWidths const): The widths of size containment box are theme.minimumMenuListSize. >+ * rendering/RenderMultiColumnFlow.cpp: >+ (WebCore::RenderMultiColumnFlow::updateSpaceShortageForSizeContainment): Set m_spaceShortageForSizeContainment. >+ * rendering/RenderMultiColumnFlow.h: >+ * rendering/RenderMultiColumnSet.cpp: >+ (WebCore::RenderMultiColumnSet::RenderMultiColumnSet): >+ (WebCore::RenderMultiColumnSet::calculateBalancedHeight const): Add m_spaceShortageForSizeContainment to the column height. >+ (WebCore::RenderMultiColumnSet::prepareForLayout): Reset m_spaceShortageForSizeContainment. >+ * rendering/RenderMultiColumnSet.h: >+ * rendering/RenderObject.cpp: >+ (WebCore::shouldApplySizeContainment): Check if the object is a size containment box. >+ * rendering/RenderObject.h: >+ (WebCore::RenderObject::isAtomicInlineLevelBox const): >+ * rendering/RenderReplaced.cpp: >+ (WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox const): >+ (WebCore::RenderReplaced::computeIntrinsicRatioInformation const): Use the empty intrinsicSize. >+ * rendering/RenderReplaced.h: The intrinsicSize of size containment is (0, 0). >+ * rendering/RenderSlider.cpp: >+ (WebCore::RenderSlider::computeIntrinsicLogicalWidths const): Ditto. >+ * rendering/RenderTextControl.cpp: >+ (WebCore::RenderTextControl::computeIntrinsicLogicalWidths const): Ditto. >+ * rendering/RenderVideo.cpp: >+ (WebCore::RenderVideo::calculateIntrinsicSize): Ditto. >+ * rendering/style/RenderStyle.h: >+ (WebCore::RenderStyle::containsSize const): >+ * rendering/svg/RenderSVGRoot.cpp: >+ (WebCore::RenderSVGRoot::computeIntrinsicRatioInformation const): Handled in RenderReplaced::computeIntrinsicRatioInformation instead. >+ > 2021-05-10 Wenson Hsieh <wenson_hsieh@apple.com> > > [macOS] Allow immediate action gestures to begin when force clicking text inside image overlays >diff --git a/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp b/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp >index 3a1479eea81af6f77607343657caff44fde49055..a270db8bd6f84cd790daf2117668f5ec2dd266fe 100644 >--- a/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp >+++ b/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp >@@ -580,7 +580,7 @@ Optional<LayoutUnit> GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild( > Optional<LayoutUnit> GridTrackSizingAlgorithm::gridAreaBreadthForChild(const RenderBox& child, GridTrackSizingDirection direction) const > { > bool addContentAlignmentOffset = >- direction == ForColumns && m_sizingState == RowSizingFirstIteration; >+ direction == ForColumns && (m_sizingState == RowSizingFirstIteration || m_sizingState == RowSizingExtraIterationForSizeContainment); > // To determine the column track's size based on an orthogonal grid item we need it's logical > // height, which may depend on the row track's size. It's possible that the row tracks sizing > // logic has not been performed yet, so we will need to do an estimation. >@@ -736,9 +736,9 @@ void GridTrackSizingAlgorithm::computeGridContainerIntrinsicSizes() > > Vector<GridTrack>& allTracks = tracks(m_direction); > for (auto& track : allTracks) { >- ASSERT(!track.infiniteGrowthPotential()); >+ ASSERT(m_strategy->isComputingSizeContainment() || !track.infiniteGrowthPotential()); > m_minContentSize += track.baseSize(); >- m_maxContentSize += track.growthLimit(); >+ m_maxContentSize += track.growthLimitIsInfinite() ? track.baseSize() : track.growthLimit(); > // The growth limit caps must be cleared now in order to properly sort > // tracks by growth potential on an eventual "Maximize Tracks". > track.setGrowthLimitCap(WTF::nullopt); >@@ -932,6 +932,7 @@ private: > double findUsedFlexFraction(Vector<unsigned>& flexibleSizedTracksIndex, GridTrackSizingDirection, Optional<LayoutUnit> freeSpace) const override; > bool recomputeUsedFlexFractionIfNeeded(double& flexFraction, LayoutUnit& totalGrowth) const override; > LayoutUnit freeSpaceForStretchAutoTracksStep() const override; >+ bool isComputingSizeContainment() const override { return shouldApplySizeContainment(*renderGrid()); } > }; > > void IndefiniteSizeStrategy::layoutGridItemForMinSizeComputation(RenderBox& child, bool overrideSizeHasChanged) const >@@ -1030,6 +1031,7 @@ private: > LayoutUnit freeSpaceForStretchAutoTracksStep() const override; > LayoutUnit minContentForChild(RenderBox&) const override; > LayoutUnit minLogicalSizeForChild(RenderBox&, const Length& childMinSize, Optional<LayoutUnit> availableSize) const override; >+ bool isComputingSizeContainment() const override { return false; } > }; > > LayoutUnit IndefiniteSizeStrategy::freeSpaceForStretchAutoTracksStep() const >@@ -1146,9 +1148,22 @@ void GridTrackSizingAlgorithm::initializeTrackSizes() > > void GridTrackSizingAlgorithm::resolveIntrinsicTrackSizes() > { >+ Vector<GridTrack>& allTracks = tracks(m_direction); >+ auto handleInfinityGrowthLimit = [&]() { >+ for (auto trackIndex : m_contentSizedTracksIndex) { >+ GridTrack& track = allTracks[trackIndex]; >+ if (track.growthLimit() == infinity) >+ track.setGrowthLimit(track.baseSize()); >+ } >+ }; >+ >+ if (m_strategy->isComputingSizeContainment()) { >+ handleInfinityGrowthLimit(); >+ return; >+ } >+ > Vector<GridItemWithSpan> itemsSortedByIncreasingSpan; > HashSet<RenderBox*> itemsSet; >- Vector<GridTrack>& allTracks = tracks(m_direction); > if (m_grid.hasGridItems()) { > for (auto trackIndex : m_contentSizedTracksIndex) { > GridIterator iterator(m_grid, m_direction, trackIndex); >@@ -1178,12 +1193,7 @@ void GridTrackSizingAlgorithm::resolveIntrinsicTrackSizes() > increaseSizesToAccommodateSpanningItems<ResolveMaxContentMaximums>(spanGroupRange); > it = spanGroupRange.rangeEnd; > } >- >- for (auto trackIndex : m_contentSizedTracksIndex) { >- GridTrack& track = allTracks[trackIndex]; >- if (track.growthLimit() == infinity) >- track.setGrowthLimit(track.baseSize()); >- } >+ handleInfinityGrowthLimit(); > } > > void GridTrackSizingAlgorithm::stretchFlexibleTracks(Optional<LayoutUnit> freeSpace) >@@ -1239,6 +1249,9 @@ void GridTrackSizingAlgorithm::advanceNextState() > m_sizingState = RowSizingFirstIteration; > return; > case RowSizingFirstIteration: >+ m_sizingState = m_strategy->isComputingSizeContainment() ? RowSizingExtraIterationForSizeContainment : ColumnSizingSecondIteration; >+ return; >+ case RowSizingExtraIterationForSizeContainment: > m_sizingState = ColumnSizingSecondIteration; > return; > case ColumnSizingSecondIteration: >@@ -1259,6 +1272,7 @@ bool GridTrackSizingAlgorithm::isValidTransition() const > case ColumnSizingSecondIteration: > return m_direction == ForColumns; > case RowSizingFirstIteration: >+ case RowSizingExtraIterationForSizeContainment: > case RowSizingSecondIteration: > return m_direction == ForRows; > } >@@ -1346,6 +1360,8 @@ void GridTrackSizingAlgorithm::run() > > // Step 3. > m_strategy->maximizeTracks(tracks(m_direction), m_direction == ForColumns ? m_freeSpaceColumns : m_freeSpaceRows); >+ if (m_strategy->isComputingSizeContainment()) >+ return; > > // Step 4. > stretchFlexibleTracks(initialFreeSpace); >diff --git a/Source/WebCore/rendering/GridTrackSizingAlgorithm.h b/Source/WebCore/rendering/GridTrackSizingAlgorithm.h >index 031125da9bfdb588a9a91961a3b1528e987f4162..6b797ea8785409ddeb18a059f4160d55d65d58ff 100644 >--- a/Source/WebCore/rendering/GridTrackSizingAlgorithm.h >+++ b/Source/WebCore/rendering/GridTrackSizingAlgorithm.h >@@ -224,6 +224,7 @@ private: > enum SizingState { > ColumnSizingFirstIteration, > RowSizingFirstIteration, >+ RowSizingExtraIterationForSizeContainment, > ColumnSizingSecondIteration, > RowSizingSecondIteration > }; >@@ -261,6 +262,7 @@ public: > virtual double findUsedFlexFraction(Vector<unsigned>& flexibleSizedTracksIndex, GridTrackSizingDirection, Optional<LayoutUnit> initialFreeSpace) const = 0; > virtual bool recomputeUsedFlexFractionIfNeeded(double& flexFraction, LayoutUnit& totalGrowth) const = 0; > virtual LayoutUnit freeSpaceForStretchAutoTracksStep() const = 0; >+ virtual bool isComputingSizeContainment() const = 0; > > protected: > GridTrackSizingAlgorithmStrategy(GridTrackSizingAlgorithm& algorithm) >diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp >index 5f4b72e6515c7a21f334fc048d419588a4bcee28..7fffe6bc0ba2f35b3a15938ee5e9d5ed41102ed5 100644 >--- a/Source/WebCore/rendering/RenderBlock.cpp >+++ b/Source/WebCore/rendering/RenderBlock.cpp >@@ -1073,6 +1073,9 @@ void RenderBlock::layoutPositionedObject(RenderBox& r, bool relayoutChildren, bo > r.setNeedsLayout(MarkOnlyThis); > r.layoutIfNeeded(); > } >+ >+ if (view().frameView().layoutContext().layoutState()->isPaginated() && is<RenderBlockFlow>(*this)) >+ downcast<RenderBlockFlow>(*this).adjustSizeContainmentChildForPagination(r, r.logicalTop()); > } > > void RenderBlock::layoutPositionedObjects(bool relayoutChildren, bool fixedPositionObjectsOnly) >@@ -2282,8 +2285,8 @@ void RenderBlock::offsetForContents(LayoutPoint& offset) const > void RenderBlock::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const > { > ASSERT(!childrenInline()); >- >- computeBlockPreferredLogicalWidths(minLogicalWidth, maxLogicalWidth); >+ if (!shouldApplySizeContainment(*this)) >+ computeBlockPreferredLogicalWidths(minLogicalWidth, maxLogicalWidth); > > maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth); > >diff --git a/Source/WebCore/rendering/RenderBlockFlow.cpp b/Source/WebCore/rendering/RenderBlockFlow.cpp >index 96c67f561e501f9fb5b2607a415f6c586a1c6372..14abf6bebdca9c029aed50e87d17275b35325452 100644 >--- a/Source/WebCore/rendering/RenderBlockFlow.cpp >+++ b/Source/WebCore/rendering/RenderBlockFlow.cpp >@@ -339,10 +339,12 @@ void RenderBlockFlow::adjustIntrinsicLogicalWidthsForColumns(LayoutUnit& minLogi > > void RenderBlockFlow::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const > { >- if (childrenInline()) >- computeInlinePreferredLogicalWidths(minLogicalWidth, maxLogicalWidth); >- else >- computeBlockPreferredLogicalWidths(minLogicalWidth, maxLogicalWidth); >+ if (!shouldApplySizeContainment(*this)) { >+ if (childrenInline()) >+ computeInlinePreferredLogicalWidths(minLogicalWidth, maxLogicalWidth); >+ else >+ computeBlockPreferredLogicalWidths(minLogicalWidth, maxLogicalWidth); >+ } > > maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth); > >@@ -1662,6 +1664,9 @@ LayoutUnit RenderBlockFlow::adjustBlockChildForPagination(LayoutUnit logicalTopA > } > } > >+ if (shouldApplySizeContainment(child)) >+ adjustSizeContainmentChildForPagination(child, result); >+ > // For replaced elements and scrolled elements, we want to shift them to the next page if they don't fit on the current one. > LayoutUnit logicalTopBeforeUnsplittableAdjustment = result; > LayoutUnit logicalTopAfterUnsplittableAdjustment = adjustForUnsplittableChild(child, result); >@@ -2047,6 +2052,24 @@ LayoutUnit RenderBlockFlow::logicalHeightForChildForFragmentation(const RenderBo > return logicalHeightForChild(child); > } > >+void RenderBlockFlow::adjustSizeContainmentChildForPagination(RenderBox& child, LayoutUnit offset) >+{ >+ if (!shouldApplySizeContainment(child)) >+ return; >+ >+ LayoutUnit childOverflowHeight = child.isHorizontalWritingMode() ? child.layoutOverflowRect().maxY() : child.layoutOverflowRect().maxX(); >+ LayoutUnit childLogicalHeight = std::max(child.logicalHeight(), childOverflowHeight); >+ >+ LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(offset, ExcludePageBoundary); >+ >+ LayoutUnit spaceShortage = childLogicalHeight - remainingLogicalHeight; >+ if (spaceShortage <= 0) >+ return; >+ >+ if (RenderFragmentedFlow* fragmentedFlow = enclosingFragmentedFlow()) >+ fragmentedFlow->updateSpaceShortageForSizeContainment(this, offsetFromLogicalTopOfFirstPage() + offset, spaceShortage); >+} >+ > void RenderBlockFlow::layoutLineGridBox() > { > if (style().lineGrid() == RenderStyle::initialLineGrid()) { >diff --git a/Source/WebCore/rendering/RenderBlockFlow.h b/Source/WebCore/rendering/RenderBlockFlow.h >index 449859d38860a03a52dfdebfe7086db5fdcd5100..c7c946bafd815a474d72388b77e22389f446ccc4 100644 >--- a/Source/WebCore/rendering/RenderBlockFlow.h >+++ b/Source/WebCore/rendering/RenderBlockFlow.h >@@ -398,6 +398,8 @@ public: > // column balancer to help set a good minimum column height. > void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight); > >+ void adjustSizeContainmentChildForPagination(RenderBox& child, LayoutUnit offset); >+ > void addFloatsToNewParent(RenderBlockFlow& toBlockFlow) const; > > LayoutUnit endPaddingWidthForCaret() const; >diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp >index 6ba310f0ec28185404e8d888a7d58e1902ce57d1..c8ae0412fc6cc68a138940535aec897d9aacafdc 100644 >--- a/Source/WebCore/rendering/RenderBox.cpp >+++ b/Source/WebCore/rendering/RenderBox.cpp >@@ -2860,6 +2860,14 @@ void RenderBox::cacheIntrinsicContentLogicalHeightForFlexItem(LayoutUnit height) > > void RenderBox::updateLogicalHeight() > { >+ if (shouldApplySizeContainment(*this) && !isRenderGrid()) { >+ // We need the exact width of border and padding here, yet we can't use borderAndPadding* interfaces. >+ // Because these interfaces evetually call borderAfter/Before, and RenderBlock::borderBefore >+ // adds extra border to fieldset by adding intrinsicBorderForFieldset which is not needed here. >+ auto borderAndPadding = RenderBox::borderBefore() + RenderBox::paddingBefore() + RenderBox::borderAfter() + RenderBox::paddingAfter(); >+ setLogicalHeight(borderAndPadding + scrollbarLogicalHeight()); >+ } >+ > cacheIntrinsicContentLogicalHeightForFlexItem(contentLogicalHeight()); > auto computedValues = computeLogicalHeight(logicalHeight(), logicalTop()); > setLogicalHeight(computedValues.m_extent); >@@ -4857,7 +4865,8 @@ bool RenderBox::isUnsplittableForPagination() const > return isReplaced() > || hasUnsplittableScrollingOverflow() > || (parent() && isWritingModeRoot()) >- || (isFloating() && style().styleType() == PseudoId::FirstLetter && style().initialLetterDrop() > 0); >+ || (isFloating() && style().styleType() == PseudoId::FirstLetter && style().initialLetterDrop() > 0) >+ || shouldApplySizeContainment(*this); > } > > LayoutUnit RenderBox::lineHeight(bool /*firstLine*/, LineDirectionMode direction, LinePositionMode /*linePositionMode*/) const >diff --git a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp >index 4f2d1f3db1b790354ffc6859fc3bd727762fe18e..fc0c6546754460c8eebc26e6da7218ad42601f18 100644 >--- a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp >+++ b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp >@@ -187,6 +187,17 @@ void RenderDeprecatedFlexibleBox::styleWillChange(StyleDifference diff, const Re > > void RenderDeprecatedFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const > { >+ auto addScrollbarWidth = [&]() { >+ LayoutUnit scrollbarWidth = intrinsicScrollbarLogicalWidth(); >+ maxLogicalWidth += scrollbarWidth; >+ minLogicalWidth += scrollbarWidth; >+ }; >+ >+ if (shouldApplySizeContainment(*this)) { >+ addScrollbarWidth(); >+ return; >+ } >+ > if (hasMultipleLines() || isVertical()) { > for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) { > if (childDoesNotAffectWidthOrFlexing(child)) >@@ -211,10 +222,7 @@ void RenderDeprecatedFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minL > } > > maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth); >- >- LayoutUnit scrollbarWidth = intrinsicScrollbarLogicalWidth(); >- maxLogicalWidth += scrollbarWidth; >- minLogicalWidth += scrollbarWidth; >+ addScrollbarWidth(); > } > > void RenderDeprecatedFlexibleBox::computePreferredLogicalWidths() >diff --git a/Source/WebCore/rendering/RenderFileUploadControl.cpp b/Source/WebCore/rendering/RenderFileUploadControl.cpp >index 3d123c54b564da50417b4c0789729f39e33b15da..8785f2299c80d3946e8ffd21662d0292194631f7 100644 >--- a/Source/WebCore/rendering/RenderFileUploadControl.cpp >+++ b/Source/WebCore/rendering/RenderFileUploadControl.cpp >@@ -197,6 +197,8 @@ void RenderFileUploadControl::paintObject(PaintInfo& paintInfo, const LayoutPoin > > void RenderFileUploadControl::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const > { >+ if (shouldApplySizeContainment(*this)) >+ return; > // Figure out how big the filename space needs to be for a given number of characters > // (using "0" as the nominal character). > const UChar character = '0'; >diff --git a/Source/WebCore/rendering/RenderFlexibleBox.cpp b/Source/WebCore/rendering/RenderFlexibleBox.cpp >index 229b693df197ffcbe26901b88ab259ac30051f25..433e0b451ed3d7cb57b025fee9f4fd61f1254e8f 100644 >--- a/Source/WebCore/rendering/RenderFlexibleBox.cpp >+++ b/Source/WebCore/rendering/RenderFlexibleBox.cpp >@@ -83,6 +83,17 @@ const char* RenderFlexibleBox::renderName() const > > void RenderFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const > { >+ auto addScrollbarWidth = [&]() { >+ LayoutUnit scrollbarWidth(scrollbarLogicalWidth()); >+ maxLogicalWidth += scrollbarWidth; >+ minLogicalWidth += scrollbarWidth; >+ }; >+ >+ if (shouldApplySizeContainment(*this)) { >+ addScrollbarWidth(); >+ return; >+ } >+ > LayoutUnit childMinWidth; > LayoutUnit childMaxWidth; > bool hadExcludedChildren = computePreferredWidthsForExcludedChildren(childMinWidth, childMaxWidth); >@@ -98,11 +109,11 @@ void RenderFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidt > ++numItemsWithNormalLayout; > > LayoutUnit margin = marginIntrinsicLogicalWidthForChild(*child); >- >+ > LayoutUnit minPreferredLogicalWidth; > LayoutUnit maxPreferredLogicalWidth; > computeChildPreferredLogicalWidths(*child, minPreferredLogicalWidth, maxPreferredLogicalWidth); >- >+ > minPreferredLogicalWidth += margin; > maxPreferredLogicalWidth += margin; > >@@ -139,9 +150,7 @@ void RenderFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidt > maxLogicalWidth = std::max(maxLogicalWidth, childMaxWidth); > } > >- LayoutUnit scrollbarWidth(scrollbarLogicalWidth()); >- maxLogicalWidth += scrollbarWidth; >- minLogicalWidth += scrollbarWidth; >+ addScrollbarWidth(); > } > > LayoutUnit RenderFlexibleBox::baselinePosition(FontBaseline, bool, LineDirectionMode direction, LinePositionMode) const >diff --git a/Source/WebCore/rendering/RenderFragmentedFlow.h b/Source/WebCore/rendering/RenderFragmentedFlow.h >index faceb196d9bf77cd628554e3351000e99893ad63..b73be2b1b0e4827edae6027aa6e35fcb171d6361 100644 >--- a/Source/WebCore/rendering/RenderFragmentedFlow.h >+++ b/Source/WebCore/rendering/RenderFragmentedFlow.h >@@ -102,6 +102,8 @@ public: > virtual void setPageBreak(const RenderBlock*, LayoutUnit /*offset*/, LayoutUnit /*spaceShortage*/) { } > virtual void updateMinimumPageHeight(const RenderBlock*, LayoutUnit /*offset*/, LayoutUnit /*minHeight*/) { } > >+ virtual void updateSpaceShortageForSizeContainment(const RenderBlock*, LayoutUnit /*offset*/, LayoutUnit /*shortage*/) { } >+ > virtual RenderFragmentContainer* fragmentAtBlockOffset(const RenderBox*, LayoutUnit, bool extendLastFragment = false) const; > > bool fragmentsHaveUniformLogicalWidth() const { return m_fragmentsHaveUniformLogicalWidth; } >diff --git a/Source/WebCore/rendering/RenderGrid.cpp b/Source/WebCore/rendering/RenderGrid.cpp >index d20bb57d5b0c1fa96a55b17c44d0b0026a355309..66beedd211db036c4b0393ad2e66565c70ff4ae8 100644 >--- a/Source/WebCore/rendering/RenderGrid.cpp >+++ b/Source/WebCore/rendering/RenderGrid.cpp >@@ -250,11 +250,17 @@ void RenderGrid::layoutBlock(bool relayoutChildren, LayoutUnit) > > // 2- Next, the track sizing algorithm resolves the sizes of the grid rows, > // using the grid column sizes calculated in the previous step. >- if (!hasDefiniteLogicalHeight) >+ bool shouldRecomputeHeight = false; >+ if (!hasDefiniteLogicalHeight) { > computeTrackSizesForIndefiniteSize(m_trackSizingAlgorithm, ForRows); >- else >+ if (shouldApplySizeContainment(*this)) >+ shouldRecomputeHeight = true; >+ } else > computeTrackSizesForDefiniteSize(ForRows, availableLogicalHeight(ExcludeMarginBorderPadding)); > LayoutUnit trackBasedLogicalHeight = m_trackSizingAlgorithm.computeTrackBasedSize() + borderAndPaddingLogicalHeight() + scrollbarLogicalHeight(); >+ if (shouldRecomputeHeight) >+ computeTrackSizesForDefiniteSize(ForRows, trackBasedLogicalHeight); >+ > setLogicalHeight(trackBasedLogicalHeight); > > LayoutUnit oldClientAfterEdge = clientLogicalBottom(); >@@ -548,7 +554,7 @@ std::unique_ptr<OrderedTrackIndexSet> RenderGrid::computeEmptyTracksForAutoRepea > unsigned firstAutoRepeatTrack = insertionPoint + grid.explicitGridStart(direction); > unsigned lastAutoRepeatTrack = firstAutoRepeatTrack + grid.autoRepeatTracks(direction); > >- if (!grid.hasGridItems()) { >+ if (!grid.hasGridItems() || shouldApplySizeContainment(*this)) { > emptyTrackIndexes = makeUnique<OrderedTrackIndexSet>(); > for (unsigned trackIndex = firstAutoRepeatTrack; trackIndex < lastAutoRepeatTrack; ++trackIndex) > emptyTrackIndexes->add(trackIndex); >diff --git a/Source/WebCore/rendering/RenderImage.cpp b/Source/WebCore/rendering/RenderImage.cpp >index 425443ee03a66c327812fc5b1f6f2bb93ff05d71..bbdbc5a43e8dfb838f4e83f7e2b951373859673e 100644 >--- a/Source/WebCore/rendering/RenderImage.cpp >+++ b/Source/WebCore/rendering/RenderImage.cpp >@@ -850,6 +850,7 @@ bool RenderImage::canMapWidthHeightToAspectRatio() const > > void RenderImage::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio) const > { >+ ASSERT(!shouldApplySizeContainment(*this)); > RenderReplaced::computeIntrinsicRatioInformation(intrinsicSize, intrinsicRatio); > > // Our intrinsicSize is empty if we're rendering generated images with relative width/height. Figure out the right intrinsic size to use. >diff --git a/Source/WebCore/rendering/RenderListBox.cpp b/Source/WebCore/rendering/RenderListBox.cpp >index 0edf26a7c77d7cb18a398c50db4b26c63f722bdb..9dad5171078fc623ed8cb1af0ac64cbca43ec993 100644 >--- a/Source/WebCore/rendering/RenderListBox.cpp >+++ b/Source/WebCore/rendering/RenderListBox.cpp >@@ -211,7 +211,7 @@ void RenderListBox::scrollToRevealSelection() > > void RenderListBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const > { >- maxLogicalWidth = m_optionsWidth + 2 * optionsSpacingHorizontal; >+ maxLogicalWidth = shouldApplySizeContainment(*this) ? 2 * optionsSpacingHorizontal : m_optionsWidth + 2 * optionsSpacingHorizontal; > if (m_vBar) > maxLogicalWidth += m_vBar->width(); > if (!style().width().isPercentOrCalculated()) >diff --git a/Source/WebCore/rendering/RenderMenuList.cpp b/Source/WebCore/rendering/RenderMenuList.cpp >index f394bd6336e4448227f16ae9996de55f24ccf8ed..773233c14fc21b4e282c1b19f254bf19fb2521b7 100644 >--- a/Source/WebCore/rendering/RenderMenuList.cpp >+++ b/Source/WebCore/rendering/RenderMenuList.cpp >@@ -315,7 +315,8 @@ LayoutRect RenderMenuList::controlClipRect(const LayoutPoint& additionalOffset) > > void RenderMenuList::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const > { >- maxLogicalWidth = std::max(m_optionsWidth, theme().minimumMenuListSize(style())) + m_innerBlock->paddingLeft() + m_innerBlock->paddingRight(); >+ maxLogicalWidth = shouldApplySizeContainment(*this) ? theme().minimumMenuListSize(style()) : std::max(m_optionsWidth, theme().minimumMenuListSize(style())); >+ maxLogicalWidth += m_innerBlock->paddingLeft() + m_innerBlock->paddingRight(); > if (!style().width().isPercentOrCalculated()) > minLogicalWidth = maxLogicalWidth; > } >diff --git a/Source/WebCore/rendering/RenderMultiColumnFlow.cpp b/Source/WebCore/rendering/RenderMultiColumnFlow.cpp >index 6185e472638bd79eed10a5097ba655b0826c836a..bdbe4a714d0c6c7a63dccc83572bb1f8708e6a0d 100644 >--- a/Source/WebCore/rendering/RenderMultiColumnFlow.cpp >+++ b/Source/WebCore/rendering/RenderMultiColumnFlow.cpp >@@ -203,6 +203,12 @@ void RenderMultiColumnFlow::updateMinimumPageHeight(const RenderBlock* block, La > multicolSet->updateMinimumColumnHeight(minHeight); > } > >+void RenderMultiColumnFlow::updateSpaceShortageForSizeContainment(const RenderBlock* block, LayoutUnit offset, LayoutUnit shortage) >+{ >+ if (auto* multicolSet = downcast<RenderMultiColumnSet>(fragmentAtBlockOffset(block, offset))) >+ multicolSet->updateSpaceShortageForSizeContainment(shortage); >+} >+ > RenderFragmentContainer* RenderMultiColumnFlow::fragmentAtBlockOffset(const RenderBox* box, LayoutUnit offset, bool extendLastFragment) const > { > if (!m_inLayout) >diff --git a/Source/WebCore/rendering/RenderMultiColumnFlow.h b/Source/WebCore/rendering/RenderMultiColumnFlow.h >index 0c83918f8edb6d201258f900a2be18d39f13e76d..eb6f088794585e8255db7c0c8588d02dc1a5ef96 100644 >--- a/Source/WebCore/rendering/RenderMultiColumnFlow.h >+++ b/Source/WebCore/rendering/RenderMultiColumnFlow.h >@@ -108,6 +108,7 @@ private: > LayoutUnit initialLogicalWidth() const override; > void setPageBreak(const RenderBlock*, LayoutUnit offset, LayoutUnit spaceShortage) override; > void updateMinimumPageHeight(const RenderBlock*, LayoutUnit offset, LayoutUnit minHeight) override; >+ void updateSpaceShortageForSizeContainment(const RenderBlock*, LayoutUnit offset, LayoutUnit shortage) override; > RenderFragmentContainer* fragmentAtBlockOffset(const RenderBox*, LayoutUnit, bool extendLastFragment = false) const override; > void setFragmentRangeForBox(const RenderBox&, RenderFragmentContainer*, RenderFragmentContainer*) override; > bool addForcedFragmentBreak(const RenderBlock*, LayoutUnit, RenderBox* breakChild, bool isBefore, LayoutUnit* offsetBreakAdjustment = 0) override; >diff --git a/Source/WebCore/rendering/RenderMultiColumnSet.cpp b/Source/WebCore/rendering/RenderMultiColumnSet.cpp >index 52d1845a2f7e7c3fbc66f7de17b093399a4ecab0..0efd59359b4cb204c7d563767945e1979fb3c317 100644 >--- a/Source/WebCore/rendering/RenderMultiColumnSet.cpp >+++ b/Source/WebCore/rendering/RenderMultiColumnSet.cpp >@@ -50,6 +50,7 @@ RenderMultiColumnSet::RenderMultiColumnSet(RenderFragmentedFlow& fragmentedFlow, > , m_maxColumnHeight(RenderFragmentedFlow::maxLogicalHeight()) > , m_minSpaceShortage(RenderFragmentedFlow::maxLogicalHeight()) > , m_minimumColumnHeight(0) >+ , m_spaceShortageForSizeContainment(0) > { > } > >@@ -235,15 +236,16 @@ LayoutUnit RenderMultiColumnSet::calculateBalancedHeight(bool initial) const > return std::max<LayoutUnit>(m_contentRuns[index].columnLogicalHeight(startOffset), m_minimumColumnHeight); > } > >+ LayoutUnit sizeContainmentShortage = std::max<LayoutUnit>(LayoutUnit(), m_spaceShortageForSizeContainment); > if (columnCount() <= computedColumnCount()) { > // With the current column height, the content fits without creating overflowing columns. We're done. >- return m_computedColumnHeight; >+ return m_computedColumnHeight + sizeContainmentShortage; > } > > if (forcedBreaksCount() >= computedColumnCount()) { > // Too many forced breaks to allow any implicit breaks. Initial balancing should already > // have set a good height. There's nothing more we should do. >- return m_computedColumnHeight; >+ return m_computedColumnHeight + sizeContainmentShortage; > } > > // If the initial guessed column height wasn't enough, stretch it now. Stretch by the lowest >@@ -252,9 +254,10 @@ LayoutUnit RenderMultiColumnSet::calculateBalancedHeight(bool initial) const > ASSERT(m_minSpaceShortage > 0); // We should never _shrink_ the height! > // ASSERT(m_minSpaceShortage != RenderFragmentedFlow::maxLogicalHeight()); // If this happens, we probably have a bug. > if (m_minSpaceShortage == RenderFragmentedFlow::maxLogicalHeight()) >- return m_computedColumnHeight; // So bail out rather than looping infinitely. >+ return m_computedColumnHeight + sizeContainmentShortage; // So bail out rather than looping infinitely. > >- return m_computedColumnHeight + m_minSpaceShortage; >+ auto toAdd = std::max<LayoutUnit>(sizeContainmentShortage, m_minSpaceShortage); >+ return m_computedColumnHeight + toAdd; > } > > void RenderMultiColumnSet::clearForcedBreaks() >@@ -365,6 +368,8 @@ void RenderMultiColumnSet::prepareForLayout(bool initial) > // Nuke previously stored minimum column height. Contents may have changed for all we know. > m_minimumColumnHeight = 0; > >+ m_spaceShortageForSizeContainment = 0; >+ > // Start with "infinite" flow thread portion height until height is known. > setLogicalBottomInFragmentedFlow(RenderFragmentedFlow::maxLogicalHeight()); > >diff --git a/Source/WebCore/rendering/RenderMultiColumnSet.h b/Source/WebCore/rendering/RenderMultiColumnSet.h >index f73bf90a316e38ea825a69e86427376f60e54a59..c48ae0a4c75865a53fa55bfbef72d1bb92273d77 100644 >--- a/Source/WebCore/rendering/RenderMultiColumnSet.h >+++ b/Source/WebCore/rendering/RenderMultiColumnSet.h >@@ -83,6 +83,15 @@ public: > void updateMinimumColumnHeight(LayoutUnit height) { m_minimumColumnHeight = std::max(height, m_minimumColumnHeight); } > LayoutUnit minimumColumnHeight() const { return m_minimumColumnHeight; } > >+ void updateSpaceShortageForSizeContainment(LayoutUnit shortage) >+ { >+ if (m_spaceShortageForSizeContainment <= 0) { >+ m_spaceShortageForSizeContainment = shortage; >+ return; >+ } >+ m_spaceShortageForSizeContainment = std::min(shortage, m_spaceShortageForSizeContainment); >+ } >+ > unsigned forcedBreaksCount() const { return m_contentRuns.size(); } > void clearForcedBreaks(); > void addForcedBreak(LayoutUnit offsetFromFirstPage); >@@ -198,6 +207,7 @@ private: > LayoutUnit m_maxColumnHeight; // Maximum column height allowed. > LayoutUnit m_minSpaceShortage; // The smallest amout of space shortage that caused a column break. > LayoutUnit m_minimumColumnHeight; >+ LayoutUnit m_spaceShortageForSizeContainment; // The shortage space that keeps size containment monolithic. > > // A run of content without explicit (forced) breaks; i.e. a flow thread portion between two > // explicit breaks, between flow thread start and an explicit break, between an explicit break >diff --git a/Source/WebCore/rendering/RenderObject.cpp b/Source/WebCore/rendering/RenderObject.cpp >index e54ed9f3ab37ff1bd379fa857ff44a8ae3adc384..c58b91bc4e3bd5f2ba865838779d16af1358f58b 100644 >--- a/Source/WebCore/rendering/RenderObject.cpp >+++ b/Source/WebCore/rendering/RenderObject.cpp >@@ -2498,3 +2498,8 @@ bool WebCore::shouldApplyLayoutContainment(const WebCore::RenderObject& renderer > { > return renderer.style().containsLayout() && (!renderer.isInline() || renderer.isAtomicInlineLevelBox()) && !renderer.isRubyText() && (!renderer.isTablePart() || renderer.isRenderBlockFlow()); > } >+ >+bool WebCore::shouldApplySizeContainment(const WebCore::RenderObject& renderer) >+{ >+ return renderer.style().containsSize() && (!renderer.isInline() || renderer.isAtomicInlineLevelBox()) && !renderer.isRubyText() && (!renderer.isTablePart() || renderer.isTableCaption()) && !renderer.isTable(); >+} >diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h >index 31f0f07d54727e8c546c547c57d30451e19232c6..86fb53c9ee41ef6ae5fec11dd5be0534d63d4cc4 100644 >--- a/Source/WebCore/rendering/RenderObject.h >+++ b/Source/WebCore/rendering/RenderObject.h >@@ -201,7 +201,7 @@ public: > bool isRenderInline() const; > bool isRenderLayerModelObject() const; > >- inline bool isAtomicInlineLevelBox() const; >+ bool isAtomicInlineLevelBox() const; > > virtual bool isCounter() const { return false; } > virtual bool isQuote() const { return false; } >@@ -1173,7 +1173,7 @@ inline RenderObject* RenderObject::nextInFlowSibling() const > return nextSibling; > } > >-bool RenderObject::isAtomicInlineLevelBox() const >+inline bool RenderObject::isAtomicInlineLevelBox() const > { > return style().isDisplayInlineType() && !(style().display() == DisplayType::Inline && !isReplaced()); > } >@@ -1187,6 +1187,7 @@ void printGraphicsLayerTreeForLiveDocuments(); > #endif > > bool shouldApplyLayoutContainment(const RenderObject&); >+bool shouldApplySizeContainment(const RenderObject&); > > } // namespace WebCore > >diff --git a/Source/WebCore/rendering/RenderReplaced.cpp b/Source/WebCore/rendering/RenderReplaced.cpp >index 2a939ce5ba840753bd59f36b072c3ae8c53d2d4e..8fe33b00379a0a80a8fb8926b61ba6dd78d6e684 100644 >--- a/Source/WebCore/rendering/RenderReplaced.cpp >+++ b/Source/WebCore/rendering/RenderReplaced.cpp >@@ -391,7 +391,9 @@ bool RenderReplaced::setNeedsLayoutIfNeededAfterIntrinsicSizeChange() > void RenderReplaced::computeAspectRatioInformationForRenderBox(RenderBox* contentRenderer, FloatSize& constrainedSize, double& intrinsicRatio) const > { > FloatSize intrinsicSize; >- if (contentRenderer) { >+ if (shouldApplySizeContainment(*this)) >+ RenderReplaced::computeIntrinsicRatioInformation(intrinsicSize, intrinsicRatio); >+ else if (contentRenderer) { > contentRenderer->computeIntrinsicRatioInformation(intrinsicSize, intrinsicRatio); > > if (style().aspectRatioType() == AspectRatioType::Ratio || (style().aspectRatioType() == AspectRatioType::AutoAndRatio && !intrinsicRatio)) >@@ -496,7 +498,7 @@ Optional<double> RenderReplaced::intrinsicAspectRatioFromWidthHeight() const > void RenderReplaced::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio) const > { > // If there's an embeddedContentBox() of a remote, referenced document available, this code-path should never be used. >- ASSERT(!embeddedContentBox()); >+ ASSERT(!embeddedContentBox() || shouldApplySizeContainment(*this)); > intrinsicSize = FloatSize(intrinsicLogicalWidth(), intrinsicLogicalHeight()); > > if (style().hasAspectRatio()) { >diff --git a/Source/WebCore/rendering/RenderReplaced.h b/Source/WebCore/rendering/RenderReplaced.h >index 3b61f49d5a170bb2350bdf670c619800596dc51f..99baa09f88f952bdd5b578c62b3fdfbe5aebfc0e 100644 >--- a/Source/WebCore/rendering/RenderReplaced.h >+++ b/Source/WebCore/rendering/RenderReplaced.h >@@ -40,7 +40,12 @@ public: > bool hasReplacedLogicalHeight() const; > bool setNeedsLayoutIfNeededAfterIntrinsicSizeChange(); > >- LayoutSize intrinsicSize() const final { return m_intrinsicSize; } >+ LayoutSize intrinsicSize() const final >+ { >+ if (shouldApplySizeContainment(*this)) >+ return LayoutSize(); >+ return m_intrinsicSize; >+ } > > RoundedRect roundedContentBoxRect() const; > >diff --git a/Source/WebCore/rendering/RenderSlider.cpp b/Source/WebCore/rendering/RenderSlider.cpp >index 47169edf98e1428c4a0770f2f4efc0b58d813c7b..9e944be00bb02e3851a43d5666619f7c429a5d94 100644 >--- a/Source/WebCore/rendering/RenderSlider.cpp >+++ b/Source/WebCore/rendering/RenderSlider.cpp >@@ -69,6 +69,8 @@ LayoutUnit RenderSlider::baselinePosition(FontBaseline, bool /*firstLine*/, Line > > void RenderSlider::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const > { >+ if (shouldApplySizeContainment(*this)) >+ return; > maxLogicalWidth = defaultTrackLength * style().effectiveZoom(); > if (!style().width().isPercentOrCalculated()) > minLogicalWidth = maxLogicalWidth; >diff --git a/Source/WebCore/rendering/RenderTextControl.cpp b/Source/WebCore/rendering/RenderTextControl.cpp >index dc058d53467aa3cfabf852f331ef01f3155321f4..242aca3a06b91574a748b13ecefa80c6172b9c59 100644 >--- a/Source/WebCore/rendering/RenderTextControl.cpp >+++ b/Source/WebCore/rendering/RenderTextControl.cpp >@@ -156,6 +156,8 @@ float RenderTextControl::scaleEmToUnits(int x) const > > void RenderTextControl::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const > { >+ if (shouldApplySizeContainment(*this)) >+ return; > // Use average character width. Matches IE. > maxLogicalWidth = preferredContentLogicalWidth(const_cast<RenderTextControl*>(this)->getAverageCharWidth()); > if (RenderBox* innerTextRenderBox = innerTextElement()->renderBox()) >diff --git a/Source/WebCore/rendering/RenderVideo.cpp b/Source/WebCore/rendering/RenderVideo.cpp >index c6d044166ccfd5bc7c8f19e0aabc21c5803821f9..2928dd4dcafed2a4c07bad0d14ae43390e59ca93 100644 >--- a/Source/WebCore/rendering/RenderVideo.cpp >+++ b/Source/WebCore/rendering/RenderVideo.cpp >@@ -123,6 +123,9 @@ bool RenderVideo::updateIntrinsicSize() > > LayoutSize RenderVideo::calculateIntrinsicSize() > { >+ if (shouldApplySizeContainment(*this)) >+ return LayoutSize(); >+ > // Spec text from 4.8.6 > // > // The intrinsic width of a video element's playback area is the intrinsic width >diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h >index df55ee622e6e103a5828d46a59e939eb07c8d873..0a568fcbc344c950511b6d39c4fa0f4c2055eae5 100644 >--- a/Source/WebCore/rendering/style/RenderStyle.h >+++ b/Source/WebCore/rendering/style/RenderStyle.h >@@ -527,6 +527,7 @@ public: > bool hasAspectRatio() const { return aspectRatioType() == AspectRatioType::Ratio || aspectRatioType() == AspectRatioType::AutoAndRatio; } > OptionSet<Containment> contain() const { return m_rareNonInheritedData->contain; } > bool containsLayout() const { return m_rareNonInheritedData->contain.contains(Containment::Layout); } >+ bool containsSize() const { return m_rareNonInheritedData->contain.contains(Containment::Size); } > BoxAlignment boxAlign() const { return static_cast<BoxAlignment>(m_rareNonInheritedData->deprecatedFlexibleBox->align); } > BoxDirection boxDirection() const { return static_cast<BoxDirection>(m_inheritedFlags.boxDirection); } > float boxFlex() const { return m_rareNonInheritedData->deprecatedFlexibleBox->flex; } >diff --git a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp b/Source/WebCore/rendering/svg/RenderSVGRoot.cpp >index fbde4b46ec1d1e572a1e5ecbbb7803da75b3f39e..161e830c2994a8f937dc816721fce7fd2184f71b 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGRoot.cpp >@@ -70,6 +70,8 @@ SVGSVGElement& RenderSVGRoot::svgSVGElement() const > > void RenderSVGRoot::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio) const > { >+ ASSERT(!shouldApplySizeContainment(*this)); >+ > // Spec: http://www.w3.org/TR/SVG/coords.html#IntrinsicSizing > // SVG needs to specify how to calculate some intrinsic sizing properties to enable inclusion within other languages. > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 89ef9b134d97484af8ae248642c7529ba5de096c..fba22fc8fc326624ef425c7abaeb6a8267e35c64 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2021-05-04 Cathie Chen <cathiechen@igalia.com> >+ >+ [CSS contain] Support contain:size >+ https://bugs.webkit.org/show_bug.cgi?id=223570 >+ >+ Reviewed by Alan Bujtas. >+ >+ Update the test result for size containment. Added explanations for size containment tests >+ that depended on other features. >+ >+ * TestExpectations: >+ > 2021-05-10 Chris Dumez <cdumez@apple.com> > > [ macOS Release wk2 ] http/tests/cache-storage/cache-records-persistency.https.html is flaky crashing >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index c37b957473e05f921a6e24dc403d185912bbfeb6..0796cf49e89dfc089c71fb0b3abf47461ae6debe 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,20 @@ >+2021-05-04 Cathie Chen <cathiechen@igalia.com> >+ >+ [CSS contain] Support contain:size >+ https://bugs.webkit.org/show_bug.cgi?id=223570 >+ >+ Reviewed by Alan Bujtas. >+ >+ <canvas> and <video> don't support computing aspect ratio from width and height attributes yet, >+ so the heights are zero when they are with "contain: size". >+ >+ * web-platform-tests/css/css-contain/contain-size-grid-003-expected.txt: >+ * web-platform-tests/css/css-contain/contain-size-grid-004-expected.txt: >+ * web-platform-tests/css/css-contain/contain-size-multicol-as-flex-item-expected.txt: >+ * web-platform-tests/css/css-flexbox/flex-item-contains-strict-expected.txt: >+ * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio-expected.txt: >+ * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio-expected.txt: >+ > 2021-05-10 Rob Buis <rbuis@igalia.com> > > Implement <form>.requestSubmit() >diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations >index 6b0401146de208b54638d9f33ded2d0a8e31c041..10585f07fedc9156159983384444ab34819d4369 100644 >--- a/LayoutTests/TestExpectations >+++ b/LayoutTests/TestExpectations >@@ -4646,7 +4646,6 @@ webanimations/transform-property-and-transform-animation-with-delay-on-forced-la > webanimations/translate-property-and-translate-animation-with-delay-on-forced-layer.html [ Skip ] > > # CSS containment tests that fail >-imported/w3c/web-platform-tests/css/css-contain/contain-animation-001.html [ ImageOnlyFailure ] > # webkit-ruby-text > imported/w3c/web-platform-tests/css/css-contain/contain-layout-017.html [ ImageOnlyFailure ] > imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-001.html [ ImageOnlyFailure ] >@@ -4663,7 +4662,6 @@ imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visib > imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-020.html [ ImageOnlyFailure ] > imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-021.html [ ImageOnlyFailure ] > imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-022.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-layout-size-003.html [ ImageOnlyFailure ] > imported/w3c/web-platform-tests/css/css-contain/contain-paint-001.html [ ImageOnlyFailure ] > imported/w3c/web-platform-tests/css/css-contain/contain-paint-004.html [ ImageOnlyFailure ] > imported/w3c/web-platform-tests/css/css-contain/contain-paint-005.html [ ImageOnlyFailure ] >@@ -4705,68 +4703,8 @@ imported/w3c/web-platform-tests/css/css-contain/contain-paint-stacking-context-0 > imported/w3c/web-platform-tests/css/css-contain/contain-paint-stacking-context-001b.html [ ImageOnlyFailure ] > imported/w3c/web-platform-tests/css/css-contain/contain-paint-table-001.html [ ImageOnlyFailure ] > imported/w3c/web-platform-tests/css/css-contain/contain-paint-table-002.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-011.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-013.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-021.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-023.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-025.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-027.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-041.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-042.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-056.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-061.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-062.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-063.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-064.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-block-001.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-block-002.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-block-003.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-block-004.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-borders.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-breaks-001.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-button-001.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-button-002.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-fieldset-001.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-fieldset-002.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-fieldset-003.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-fieldset-004.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-flex-001.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-flexbox-001.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-001.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-002.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-005.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-block-001.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-block-002.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-block-003.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-block-004.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-flex-001.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-monolithic-001.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-monolithic-002.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-multicol-001.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-multicol-002.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-multicol-003.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-001.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-002.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-003a.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-003b.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-003c.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-004.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-005.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-006.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-scrollbars-001.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-scrollbars-002.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-scrollbars-003.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-select-001.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-select-002.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-001.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-002.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-003.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-004.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-005.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-size-table-caption-001.html [ ImageOnlyFailure ] > imported/w3c/web-platform-tests/css/css-contain/contain-strict-001.html [ ImageOnlyFailure ] > imported/w3c/web-platform-tests/css/css-contain/contain-strict-002.html [ ImageOnlyFailure ] >-imported/w3c/web-platform-tests/css/css-contain/contain-strict-003.html [ ImageOnlyFailure ] > imported/w3c/web-platform-tests/css/css-contain/contain-strict-011.html [ ImageOnlyFailure ] > imported/w3c/web-platform-tests/css/css-contain/contain-style-counters-001.html [ ImageOnlyFailure ] > imported/w3c/web-platform-tests/css/css-contain/contain-style-counters-002.html [ ImageOnlyFailure ] >@@ -4802,6 +4740,31 @@ imported/w3c/web-platform-tests/css/css-contain/quote-scoping-004.html [ ImageOn > # Flaky css-contain test > imported/w3c/web-platform-tests/css/css-contain/content-visibility/animation-display-lock.html [ Failure Pass ] > >+# Canvas doesn't get default aspect-ratio for width and height attributes. >+webkit.org/b/217529 imported/w3c/web-platform-tests/css/css-flexbox/canvas-contain-size.html [ ImageOnlyFailure ] >+ >+# Content is painted on svg's padding area. >+webkit.org/b/425868 imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-002.html [ ImageOnlyFailure ] >+ >+# Multicolumn does not paint the horizontal overflow area of a relative child. >+webkit.org/b/41796 imported/w3c/web-platform-tests/css/css-contain/contain-size-monolithic-002.html [ ImageOnlyFailure ] >+ >+# Buttons with auto width and height has extra margins. >+imported/w3c/web-platform-tests/css/css-contain/contain-size-button-001.html [ ImageOnlyFailure ] >+imported/w3c/web-platform-tests/css/css-contain/contain-size-button-002.html [ ImageOnlyFailure ] >+ >+# Scrollbar displays are different. >+imported/w3c/web-platform-tests/css/css-contain/contain-size-block-003.html [ ImageOnlyFailure ] >+imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-block-003.html [ ImageOnlyFailure ] >+ >+# Select with empty content always has root linebox, so the heights are different. >+imported/w3c/web-platform-tests/css/css-contain/contain-size-select-001.html [ ImageOnlyFailure ] >+imported/w3c/web-platform-tests/css/css-contain/contain-size-select-002.html [ ImageOnlyFailure ] >+ >+# CSS property color is not working in select elements. >+imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-001.html [ ImageOnlyFailure ] >+imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-002.html [ ImageOnlyFailure ] >+ > # Tests that fail because they assume a vertical scrollbar in `writing-mode: vertical-rl` elements will be on the right-hand side > webkit.org/b/224357 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthog-vrl-in-htb-013.xht [ ImageOnlyFailure ] > webkit.org/b/224357 imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-vertical-rl.html [ ImageOnlyFailure ] >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-003-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-003-expected.txt >index e16d67dbf7d4524af7f3110309f978299041c2d2..51e8e2002ff7ca742c95e3946fd1cc8bff7b11f4 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-003-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-003-expected.txt >@@ -36,19 +36,8 @@ PASS .grid 34 > PASS .grid 35 > PASS .grid 36 > PASS .grid 37 >-FAIL .grid 38 assert_equals: >-<div class="grid" style="grid: repeat(auto-fit, 75px) / repeat(auto-fit, 100px);" data-expected-width="0" data-expected-height="0"> >- <div></div> >- </div> >-width expected 0 but got 100 >-FAIL .grid 39 assert_equals: >-<div class="grid" style="grid: auto 50px / 100px auto;" data-expected-width="100" data-expected-height="50"> >- <div data-expected-width="100" data-expected-height="10" data-offset-x="0" data-offset-y="0">X</div> >- <div data-expected-width="40" data-expected-height="10" data-offset-x="100" data-offset-y="0">XX</div> >- <div data-expected-width="100" data-expected-height="50" data-offset-x="0" data-offset-y="10">XXX</div> >- <div data-expected-width="40" data-expected-height="50" data-offset-x="100" data-offset-y="10">XXXX</div> >-</div> >-width expected 100 but got 140 >+PASS .grid 38 >+PASS .grid 39 > > X > XX >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-004-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-004-expected.txt >index 70cd7e6191d0ffdba52264246b8a81cf3483df38..e0a1c9d51fbf4b6a5624df41b9fb221c45ef6bc2 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-004-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-004-expected.txt >@@ -1,38 +1,18 @@ > > PASS .grid 1 >-FAIL .grid 2 assert_equals: >-<div class="grid percent min-content" data-expected-height="0" data-expected-width="0"> >- <div data-expected-height="0" data-expected-width="0">XXXX</div> >-</div> >-width expected 0 but got 300 >+PASS .grid 2 > PASS .grid 3 >-FAIL .grid 4 assert_equals: >-<div class="grid percent max-content" data-expected-height="0" data-expected-width="0"> >- <div data-expected-height="0" data-expected-width="0">XXXX</div> >-</div> >-width expected 0 but got 300 >+PASS .grid 4 > PASS .grid 5 > PASS .grid 6 > PASS .grid 7 >-FAIL .grid 8 assert_equals: >-<div class="grid calc min-content" data-expected-height="0" data-expected-width="0"> >- <div data-expected-height="100" data-expected-width="100">XXXX</div> >-</div> >-width expected 0 but got 300 >+PASS .grid 8 > PASS .grid 9 >-FAIL .grid 10 assert_equals: >-<div class="grid calc max-content" data-expected-height="0" data-expected-width="0"> >- <div data-expected-height="100" data-expected-width="100">XXXX</div> >-</div> >-width expected 0 but got 300 >+PASS .grid 10 > PASS .grid 11 > PASS .grid 12 > PASS .grid 13 >-FAIL .grid 14 assert_equals: >-<div class="grid minmax-percent-fixed min-content" data-expected-height="100" data-expected-width="0"> >- <div data-expected-height="100" data-expected-width="0">XXXX</div> >-</div> >-width expected 0 but got 100 >+PASS .grid 14 > PASS .grid 15 > PASS .grid 16 > PASS .grid 17 >@@ -40,67 +20,31 @@ PASS .grid 18 > PASS .grid 19 > PASS .grid 20 > PASS .grid 21 >-FAIL .grid 22 assert_equals: >-<div class="grid minmax-fixed-percent max-content" data-expected-height="100" data-expected-width="100"> >- <div data-expected-height="100" data-expected-width="100">XXXX</div> >-</div> >-width expected 100 but got 300 >+PASS .grid 22 > PASS .grid 23 > PASS .grid 24 > PASS .grid 25 >-FAIL .grid 26 assert_equals: >-<div class="grid minmax-percent-flex min-content" data-expected-height="0" data-expected-width="0"> >- <div data-expected-height="0" data-expected-width="0">XXXX</div> >-</div> >-width expected 0 but got 300 >+PASS .grid 26 > PASS .grid 27 >-FAIL .grid 28 assert_equals: >-<div class="grid minmax-percent-flex max-content" data-expected-height="0" data-expected-width="0"> >- <div data-expected-height="0" data-expected-width="0">XXXX</div> >-</div> >-width expected 0 but got 300 >+PASS .grid 28 > PASS .grid 29 > PASS .grid 30 > PASS .grid 31 >-FAIL .grid 32 assert_equals: >-<div class="grid minmax-intrinsic-percent min-content" data-expected-height="0" data-expected-width="0"> >- <div data-expected-height="75" data-expected-width="300">XXXX</div> >-</div> >-width expected 0 but got 300 >+PASS .grid 32 > PASS .grid 33 >-FAIL .grid 34 assert_equals: >-<div class="grid minmax-intrinsic-percent max-content" data-expected-height="0" data-expected-width="0"> >- <div data-expected-height="75" data-expected-width="300">XXXX</div> >-</div> >-width expected 0 but got 300 >+PASS .grid 34 > PASS .grid 35 > PASS .grid 36 > PASS .grid 37 >-FAIL .grid 38 assert_equals: >-<div class="grid minmax-percent-intrinsic min-content" data-expected-height="0" data-expected-width="0"> >- <div data-expected-height="0" data-expected-width="0">XXXX</div> >-</div> >-width expected 0 but got 300 >+PASS .grid 38 > PASS .grid 39 >-FAIL .grid 40 assert_equals: >-<div class="grid minmax-percent-intrinsic max-content" data-expected-height="0" data-expected-width="0"> >- <div data-expected-height="0" data-expected-width="0">XXXX</div> >-</div> >-width expected 0 but got 300 >+PASS .grid 40 > PASS .grid 41 > PASS .grid 42 > PASS .grid 43 >-FAIL .grid 44 assert_equals: >-<div class="grid fit-content min-content" data-expected-height="0" data-expected-width="0"> >- <div data-expected-height="75" data-expected-width="300">XXXX</div> >-</div> >-width expected 0 but got 300 >+PASS .grid 44 > PASS .grid 45 >-FAIL .grid 46 assert_equals: >-<div class="grid fit-content max-content" data-expected-height="0" data-expected-width="0"> >- <div data-expected-height="75" data-expected-width="300">XXXX</div> >-</div> >-width expected 0 but got 300 >+PASS .grid 46 > PASS .grid 47 > PASS .grid 48 > XXXX >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-multicol-as-flex-item-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-multicol-as-flex-item-expected.txt >index 3e140867b7e7214611cc529abb485fd2f8e1b947..3e7991c1c051a77663dd7571229a03ca71e326b2 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-multicol-as-flex-item-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-multicol-as-flex-item-expected.txt >@@ -1,11 +1,5 @@ > There should be a green square below. > > >-FAIL #flex 1 assert_equals: >-<div id="flex"> >- <div id="multicol" data-expected-width="100" data-expected-height="100"> >- <div style="width:1000px; height:1px;"></div> >- </div> >-</div> >-width expected 100 but got 784 >+PASS #flex 1 > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-item-contains-strict-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-item-contains-strict-expected.txt >index 744dc4f62af10233895ffc8ab6ffd43dedd9b870..cc0bac758a866d4aeec75ace8ee7d833bf1dc1ee 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-item-contains-strict-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-item-contains-strict-expected.txt >@@ -17,28 +17,12 @@ Column > > Row > >-FAIL .inline-flex 1 assert_equals: >-<div class="inline-flex" style="display: inline-flex; flex-direction: column;" data-expected-width="0" data-expected-height="0"> >- <div style="contain: strict;" data-expected-width="0" data-expected-height="0">Column</div> >-</div> >-width expected 0 but got 52 >-FAIL .inline-flex 2 assert_equals: >-<div class="inline-flex" data-expected-width="0" data-expected-height="0"> >- <div style="contain: strict;" data-expected-width="0" data-expected-height="0">Row</div> >-</div> >-width expected 0 but got 30 >+PASS .inline-flex 1 >+PASS .inline-flex 2 > PASS .inline-flex 3 > PASS .inline-flex 4 >-FAIL .inline-flex 5 assert_equals: >-<div class="inline-flex" style="flex-direction: column; align-items: flex-start;" data-expected-width="0" data-expected-height="0"> >- <div style="contain: strict;" data-expected-width="0" data-expected-height="0">Column</div> >-</div> >-width expected 0 but got 52 >-FAIL .inline-flex 6 assert_equals: >-<div class="inline-flex" style="align-items: flex-start;" data-expected-width="0" data-expected-height="0"> >- <div style="contain: strict;" data-expected-width="0" data-expected-height="0">Row</div> >-</div> >-width expected 0 but got 30 >+PASS .inline-flex 5 >+PASS .inline-flex 6 > PASS .inline-flex 7 > PASS .inline-flex 8 > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio-expected.txt >index abcba0308555e6dece427ce1ab3fa560c4f37d05..e6fce96904953ebfb6c587616e8bee95bfa0ad0d 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio-expected.txt >@@ -1,6 +1,6 @@ > > >-PASS Canvas width and height attributes are used as the surface size with contain:size >+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 > PASS Canvas width and height attributes are used as the surface size > FAIL Computed style test: canvas with {"width":"10","height":"20"} assert_equals: expected "auto 10 / 20" but got "auto" > PASS Computed style test: canvas with {"width":"0","height":"1"} >diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio-expected.txt >index 1a60441e4d3685e1292ee20a236ce852bf853e5a..3c45c7e436f08a46bda82fdb460061380c91abf4 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio-expected.txt >@@ -1,6 +1,6 @@ > > >-FAIL Video width and height attributes are not used to infer aspect-ratio assert_approx_equals: expected 2.5 +/- 0.001 but got 2 >+FAIL Video width and height attributes are not used to infer aspect-ratio assert_approx_equals: expected 2.5 +/- 0.001 but got Infinity > FAIL Computed style test: video with {"width":"10","height":"20"} assert_equals: expected "auto 10 / 20" but got "auto" > FAIL Computed style test: video with {"width":"0.5","height":"1.5"} assert_equals: expected "auto 0.5 / 1.5" but got "auto" > PASS Computed style test: video with {"width":"0","height":"1"}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 223570
:
424901
|
424903
|
425756
|
425987
|
426439
|
426537
|
426543
|
427668
|
427740
|
427744
|
428256
| 428264