Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ab10ecb9a37d4ce68b3b23b783099af08387fccf
https://github.com/WebKit/WebKit/commit/ab10ecb9a37d4ce68b3b23b783099af08387fccf
Author: Nikolas Zimmermann <[email protected]>
Date: 2026-08-19 (Wed, 19 Aug 2026)
Changed paths:
M LayoutTests/platform/mac-tahoe-wk2-lbse-text/TestExpectations
M
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/zoom/page/zoom-coords-viewattr-01-b-expected.png
M
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/zoom/page/zoom-coords-viewattr-01-b-expected.txt
M
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/zoom/page/zoom-mask-with-percentages-expected.txt
M
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt
M
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt
M
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt
M Source/WebCore/rendering/svg/SVGTransformComputation.h
Log Message:
-----------
[LBSE] SVG text is scaled for the wrong resolution in a zoomed SVG document
https://bugs.webkit.org/show_bug.cgi?id=322064
Reviewed by Rob Buis.
SVG text is not painted at its specified font size. The font is scaled up to
the resolution the text is finally rendered at, and the context is scaled back
down by the same factor, so glyphs are rasterized at their on-screen size. The
factor comes from calculateScreenFontSizeScalingFactor(), and 'vector-effect:
non-scaling-stroke' on <text> divides the stroke thickness by it too.
It is derived from computeAccumulatedTransform(TrackSVGScreenCTMMatrix), which
follows getScreenCTM() semantics and is zoom independent on purpose: getCTM()
and getScreenCTM() need to report the same matrix at every zoom level. The zoom
was multiplied back in from style().usedZoom(), but only for SVG embedded in an
HTML document. In a standalone SVG document the factor kept its unzoomed value,
so at page zoom the text was rasterized for the wrong resolution and a
non-scaling stroke came out too thick by the zoom factor.
The accumulated matrix is the same in both cases, so drop the condition and
always apply the zoom. The text metrics of the zoomed documents below now match
the legacy SVG engine, which reaches the same factor by accumulating
localToParentTransform() through LegacyRenderSVGRoot, whose
localToBorderBoxTransform() carries the zoom.
Covered by existing tests.
* LayoutTests/platform/mac-tahoe-wk2-lbse-text/TestExpectations:
*
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/zoom/page/zoom-coords-viewattr-01-b-expected.png:
*
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/zoom/page/zoom-coords-viewattr-01-b-expected.txt:
*
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/zoom/page/zoom-mask-with-percentages-expected.txt:
*
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt:
*
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt:
*
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt:
* Source/WebCore/rendering/svg/SVGTransformComputation.h:
(WebCore::SVGTransformComputation::calculateScreenFontSizeScalingFactor const):
Canonical link: https://commits.webkit.org/319445@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications