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

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

Issue 1846633002: Move SVGTextPositioningElement::elementFromLayoutObject (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | third_party/WebKit/Source/core/svg/SVGTextPositioningElement.h » ('j') | 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 9e27a08ce3020227ab6b7014725ab088f576e294..604dfced46d550766a564483d6fbede7a18c96f5 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.cpp
@@ -98,6 +98,17 @@ static inline void processLayoutSVGInlineText(LayoutSVGInlineText* text, unsigne
}
}
+static SVGTextPositioningElement* positioningElementFromLayoutObject(LayoutObject& layoutObject)
+{
+ ASSERT(layoutObject.isSVGText() || layoutObject.isSVGInline());
+
+ Node* node = layoutObject.node();
+ ASSERT(node);
+ ASSERT(node->isSVGElement());
+
+ return isSVGTextPositioningElement(*node) ? toSVGTextPositioningElement(node) : nullptr;
+}
+
void SVGTextLayoutAttributesBuilder::collectTextPositioningElements(LayoutBoxModelObject& start, UChar& lastCharacter)
{
ASSERT(!start.isSVGText() || m_textPositions.isEmpty());
@@ -112,7 +123,7 @@ void SVGTextLayoutAttributesBuilder::collectTextPositioningElements(LayoutBoxMod
continue;
LayoutSVGInline& inlineChild = toLayoutSVGInline(*child);
- SVGTextPositioningElement* element = SVGTextPositioningElement::elementFromLayoutObject(inlineChild);
+ SVGTextPositioningElement* element = positioningElementFromLayoutObject(inlineChild);
unsigned atPosition = m_textPositions.size();
if (element)
m_textPositions.append(TextPosition(element, m_textLength));
@@ -131,7 +142,7 @@ void SVGTextLayoutAttributesBuilder::collectTextPositioningElements(LayoutBoxMod
void SVGTextLayoutAttributesBuilder::buildCharacterDataMap(LayoutSVGText& textRoot)
{
- SVGTextPositioningElement* outermostTextElement = SVGTextPositioningElement::elementFromLayoutObject(textRoot);
+ SVGTextPositioningElement* outermostTextElement = positioningElementFromLayoutObject(textRoot);
ASSERT(outermostTextElement);
// Grab outermost <text> element value lists and insert them in the character data map.
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/svg/SVGTextPositioningElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698