| 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 #include "core/svg/SVGAnimatedHref.h" | 5 #include "core/svg/SVGAnimatedHref.h" |
| 6 | 6 |
| 7 #include "core/SVGNames.h" | 7 #include "core/SVGNames.h" |
| 8 #include "core/XLinkNames.h" | 8 #include "core/XLinkNames.h" |
| 9 #include "core/frame/UseCounter.h" | 9 #include "core/frame/UseCounter.h" |
| 10 #include "core/svg/SVGElement.h" | 10 #include "core/svg/SVGElement.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 void SVGAnimatedHref::setBaseVal(const String& value, ExceptionState& exceptionS
tate) | 58 void SVGAnimatedHref::setBaseVal(const String& value, ExceptionState& exceptionS
tate) |
| 59 { | 59 { |
| 60 UseCounter::count(contextElement()->document(), UseCounter::SVGHrefBaseVal); | 60 UseCounter::count(contextElement()->document(), UseCounter::SVGHrefBaseVal); |
| 61 return backingString()->SVGAnimatedString::setBaseVal(value, exceptionState)
; | 61 return backingString()->SVGAnimatedString::setBaseVal(value, exceptionState)
; |
| 62 } | 62 } |
| 63 | 63 |
| 64 String SVGAnimatedHref::animVal() | 64 String SVGAnimatedHref::animVal() |
| 65 { | 65 { |
| 66 UseCounter::count(contextElement()->document(), UseCounter::SVGHrefAnimVal); | 66 UseCounter::count(contextElement()->document(), UseCounter::SVGHrefAnimVal); |
| 67 // We should only animate (non-XLink) 'href'. | 67 return backingString()->SVGAnimatedString::animVal(); |
| 68 return SVGAnimatedString::animVal(); | |
| 69 } | 68 } |
| 70 | 69 |
| 71 SVGAnimatedString* SVGAnimatedHref::backingString() | 70 SVGAnimatedString* SVGAnimatedHref::backingString() |
| 72 { | 71 { |
| 73 return useXLink() ? m_xlinkHref.get() : this; | 72 return useXLink() ? m_xlinkHref.get() : this; |
| 74 } | 73 } |
| 75 | 74 |
| 76 const SVGAnimatedString* SVGAnimatedHref::backingString() const | 75 const SVGAnimatedString* SVGAnimatedHref::backingString() const |
| 77 { | 76 { |
| 78 return useXLink() ? m_xlinkHref.get() : this; | 77 return useXLink() ? m_xlinkHref.get() : this; |
| 79 } | 78 } |
| 80 | 79 |
| 81 bool SVGAnimatedHref::useXLink() const | 80 bool SVGAnimatedHref::useXLink() const |
| 82 { | 81 { |
| 83 return !SVGAnimatedString::isSpecified() && m_xlinkHref->isSpecified(); | 82 return !SVGAnimatedString::isSpecified() && m_xlinkHref->isSpecified(); |
| 84 } | 83 } |
| 85 | 84 |
| 86 } // namespace blink | 85 } // namespace blink |
| OLD | NEW |