Bug 248357
| Summary: | SVG text selection has bugs with collapsed whitespace | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
| Component: | SVG | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | sabouhallawa, webkit-bug-importer, zimmermann |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: |
https://bugs.webkit.org/show_bug.cgi?id=248356 https://bugs.webkit.org/show_bug.cgi?id=184748 |
||
Ahmad Saleem
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/102933142>
Ahmad Saleem
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
Instead of 'squaredDistanceToClosestPoint' from Chromium patch, merge this as well: https://chromium.googlesource.com/chromium/src.git/+/ec9931b6a84f86605970d9aab571d2ca429df2fa
(Implement) - https://chromium.googlesource.com/chromium/src.git/+/ac7237a24b28daa6f1c5292f32e940cc63fba39d
Ahmad Saleem
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
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.
Ahmad Saleem
SVN is gone - https://github.com/chromium/chromium/commit/1bf89d746933e56ce69d972b77304102102d86c1