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

Unified Diff: Source/core/rendering/svg/RenderSVGTextPath.cpp

Issue 143263011: Convert SVG <text> and descendants to use RenderObject::isChildAllowed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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: Source/core/rendering/svg/RenderSVGTextPath.cpp
diff --git a/Source/core/rendering/svg/RenderSVGTextPath.cpp b/Source/core/rendering/svg/RenderSVGTextPath.cpp
index 20c0049aca17ac1c1afea1af9a00f8f2d8e78dc5..c921c2f84ce59315bd06779f414e266b78ac3454 100644
--- a/Source/core/rendering/svg/RenderSVGTextPath.cpp
+++ b/Source/core/rendering/svg/RenderSVGTextPath.cpp
@@ -23,6 +23,7 @@
#include "SVGNames.h"
#include "core/rendering/svg/SVGPathData.h"
+#include "core/rendering/svg/SVGRenderSupport.h"
#include "core/svg/SVGPathElement.h"
#include "core/svg/SVGTextPathElement.h"
@@ -33,6 +34,20 @@ RenderSVGTextPath::RenderSVGTextPath(Element* element)
{
}
+bool RenderSVGTextPath::isChildAllowed(RenderObject* child, RenderStyle*) const
+{
+ if (child->isText())
+ return !SVGRenderSupport::isEmptySVGInlineText(child);
+
+#if ENABLE(SVG_FONTS)
+ // 'altGlyph' is supported by the content model for 'textPath', but...
+ if (child->node()->hasTagName(SVGNames::altGlyphTag))
+ return false;
+#endif
+
+ return child->isSVGInline() && !child->isSVGTextPath();
+}
+
Path RenderSVGTextPath::layoutPath() const
{
SVGTextPathElement* textPathElement = toSVGTextPathElement(node());

Powered by Google App Engine
This is Rietveld 408576698