Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[css-contain] Support contain:paint
https://bugs.webkit.org/show_bug.cgi?id=224742 Patch by Rob Buis <rbuis@igalia.com> on 2021-11-16 Reviewed by Alan Bujtas. LayoutTests/imported/w3c: Adjust test expectation now that contain: strict is supported. * web-platform-tests/css/css-flexbox/flex-item-contains-strict-expected.txt: Source/WebCore: This patch implements paint containment as specified[1]. It adds shouldApplyPaintContainment to check whether the element applies for paint containment. Is so, then: - an independent formatting context is established. - an absolute positioning and fixed positioning containing block is established. - a stacking context is created. - implements clipping on the overflow clip edge. This patch also adds effectiveOverflowX/effectiveOverflowY on RenderElement to take the effect of paint containment on overflow-x/y into account. [1] https://drafts.csswg.org/css-contain-2/#paint-containment * page/FrameView.cpp: (WebCore::FrameView::applyOverflowToViewport): (WebCore::FrameView::applyPaginationToViewport): (WebCore::FrameView::calculateScrollbarModesForLayout): * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const): * rendering/RenderBox.cpp: (WebCore::RenderBox::updateFromStyle): (WebCore::RenderBox::constrainLogicalWidthInFragmentByMinMax const): (WebCore::RenderBox::constrainLogicalHeightByMinMax const): (WebCore::RenderBox::createsNewFormattingContext const): (WebCore::RenderBox::addOverflowFromChild): * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::updateFromStyle): * rendering/RenderElement.cpp: (WebCore::includeNonFixedHeight): (WebCore::RenderElement::effectiveOverflowX const): (WebCore::RenderElement::effectiveOverflowY const): * rendering/RenderElement.h: (WebCore::RenderElement::effectiveOverflowInlineDirection const): (WebCore::RenderElement::effectiveOverflowBlockDirection const): (WebCore::RenderElement::canContainFixedPositionObjects const): (WebCore::RenderElement::canContainAbsolutelyPositionedObjects const): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::mainAxisOverflowForChild const): (WebCore::RenderFlexibleBox::crossAxisOverflowForChild const): * rendering/RenderFragmentContainer.cpp: (WebCore::RenderFragmentContainer::overflowRectForFragmentedFlowPortion): * rendering/RenderInline.h: * rendering/RenderLayer.cpp: (WebCore::canCreateStackingContext): (WebCore::RenderLayer::shouldBeCSSStackingContext const): (WebCore::RenderLayer::setAncestorChainHasSelfPaintingLayerDescendant): (WebCore::RenderLayer::setAncestorChainHasVisibleDescendant): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderObject.cpp: (WebCore::RenderObject::setPaintContainmentApplies): (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData): (WebCore::shouldApplyPaintContainment): * rendering/RenderObject.h: (WebCore::RenderObject::paintContainmentApplies const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::overflowY const): (WebCore::RenderStyle::containsPaint const): (WebCore::RenderStyle::overflowInlineDirection const): Deleted. (WebCore::RenderStyle::overflowBlockDirection const): Deleted. * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::shouldApplyViewportClip const): LayoutTests: Unskip tests that pass now. * TestExpectations: Canonical link: https://commits.webkit.org/244309@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285885 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
0485e09
commit 5ed3c610d08e786fec6b85e6137676ce89002aed
Showing
19 changed files
with
177 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
Stretched: | ||
|
||
Column | ||
|
||
Row | ||
|
||
Column | ||
|
||
Row | ||
Flex-start: | ||
|
||
Column | ||
|
||
Row | ||
|
||
Column | ||
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.