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

Unified Diff: third_party/WebKit/Source/core/style/ClipPathOperation.h

Issue 2484153003: Use an SVGElementProxy in ReferenceClipPathOperation (Closed)
Patch Set: Rebase; fix comments; findElement Created 4 years, 1 month 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: third_party/WebKit/Source/core/style/ClipPathOperation.h
diff --git a/third_party/WebKit/Source/core/style/ClipPathOperation.h b/third_party/WebKit/Source/core/style/ClipPathOperation.h
index 16405443cb531a41e8c76197864b4bb47463d7d1..e08e4d4f0fe46518fb4045b702eb14e198450c3e 100644
--- a/third_party/WebKit/Source/core/style/ClipPathOperation.h
+++ b/third_party/WebKit/Source/core/style/ClipPathOperation.h
@@ -31,6 +31,7 @@
#define ClipPathOperation_h
#include "core/style/BasicShapes.h"
+#include "core/svg/SVGElementProxy.h"
#include "platform/graphics/Path.h"
#include "wtf/PtrUtil.h"
#include "wtf/RefCounted.h"
@@ -39,6 +40,10 @@
namespace blink {
+class SVGElement;
+class SVGResourceClient;
+class TreeScope;
+
class ClipPathOperation : public RefCounted<ClipPathOperation> {
public:
enum OperationType { REFERENCE, SHAPE };
@@ -61,25 +66,26 @@ class ReferenceClipPathOperation final : public ClipPathOperation {
public:
static PassRefPtr<ReferenceClipPathOperation> create(
const String& url,
- const AtomicString& fragment) {
- return adoptRef(new ReferenceClipPathOperation(url, fragment));
+ SVGElementProxy& elementProxy) {
+ return adoptRef(new ReferenceClipPathOperation(url, elementProxy));
}
+ void addClient(SVGResourceClient*);
+ void removeClient(SVGResourceClient*);
+
+ SVGElement* findElement(TreeScope&) const;
+
const String& url() const { return m_url; }
- const AtomicString& fragment() const { return m_fragment; }
private:
- bool operator==(const ClipPathOperation& o) const override {
- return isSameType(o) &&
- m_url == static_cast<const ReferenceClipPathOperation&>(o).m_url;
- }
+ bool operator==(const ClipPathOperation&) const override;
OperationType type() const override { return REFERENCE; }
- ReferenceClipPathOperation(const String& url, const AtomicString& fragment)
- : m_url(url), m_fragment(fragment) {}
+ ReferenceClipPathOperation(const String& url, SVGElementProxy& elementProxy)
+ : m_elementProxy(&elementProxy), m_url(url) {}
+ Persistent<SVGElementProxy> m_elementProxy;
String m_url;
- AtomicString m_fragment;
};
DEFINE_TYPE_CASTS(ReferenceClipPathOperation,
« no previous file with comments | « third_party/WebKit/Source/core/style/BUILD.gn ('k') | third_party/WebKit/Source/core/style/ClipPathOperation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698