Changeset 121756 in webkit
- Timestamp:
- Jul 3, 2012 3:29:08 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r121754 r121756 1 2012-07-03 Philip Rogers <pdr@google.com> 2 3 Fix text positioning with non-bmp characters. 4 https://bugs.webkit.org/show_bug.cgi?id=87681 5 6 Reviewed by Nikolas Zimmermann. 7 8 * svg/text/non-bmp-tspans-expected.svg: Added. 9 * svg/text/non-bmp-tspans.svg: Added. 10 1 11 2012-07-03 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r121754 r121756 1 2012-07-03 Philip Rogers <pdr@google.com> 2 3 Fix text positioning with non-bmp characters. 4 https://bugs.webkit.org/show_bug.cgi?id=87681 5 6 Reviewed by Nikolas Zimmermann. 7 8 Previously when constructing metrics for tspans with non-bmp characters, 9 each non-bmp character treated as a skipped character in the same way that 10 spaces are ignored. 11 This made sense because the initial SVGCharacterDataMap for <text> is 12 indexed by character index (not string length) so the high portion of a 13 non-bmp character was treated as a skipped space. Unfortunately, this 14 led to a bug because skipped spaces lead to an offset in the positioning 15 values list but non-bmp characters do not. 16 17 This change switches the code to use a new offset for non-bmp characters, 18 surrogatePairCharacters, which does not affect the positioning values list. 19 20 Tests: svg/text/non-bmp-tspans-expected.svg 21 svg/text/non-bmp-tspans.svg 22 23 * rendering/svg/SVGTextMetricsBuilder.cpp: 24 (WebCore::SVGTextMetricsBuilder::measureTextRenderer): 25 1 26 2012-07-03 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 27 -
trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp
r117259 r121756 156 156 initializeMeasurementWithTextRenderer(text); 157 157 bool preserveWhiteSpace = text->style()->whiteSpace() == PRE; 158 int surrogatePairCharacters = 0; 158 159 159 160 while (advance()) { … … 169 170 if (data->processRenderer) { 170 171 if (data->allCharactersMap) { 171 const SVGCharacterDataMap::const_iterator it = data->allCharactersMap->find(data->valueListPosition + m_textPosition - data->skippedCharacters + 1);172 const SVGCharacterDataMap::const_iterator it = data->allCharactersMap->find(data->valueListPosition + m_textPosition - data->skippedCharacters - surrogatePairCharacters + 1); 172 173 if (it != data->allCharactersMap->end()) 173 174 attributes->characterDataMap().set(m_textPosition + 1, it->second); … … 177 178 178 179 if (data->allCharactersMap && currentCharacterStartsSurrogatePair()) 179 data->skippedCharacters += m_currentMetrics.length() - 1;180 surrogatePairCharacters++; 180 181 181 182 data->lastCharacter = currentCharacter;
Note: See TracChangeset
for help on using the changeset viewer.