[webkit-changes] [WebKit/WebKit] 5c38a2: SVG textLength not working correctly
Ahmad Saleem
noreply at github.com
Sat Jan 14 13:29:29 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 5c38a23d96c2b79d8dbab14b7a7926eac78d4001
https://github.com/WebKit/WebKit/commit/5c38a23d96c2b79d8dbab14b7a7926eac78d4001
Author: Ahmad Saleem <ahmad.saleem792+github at gmail.com>
Date: 2023-01-14 (Sat, 14 Jan 2023)
Changed paths:
M LayoutTests/imported/w3c/web-platform-tests/svg/text/scripted/textpath-textlength-text-anchor-001.tentative-expected.txt
M LayoutTests/platform/gtk/imported/w3c/web-platform-tests/svg/import/text-text-01-b-manual-expected.txt
M LayoutTests/platform/gtk/svg/W3C-SVG-1.1/text-text-01-b-expected.png
M LayoutTests/platform/gtk/svg/W3C-SVG-1.1/text-text-01-b-expected.txt
M LayoutTests/platform/gtk/svg/batik/text/textLayout-expected.png
M LayoutTests/platform/gtk/svg/batik/text/textLayout-expected.txt
M LayoutTests/platform/gtk/svg/batik/text/textLength-expected.png
M LayoutTests/platform/gtk/svg/batik/text/textLength-expected.txt
M LayoutTests/platform/gtk/svg/batik/text/textOnPathSpaces-expected.png
M LayoutTests/platform/gtk/svg/batik/text/textOnPathSpaces-expected.txt
M LayoutTests/platform/gtk/svg/text/select-textLength-spacing-squeeze-1-expected.png
M LayoutTests/platform/gtk/svg/text/select-textLength-spacing-squeeze-1-expected.txt
M LayoutTests/platform/gtk/svg/text/select-textLength-spacing-squeeze-2-expected.png
M LayoutTests/platform/gtk/svg/text/select-textLength-spacing-squeeze-2-expected.txt
M LayoutTests/platform/gtk/svg/text/select-textLength-spacing-squeeze-4-expected.png
M LayoutTests/platform/gtk/svg/text/select-textLength-spacing-squeeze-4-expected.txt
M LayoutTests/platform/gtk/svg/text/select-textLength-spacing-stretch-1-expected.png
M LayoutTests/platform/gtk/svg/text/select-textLength-spacing-stretch-1-expected.txt
M LayoutTests/platform/gtk/svg/text/select-textLength-spacing-stretch-2-expected.png
M LayoutTests/platform/gtk/svg/text/select-textLength-spacing-stretch-2-expected.txt
M LayoutTests/platform/gtk/svg/text/select-textLength-spacing-stretch-3-expected.png
M LayoutTests/platform/gtk/svg/text/select-textLength-spacing-stretch-3-expected.txt
M LayoutTests/platform/gtk/svg/text/select-textLength-spacing-stretch-4-expected.png
M LayoutTests/platform/gtk/svg/text/select-textLength-spacing-stretch-4-expected.txt
M LayoutTests/platform/gtk/svg/text/text-text-01-b-expected.png
M LayoutTests/platform/gtk/svg/text/text-text-01-b-expected.txt
M LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/svg/import/text-text-01-b-manual-expected.txt
M LayoutTests/platform/ios/svg/W3C-SVG-1.1/text-text-01-b-expected.txt
M LayoutTests/platform/ios/svg/batik/text/textLayout-expected.txt
M LayoutTests/platform/ios/svg/batik/text/textLength-expected.txt
M LayoutTests/platform/ios/svg/batik/text/textOnPathSpaces-expected.txt
M LayoutTests/platform/ios/svg/text/text-text-01-b-expected.txt
M LayoutTests/platform/mac/imported/w3c/web-platform-tests/svg/import/text-text-01-b-manual-expected.txt
M LayoutTests/platform/mac/svg/W3C-SVG-1.1/text-text-01-b-expected.png
M LayoutTests/platform/mac/svg/W3C-SVG-1.1/text-text-01-b-expected.txt
M LayoutTests/platform/mac/svg/batik/text/textLayout-expected.png
M LayoutTests/platform/mac/svg/batik/text/textLayout-expected.txt
M LayoutTests/platform/mac/svg/batik/text/textOnPathSpaces-expected.png
M LayoutTests/platform/mac/svg/batik/text/textOnPathSpaces-expected.txt
M LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-1-expected.png
M LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-1-expected.txt
M LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-2-expected.png
M LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-2-expected.txt
M LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-3-expected.png
M LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-3-expected.txt
M LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-4-expected.png
M LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-4-expected.txt
M LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-1-expected.png
M LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-1-expected.txt
M LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-2-expected.png
M LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-2-expected.txt
M LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-3-expected.png
M LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-3-expected.txt
M LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-4-expected.png
M LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-4-expected.txt
M LayoutTests/platform/mac/svg/text/text-text-01-b-expected.png
M LayoutTests/platform/mac/svg/text/text-text-01-b-expected.txt
M Source/WebCore/rendering/svg/SVGTextChunk.cpp
M Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp
Log Message:
-----------
SVG textLength not working correctly
SVG textLength not working correctly
https://bugs.webkit.org/show_bug.cgi?id=171805
Reviewed by Simon Fraser.
Merge - https://chromium.googlesource.com/chromium/src/+/308e792b8d4648ba4e298c80faca80bc780b5735 &
https://chromium.googlesource.com/chromium/src/+/1cc74004b24c8a79dcee523e913c1d929c1167da
There should be no advance adjustment after the last character (really,
"typographic unit"), so divide the excess space by the character count
minus one - i.e the number of gaps - rather than the character count.
Further, extend it to adjusting the 'textPath', 'textLength' computation in the same way.
* Source/WebCore/rendering/svg/SVGTextChunk.cpp:
(SVGTextChunk::layout): Update to account for last character in adjustment
* Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp:
(SVGTextLayoutEngine::beginTextPathLayout): Ditto
* LayoutTests/imported/w3c/web-platform-tests/svg/text/scripted/texpath-textLength-text-anchor-001.tentative-expected.txt: Rebaselined
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/svg/import/text-text-01-b-manual-expected.txt: Ditto
* LayoutTests/platform/gtk/svg/batik/text/textLayout-expected.txt: Ditto
* LayoutTests/platform/gtk/svg/batik/text/textLayout-expected.png: Ditto
* LayoutTests/platform/gtk/svg/batik/text/textLength-expected.txt: Ditto
* LayoutTests/platform/gtk/svg/batik/text/textLength-expected.png: Ditto
* LayoutTests/platform/gtk/svg/batik/text/textOnPathSpaces-expected.png: Ditto
* LayoutTests/platform/gtk/svg/batik/text/textOnPathSpaces-expected.txt: Ditto
* LayoutTests/platform/gtk/svg/text/select-textLength-spacing-squeeze-1-expected.txt: Ditto
* LayoutTests/platform/gtk/svg/text/select-textLength-spacing-squeeze-1-expected.png: Ditto
* LayoutTests/platform/gtk/svg/text/select-textLength-spacing-squeeze-2-expected.txt: Ditto
* LayoutTests/platform/gtk/svg/text/select-textLength-spacing-squeeze-2-expected.png: Ditto
* LayoutTests/platform/gtk/svg/text/select-textLength-spacing-squeeze-4-expected.txt: Ditto
* LayoutTests/platform/gtk/svg/text/select-textLength-spacing-squeeze-4-expected.png: Ditto
* LayoutTests/platform/gtk/svg/text/select-textLength-spacing-stretch-1-expected.txt: Ditto
* LayoutTests/platform/gtk/svg/text/select-textLength-spacing-stretch-1-expected.png: Ditto
* LayoutTests/platform/gtk/svg/text/select-textLength-spacing-stretch-2-expected.txt: Ditto
* LayoutTests/platform/gtk/svg/text/select-textLength-spacing-stretch-2-expected.png: Ditto
* LayoutTests/platform/gtk/svg/text/select-textLength-spacing-stretch-3-expected.txt: Ditto
* LayoutTests/platform/gtk/svg/text/select-textLength-spacing-stretch-3-expected.png: Ditto
* LayoutTests/platform/gtk/svg/text/select-textLength-spacing-stretch-4-expected.txt: Ditto
* LayoutTests/platform/gtk/svg/text/select-textLength-spacing-stretch-4-expected.png: Ditto
* LayoutTests/platform/gtk/svg/text/text-text-01-b-expected.png: Ditto
* LayoutTests/platform/gtk/svg/text/text-text-01-b-expected.txt: Ditto
* LayoutTests/platform/gtk/svg/W3C-SVG-1.1/text-text-01-b-expected.png: Ditto
* LayoutTests/platform/gtk/svg/W3C-SVG-1.1/text-text-01-b-expected.txt: Ditto
* LayoutTests/platform/mac/svg/batik/text/textLayout-expected.png: Ditto
* LayoutTests/platform/mac/svg/batik/text/textLayout-expected.txt: Ditto
* LayoutTests/platform/mac/svg/batik/text/texOnPathSpaces-expected.txt: Ditto
* LayoutTests/platform/mac/svg/batik/text/texOnPathSpaces-expected.png: Ditto
* LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-1-expected.png: Ditto
* LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-1-expected.txt: Ditto
* LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-2-expected.png: Ditto
* LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-2-expected.txt: Ditto
* LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-3-expected.png: Ditto
* LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-3-expected.txt: Ditto
* LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-4-expected.png: Ditto
* LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-4-expected.txt: Ditto
* LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-1-expected.png: Ditto
* LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-1-expected.txt: Ditto
* LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-2-expected.png: Ditto
* LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-2-expected.txt: Ditto
* LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-3-expected.png: Ditto
* LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-3-expected.txt: Ditto
* LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-4-expected.png: Ditto
* LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-4-expected.txt: Ditto
* LayoutTests/platform/mac/svg/text/text-text-01-b-expected.txt: Ditto
* LayoutTests/platform/mac/svg/W3C-SVG-1.1/text-text-01-b-expected.png: Ditto
* LayoutTests/platform/mac/svg/W3C-SVG-1.1/text-text-01-b-expected.png: Ditto
* LayoutTests/platform/ios/svg/batik/text/textLayout-expected.txt: Ditto
* LayoutTests/platform/ios/svg/batik/text/textLength-expected.txt: Ditto
* LayoutTests/platform/ios/svg/batik/text/textOnPathSpaces-expected.txt: Ditto
* LayoutTests/platform/ios/svg/text/text-text-01-b-expected.txt: Ditto
* LayoutTests/platform/ios/svg/W3C-SVG-1.1/text-text-01-b-expected.txt: Ditto
* LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/svg/import/text-text-01-b-manual-expected.txt: Ditto
* LayoutTests/platform/mac/imported/w3c/web-platform-tests/svg/import/text-text-01-b-manual-expected.txt: Ditto
Canonical link: https://commits.webkit.org/258921@main
More information about the webkit-changes
mailing list