Title: [285745] trunk

Diff

Modified: trunk/LayoutTests/ChangeLog (285744 => 285745)


--- trunk/LayoutTests/ChangeLog	2021-11-12 22:47:21 UTC (rev 285744)
+++ trunk/LayoutTests/ChangeLog	2021-11-12 23:00:38 UTC (rev 285745)
@@ -1,3 +1,16 @@
+2021-11-12  Ryan Haddad  <[email protected]>
+
+        Unreviewed, reverting r285583.
+
+        Seems to have caused many layout tests to become flaky
+        failures
+
+        Reverted changeset:
+
+        "[css-contain] Support contain:paint"
+        https://bugs.webkit.org/show_bug.cgi?id=224742
+        https://commits.webkit.org/r285583
+
 2021-11-12  Chris Dumez  <[email protected]>
 
         Regression(r285639) fast/dom/Geolocation/cached-position-iframe.html is frequently crashing on Mac-wk1

Modified: trunk/LayoutTests/TestExpectations (285744 => 285745)


--- trunk/LayoutTests/TestExpectations	2021-11-12 22:47:21 UTC (rev 285744)
+++ trunk/LayoutTests/TestExpectations	2021-11-12 23:00:38 UTC (rev 285745)
@@ -4721,10 +4721,6 @@
 # CSS containment tests that fail
 # webkit-ruby-text
 imported/w3c/web-platform-tests/css/css-contain/contain-layout-017.html [ ImageOnlyFailure ]
-imported/w3c/web-platform-tests/css/css-contain/contain-paint-005.html [ ImageOnlyFailure ]
-imported/w3c/web-platform-tests/css/css-contain/contain-paint-006.html [ ImageOnlyFailure ]
-imported/w3c/web-platform-tests/css/css-contain/contain-paint-008.html [ ImageOnlyFailure ]
-imported/w3c/web-platform-tests/css/css-contain/contain-paint-021.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-001.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-003.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-004.html [ ImageOnlyFailure ]
@@ -4739,8 +4735,49 @@
 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-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 ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-006.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-008.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-009.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-010.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-014.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-019.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-020.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-022.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-023.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-047.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-048.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-cell-001.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-cell-002.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-001.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-002.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-006.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-011.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-012.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-013.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-014.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-015.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-016.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-017.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-018.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-019.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-containing-block-absolute-001.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-containing-block-fixed-001.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-formatting-context-float-001.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-formatting-context-margin-001.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-ifc-011.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-independent-formatting-context-001.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-size-001.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-size-002.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-size-003.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-contain/contain-paint-stacking-context-001a.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-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-011.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-032.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-033.sub.https.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-034.html [ ImageOnlyFailure ]

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (285744 => 285745)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-11-12 22:47:21 UTC (rev 285744)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-11-12 23:00:38 UTC (rev 285745)
@@ -1,3 +1,16 @@
+2021-11-12  Ryan Haddad  <[email protected]>
+
+        Unreviewed, reverting r285583.
+
+        Seems to have caused many layout tests to become flaky
+        failures
+
+        Reverted changeset:
+
+        "[css-contain] Support contain:paint"
+        https://bugs.webkit.org/show_bug.cgi?id=224742
+        https://commits.webkit.org/r285583
+
 2021-11-12  Alexey Shvayka  <[email protected]>
 
         Implement custom element definition's *disable shadow* flag

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-item-contains-strict-expected.txt (285744 => 285745)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-item-contains-strict-expected.txt	2021-11-12 22:47:21 UTC (rev 285744)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-item-contains-strict-expected.txt	2021-11-12 23:00:38 UTC (rev 285745)
@@ -1,6 +1,8 @@
 Stretched:
 
+Column
 
+Row
 
 Column
 
@@ -7,7 +9,9 @@
 Row
 Flex-start:
 
+Column
 
+Row
 
 Column
 

Modified: trunk/Source/WebCore/ChangeLog (285744 => 285745)


