Skip to content
Permalink
Browse files
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


Canonical link: https://commits.webkit.org/244204@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285745 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
ryanhaddad committed Nov 12, 2021
1 parent c5a1e9b commit 097e0faf42e9fe4fbf205bbbe4b9931d777c4545
Show file tree
Hide file tree
Showing 19 changed files with 108 additions and 84 deletions.
@@ -1,3 +1,16 @@
2021-11-12 Ryan Haddad <ryanhaddad@apple.com>

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 <cdumez@apple.com>

Regression(r285639) fast/dom/Geolocation/cached-position-iframe.html is frequently crashing on Mac-wk1
@@ -4721,10 +4721,6 @@ webanimations/translate-property-and-translate-animation-with-delay-on-forced-la
# 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-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-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 ]
@@ -1,3 +1,16 @@
2021-11-12 Ryan Haddad <ryanhaddad@apple.com>

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 <ashvayka@apple.com>

Implement custom element definition's *disable shadow* flag
@@ -1,13 +1,17 @@
Stretched:

Column

Row

Column

Row
Flex-start:

Column

Row

Column

@@ -1,3 +1,16 @@
2021-11-12 Ryan Haddad <ryanhaddad@apple.com>

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 <ashvayka@apple.com>

Implement custom element definition's *disable shadow* flag
@@ -644,8 +644,8 @@ void FrameView::applyOverflowToViewport(const RenderElement& renderer, Scrollbar

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 @@ void FrameView::applyPaginationToViewport()

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 @@ void FrameView::calculateScrollbarModesForLayout(ScrollbarMode& hMode, Scrollbar
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);
@@ -846,7 +846,7 @@ LayoutUnit GridTrackSizingAlgorithmStrategy::minSizeForChild(RenderBox& child) c
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) {
@@ -487,7 +487,7 @@ void RenderBox::updateFromStyle()
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 @@ void RenderBox::updateFromStyle()
// (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 @@ LayoutUnit RenderBox::constrainLogicalWidthInFragmentByMinMax(LayoutUnit logical
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 @@ LayoutUnit RenderBox::constrainLogicalHeightByMinMax(LayoutUnit logicalHeight, s
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 @@ bool RenderBox::createsNewFormattingContext() const
{
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 @@ LayoutRect RenderBox::applyVisualEffectOverflow(const LayoutRect& borderBox) con

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;
@@ -211,7 +211,6 @@ void RenderBoxModelObject::updateFromStyle()
setHorizontalWritingMode(styleToUse.isHorizontalWritingMode());
if (styleToUse.isFlippedBlocksWritingMode())
view().frameView().setHasFlippedBlockRenderers(true);
setPaintContainmentApplies(shouldApplyPaintContainment(*this));
}

static LayoutSize accumulateInFlowPositionOffsets(const RenderObject* child)
@@ -2317,7 +2317,7 @@ static RenderObject::BlockContentHeightType includeNonFixedHeight(const RenderOb
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 @@ void RenderElement::setBackdropRenderer(RenderBlockFlow& renderer)
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;
}

}
@@ -268,11 +268,6 @@ class RenderElement : public RenderObject {

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 @@ inline bool RenderElement::canContainFixedPositionObjects() const
// 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 @@ inline bool RenderElement::canContainAbsolutelyPositionedObjects() const
|| (isRenderBlock() && style().willChange() && style().willChange()->createsContainingBlockForAbsolutelyPositioned())
|| isSVGForeignObject()
|| shouldApplyLayoutContainment(*this)
|| shouldApplyPaintContainment(*this)
|| isRenderView();
}

@@ -1844,15 +1844,15 @@ bool RenderFlexibleBox::childHasIntrinsicMainAxisSize(const RenderBox& child)
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
@@ -157,14 +157,14 @@ LayoutRect RenderFragmentContainer::overflowRectForFragmentedFlowPortion(const L
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);
} 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);

0 comments on commit 097e0fa

Please sign in to comment.