Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: a9ba148c1a1793210f451e03e94ee71a359c94b0 https://github.com/WebKit/WebKit/commit/a9ba148c1a1793210f451e03e94ee71a359c94b0 Author: Nikolas Zimmermann <nzimmerm...@igalia.com> Date: 2023-05-30 (Tue, 30 May 2023)
Changed paths: A LayoutTests/svg/text/textLength-tspan-1-expected.html A LayoutTests/svg/text/textLength-tspan-1.html A LayoutTests/svg/text/textLength-tspan-2-expected.html A LayoutTests/svg/text/textLength-tspan-2.html M Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp M Source/WebCore/rendering/svg/SVGTextLayoutEngine.h Log Message: ----------- 'textLength' support for 'tspan' elements is incomplete https://bugs.webkit.org/show_bug.cgi?id=257160 Reviewed by Rob Buis. WebKit issue #171805 contained an imported fix from Chromium to properly compute the inter-character spacing (off-by-one). Continue the work to make textLength fully functional on <tspan> elements, in a few edge cases related to whitespace/text chunk handling. Prior to this patch, non-collapsed whitespace remnants between flow boxes ended up contributing to the size of a text chunk -- this goes unnoticed as long as textLength support isn't used. If textLength is used on <tspan> elements, the extra characters, lead to wrong inter-character space computation (as the number of characters is larger than expected). Add new reftests to cover the new logic - see LayoutTests/svg/text/textLength-tspan-{1|2}.html. * LayoutTests/svg/text/textLength-tspan-1-expected.html: Added. * LayoutTests/svg/text/textLength-tspan-1.html: Added. * LayoutTests/svg/text/textLength-tspan-2-expected.html: Added. * LayoutTests/svg/text/textLength-tspan-2.html: Added. * Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp: (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath): * Source/WebCore/rendering/svg/SVGTextLayoutEngine.h: Canonical link: https://commits.webkit.org/264666@main _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes