Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Unified Diff: third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp

Issue 1854123002: Rebuild layout attributes on layout instead of on layout tree updates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 03996aee346998ceb85e42ad238f504f96d58338..82557fd256b0ee7a5c9c215f0f728d91cb41f306 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp
@@ -321,10 +321,10 @@ void walkInlineText(LayoutSVGInlineText* text, TreeWalkTextState& textState, Upd
textState.valueListPosition += calculator.currentPosition() - skippedWhitespace;
}
-void walkTree(LayoutSVGText* start, LayoutSVGInlineText* stopAtText, SVGCharacterDataMap* allCharactersMap = nullptr)
+void walkTree(LayoutSVGText& start, LayoutSVGInlineText* stopAtText, SVGCharacterDataMap* allCharactersMap = nullptr)
{
TreeWalkTextState textState;
- LayoutObject* child = start->firstChild();
+ LayoutObject* child = start.firstChild();
while (child) {
if (child->isSVGInlineText()) {
LayoutSVGInlineText* text = toLayoutSVGInlineText(child);
@@ -341,23 +341,20 @@ void walkTree(LayoutSVGText* start, LayoutSVGInlineText* stopAtText, SVGCharacte
continue;
}
}
- child = child->nextInPreOrderAfterChildren(start);
+ child = child->nextInPreOrderAfterChildren(&start);
}
}
} // namespace
-void SVGTextMetricsBuilder::measureTextLayoutObject(LayoutSVGInlineText* text)
+void SVGTextMetricsBuilder::measureTextLayoutObject(LayoutSVGText& textRoot, LayoutSVGInlineText& text)
{
- ASSERT(text);
- if (LayoutSVGText* textRoot = LayoutSVGText::locateLayoutSVGTextAncestor(text))
- walkTree(textRoot, text);
+ walkTree(textRoot, &text);
}
-void SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes(LayoutSVGText* textRoot, LayoutSVGInlineText* stopAtText, SVGCharacterDataMap& allCharactersMap)
+void SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes(LayoutSVGText& textRoot, SVGCharacterDataMap& allCharactersMap)
{
- ASSERT(textRoot);
- walkTree(textRoot, stopAtText, &allCharactersMap);
+ walkTree(textRoot, nullptr, &allCharactersMap);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698