Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: cd5e57e3a9dedd146aeefa5808eb35a547297951
https://github.com/WebKit/WebKit/commit/cd5e57e3a9dedd146aeefa5808eb35a547297951
Author: Nikolas Zimmermann <[email protected]>
Date: 2026-08-17 (Mon, 17 Aug 2026)
Changed paths:
A
LayoutTests/svg/custom/gradient-transform-empty-or-invalid-not-inherited-expected.svg
A
LayoutTests/svg/custom/gradient-transform-empty-or-invalid-not-inherited.svg
A
LayoutTests/svg/custom/pattern-transform-empty-or-invalid-not-inherited-expected.svg
A
LayoutTests/svg/custom/pattern-transform-empty-or-invalid-not-inherited.svg
M Source/WebCore/rendering/svg/RenderSVGResourceLinearGradient.cpp
M Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp
M Source/WebCore/rendering/svg/RenderSVGResourceRadialGradient.cpp
M Source/WebCore/svg/SVGGradientElement.cpp
M Source/WebCore/svg/SVGGradientElement.h
M Source/WebCore/svg/SVGLinearGradientElement.cpp
M Source/WebCore/svg/SVGPatternElement.cpp
M Source/WebCore/svg/SVGPatternElement.h
M Source/WebCore/svg/SVGRadialGradientElement.cpp
Log Message:
-----------
[LBSE] Avoid serializing the gradient and pattern transform to answer a
presence check
https://bugs.webkit.org/show_bug.cgi?id=321675
Reviewed by Rob Buis.
collectGradientAttributes() and collectPatternAttributes() asked hasAttribute()
whether gradientTransform / patternTransform was specified. Answering that costs
a serialization of the transform list into the attribute map whenever the base
value was changed through the SVG DOM, and the serialized string is never read
back: the value itself comes from the typed accessor gradientTransform() /
patternTransform() -> answer the presence check directly instead.
Move the attributes shared by <linearGradient> and <radialGradient> into
SVGGradientElement::collectCommonGradientAttributes(), so the two copies of that
code cannot drift apart.
Tests: svg/custom/gradient-transform-empty-or-invalid-not-inherited.svg
svg/custom/pattern-transform-empty-or-invalid-not-inherited.svg
*
LayoutTests/svg/custom/gradient-transform-empty-or-invalid-not-inherited-expected.svg:
Added.
* LayoutTests/svg/custom/gradient-transform-empty-or-invalid-not-inherited.svg:
Added.
*
LayoutTests/svg/custom/pattern-transform-empty-or-invalid-not-inherited-expected.svg:
Added.
* LayoutTests/svg/custom/pattern-transform-empty-or-invalid-not-inherited.svg:
Added.
* Source/WebCore/rendering/svg/RenderSVGResourceLinearGradient.cpp:
(WebCore::RenderSVGResourceLinearGradient::collectGradientAttributesIfNeeded):
* Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp:
(WebCore::RenderSVGResourcePattern::collectPatternAttributesIfNeeded):
* Source/WebCore/rendering/svg/RenderSVGResourceRadialGradient.cpp:
(WebCore::RenderSVGResourceRadialGradient::collectGradientAttributesIfNeeded):
* Source/WebCore/svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::hasGradientTransformAttribute const):
(WebCore::SVGGradientElement::collectCommonGradientAttributes):
* Source/WebCore/svg/SVGGradientElement.h:
* Source/WebCore/svg/SVGLinearGradientElement.cpp:
(WebCore::setGradientAttributes):
* Source/WebCore/svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::hasPatternTransformAttribute const):
(WebCore::SVGPatternElement::collectPatternAttributes const):
* Source/WebCore/svg/SVGPatternElement.h:
* Source/WebCore/svg/SVGRadialGradientElement.cpp:
(WebCore::setGradientAttributes):
Canonical link: https://commits.webkit.org/319280@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications