| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SVGAnimatedHref_h | 5 #ifndef SVGAnimatedHref_h |
| 6 #define SVGAnimatedHref_h | 6 #define SVGAnimatedHref_h |
| 7 | 7 |
| 8 #include "core/svg/SVGAnimatedString.h" | 8 #include "core/svg/SVGAnimatedString.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 // This is an "access wrapper" for the 'href' attribute. The object | 12 // This is an "access wrapper" for the 'href' attribute. The object |
| 13 // itself holds the value for 'href' in the null/default NS and wraps | 13 // itself holds the value for 'href' in the null/default NS and wraps |
| 14 // one for 'href' in the XLink NS. Both objects are added to an | 14 // one for 'href' in the XLink NS. Both objects are added to an |
| 15 // SVGElement's property map and hence any updates/synchronization/etc | 15 // SVGElement's property map and hence any updates/synchronization/etc |
| 16 // via the "attribute DOM" (setAttribute and friends) will operate on | 16 // via the "attribute DOM" (setAttribute and friends) will operate on |
| 17 // the independent objects, while users of an 'href' value will be | 17 // the independent objects, while users of an 'href' value will be |
| 18 // using this interface (which essentially just selects either itself | 18 // using this interface (which essentially just selects either itself |
| 19 // or the wrapped object and forwards the operation to it.) | 19 // or the wrapped object and forwards the operation to it.) |
| 20 class SVGAnimatedHref final : public SVGAnimatedString { | 20 class SVGAnimatedHref final : public SVGAnimatedString { |
| 21 public: | 21 public: |
| 22 static PassRefPtrWillBeRawPtr<SVGAnimatedHref> create(SVGElement* contextEle
ment); | 22 static RawPtr<SVGAnimatedHref> create(SVGElement* contextElement); |
| 23 | 23 |
| 24 SVGString* currentValue(); | 24 SVGString* currentValue(); |
| 25 const SVGString* currentValue() const; | 25 const SVGString* currentValue() const; |
| 26 | 26 |
| 27 String baseVal() override; | 27 String baseVal() override; |
| 28 void setBaseVal(const String&, ExceptionState&) override; | 28 void setBaseVal(const String&, ExceptionState&) override; |
| 29 String animVal() override; | 29 String animVal() override; |
| 30 | 30 |
| 31 bool isSpecified() const { return SVGAnimatedString::isSpecified() || m_xlin
kHref->isSpecified(); } | 31 bool isSpecified() const { return SVGAnimatedString::isSpecified() || m_xlin
kHref->isSpecified(); } |
| 32 | 32 |
| 33 static bool isKnownAttribute(const QualifiedName&); | 33 static bool isKnownAttribute(const QualifiedName&); |
| 34 void addToPropertyMap(SVGElement*); | 34 void addToPropertyMap(SVGElement*); |
| 35 | 35 |
| 36 DECLARE_VIRTUAL_TRACE(); | 36 DECLARE_VIRTUAL_TRACE(); |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 explicit SVGAnimatedHref(SVGElement* contextElement); | 39 explicit SVGAnimatedHref(SVGElement* contextElement); |
| 40 | 40 |
| 41 SVGAnimatedString* backingString(); | 41 SVGAnimatedString* backingString(); |
| 42 const SVGAnimatedString* backingString() const; | 42 const SVGAnimatedString* backingString() const; |
| 43 bool useXLink() const; | 43 bool useXLink() const; |
| 44 | 44 |
| 45 RefPtrWillBeMember<SVGAnimatedString> m_xlinkHref; | 45 Member<SVGAnimatedString> m_xlinkHref; |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 } // namespace blink | 48 } // namespace blink |
| 49 | 49 |
| 50 #endif // SVGAnimatedHref_h | 50 #endif // SVGAnimatedHref_h |
| OLD | NEW |