OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef SVGAnimatedHref_h | |
6 #define SVGAnimatedHref_h | |
7 | |
8 #include "core/svg/SVGAnimatedString.h" | |
9 | |
10 namespace blink { | |
11 | |
12 // This is an "access wrapper" for the 'href' attribute. It holds one object | |
13 // for 'href' in the null/default NS and one for 'href' in the XLink NS. The | |
14 // internal objects are the ones added to an SVGElement's property map and | |
15 // hence any updates/synchronization/etc via the "attribute DOM" (setAttribute | |
16 // and friends) will operate on the internal objects, while users of 'href' | |
17 // will be using this interface (which essentially just selects one of the | |
18 // internal objects and forwards the operation to it.) | |
19 class SVGAnimatedHref final : public SVGAnimatedString { | |
pdr.
2016/02/09 23:17:07
So much complexity that will bite us in the future
fs
2016/02/10 14:44:46
Well this is actually the less-complex solution...
| |
20 public: | |
21 static PassRefPtrWillBeRawPtr<SVGAnimatedHref> create(SVGElement* contextEle ment); | |
22 | |
23 SVGString* baseValue() { return backingHref()->baseValue(); } | |
24 SVGString* currentValue() { return backingHref()->currentValue(); } | |
25 const SVGString* currentValue() const { return backingHref()->currentValue() ; } | |
26 | |
27 // None of the below should be called on this interface. | |
28 SVGPropertyBase* currentValueBase() override; | |
29 const SVGPropertyBase& baseValueBase() const override; | |
30 bool isAnimating() const override; | |
31 PassRefPtrWillBeRawPtr<SVGPropertyBase> createAnimatedValue() override; | |
32 void setAnimatedValue(PassRefPtrWillBeRawPtr<SVGPropertyBase>) override; | |
33 void animationEnded() override; | |
34 SVGParsingError setBaseValueAsString(const String&) override; | |
35 bool needsSynchronizeAttribute() override; | |
36 void synchronizeAttribute() override; | |
37 | |
38 String baseVal() override; | |
39 void setBaseVal(const String&, ExceptionState&) override; | |
40 String animVal() override; | |
41 | |
42 bool isSpecified() const { return m_href->isSpecified() || m_xlinkHref->isSp ecified(); } | |
43 | |
44 static bool isKnownAttribute(const QualifiedName&); | |
45 void addToPropertyMap(SVGElement*); | |
46 | |
47 DECLARE_VIRTUAL_TRACE(); | |
48 | |
49 private: | |
50 explicit SVGAnimatedHref(SVGElement* contextElement); | |
51 | |
52 SVGAnimatedString* backingHref() const; | |
53 | |
54 RefPtrWillBeMember<SVGAnimatedString> m_href; | |
55 RefPtrWillBeMember<SVGAnimatedString> m_xlinkHref; | |
56 }; | |
57 | |
58 } // namespace blink | |
59 | |
60 #endif // SVGAnimatedHref_h | |
OLD | NEW |