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

Unified Diff: Source/core/svg/SVGClipPathElement.cpp

Issue 423823004: Add support for SVG Clip paths in HTML (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Changed LayoutTests and Aligned with review comments Created 6 years, 4 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/svg/SVGClipPathElement.cpp
diff --git a/Source/core/svg/SVGClipPathElement.cpp b/Source/core/svg/SVGClipPathElement.cpp
index 4de9d37af7a77d7f5b95606563cd4b34c9f1efb8..bb37630eef3f5d496236518a7f2c2013ef990ffb 100644
--- a/Source/core/svg/SVGClipPathElement.cpp
+++ b/Source/core/svg/SVGClipPathElement.cpp
@@ -37,6 +37,14 @@ inline SVGClipPathElement::SVGClipPathElement(Document& document)
DEFINE_NODE_FACTORY(SVGClipPathElement)
+void SVGClipPathElement::trace(Visitor* visitor)
+{
+#if ENABLE(OILPAN)
+ visitor->trace(m_clientsToAdd);
+#endif
+ SVGGraphicsElement::trace(visitor);
+}
+
bool SVGClipPathElement::isSupportedAttribute(const QualifiedName& attrName)
{
DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
@@ -90,7 +98,26 @@ void SVGClipPathElement::childrenChanged(const ChildrenChange& change)
RenderObject* SVGClipPathElement::createRenderer(RenderStyle*)
{
- return new RenderSVGResourceClipper(this);
+ RenderSVGResourceClipper* renderer = new RenderSVGResourceClipper(this);
+
+ WillBeHeapHashSet<RefPtrWillBeMember<Node> >::iterator layerEnd = m_clientsToAdd.end();
+ for (WillBeHeapHashSet<RefPtrWillBeMember<Node> >::iterator it = m_clientsToAdd.begin(); it != layerEnd; ++it)
+ renderer->addClientRenderLayer(it->get());
+ m_clientsToAdd.clear();
+
+ return renderer;
+}
+
+void SVGClipPathElement::addClient(Node* client)
+{
+ ASSERT(client);
+ m_clientsToAdd.add(client);
+}
+
+void SVGClipPathElement::removeClient(Node* client)
+{
+ ASSERT(client);
+ m_clientsToAdd.remove(client);
}
}
« Source/core/rendering/RenderLayerClipPathInfo.cpp ('K') | « Source/core/svg/SVGClipPathElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698