This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse the repository at this point in the history
Handle multiple fragments in the getCharNumberAtPosition SVGTextQuery
https://bugs.webkit.org/show_bug.cgi?id=257429 Reviewed by Simon Fraser. This patch aligns WebKit with Blink / Chromium and Gecko / Firefox. Merge: https://src.chromium.org/viewvc/blink?view=revision&revision=176936 The start position (and thus indirectly end position) used to compute the extents of a glyph to check against the point is computed based on the 'processedCharacter' query data state. Following state is only updated after each text box has been processed, meaning that for a text box with multiple fragments, the offset of the fragment within the box needs to be included to get the correct start/end position. * Source/WebCore/rendering/svg/SVGTextQuery.cpp: (SVGTextQuery::characterNumberAtPositionCallback): As above * LayoutTests/svg/text/getcharnumatposition-multiple-fragments.html: Add Test Case * LayoutTests/svg/text/getcharnumatposition-multiple-fragments-expected.txt: Add Test Case Expectation Canonical link: https://commits.webkit.org/264796@main
- Loading branch information
Showing 3 changed files with 31 additions and 2 deletions.