[webkit-changes] [WebKit/WebKit] 26d12c: [LBSE] 'mask' / 'clipPath' (SVG) DOM changes shoul...
Nikolas Zimmermann
noreply at github.com
Mon Jan 22 04:00:49 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 26d12c80d8df13b1005c00fc45cb88ad622e2f64
https://github.com/WebKit/WebKit/commit/26d12c80d8df13b1005c00fc45cb88ad622e2f64
Author: Nikolas Zimmermann <nzimmermann at igalia.com>
Date: 2024-01-22 (Mon, 22 Jan 2024)
Changed paths:
M LayoutTests/platform/ios/svg/repaint/clip-path-object-bounding-box-transformed-expected.txt
M LayoutTests/platform/ios/svg/repaint/mask-object-bounding-box-transformed-expected.txt
A LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/animations/svg-element-attribute-changed-crash-expected.txt
A LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/transforms/svg-css-transforms-clip-path-expected.txt
A LayoutTests/svg/repaint/clip-path-change-unit-space-expected.txt
A LayoutTests/svg/repaint/clip-path-change-unit-space.html
M LayoutTests/svg/repaint/clip-path-object-bounding-box-transformed-expected.txt
M LayoutTests/svg/repaint/clip-path-user-space-on-use-transformed-expected.txt
M LayoutTests/svg/repaint/mask-object-bounding-box-transformed-expected.txt
M LayoutTests/svg/repaint/mask-user-space-on-use-transformed-expected.txt
M Source/WebCore/rendering/ReferencedSVGResources.cpp
M Source/WebCore/rendering/RenderLayer.cpp
M Source/WebCore/rendering/svg/SVGContainerLayout.cpp
M Source/WebCore/svg/SVGClipPathElement.cpp
M Source/WebCore/svg/SVGMaskElement.cpp
Log Message:
-----------
[LBSE] 'mask' / 'clipPath' (SVG) DOM changes should never trigger relayouts
https://bugs.webkit.org/show_bug.cgi?id=267732
Reviewed by Rob Buis and Simon Fraser.
When clipPahUnits change via (SVG) DOM, SVGClipPathElement::svgAttributeChanged()
will trigger an async re-layout of the associated RenderSVGResourceClipper. This is
useless, as it does not repaint the elements making use of the resource. Furthermore
unnecessary work is spent in layout - avoid all of that, and repaint the old and new
boundaries of all resource users, with the help of RenderLayers repaintRect tracking,
that assures the objects is repainted at its old and new position, not leaving visual
artifacts.
Covered by existing tests in LBSE + added a new test svg/repaint/clip-path-change-unit-space.html.
* LayoutTests/platform/ios/svg/repaint/clip-path-object-bounding-box-transformed-expected.txt:
* LayoutTests/platform/ios/svg/repaint/mask-object-bounding-box-transformed-expected.txt:
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/animations/svg-element-attribute-changed-crash-expected.txt: Added.
* LayoutTests/platform/mac-sonoma-wk2-lbse-text/svg/transforms/svg-css-transforms-clip-path-expected.txt: Added.
* LayoutTests/svg/repaint/clip-path-change-unit-space-expected.txt: Added.
* LayoutTests/svg/repaint/clip-path-change-unit-space.html: Added.
* LayoutTests/svg/repaint/clip-path-object-bounding-box-transformed-expected.txt:
* LayoutTests/svg/repaint/clip-path-user-space-on-use-transformed-expected.txt:
* LayoutTests/svg/repaint/mask-object-bounding-box-transformed-expected.txt:
* LayoutTests/svg/repaint/mask-user-space-on-use-transformed-expected.txt:
* Source/WebCore/rendering/ReferencedSVGResources.cpp:
(WebCore::CSSSVGResourceElementClient::resourceChanged):
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::recursiveUpdateLayerPositions):
* Source/WebCore/rendering/svg/SVGContainerLayout.cpp:
(WebCore::SVGContainerLayout::layoutChildren):
* Source/WebCore/svg/SVGClipPathElement.cpp:
(WebCore::SVGClipPathElement::svgAttributeChanged):
(WebCore::SVGClipPathElement::childrenChanged):
* Source/WebCore/svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::svgAttributeChanged):
(WebCore::SVGMaskElement::childrenChanged):
Canonical link: https://commits.webkit.org/273293@main
More information about the webkit-changes
mailing list