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

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

Issue 622653003: Gradients should restrict possible content (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 6 years, 2 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/RenderSVGResourceGradient.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGResourceGradient.cpp
diff --git a/Source/core/rendering/svg/RenderSVGResourceGradient.cpp b/Source/core/rendering/svg/RenderSVGResourceGradient.cpp
index d1a3363ab40d9043c3be3731beb672ac421c6559..2edfe27f45389ae35d0aa40782022addc6b6b8a0 100644
--- a/Source/core/rendering/svg/RenderSVGResourceGradient.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourceGradient.cpp
@@ -126,6 +126,20 @@ void RenderSVGResourceGradient::postApplyResource(GraphicsContext* context)
context->restore();
}
+bool RenderSVGResourceGradient::isChildAllowed(RenderObject* child, RenderStyle*) const
+{
+ if (child->isSVGGradientStop())
+ return true;
+
+ if (!child->isSVGResourceContainer())
+ return false;
+
+ RenderSVGResourceContainer* resource = toRenderSVGResourceContainer(child);
+ return resource->resourceType() == PatternResourceType
+ || resource->resourceType() == LinearGradientResourceType
+ || resource->resourceType() == RadialGradientResourceType;
+}
+
void RenderSVGResourceGradient::addStops(GradientData* gradientData, const Vector<Gradient::ColorStop>& stops) const
{
ASSERT(gradientData->gradient);
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceGradient.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698