--- trunk/Source/WebCore/ChangeLog	2021-11-12 22:47:21 UTC (rev 285744)
+++ trunk/Source/WebCore/ChangeLog	2021-11-12 23:00:38 UTC (rev 285745)
@@ -1,3 +1,16 @@
+2021-11-12  Ryan Haddad  <[email protected]>
+
+        Unreviewed, reverting r285583.
+
+        Seems to have caused many layout tests to become flaky
+        failures
+
+        Reverted changeset:
+
+        "[css-contain] Support contain:paint"
+        https://bugs.webkit.org/show_bug.cgi?id=224742
+        https://commits.webkit.org/r285583
+
 2021-11-12  Alexey Shvayka  <[email protected]>
 
         Implement custom element definition's *disable shadow* flag

Modified: trunk/Source/WebCore/page/FrameView.cpp (285744 => 285745)


--- trunk/Source/WebCore/page/FrameView.cpp	2021-11-12 22:47:21 UTC (rev 285744)
+++ trunk/Source/WebCore/page/FrameView.cpp	2021-11-12 23:00:38 UTC (rev 285745)
@@ -644,8 +644,8 @@
 
     bool overrideHidden = frame().isMainFrame() && ((frame().frameScaleFactor() > 1) || headerHeight() || footerHeight());
 
