NEW248357
SVG text selection has bugs with collapsed whitespace
https://bugs.webkit.org/show_bug.cgi?id=248357
Summary SVG text selection has bugs with collapsed whitespace
Ahmad Saleem
Reported 2022-11-26 02:33:00 PST
Hi Team, While going through Chromium Monorail, I come across another failing test case in Safari: Link - https://jsfiddle.net/progers/g1z286fL/ While trying to select text from world to next line "hello", it does not paint the selection properly and jump it to first top line while it works fine in Chrome Canary 110. It is broken in Safari Technology Preview 158 and 16.1 both, it was fixed with this commit: Commit - https://src.chromium.org/viewvc/blink?view=revision&revision=194860 It had some pre-requisite fixes for "SelectionTestCase.js" script, which I will land first so this can be looked into as potential blink merge. Thanks!
Attachments
Radar WebKit Bug Importer
Comment 1 2022-12-03 02:33:38 PST
Ahmad Saleem
Comment 2 2023-02-08 06:01:18 PST
I tried this in following PR: https://github.com/WebKit/WebKit/pull/9749 At least selection works in local testing but it does not pass the test and also regresses other, so there might be some pre-requisite to it or some other underlying difference. NOTE - GTK does not regress the test cases, which got regressed on Mac-OS, which seems to indicate some vendor specific bits. I am closing my PR for time being and going to test more locally.
Ahmad Saleem
Comment 3 2023-09-04 07:07:02 PDT
Ahmad Saleem
Comment 4 2023-09-04 15:53:27 PDT
Only got this failure locally: svg/text/select-textLength-spacingAndGlyphs-squeeze-3.svg This would make it pass: <svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 160 120"> <g id="container"/> <!-- "Squ" should be selected, char 8-10 --> <text id="test" x="10" y="10" font-family="Arial" font-size="10" textLength="50" lengthAdjust="spacingAndGlyphs">Text to Squeeze</text> <script xlink:href="resources/SelectionTestCase.js"/> <script>selectRange("test", 8, 10, "o ");</script> </svg>
Ahmad Saleem
Comment 5 2023-10-02 07:06:39 PDT
float FloatRect::squaredDistanceTo(const FloatPoint& point) const { FloatPoint closestPoint; closestPoint.setX(clampTo<float>(point.x(), x(), maxX())); closestPoint.setY(clampTo<float>(point.y(), y(), maxY())); return (point - closestPoint).diagonalLengthSquared(); } ^ In FloatRect.cpp float squaredDistanceTo(const FloatPoint&) const; ^ In FloatRect.h ____ Just wanted to update.
Note You need to log in before you can comment on or make changes to this bug.