Skip to content

Commit

Permalink
View transition old snapshots incorrectly get scaled to the border-bo…
Browse files Browse the repository at this point in the history
…x size.

https://bugs.webkit.org/show_bug.cgi?id=269954
<rdar://123478049>

Reviewed by Tim Nguyen.

Drawing of the old snapshot rescales the image to the border-box size, even if
we captured a larger area.

We shouldn't apply scaling, just align the origin of the border-box in the snapshot
to the border-box origin of the pseudo element.

This records the overflow rect for which the snapshot is captured, and uses it
to adjust the overflow rect of the pseudo element and align the painting
position of the snapshot.

As a slight cleanup, merges the two createRendererIfNeeded lambdas into a single
static function.

* LayoutTests/TestExpectations:
* LayoutTests/platform/glib/TestExpectations:
* Source/WebCore/dom/ViewTransition.cpp:
(WebCore::snapshotNodeVisualOverflowClippedToViewport):
(WebCore::ViewTransition::captureOldState):
* Source/WebCore/dom/ViewTransition.h:
* Source/WebCore/page/FrameSnapshotting.cpp:
(WebCore::snapshotFrameRectWithClip):
* Source/WebCore/page/FrameSnapshotting.h:
* Source/WebCore/rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::requiresLayer const):
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::capturedInViewTransition const):
(WebCore::RenderElement::hasViewTransitionName const):
* Source/WebCore/rendering/RenderElement.h:
* Source/WebCore/rendering/RenderInline.cpp:
(WebCore::RenderInline::requiresLayer const):
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::canCreateStackingContext):
(WebCore::RenderLayer::shouldBeCSSStackingContext const):
(WebCore::RenderLayer::computeCanBeBackdropRoot const):
* Source/WebCore/rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::requiresLayer const):
* Source/WebCore/rendering/RenderViewTransitionCapture.cpp:
(WebCore::RenderViewTransitionCapture::setImage):
(WebCore::RenderViewTransitionCapture::paintReplaced):
(WebCore::RenderViewTransitionCapture::layout):
* Source/WebCore/rendering/RenderViewTransitionCapture.h:
* Source/WebCore/rendering/updating/RenderTreeUpdaterViewTransition.cpp:
(WebCore::createRendererIfNeeded):
(WebCore::RenderTreeUpdater::ViewTransition::buildPseudoElementGroup):
(WebCore::RenderTreeUpdater::ViewTransition::updatePseudoElementGroup):

Canonical link: https://commits.webkit.org/275227@main
  • Loading branch information
