Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[view-transitions] Pseudo elements can't be captured.
https://bugs.webkit.org/show_bug.cgi?id=273166 <rdar://126964779> Reviewed by Tim Nguyen. Pseudo elements (like ::backdrop) don't have an associated Element, so can't be found by ViewTransition's forEachElementInPaintOrder. Rather than holding an Element in CapturedElement, hold a Styleable instead which can represent these pseudo elements as well. Since the normal Styleable class uses an Element reference, introduces a WeakStyleable object which uses a WeakPtr to an Element and can (maybe) be converted back into a Styleable when needed. Changes most of the ViewTransition code to operator on the RenderElement from the Styleable, instead of the Element. Adds capturedInViewTransition to Styleable, so that we can look this up in cases where the renderer hasn't yet been created. * LayoutTests/TestExpectations: * Source/WebCore/dom/Element.cpp: (WebCore::operator<<): * Source/WebCore/dom/Element.h: (WebCore::Element::capturedInViewTransition const): Deleted. (WebCore::Element::setCapturedInViewTransition): Deleted. * Source/WebCore/dom/Node.h: * Source/WebCore/dom/ViewTransition.cpp: (WebCore::effectiveViewTransitionName): (WebCore::captureOverflowRect): (WebCore::snapshotElementVisualOverflowClippedToViewport): (WebCore::forEachRendererInPaintOrder): (WebCore::ViewTransition::captureOldState): (WebCore::ViewTransition::captureNewState): (WebCore::ViewTransition::activateViewTransition): (WebCore::ViewTransition::clearViewTransition): (WebCore::ViewTransition::copyElementBaseProperties): (WebCore::ViewTransition::updatePseudoElementStyles): (WebCore::ViewTransition::viewTransitionNewPseudoForCapturedElement): (WebCore::forEachElementInPaintOrder): Deleted. * Source/WebCore/dom/ViewTransition.h: * Source/WebCore/rendering/RenderElement.cpp: (WebCore::RenderElement::initializeStyle): (WebCore::RenderElement::capturedInViewTransition const): Deleted. * Source/WebCore/rendering/RenderElement.h: * Source/WebCore/rendering/RenderLayer.cpp: (WebCore::RenderLayer::rebuildZOrderLists): (WebCore::RenderLayer::paintList): * Source/WebCore/rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateTransform): (WebCore::RenderLayerBacking::updateGeometry): * Source/WebCore/rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::collectViewTransitionNewContentLayers): * Source/WebCore/rendering/RenderObject.h: (WebCore::RenderObject::capturedInViewTransition const): (WebCore::RenderObject::setCapturedInViewTransition): * Source/WebCore/style/Styleable.cpp: (WebCore::Styleable::capturedInViewTransition const): * Source/WebCore/style/Styleable.h: (WebCore::WeakStyleable::operator bool const): (WebCore::WeakStyleable::operator=): (WebCore::WeakStyleable::styleable const): Canonical link: https://commits.webkit.org/278123@main
- Loading branch information