-    Overflow overflowX = renderer.effectiveOverflowX();
-    Overflow overflowY = renderer.effectiveOverflowY();
+    Overflow overflowX = renderer.style().overflowX();
+    Overflow overflowY = renderer.style().overflowY();
 
     if (is<RenderSVGRoot>(renderer)) {
         // FIXME: evaluate if we can allow overflow for these cases too.
@@ -709,12 +709,12 @@
 
     auto* body = document->body();
     if (body && body->renderer()) {
-        documentOrBodyRenderer = documentRenderer.effectiveOverflowX() == Overflow::Visible && is<HTMLHtmlElement>(*documentElement) ?
+        documentOrBodyRenderer = documentRenderer.style().overflowX() == Overflow::Visible && is<HTMLHtmlElement>(*documentElement) ?
             body->renderer() : &documentRenderer;
     }
 
     Pagination pagination;
-    Overflow overflowY = documentOrBodyRenderer->effectiveOverflowY();
+    Overflow overflowY = documentOrBodyRenderer->style().overflowY();
     if (overflowY == Overflow::PagedX || overflowY == Overflow::PagedY) {
         pagination.mode = WebCore::paginationModeForRenderStyle(documentOrBodyRenderer->style());
         GapLength columnGapLength = documentOrBodyRenderer->style().columnGap();
@@ -776,7 +776,7 @@
     if (is<HTMLBodyElement>(*bodyOrFrameset) && rootRenderer) {
         // It's sufficient to just check the X overflow,
         // since it's illegal to have visible in only one direction.
-        if (rootRenderer->effectiveOverflowX() == Overflow::Visible && is<HTMLHtmlElement>(documentElement)) {
+        if (rootRenderer->style().overflowX() == Overflow::Visible && is<HTMLHtmlElement>(documentElement)) {
             auto* bodyRenderer = bodyOrFrameset->renderer();
             if (bodyRenderer) {
                 applyOverflowToViewport(*bodyRenderer, hMode, vMode);

Modified: trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp (285744 => 285745)


--- trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp	2021-11-12 22:47:21 UTC (rev 285744)
+++ trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp	2021-11-12 23:00:38 UTC (rev 285745)
@@ -846,7 +846,7 @@
         return minContentForChild(child);
 
     const Length& childMinSize = isRowAxis ? child.style().logicalMinWidth() : child.style().logicalMinHeight();
-    bool overflowIsVisible = isRowAxis ? child.effectiveOverflowInlineDirection() == Overflow::Visible : child.effectiveOverflowBlockDirection() == Overflow::Visible;
+    bool overflowIsVisible = isRowAxis ? child.style().overflowInlineDirection() == Overflow::Visible : child.style().overflowBlockDirection() == Overflow::Visible;
     LayoutUnit baselineShim = m_algorithm.baselineOffsetForChild(child, gridAxisForDirection(direction()));
 
     if (childMinSize.isAuto() && overflowIsVisible) {

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (285744 => 285745)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2021-11-12 22:47:21 UTC (rev 285744)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2021-11-12 23:00:38 UTC (rev 285745)
@@ -487,7 +487,7 @@
     setFloating(!isOutOfFlowPositioned() && styleToUse.isFloating());
 
     // We also handle <body> and <html>, whose overflow applies to the viewport.
-    if (!(effectiveOverflowX() == Overflow::Visible && effectiveOverflowY() == Overflow::Visible) && !isDocElementRenderer && isRenderBlock()) {
+    if (!(styleToUse.overflowX() == Overflow::Visible && styleToUse.overflowY() == Overflow::Visible) && !isDocElementRenderer && isRenderBlock()) {
         bool boxHasNonVisibleOverflow = true;
         if (isBody()) {
             // Overflow on the body can propagate to the viewport under the following conditions.
@@ -496,7 +496,7 @@
             // (3) The root element has visible overflow.
             if (is<HTMLHtmlElement>(*document().documentElement())
                 && document().body() == element()
-                && document().documentElement()->renderer()->effectiveOverflowX() == Overflow::Visible) {
+                && document().documentElement()->renderer()->style().overflowX() == Overflow::Visible) {
                 boxHasNonVisibleOverflow = false;
             }
         }
@@ -666,7 +666,7 @@
     if (allowIntrinsic == AllowIntrinsic::No && styleToUse.logicalMinWidth().isIntrinsic())
         return logicalWidth;
     auto minLength = styleToUse.logicalMinWidth();
-    if (styleToUse.hasAspectRatio() && minLength.isAuto() && (styleToUse.logicalWidth().isAuto() || styleToUse.logicalWidth().isMinContent() || styleToUse.logicalWidth().isMaxContent()) && effectiveOverflowInlineDirection() == Overflow::Visible) {
+    if (styleToUse.hasAspectRatio() && minLength.isAuto() && (styleToUse.logicalWidth().isAuto() || styleToUse.logicalWidth().isMinContent() || styleToUse.logicalWidth().isMaxContent()) && styleToUse.overflowInlineDirection() == Overflow::Visible) {
         // Make sure we actually used the aspect ratio.
         if (shouldComputeLogicalWidthFromAspectRatio())
             minLength = Length(LengthType::MinContent);
@@ -682,7 +682,7 @@
             logicalHeight = std::min(logicalHeight, maxH.value());
     }
     auto logicalMinHeight = styleToUse.logicalMinHeight();
-    if (logicalMinHeight.isAuto() && shouldComputeLogicalHeightFromAspectRatio() && intrinsicContentHeight && effectiveOverflowBlockDirection() == Overflow::Visible) {
+    if (logicalMinHeight.isAuto() && shouldComputeLogicalHeightFromAspectRatio() && intrinsicContentHeight && styleToUse.overflowBlockDirection() == Overflow::Visible) {
         auto heightFromAspectRatio = blockSizeFromAspectRatio(horizontalBorderAndPaddingExtent(), verticalBorderAndPaddingExtent(), LayoutUnit(style().logicalAspectRatio()), style().boxSizingForAspectRatio(), logicalWidth()) - borderAndPaddingLogicalHeight();
         if (firstChild())
             heightFromAspectRatio = std::max(heightFromAspectRatio, *intrinsicContentHeight);
@@ -4906,7 +4906,7 @@
 {
     return isInlineBlockOrInlineTable() || isFloatingOrOutOfFlowPositioned() || hasPotentiallyScrollableOverflow() || isFlexItemIncludingDeprecated()
         || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot() || isDocumentElementRenderer() || isRenderFragmentedFlow()
-        || style().containsLayout() || paintContainmentApplies() || isGridItem() || style().specifiesColumns() || style().columnSpan() == ColumnSpan::All || style().display() == DisplayType::FlowRoot;
+        || style().containsLayout() || isGridItem() || style().specifiesColumns() || style().columnSpan() == ColumnSpan::All || style().display() == DisplayType::FlowRoot;
 }
 
 bool RenderBox::avoidsFloats() const
@@ -4974,8 +4974,6 @@
 
 void RenderBox::addOverflowFromChild(const RenderBox* child, const LayoutSize& delta)
 {
-    if (paintContainmentApplies())
-        return;
     // Never allow flow threads to propagate overflow up to a parent.
     if (child->isRenderFragmentedFlow())
         return;

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (285744 => 285745)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2021-11-12 22:47:21 UTC (rev 285744)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2021-11-12 23:00:38 UTC (rev 285745)
@@ -211,7 +211,6 @@
     setHorizontalWritingMode(styleToUse.isHorizontalWritingMode());
     if (styleToUse.isFlippedBlocksWritingMode())
         view().frameView().setHasFlippedBlockRenderers(true);
-    setPaintContainmentApplies(shouldApplyPaintContainment(*this));
 }
 
 static LayoutSize accumulateInFlowPositionOffsets(const RenderObject* child)

Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (285744 => 285745)


--- trunk/Source/WebCore/rendering/RenderElement.cpp	2021-11-12 22:47:21 UTC (rev 285744)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp	2021-11-12 23:00:38 UTC (rev 285745)
@@ -2317,7 +2317,7 @@
         if (is<RenderBlock>(renderer)) {
             // For fixed height styles, if the overflow size of the element spills out of the specified
             // height, assume we can apply text auto-sizing.
-            if (downcast<RenderBlock>(renderer).effectiveOverflowY() == Overflow::Visible
+            if (style.overflowY() == Overflow::Visible
                 && style.height().value() < downcast<RenderBlock>(renderer).layoutOverflowRect().maxY())
                 return RenderObject::OverflowHeight;
         }
@@ -2407,20 +2407,4 @@
     ensureRareData().backdropRenderer = renderer;
 }
 
-Overflow RenderElement::effectiveOverflowX() const
-{
-    auto overflowX = style().overflowX();
-    if (paintContainmentApplies() && overflowX == Overflow::Visible)
-        return Overflow::Clip;
-    return overflowX;
 }
-
-Overflow RenderElement::effectiveOverflowY() const
-{
-    auto overflowY = style().overflowY();
-    if (paintContainmentApplies() && overflowY == Overflow::Visible)
-        return Overflow::Clip;
-    return overflowY;
-}
-
-}

Modified: trunk/Source/WebCore/rendering/RenderElement.h (285744 => 285745)


--- trunk/Source/WebCore/rendering/RenderElement.h	2021-11-12 22:47:21 UTC (rev 285744)
+++ trunk/Source/WebCore/rendering/RenderElement.h	2021-11-12 23:00:38 UTC (rev 285745)
@@ -268,11 +268,6 @@
 
     ReferencedSVGResources& ensureReferencedSVGResources();
 
-    Overflow effectiveOverflowX() const;
-    Overflow effectiveOverflowY() const;
-    Overflow effectiveOverflowInlineDirection() const { return style().isHorizontalWritingMode() ? effectiveOverflowX() : effectiveOverflowY(); }
-    Overflow effectiveOverflowBlockDirection() const { return style().isHorizontalWritingMode() ? effectiveOverflowY() : effectiveOverflowX(); }
-
 protected:
     enum BaseTypeFlag {
         RenderLayerModelObjectFlag  = 1 << 0,
@@ -461,8 +456,7 @@
         // FIXME: will-change should create containing blocks on inline boxes (bug 225035)
         || (isRenderBlock() && style().willChange() && style().willChange()->createsContainingBlockForOutOfFlowPositioned())
         || isSVGForeignObject()
-        || shouldApplyLayoutContainment(*this)
-        || shouldApplyPaintContainment(*this);
+        || shouldApplyLayoutContainment(*this);
 }
 
 inline bool RenderElement::canContainAbsolutelyPositionedObjects() const
@@ -473,7 +467,6 @@
         || (isRenderBlock() && style().willChange() && style().willChange()->createsContainingBlockForAbsolutelyPositioned())
         || isSVGForeignObject()
         || shouldApplyLayoutContainment(*this)
-        || shouldApplyPaintContainment(*this)
         || isRenderView();
 }
 

Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (285744 => 285745)


--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2021-11-12 22:47:21 UTC (rev 285744)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2021-11-12 23:00:38 UTC (rev 285745)
@@ -1844,15 +1844,15 @@
 Overflow RenderFlexibleBox::mainAxisOverflowForChild(const RenderBox& child) const
 {
     if (isHorizontalFlow())
-        return child.effectiveOverflowX();
-    return child.effectiveOverflowY();
+        return child.style().overflowX();
+    return child.style().overflowY();
 }
 
 Overflow RenderFlexibleBox::crossAxisOverflowForChild(const RenderBox& child) const
 {
     if (isHorizontalFlow())
-        return child.effectiveOverflowY();
-    return child.effectiveOverflowX();
+        return child.style().overflowY();
+    return child.style().overflowX();
 }
 
 bool RenderFlexibleBox::childHasPercentHeightDescendants(const RenderBox& renderer) const

Modified: trunk/Source/WebCore/rendering/RenderFragmentContainer.cpp (285744 => 285745)


--- trunk/Source/WebCore/rendering/RenderFragmentContainer.cpp	2021-11-12 22:47:21 UTC (rev 285744)
+++ trunk/Source/WebCore/rendering/RenderFragmentContainer.cpp	2021-11-12 23:00:38 UTC (rev 285745)
@@ -157,7 +157,7 @@
     if (m_fragmentedFlow->isHorizontalWritingMode()) {
         LayoutUnit minY = isFirstPortion ? fragmentedFlowOverflow.y() : fragmentedFlowPortionRect.y();
         LayoutUnit maxY = isLastPortion ? std::max(fragmentedFlowPortionRect.maxY(), fragmentedFlowOverflow.maxY()) : fragmentedFlowPortionRect.maxY();
-        bool clipX = effectiveOverflowX() != Overflow::Visible;
+        bool clipX = style().overflowX() != Overflow::Visible;
         LayoutUnit minX = clipX ? fragmentedFlowPortionRect.x() : std::min(fragmentedFlowPortionRect.x(), fragmentedFlowOverflow.x());
         LayoutUnit maxX = clipX ? fragmentedFlowPortionRect.maxX() : std::max(fragmentedFlowPortionRect.maxX(), fragmentedFlowOverflow.maxX());
         clipRect = LayoutRect(minX, minY, maxX - minX, maxY - minY);
@@ -164,7 +164,7 @@
     } else {
         LayoutUnit minX = isFirstPortion ? fragmentedFlowOverflow.x() : fragmentedFlowPortionRect.x();
         LayoutUnit maxX = isLastPortion ? std::max(fragmentedFlowPortionRect.maxX(), fragmentedFlowOverflow.maxX()) : fragmentedFlowPortionRect.maxX();
-        bool clipY = effectiveOverflowY() != Overflow::Visible;
+        bool clipY = style().overflowY() != Overflow::Visible;
         LayoutUnit minY = clipY ? fragmentedFlowPortionRect.y() : std::min(fragmentedFlowPortionRect.y(), fragmentedFlowOverflow.y());
         LayoutUnit maxY = clipY ? fragmentedFlowPortionRect.maxY() : std::max(fragmentedFlowPortionRect.y(), fragmentedFlowOverflow.maxY());
         clipRect = LayoutRect(minX, minY, maxX - minX, maxY - minY);

Modified: trunk/Source/WebCore/rendering/RenderInline.h (285744 => 285745)


--- trunk/Source/WebCore/rendering/RenderInline.h	2021-11-12 22:47:21 UTC (rev 285744)
+++ trunk/Source/WebCore/rendering/RenderInline.h	2021-11-12 23:00:38 UTC (rev 285745)
@@ -82,7 +82,7 @@
 
     bool mayAffectLayout() const;
 
-    bool requiresLayer() const override { return isInFlowPositioned() || createsGroup() || hasClipPath() || shouldApplyPaintContainment(*this) || willChangeCreatesStackingContext() || hasRunningAcceleratedAnimations(); }
+    bool requiresLayer() const override { return isInFlowPositioned() || createsGroup() || hasClipPath() || willChangeCreatesStackingContext() || hasRunningAcceleratedAnimations(); }
 
 protected:
     void willBeDestroyed() override;

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (285744 => 285745)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2021-11-12 22:47:21 UTC (rev 285744)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2021-11-12 23:00:38 UTC (rev 285745)
@@ -556,7 +556,6 @@
         || renderer.isPositioned() // Note that this only creates stacking context in conjunction with explicit z-index.
         || renderer.hasReflection()
         || renderer.style().hasIsolation()
-        || shouldApplyPaintContainment(renderer)
         || !renderer.style().hasAutoUsedZIndex()
         || (renderer.style().willChange() && renderer.style().willChange()->canCreateStackingContext())
         || layer.establishesTopLayer();
@@ -588,7 +587,7 @@
 
 bool RenderLayer::shouldBeCSSStackingContext() const
 {
-    return !renderer().style().hasAutoUsedZIndex() || shouldApplyPaintContainment(renderer()) || isRenderViewLayer();
+    return !renderer().style().hasAutoUsedZIndex() || isRenderViewLayer();
 }
 
 bool RenderLayer::setIsNormalFlowOnly(bool isNormalFlowOnly)
@@ -1090,11 +1089,6 @@
 void RenderLayer::setAncestorChainHasSelfPaintingLayerDescendant()
 {
     for (RenderLayer* layer = this; layer; layer = layer->parent()) {
-        if (shouldApplyPaintContainment(renderer())) {
-            m_hasSelfPaintingLayerDescendant = true;
-            m_hasSelfPaintingLayerDescendantDirty = false;
-            break;
-        }
         if (!layer->m_hasSelfPaintingLayerDescendantDirty && layer->hasSelfPaintingLayerDescendant())
             break;
 
@@ -1495,11 +1489,6 @@
 void RenderLayer::setAncestorChainHasVisibleDescendant()
 {
     for (RenderLayer* layer = this; layer; layer = layer->parent()) {
-        if (shouldApplyPaintContainment(renderer())) {
-            m_hasVisibleDescendant = true;
-            m_visibleDescendantStatusDirty = false;
-            break;
-        }
         if (!layer->m_visibleDescendantStatusDirty && layer->hasVisibleDescendant())
             break;
 
@@ -4540,10 +4529,6 @@
             clipRects.setOverflowClipRect(intersection(newOverflowClip, clipRects.overflowClipRect()));
             if (renderer().isPositioned())
                 clipRects.setPosClipRect(intersection(newOverflowClip, clipRects.posClipRect()));
-            if (shouldApplyPaintContainment(renderer())) {
-                clipRects.setPosClipRect(intersection(newOverflowClip, clipRects.posClipRect()));
-                clipRects.setFixedClipRect(intersection(newOverflowClip, clipRects.fixedClipRect()));
-            }
         }
         if (renderer().hasClip()) {
             LayoutRect newPosClip = downcast<RenderBox>(renderer()).clipRect(offset, nullptr);

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (285744 => 285745)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2021-11-12 22:47:21 UTC (rev 285744)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2021-11-12 23:00:38 UTC (rev 285745)
@@ -1919,12 +1919,6 @@
         ensureRareData().setHasOutlineAutoAncestor(hasOutlineAutoAncestor);
 }
 
-void RenderObject::setPaintContainmentApplies(bool paintContainmentApplies)
-{
-    if (paintContainmentApplies || hasRareData())
-        ensureRareData().setPaintContainmentApplies(paintContainmentApplies);
-}
-
 RenderObject::RareDataMap& RenderObject::rareDataMap()
 {
     static NeverDestroyed<RareDataMap> map;
@@ -2552,9 +2546,3 @@
         return false;
     return (!renderer.isInline() || renderer.isAtomicInlineLevelBox()) && !renderer.isRubyText() && (!renderer.isTablePart() || renderer.isTableCaption()) && !renderer.isTable();
 }
-
-bool WebCore::shouldApplyPaintContainment(const WebCore::RenderObject& renderer)
-{
-    return renderer.style().containsPaint() && (!renderer.isInline() || renderer.isAtomicInlineLevelBox()) && !renderer.isRubyText() && (!renderer.isTablePart() || renderer.isRenderBlockFlow());
-}
-

Modified: trunk/Source/WebCore/rendering/RenderObject.h (285744 => 285745)


--- trunk/Source/WebCore/rendering/RenderObject.h	2021-11-12 22:47:21 UTC (rev 285744)
+++ trunk/Source/WebCore/rendering/RenderObject.h	2021-11-12 23:00:38 UTC (rev 285745)
@@ -408,7 +408,6 @@
     bool hasReflection() const { return m_bitfields.hasRareData() && rareData().hasReflection(); }
     bool isRenderFragmentedFlow() const { return m_bitfields.hasRareData() && rareData().isRenderFragmentedFlow(); }
     bool hasOutlineAutoAncestor() const { return m_bitfields.hasRareData() && rareData().hasOutlineAutoAncestor(); }
-    bool paintContainmentApplies() const { return m_bitfields.hasRareData() && rareData().paintContainmentApplies(); }
 
     bool isExcludedFromNormalLayout() const { return m_bitfields.isExcludedFromNormalLayout(); }
     void setIsExcludedFromNormalLayout(bool excluded) { m_bitfields.setIsExcludedFromNormalLayout(excluded); }
@@ -506,7 +505,6 @@
     void setHasReflection(bool = true);
     void setIsRenderFragmentedFlow(bool = true);
     void setHasOutlineAutoAncestor(bool = true);
-    void setPaintContainmentApplies(bool = true);
 
     // Hook so that RenderTextControl can return the line height of its inner renderer.
     // For other renderers, the value is the same as lineHeight(false).
@@ -937,7 +935,6 @@
         ADD_BOOLEAN_BITFIELD(hasReflection, HasReflection);
         ADD_BOOLEAN_BITFIELD(isRenderFragmentedFlow, IsRenderFragmentedFlow);
         ADD_BOOLEAN_BITFIELD(hasOutlineAutoAncestor, HasOutlineAutoAncestor);
-        ADD_BOOLEAN_BITFIELD(paintContainmentApplies, PaintContainmentApplies);
 
         // From RenderElement
         std::unique_ptr<RenderStyle> cachedFirstLineStyle;
@@ -1212,7 +1209,6 @@
 bool shouldApplyLayoutContainment(const RenderObject&);
 bool shouldApplySizeContainment(const RenderObject&);
 bool shouldApplyStyleContainment(const RenderObject&);
-bool shouldApplyPaintContainment(const RenderObject&);
 
 } // namespace WebCore
 

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (285744 => 285745)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2021-11-12 22:47:21 UTC (rev 285744)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2021-11-12 23:00:38 UTC (rev 285745)
@@ -331,6 +331,8 @@
     
     Overflow overflowX() const { return static_cast<Overflow>(m_nonInheritedFlags.overflowX); }
     Overflow overflowY() const { return static_cast<Overflow>(m_nonInheritedFlags.overflowY); }
+    Overflow overflowInlineDirection() const { return isHorizontalWritingMode() ? overflowX() : overflowY(); }
+    Overflow overflowBlockDirection() const { return isHorizontalWritingMode() ? overflowY() : overflowX(); }
     bool isOverflowVisible() const { return overflowX() == Overflow::Visible || overflowY() == Overflow::Visible; }
 
     OverscrollBehavior overscrollBehaviorX() const { return static_cast<OverscrollBehavior>(m_rareNonInheritedData->overscrollBehaviorX); }
@@ -530,7 +532,6 @@
     bool containsLayout() const { return m_rareNonInheritedData->contain.contains(Containment::Layout); }
     bool containsSize() const { return m_rareNonInheritedData->contain.contains(Containment::Size); }
     bool containsStyle() const { return m_rareNonInheritedData->contain.contains(Containment::Style); }
-    bool containsPaint() const { return m_rareNonInheritedData->contain.contains(Containment::Paint); }
     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; }

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp (285744 => 285745)


--- trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp	2021-11-12 22:47:21 UTC (rev 285744)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp	2021-11-12 23:00:38 UTC (rev 285745)
@@ -215,7 +215,7 @@
     // the outermost svg is clipped if auto, and svg document roots are always clipped
     // When the svg is stand-alone (isDocumentElement() == true) the viewport clipping should always
     // be applied, noting that the window scrollbars should be hidden if overflow=hidden.
-    return effectiveOverflowX() == Overflow::Hidden
+    return style().overflowX() == Overflow::Hidden
         || style().overflowX() == Overflow::Auto
         || style().overflowX() == Overflow::Scroll
         || this->isDocumentElementRenderer();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to