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
[LBSE] Transform update handling is unreliable
https://bugs.webkit.org/show_bug.cgi?id=247671 Reviewed by Rob Buis. If a SVG renderer does not have a transformation and <animateMotion> adds a non-identity supplementalTransform() no visual effect is observed. Only when e.g. zooming in/out (-> style invalidation) the animation starts to be visible. If e.g. the 'transform' attribute changes SVG*Element::svgAttributeChanged() needs to notify the renderer to re-evaluate the 'HasSVGTransform' and 'HasTransformRelatedProperty' flags, since the renderer might have gained or lost a transformation due to the attribute change. Therefore explicitely call updateHasSVGTransformFlags() instead of either updateFromStyle() or updateFromElement(). This avoids unnecessary extra work, and will allow us to handle transformation changes without performing relayouts, soon. SVGAnimateMotionElement was lacking similar logic to communicate transformation changes -- the aforementioned flags were out of sync, and thus only if the element was already transformed one could observe the animation -- that's fixed now in general. Revisit all renderers to enforce that updateFromStyle() is only called from one place (RenderLayerModelObject::styleDidChange) except for one exception: RenderSVGRoot needs to forward updateFromStyle() calls to its anonymous child, the RenderSVGViewportContainer. RenderSVGRoot no longer stores a pointer to the RenderSVGViewportContainer, but instead grabs it from the render tree hierarchy (firstChild()). This allows to ink the anonymous RenderSVGViewportContainer to its owning RenderSVGRoot, simplifying the render tree building (see RenderTreeBuilderSVG). updateFromElement() is no longer needed for SVG. Transform change handling is now handled consistenly for CSS transforms, SVG transforms, SMIL transforms, SVG "generated" / "induced" transforms such as viewBox, x/y translation for <use> elements, etc. share the same logic. Covered by existing tests - 25 tests are fixed by this patch in LBSE. * LayoutTests/platform/mac-ventura-wk2-lbse-text/TestExpectations: * LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/missing-xlink-expected.png: Removed. * LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/repaint/mask-clip-target-transform-expected.txt: * LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/page/zoom-hixie-mixed-008-expected.png: * LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/page/zoom-hixie-mixed-009-expected.png: * LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/page/zoom-hixie-rendering-model-004-expected.png: Removed. * LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/page/zoom-svg-float-border-padding-expected.png: * LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/text/zoom-hixie-mixed-008-expected.png: Removed. * LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/text/zoom-hixie-rendering-model-004-expected.png: Removed. * LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/text/zoom-svg-float-border-padding-expected.png: Removed. * Source/WebCore/rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::updateHasSVGTransformFlags): * Source/WebCore/rendering/RenderLayerModelObject.h: (WebCore::RenderLayerModelObject::needsHasSVGTransformFlags const): (WebCore::RenderLayerModelObject::updateFromStyle): * Source/WebCore/rendering/svg/RenderSVGBlock.cpp: (WebCore::RenderSVGBlock::updateFromStyle): (WebCore::RenderSVGBlock::needsHasSVGTransformFlags const): * Source/WebCore/rendering/svg/RenderSVGBlock.h: * Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp: (WebCore::RenderSVGForeignObject::updateFromStyle): * Source/WebCore/rendering/svg/RenderSVGForeignObject.h: * Source/WebCore/rendering/svg/RenderSVGHiddenContainer.h: * Source/WebCore/rendering/svg/RenderSVGImage.cpp: (WebCore::RenderSVGImage::needsHasSVGTransformFlags const): * Source/WebCore/rendering/svg/RenderSVGImage.h: * Source/WebCore/rendering/svg/RenderSVGInline.cpp: (WebCore::RenderSVGInline::needsHasSVGTransformFlags const): (WebCore::RenderSVGInline::updateFromStyle): * Source/WebCore/rendering/svg/RenderSVGInline.h: * Source/WebCore/rendering/svg/RenderSVGModelObject.cpp: (WebCore::RenderSVGModelObject::updateFromStyle): * Source/WebCore/rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::viewportContainer const): (WebCore::RenderSVGRoot::needsHasSVGTransformFlags const): (WebCore::RenderSVGRoot::updateFromStyle): (WebCore::RenderSVGRoot::setViewportContainer): Deleted. (WebCore::RenderSVGRoot::updateFromElement): Deleted. * Source/WebCore/rendering/svg/RenderSVGRoot.h: * Source/WebCore/rendering/svg/RenderSVGShape.cpp: (WebCore::RenderSVGShape::needsHasSVGTransformFlags const): * Source/WebCore/rendering/svg/RenderSVGShape.h: * Source/WebCore/rendering/svg/RenderSVGTransformableContainer.cpp: (WebCore::RenderSVGTransformableContainer::needsHasSVGTransformFlags const): (WebCore::RenderSVGTransformableContainer::updateFromStyle): Deleted. * Source/WebCore/rendering/svg/RenderSVGTransformableContainer.h: * Source/WebCore/rendering/svg/RenderSVGViewportContainer.cpp: (WebCore::RenderSVGViewportContainer::RenderSVGViewportContainer): (WebCore::RenderSVGViewportContainer::svgSVGElement const): (WebCore::RenderSVGViewportContainer::needsHasSVGTransformFlags const): (WebCore::RenderSVGViewportContainer::updateFromStyle): (WebCore::RenderSVGViewportContainer::updateFromElement): Deleted. (WebCore::RenderSVGViewportContainer::needsHasSVGTransformFlag const): Deleted. * Source/WebCore/rendering/svg/RenderSVGViewportContainer.h: * Source/WebCore/rendering/updating/RenderTreeBuilderSVG.cpp: (WebCore::RenderTreeBuilder::SVG::attach): (WebCore::RenderTreeBuilder::SVG::findOrCreateParentForChild): * Source/WebCore/svg/SVGAnimateMotionElement.cpp: (WebCore::SVGAnimateMotionElement::applyResultsToTarget): * Source/WebCore/svg/SVGGraphicsElement.cpp: (WebCore::SVGGraphicsElement::svgAttributeChanged): * Source/WebCore/svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::updateCurrentTranslate): (WebCore::SVGSVGElement::svgAttributeChanged): (WebCore::SVGSVGElement::didAttachRenderers): Deleted. * Source/WebCore/svg/SVGSVGElement.h: Canonical link: https://commits.webkit.org/256787@main
- Loading branch information
1 parent
e633ef2
commit 6b5b349b0390030413d11288faf13659fd76ec5d
Showing
35 changed files
with
145 additions
and
143 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
Binary file not shown.
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
BIN
-293 Bytes
(99%)
...tform/mac-ventura-wk2-lbse-text/svg/zoom/page/zoom-hixie-mixed-008-expected.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
-175 Bytes
(99%)
...tform/mac-ventura-wk2-lbse-text/svg/zoom/page/zoom-hixie-mixed-009-expected.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
BIN
+17 Bytes
(100%)
...-ventura-wk2-lbse-text/svg/zoom/page/zoom-svg-float-border-padding-expected.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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
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.