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.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121756
268f45cc-cd09-0410-ab3c-
d52691b4dbfc