| 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 79f1bd3fe6d76be63f781241025adecc7fe44c2e..759a7d5e3e3e28283ec62dc705f95955678f89bb 100644
|
| --- a/third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp
|
| @@ -226,21 +226,25 @@ struct TreeWalkTextState {
|
| // TreeWalkTextState should be used to maintain the value list position which
|
| // indexes into the SVGCharacterDataMap of all characters.
|
| struct UpdateAttributes {
|
| - UpdateAttributes(SVGTextLayoutAttributes& textAttributes, const SVGCharacterDataMap* allCharacters)
|
| - : attributes(textAttributes)
|
| + UpdateAttributes(
|
| + SVGTextLayoutAttributes& textAttributes,
|
| + Vector<SVGTextMetrics>& metricsList,
|
| + const SVGCharacterDataMap* allCharacters)
|
| + : metricsList(metricsList)
|
| + , attributes(textAttributes)
|
| , allCharactersMap(allCharacters) { }
|
|
|
| void clearExistingAttributes()
|
| {
|
| + metricsList.clear();
|
| +
|
| if (allCharactersMap)
|
| attributes.clear();
|
| - else
|
| - attributes.textMetricsValues().clear();
|
| }
|
|
|
| void addMetrics(SVGTextMetrics metrics)
|
| {
|
| - attributes.textMetricsValues().append(metrics);
|
| + metricsList.append(metrics);
|
| }
|
|
|
| void updateCharacterDataMap(unsigned valueListPosition, unsigned currentTextPosition)
|
| @@ -252,6 +256,7 @@ struct UpdateAttributes {
|
| attributes.characterDataMap().set(currentTextPosition, it->value);
|
| }
|
|
|
| + Vector<SVGTextMetrics>& metricsList;
|
| SVGTextLayoutAttributes& attributes;
|
| const SVGCharacterDataMap* allCharactersMap;
|
| };
|
| @@ -303,7 +308,7 @@ void walkTree(LayoutSVGText* start, LayoutSVGInlineText* stopAtText, SVGCharacte
|
| LayoutSVGInlineText* text = toLayoutSVGInlineText(child);
|
| OwnPtr<UpdateAttributes> attributesToUpdate = nullptr;
|
| if (!stopAtText || stopAtText == text)
|
| - attributesToUpdate = adoptPtr(new UpdateAttributes(*text->layoutAttributes(), allCharactersMap));
|
| + attributesToUpdate = adoptPtr(new UpdateAttributes(*text->layoutAttributes(), text->metricsList(), allCharactersMap));
|
| walkInlineText(text, textState, attributesToUpdate.get());
|
| if (stopAtText == text)
|
| return;
|
|
|