Index: third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp |
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp b/third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp |
index 8be2a13b5aa724e2dddbc679dab2c801b563340e..23b43b43b47ab19f87a653801f0d8bae71ec82da 100644 |
--- a/third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp |
+++ b/third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp |
@@ -270,31 +270,25 @@ void walkInlineText(LayoutSVGInlineText* text, TreeWalkTextState& textState, Upd |
// iterator and move all subrun logic to a single function. |
SVGTextMetricsCalculator calculator(textLayoutItem); |
bool preserveWhiteSpace = textLayoutItem.styleRef().whiteSpace() == PRE; |
- unsigned surrogatePairCharacters = 0; |
- unsigned skippedWhitespace = 0; |
do { |
bool currentCharacterIsWhiteSpace = calculator.currentCharacterIsWhiteSpace(); |
if (currentCharacterIsWhiteSpace && !preserveWhiteSpace && textState.lastCharacterWasWhiteSpace) { |
if (attributesToUpdate) |
attributesToUpdate->addMetrics(SVGTextMetrics(SVGTextMetrics::SkippedSpaceMetrics)); |
ASSERT(calculator.currentCharacterMetrics().length() == 1); |
- skippedWhitespace++; |
continue; |
} |
if (attributesToUpdate) { |
- unsigned currentTextValueListPosition = calculator.currentPosition() - skippedWhitespace - surrogatePairCharacters; |
- attributesToUpdate->updateCharacterDataMap(textState.valueListPosition + currentTextValueListPosition + 1, calculator.currentPosition() + 1); |
+ attributesToUpdate->updateCharacterDataMap(textState.valueListPosition + 1, calculator.currentPosition() + 1); |
attributesToUpdate->addMetrics(calculator.currentCharacterMetrics()); |
} |
- if (calculator.currentCharacterStartsSurrogatePair()) |
- surrogatePairCharacters++; |
+ // Increase the position in the value/attribute list with one for each |
+ // "character unit" (that will be displayed.) |
+ textState.valueListPosition++; |
textState.lastCharacterWasWhiteSpace = currentCharacterIsWhiteSpace; |
} while (calculator.advancePosition()); |
- |
- unsigned currentTextValueListPosition = calculator.currentPosition() - skippedWhitespace - surrogatePairCharacters; |
- textState.valueListPosition += currentTextValueListPosition; |
} |
void walkTree(LayoutSVGText* start, LayoutSVGInlineText* stopAtText, SVGCharacterDataMap* allCharactersMap = nullptr) |