| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "core/svg/properties/SVGPropertyHelper.h" | 35 #include "core/svg/properties/SVGPropertyHelper.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class SVGBoolean : public SVGPropertyHelper<SVGBoolean> { | 39 class SVGBoolean : public SVGPropertyHelper<SVGBoolean> { |
| 40 public: | 40 public: |
| 41 // SVGBoolean does not have a tear-off type. | 41 // SVGBoolean does not have a tear-off type. |
| 42 typedef void TearOffType; | 42 typedef void TearOffType; |
| 43 typedef bool PrimitiveType; | 43 typedef bool PrimitiveType; |
| 44 | 44 |
| 45 static PassRefPtrWillBeRawPtr<SVGBoolean> create(bool value = false) | 45 static RawPtr<SVGBoolean> create(bool value = false) |
| 46 { | 46 { |
| 47 return adoptRefWillBeNoop(new SVGBoolean(value)); | 47 return new SVGBoolean(value); |
| 48 } | 48 } |
| 49 | 49 |
| 50 PassRefPtrWillBeRawPtr<SVGBoolean> clone() const { return create(m_value); } | 50 RawPtr<SVGBoolean> clone() const { return create(m_value); } |
| 51 | 51 |
| 52 String valueAsString() const override; | 52 String valueAsString() const override; |
| 53 SVGParsingError setValueAsString(const String&); | 53 SVGParsingError setValueAsString(const String&); |
| 54 | 54 |
| 55 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; | 55 void add(RawPtr<SVGPropertyBase>, SVGElement*) override; |
| 56 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> from, PassRefPtrWillBeRawP
tr<SVGPropertyBase> to, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEndOfDuratio
nValue, SVGElement*) override; | 56 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, RawPtr<SVGPropertyBase> from, RawPtr<SVGPropertyBase> to, RawPtr<S
VGPropertyBase> toAtEndOfDurationValue, SVGElement*) override; |
| 57 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme
nt*) override; | 57 float calculateDistance(RawPtr<SVGPropertyBase> to, SVGElement*) override; |
| 58 | 58 |
| 59 bool value() const { return m_value; } | 59 bool value() const { return m_value; } |
| 60 void setValue(bool value) { m_value = value; } | 60 void setValue(bool value) { m_value = value; } |
| 61 | 61 |
| 62 static AnimatedPropertyType classType() { return AnimatedBoolean; } | 62 static AnimatedPropertyType classType() { return AnimatedBoolean; } |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 SVGBoolean(bool value) | 65 SVGBoolean(bool value) |
| 66 : m_value(value) | 66 : m_value(value) |
| 67 { | 67 { |
| 68 } | 68 } |
| 69 | 69 |
| 70 bool m_value; | 70 bool m_value; |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGBoolean); | 73 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGBoolean); |
| 74 | 74 |
| 75 } // namespace blink | 75 } // namespace blink |
| 76 | 76 |
| 77 #endif // SVGBoolean_h | 77 #endif // SVGBoolean_h |
| OLD | NEW |