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

Unified Diff: third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.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/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 326ddda335f5e773e7d90302a1fd0b72488fbfa0..0054487780627aadd3aa38c72edd754ece8c5547 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.cpp
@@ -32,30 +32,6 @@ SVGTextLayoutAttributesBuilder::SVGTextLayoutAttributesBuilder()
{
}
-void SVGTextLayoutAttributesBuilder::buildLayoutAttributesForText(LayoutSVGInlineText* text)
-{
- ASSERT(text);
-
- LayoutSVGText* textRoot = LayoutSVGText::locateLayoutSVGTextAncestor(text);
- if (!textRoot)
- return;
-
- if (m_textPositions.isEmpty()) {
- m_characterDataMap.clear();
-
- m_textLength = 0;
- UChar lastCharacter = ' ';
- collectTextPositioningElements(*textRoot, lastCharacter);
-
- if (!m_textLength)
- return;
-
- buildCharacterDataMap(*textRoot);
- }
-
- SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes(textRoot, text, m_characterDataMap);
-}
-
bool SVGTextLayoutAttributesBuilder::buildLayoutAttributesForForSubtree(LayoutSVGText& textRoot)
{
m_characterDataMap.clear();
@@ -70,14 +46,13 @@ bool SVGTextLayoutAttributesBuilder::buildLayoutAttributesForForSubtree(LayoutSV
return false;
buildCharacterDataMap(textRoot);
- SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes(&textRoot, nullptr, m_characterDataMap);
+ SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes(textRoot, m_characterDataMap);
return true;
}
-void SVGTextLayoutAttributesBuilder::rebuildMetricsForTextLayoutObject(LayoutSVGInlineText* text)
+void SVGTextLayoutAttributesBuilder::rebuildMetricsForTextLayoutObject(LayoutSVGText& textRoot, LayoutSVGInlineText& text)
{
- ASSERT(text);
- SVGTextMetricsBuilder::measureTextLayoutObject(text);
+ SVGTextMetricsBuilder::measureTextLayoutObject(textRoot, text);
}
static inline void processLayoutSVGInlineText(LayoutSVGInlineText* text, unsigned& atCharacter, UChar& lastCharacter)

Powered by Google App Engine
This is Rietveld 408576698