Bug 257429
| Summary: | Handle multiple fragments in the getCharNumberAtPosition SVGTextQuery | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
| Component: | SVG | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | sabouhallawa, webkit-bug-importer, zimmermann |
| Priority: | P2 | Keywords: | BrowserCompat, InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Ahmad Saleem
Hi Team,
We fail following test in WebKit ToT:
Testcase: https://jsfiddle.net/czgum406/show
Blink Commit: https://src.chromium.org/viewvc/blink?view=revision&revision=176936
WebKit Source: https://searchfox.org/wubkat/source/Source/WebCore/rendering/svg/SVGTextQuery.cpp#524
This works:
________
// Offset of the fragment within the text box.
unsigned boxOffset = fragment.characterOffset - queryData->textBox->start();
FloatRect extent;
for (unsigned i = 0; i < fragment.length; ++i) {
unsigned startPosition = data->processedCharacters + boxOffset + i;
unsigned endPosition = startPosition + 1;
if (!mapStartEndPositionsIntoFragmentCoordinates(queryData, fragment, startPosition, endPosition))
continue;
calculateGlyphBoundaries(queryData, fragment, startPosition, extent);
if (extent.contains(data->position)) {
data->processedCharacters += boxOffset + I;
_________
Just wanted to raise so we can fix it.
Thanks!
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
EWS
Committed 264796@main (c01e3bafb0da): <https://commits.webkit.org/264796@main>
Reviewed commits have been landed. Closing PR #14433 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/110119702>