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

Unified Diff: third_party/WebKit/Source/core/svg/SVGAnimatedHref.h

Issue 1681553002: Add support for 'href' (w/o XLink NS) for various SVG elements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase; update comment Created 4 years, 10 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: third_party/WebKit/Source/core/svg/SVGAnimatedHref.h
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimatedHref.h b/third_party/WebKit/Source/core/svg/SVGAnimatedHref.h
new file mode 100644
index 0000000000000000000000000000000000000000..18ef03d2bbef16f8216b317c69efb3c47c1c6342
--- /dev/null
+++ b/third_party/WebKit/Source/core/svg/SVGAnimatedHref.h
@@ -0,0 +1,60 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SVGAnimatedHref_h
+#define SVGAnimatedHref_h
+
+#include "core/svg/SVGAnimatedString.h"
+
+namespace blink {
+
+// This is an "access wrapper" for the 'href' attribute. It holds one object
+// for 'href' in the null/default NS and one for 'href' in the XLink NS. The
+// internal objects are the ones added to an SVGElement's property map and
+// hence any updates/synchronization/etc via the "attribute DOM" (setAttribute
+// and friends) will operate on the internal objects, while users of 'href'
+// will be using this interface (which essentially just selects one of the
+// internal objects and forwards the operation to it.)
+class SVGAnimatedHref final : public SVGAnimatedString {
+public:
+ static PassRefPtrWillBeRawPtr<SVGAnimatedHref> create(SVGElement* contextElement);
+
+ SVGString* baseValue() { return backingHref()->baseValue(); }
+ SVGString* currentValue() { return backingHref()->currentValue(); }
+ const SVGString* currentValue() const { return backingHref()->currentValue(); }
+
+ // None of the below should be called on this interface.
+ SVGPropertyBase* currentValueBase() override;
+ const SVGPropertyBase& baseValueBase() const override;
+ bool isAnimating() const override;
+ PassRefPtrWillBeRawPtr<SVGPropertyBase> createAnimatedValue() override;
+ void setAnimatedValue(PassRefPtrWillBeRawPtr<SVGPropertyBase>) override;
+ void animationEnded() override;
+ SVGParsingError setBaseValueAsString(const String&) override;
+ bool needsSynchronizeAttribute() override;
+ void synchronizeAttribute() override;
+
+ String baseVal() override;
+ void setBaseVal(const String&, ExceptionState&) override;
+ String animVal() override;
+
+ bool isSpecified() const { return m_href->isSpecified() || m_xlinkHref->isSpecified(); }
+
+ static bool isKnownAttribute(const QualifiedName&);
+ void addToPropertyMap(SVGElement*);
+
+ DECLARE_VIRTUAL_TRACE();
+
+private:
+ explicit SVGAnimatedHref(SVGElement* contextElement);
+
+ SVGAnimatedString* backingHref() const;
+
+ RefPtrWillBeMember<SVGAnimatedString> m_href;
+ RefPtrWillBeMember<SVGAnimatedString> m_xlinkHref;
+};
+
+} // namespace blink
+
+#endif // SVGAnimatedHref_h
« no previous file with comments | « third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp ('k') | third_party/WebKit/Source/core/svg/SVGAnimatedHref.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698