mattwoodrow committed Feb 23, 2024
1 parent 277513e commit 34e14bf
Show file tree
Hide file tree
Showing 15 changed files with 104 additions and 97 deletions.
29 changes: 4 additions & 25 deletions LayoutTests/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -6896,16 +6896,12 @@ imported/w3c/web-platform-tests/css/css-view-transitions/animating-new-content-s
imported/w3c/web-platform-tests/css/css-view-transitions/animating-new-content.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/block-with-overflowing-text.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/capture-with-offscreen-child-translated.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/capture-with-opacity-zero-child.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/capture-with-visibility-mixed-descendants.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/content-smaller-than-box-size.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/content-with-child-with-transparent-background.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/content-with-clip-root.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/content-with-inline-child.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/content-with-transform-old-image.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/content-with-transparent-background.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/css-tags-paint-order-with-entry.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/css-tags-paint-order.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/css-tags-shared-element.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/dialog-in-top-layer-during-transition-new.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/element-is-grouping-during-animation.html [ ImageOnlyFailure ]
Expand All @@ -6916,8 +6912,6 @@ imported/w3c/web-platform-tests/css/css-view-transitions/fractional-box-with-ove
imported/w3c/web-platform-tests/css/css-view-transitions/fractional-box-with-shadow-new.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/fractional-box-with-shadow-old.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/hit-test-unpainted-element-from-point.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/inline-child-with-filter.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/inline-element-size.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/inline-with-offset-from-containing-block.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/massive-element-below-and-on-top-of-viewport-partially-onscreen-old.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/massive-element-left-of-viewport-offscreen-new.html [ ImageOnlyFailure ]
Expand All @@ -6937,13 +6931,8 @@ imported/w3c/web-platform-tests/css/css-view-transitions/object-view-box-new-ima
imported/w3c/web-platform-tests/css/css-view-transitions/object-view-box-old-image.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/old-content-captures-clip-path.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/old-content-captures-different-size.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/old-content-element-writing-modes.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/old-content-has-scrollbars.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/old-content-intrinsic-aspect-ratio.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/old-content-object-fit-none.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/old-content-object-view-box-clip-path-reference.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/old-content-object-view-box-clip-path.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/old-content-object-view-box-overflow.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/old-content-with-overflow-zoomed.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/old-root-vertical-writing-mode.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/root-captured-as-different-tag.html [ ImageOnlyFailure ]
Expand All @@ -6957,10 +6946,8 @@ imported/w3c/web-platform-tests/css/css-view-transitions/snapshot-containing-blo
imported/w3c/web-platform-tests/css/css-view-transitions/span-with-overflowing-text-and-box-decorations.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/span-with-overflowing-text.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/transform-origin-view-transition-group.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/view-transition-name-is-backdrop-filter-root.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/view-transition-name-is-grouping.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/writing-mode-container-resize.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/break-inside-avoid-child.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/capture-with-offscreen-child.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/content-visibility-auto-shared-element.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/content-with-transform-new-image.html [ ImageOnlyFailure ]
Expand All @@ -6969,7 +6956,6 @@ imported/w3c/web-platform-tests/css/css-view-transitions/element-with-overflow.h
imported/w3c/web-platform-tests/css/css-view-transitions/exit-transition-with-anonymous-layout-object.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/far-away-capture.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/fractional-box-with-overflow-children-new.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/japanese-tag.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/massive-element-below-and-on-top-of-viewport-partially-onscreen-new.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/massive-element-below-viewport-offscreen-new.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/massive-element-below-viewport-offscreen-old.html [ ImageOnlyFailure ]
Expand All @@ -6988,31 +6974,24 @@ imported/w3c/web-platform-tests/css/css-view-transitions/new-content-object-fit-
imported/w3c/web-platform-tests/css/css-view-transitions/new-content-with-overflow-zoomed.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/old-content-captures-opacity.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/old-content-captures-root.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/old-content-container-writing-modes.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/old-content-is-inline.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/old-content-object-fit-fill.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/old-content-with-object-view-box.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/old-content-with-overflow.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/pseudo-rendering-invalidation.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/snapshot-containing-block-static.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/span-with-overflowing-text-hidden.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/fractional-translation-from-position.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/fractional-translation-from-transform.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/iframe-new-has-scrollbar.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/iframe-old-has-scrollbar.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/massive-element-below-viewport-partially-onscreen-old.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/named-element-with-fix-pos-child-new.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/named-element-with-fix-pos-child-old.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/new-and-old-sizes-match.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/new-content-has-scrollbars.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/no-root-capture.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/rotated-cat-off-top-edge.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/scroller-child-abspos.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/scroller-child.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/scroller.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/web-animations-api.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/new-content-element-writing-modes.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/offscreen-element-modified-before-coming-onscreen.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/content-with-clip.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/fragmented-at-start-ignored.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/new-content-is-empty-div.html [ ImageOnlyFailure ]


# Timeouts
imported/w3c/web-platform-tests/css/css-view-transitions/iframe-transition.sub.html [ Skip ]
Expand Down
3 changes: 3 additions & 0 deletions LayoutTests/platform/glib/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -3872,6 +3872,9 @@ webkit.org/b/180134 webanimations/opacity-animation-no-longer-composited-upon-co
imported/w3c/web-platform-tests/css/css-view-transitions/backdrop-filter-captured.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/element-stops-grouping-after-animation.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/massive-element-below-viewport-partially-onscreen-new.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/capture-with-opacity-zero-child.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/offscreen-element-modified-before-coming-onscreen.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-view-transitions/pseudo-rendering-invalidation.html [ ImageOnlyFailure ]

# End: Common failures between GTK and WPE.

Expand Down
32 changes: 31 additions & 1 deletion Source/WebCore/dom/ViewTransition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@
#include "FrameSnapshotting.h"
#include "JSDOMPromise.h"
#include "JSDOMPromiseDeferred.h"
#include "LayoutRect.h"
#include "PseudoElementRequest.h"
#include "RenderBox.h"
#include "RenderLayer.h"
#include "StyleResolver.h"
#include "StyleScope.h"
#include "Styleable.h"
Expand Down Expand Up @@ -260,6 +262,34 @@ static ExceptionOr<void> checkDuplicateViewTransitionName(const AtomString& name
return { };
}

