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

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

Issue 1871393003: Don't persist the SVGTextLayoutAttributesBuilder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: explicit 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.cpp b/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.cpp
index 7f51151aafed270e96d7067162846184458d9cec..8153cff9904aed86f413c3bd8e6a57d878b9c798 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.cpp
@@ -52,15 +52,28 @@ void updateLayoutAttributes(LayoutSVGInlineText& text, unsigned& valueListPositi
} // namespace
-SVGTextLayoutAttributesBuilder::SVGTextLayoutAttributesBuilder()
- : m_characterCount(0)
+SVGTextLayoutAttributesBuilder::SVGTextLayoutAttributesBuilder(LayoutSVGText& textRoot)
+ : m_textRoot(textRoot)
+ , m_characterCount(0)
{
}
-void SVGTextLayoutAttributesBuilder::buildLayoutAttributes(LayoutSVGText& textRoot) const
+void SVGTextLayoutAttributesBuilder::buildLayoutAttributes()
{
+ m_characterDataMap.clear();
+
+ if (m_textPositions.isEmpty()) {
+ m_characterCount = 0;
+ collectTextPositioningElements(m_textRoot);
+ }
+
+ if (!m_characterCount)
+ return;
+
+ buildCharacterDataMap(m_textRoot);
+
unsigned valueListPosition = 0;
- LayoutObject* child = textRoot.firstChild();
+ LayoutObject* child = m_textRoot.firstChild();
while (child) {
if (child->isSVGInlineText()) {
updateLayoutAttributes(toLayoutSVGInlineText(*child), valueListPosition, m_characterDataMap);
@@ -71,24 +84,8 @@ void SVGTextLayoutAttributesBuilder::buildLayoutAttributes(LayoutSVGText& textRo
continue;
}
}
- child = child->nextInPreOrderAfterChildren(&textRoot);
- }
-}
-
-void SVGTextLayoutAttributesBuilder::buildLayoutAttributesForTextRoot(LayoutSVGText& textRoot)
-{
- m_characterDataMap.clear();
-
- if (m_textPositions.isEmpty()) {
- m_characterCount = 0;
- collectTextPositioningElements(textRoot);
+ child = child->nextInPreOrderAfterChildren(&m_textRoot);
}
-
- if (!m_characterCount)
- return;
-
- buildCharacterDataMap(textRoot);
- buildLayoutAttributes(textRoot);
}
static inline unsigned countCharactersInTextNode(const LayoutSVGInlineText& text)
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698