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

Unified Diff: Source/core/rendering/svg/RenderSVGTSpan.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
« no previous file with comments | « Source/core/rendering/svg/RenderSVGTSpan.h ('k') | Source/core/rendering/svg/RenderSVGText.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGTSpan.cpp
diff --git a/Source/core/rendering/svg/RenderSVGTSpan.cpp b/Source/core/rendering/svg/RenderSVGTSpan.cpp
index 5f34538620ba7d92041f7911df853581001b14bd..168037e97903a0b97f8e5d8a25fa80c7fd6b1b4a 100644
--- a/Source/core/rendering/svg/RenderSVGTSpan.cpp
+++ b/Source/core/rendering/svg/RenderSVGTSpan.cpp
@@ -24,6 +24,9 @@
#include "core/rendering/svg/RenderSVGTSpan.h"
+#include "SVGNames.h"
+#include "core/rendering/svg/SVGRenderSupport.h"
+
namespace WebCore {
RenderSVGTSpan::RenderSVGTSpan(Element* element)
@@ -31,4 +34,19 @@ RenderSVGTSpan::RenderSVGTSpan(Element* element)
{
}
+bool RenderSVGTSpan::isChildAllowed(RenderObject* child, RenderStyle*) const
+{
pdr. 2014/01/24 18:28:42 Should we add this here? if (!RenderSVGInline::is
+ // Always allow text (except empty textnodes).
+ if (child->isText())
+ return !SVGRenderSupport::isEmptySVGInlineText(child);
+
+#if ENABLE(SVG_FONTS)
+ // Only allow other types of children if this is not an 'altGlyph'.
+ if (node()->hasTagName(SVGNames::altGlyphTag))
+ return false;
+#endif
+
+ return child->isSVGInline() && !child->isSVGTextPath();
+}
+
}
« no previous file with comments | « Source/core/rendering/svg/RenderSVGTSpan.h ('k') | Source/core/rendering/svg/RenderSVGText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698