Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix text positioning with non-bmp characters.
https://bugs.webkit.org/show_bug.cgi?id=87681 Reviewed by Nikolas Zimmermann. Source/WebCore: Previously when constructing metrics for tspans with non-bmp characters, each non-bmp character treated as a skipped character in the same way that spaces are ignored. This made sense because the initial SVGCharacterDataMap for <text> is indexed by character index (not string length) so the high portion of a non-bmp character was treated as a skipped space. Unfortunately, this led to a bug because skipped spaces lead to an offset in the positioning values list but non-bmp characters do not. This change switches the code to use a new offset for non-bmp characters, surrogatePairCharacters, which does not affect the positioning values list. Tests: svg/text/non-bmp-tspans-expected.svg svg/text/non-bmp-tspans.svg * rendering/svg/SVGTextMetricsBuilder.cpp: (WebCore::SVGTextMetricsBuilder::measureTextRenderer): LayoutTests: * svg/text/non-bmp-tspans-expected.svg: Added. * svg/text/non-bmp-tspans.svg: Added. Canonical link: https://commits.webkit.org/108316@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@121756 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
5 changed files
with
62 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters