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. |