| 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 |
||
|
Description
Ahmad Saleem
2022-11-26 02:33:00 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. 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 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> 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.
|