static RefPtr<ImageBuffer> snapshotNodeVisualOverflowClippedToViewport(LocalFrame& frame, Node& node, SnapshotOptions&& options, LayoutRect& oldOverflowRect)
{
if (!node.renderer())
return nullptr;

auto paintBehavior = frame.view()->paintBehavior();
auto backgroundColor = frame.view()->baseBackgroundColor();

options.flags.add(SnapshotFlags::Accelerated);

frame.view()->setBaseBackgroundColor(Color::transparentBlack);
frame.view()->setNodeToDraw(&node);

ASSERT(node.renderer()->hasLayer());
CheckedPtr layerRenderer = downcast<RenderLayerModelObject>(node.renderer());

IntRect paintRect = layerRenderer->layer()->absoluteBoundingBox();
paintRect.intersect(snappedIntRect(frame.view()->layoutViewportRect()));
RefPtr result = snapshotFrameRect(frame, paintRect, WTFMove(options));

frame.view()->setPaintBehavior(paintBehavior);
frame.view()->setBaseBackgroundColor(backgroundColor);
frame.view()->setNodeToDraw(nullptr);

oldOverflowRect = layerRenderer->layer()->localBoundingBox();
return result;
}

// https://drafts.csswg.org/css-view-transitions/#capture-old-state-algorithm
ExceptionOr<void> ViewTransition::captureOldState()
{
Expand Down Expand Up @@ -287,7 +317,7 @@ ExceptionOr<void> ViewTransition::captureOldState()
capture.oldSize = renderBox->size();
capture.oldProperties = copyElementBaseProperties(element.get());
if (m_document->frame())
capture.oldImage = snapshotNode(*m_document->frame(), element.get(), { { }, PixelFormat::BGRA8, DestinationColorSpace::SRGB() });
capture.oldImage = snapshotNodeVisualOverflowClippedToViewport(*m_document->frame(), element.get(), { { }, PixelFormat::BGRA8, DestinationColorSpace::SRGB() }, capture.oldOverflowRect);

auto transitionName = element->computedStyle()->viewTransitionName();
m_namedElements.add(transitionName->name, capture);
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/dom/ViewTransition.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ struct CapturedElement {
WTF_MAKE_FAST_ALLOCATED;
public:
RefPtr<ImageBuffer> oldImage;
LayoutRect oldOverflowRect;
LayoutSize oldSize;
RefPtr<MutableStyleProperties> oldProperties;
WeakPtr<Element, WeakPtrImplWithEventTargetData> newElement;
Expand Down
6 changes: 5 additions & 1 deletion Source/WebCore/page/FrameSnapshotting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ RefPtr<ImageBuffer> snapshotFrameRectWithClip(LocalFrame& frame, const IntRect&

ScopedFramePaintingState state(frame, nullptr);

OptionSet<ImageBufferOptions> bufferOptions;
if (options.flags.contains(SnapshotFlags::Accelerated))
bufferOptions.add(ImageBufferOptions::Accelerated);

auto paintBehavior = state.paintBehavior;
if (options.flags.contains(SnapshotFlags::ForceBlackText))
paintBehavior.add(PaintBehavior::ForceBlackText);
Expand All @@ -120,7 +124,7 @@ RefPtr<ImageBuffer> snapshotFrameRectWithClip(LocalFrame& frame, const IntRect&
auto purpose = options.flags.contains(SnapshotFlags::Shareable) ? RenderingPurpose::ShareableSnapshot : RenderingPurpose::Snapshot;
auto hostWindow = (document->view() && document->view()->root()) ? document->view()->root()->hostWindow() : nullptr;

auto buffer = ImageBuffer::create(imageRect.size(), purpose, scaleFactor, options.colorSpace, options.pixelFormat, { }, hostWindow);
auto buffer = ImageBuffer::create(imageRect.size(), purpose, scaleFactor, options.colorSpace, options.pixelFormat, bufferOptions, hostWindow);
if (!buffer)
return nullptr;

Expand Down
3 changes: 2 additions & 1 deletion Source/WebCore/page/FrameSnapshotting.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ImageBuffer;
class LocalFrame;
class Node;

enum class SnapshotFlags : uint8_t {
enum class SnapshotFlags : uint16_t {
ExcludeSelectionHighlighting = 1 << 0,
PaintSelectionOnly = 1 << 1,
InViewCoordinates = 1 << 2,
Expand All @@ -53,6 +53,7 @@ enum class SnapshotFlags : uint8_t {
PaintEverythingExcludingSelection = 1 << 5,
PaintWithIntegralScaleFactor = 1 << 6,
Shareable = 1 << 7,
Accelerated = 1 << 8,
};

struct SnapshotOptions {
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/rendering/RenderBoxModelObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ void RenderBoxModelObject::applyTransform(TransformationMatrix&, const RenderSty

bool RenderBoxModelObject::requiresLayer() const
{
return isDocumentElementRenderer() || isPositioned() || createsGroup() || hasTransformRelatedProperty() || hasHiddenBackface() || hasReflection() || capturedInViewTransition() || isViewTransitionPseudo();
return isDocumentElementRenderer() || isPositioned() || createsGroup() || hasTransformRelatedProperty() || hasHiddenBackface() || hasReflection() || hasViewTransitionName() || isViewTransitionPseudo();
}

} // namespace WebCore
7 changes: 6 additions & 1 deletion Source/WebCore/rendering/RenderElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2066,12 +2066,17 @@ bool RenderElement::hasSelfPaintingLayer() const

bool RenderElement::capturedInViewTransition() const
{
if (!style().viewTransitionName())
if (!hasViewTransitionName())
return false;

return !!document().activeViewTransition();
}

bool RenderElement::hasViewTransitionName() const
{
return !!style().viewTransitionName();
}

bool RenderElement::isViewTransitionPseudo() const
{
return style().pseudoElementType() == PseudoId::ViewTransitionNew || style().pseudoElementType() == PseudoId::ViewTransitionOld;
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/rendering/RenderElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ class RenderElement : public RenderObject {
inline bool hasClipPath() const;
inline bool hasHiddenBackface() const;
bool capturedInViewTransition() const;
bool hasViewTransitionName() const;
bool isViewTransitionPseudo() const;
bool hasOutlineAnnotation() const;
inline bool hasOutline() const;
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/rendering/RenderInline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ inline bool RenderInline::willChangeCreatesStackingContext() const

bool RenderInline::requiresLayer() const
{
return isInFlowPositioned() || createsGroup() || hasClipPath() || shouldApplyPaintContainment() || willChangeCreatesStackingContext() || hasRunningAcceleratedAnimations();
return isInFlowPositioned() || createsGroup() || hasClipPath() || shouldApplyPaintContainment() || willChangeCreatesStackingContext() || hasRunningAcceleratedAnimations() || hasViewTransitionName();
}

} // namespace WebCore
6 changes: 3 additions & 3 deletions Source/WebCore/rendering/RenderLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ static bool canCreateStackingContext(const RenderLayer& layer)
|| renderer.hasBackdropFilter()
|| renderer.hasBlendMode()
|| renderer.isTransparent()
|| renderer.capturedInViewTransition()
|| renderer.hasViewTransitionName()
|| renderer.isViewTransitionPseudo()
|| renderer.isPositioned() // Note that this only creates stacking context in conjunction with explicit z-index.
|| renderer.hasReflection()
Expand All @@ -602,7 +602,7 @@ bool RenderLayer::shouldBeNormalFlowOnly() const

bool RenderLayer::shouldBeCSSStackingContext() const
{
return !renderer().style().hasAutoUsedZIndex() || renderer().shouldApplyLayoutOrPaintContainment() || renderer().capturedInViewTransition() || renderer().isViewTransitionPseudo() || isRenderViewLayer();
return !renderer().style().hasAutoUsedZIndex() || renderer().shouldApplyLayoutOrPaintContainment() || renderer().hasViewTransitionName() || renderer().isViewTransitionPseudo() || isRenderViewLayer();
}

bool RenderLayer::computeCanBeBackdropRoot() const
Expand All @@ -616,7 +616,7 @@ bool RenderLayer::computeCanBeBackdropRoot() const
|| renderer().hasFilter()
|| renderer().hasBlendMode()
|| renderer().hasMask()
|| renderer().capturedInViewTransition()
|| renderer().hasViewTransitionName()
|| renderer().isDocumentElementRenderer()
|| (renderer().style().willChange() && renderer().style().willChange()->canBeBackdropRoot());
}
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/rendering/RenderTableRow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ RenderPtr<RenderTableRow> RenderTableRow::createAnonymousWithParentRenderer(cons

bool RenderTableRow::requiresLayer() const
{
return hasNonVisibleOverflow() || hasTransformRelatedProperty() || hasHiddenBackface() || hasClipPath() || createsGroup() || isStickilyPositioned();
return hasNonVisibleOverflow() || hasTransformRelatedProperty() || hasHiddenBackface() || hasClipPath() || createsGroup() || isStickilyPositioned() || hasViewTransitionName();
}

RenderPtr<RenderBox> RenderTableRow::createAnonymousBoxWithSameTypeAs(const RenderBox& renderer) const
Expand Down
Loading

0 comments on commit 34e14bf

Please sign in to comment.