Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 G* * Redistributions in binary form must reproduce the above | 10 G* * Redistributions in binary form must reproduce the above |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 virtual NewSVGPropertyBase* currentValueBase() OVERRIDE | 130 virtual NewSVGPropertyBase* currentValueBase() OVERRIDE |
| 131 { | 131 { |
| 132 return currentValue(); | 132 return currentValue(); |
| 133 } | 133 } |
| 134 | 134 |
| 135 void setBaseValueAsString(const String& value, SVGParsingError& parseError) | 135 void setBaseValueAsString(const String& value, SVGParsingError& parseError) |
| 136 { | 136 { |
| 137 TrackExceptionState es; | 137 TrackExceptionState es; |
| 138 | 138 |
| 139 m_baseValue->setValueAsString(value, es); | 139 m_baseValue->setValueAsString(value, es); |
| 140 commitChange(); | |
| 141 | 140 |
| 142 if (es.hadException()) | 141 if (es.hadException()) |
| 143 parseError = ParsingAttributeFailedError; | 142 parseError = ParsingAttributeFailedError; |
| 144 } | 143 } |
| 145 | 144 |
| 146 virtual PassRefPtr<NewSVGPropertyBase> createAnimatedValue() OVERRIDE | 145 virtual PassRefPtr<NewSVGPropertyBase> createAnimatedValue() OVERRIDE |
| 147 { | 146 { |
| 148 return m_baseValue->clone(); | 147 return m_baseValue->clone(); |
| 149 } | 148 } |
| 150 | 149 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 203 virtual bool needsSynchronizeAttribute() OVERRIDE | 202 virtual bool needsSynchronizeAttribute() OVERRIDE |
| 204 { | 203 { |
| 205 // DOM attribute synchronization is only needed if tear-off is being tou ched from javascript or the property is being animated. | 204 // DOM attribute synchronization is only needed if tear-off is being tou ched from javascript or the property is being animated. |
| 206 // This prevents unnecessary attribute creation on target element. | 205 // This prevents unnecessary attribute creation on target element. |
| 207 return m_baseValTearOff || this->isAnimating(); | 206 return m_baseValTearOff || this->isAnimating(); |
| 208 } | 207 } |
| 209 | 208 |
| 210 // SVGAnimated* DOM Spec implementations: | 209 // SVGAnimated* DOM Spec implementations: |
| 211 | 210 |
| 212 // baseVal()/animVal() are only to be used from SVG DOM implementation. | 211 // baseVal()/animVal() are only to be used from SVG DOM implementation. |
| 213 // Use currentValue() from C++ code. | 212 // Use currentValue() from C++ code. |
|
pdr.
2014/01/16 03:25:47
Should this comment be updated?
kouhei (in TOK)
2014/01/16 03:42:27
I think they are fine. currentValue() definition i
| |
| 214 virtual TearOffType* baseVal() | 213 virtual TearOffType* baseVal() |
| 215 { | 214 { |
| 216 if (!m_baseValTearOff) | 215 if (!m_baseValTearOff) { |
| 217 m_baseValTearOff = TearOffType::create(this->baseValue(), this->cont extElement(), PropertyIsNotAnimVal, this->attributeName()); | 216 m_baseValTearOff = TearOffType::create(this->baseValue(), this->cont extElement(), PropertyIsNotAnimVal, this->attributeName()); |
| 217 if (this->isReadOnly()) | |
| 218 m_baseValTearOff->setIsReadOnlyProperty(); | |
| 219 } | |
| 218 | 220 |
| 219 return m_baseValTearOff.get(); | 221 return m_baseValTearOff.get(); |
| 220 } | 222 } |
| 221 | 223 |
| 222 TearOffType* animVal() | 224 TearOffType* animVal() |
| 223 { | 225 { |
| 224 if (!m_animValTearOff) | 226 if (!m_animValTearOff) |
| 225 m_animValTearOff = TearOffType::create(this->currentValue(), this->c ontextElement(), PropertyIsAnimVal, this->attributeName()); | 227 m_animValTearOff = TearOffType::create(this->currentValue(), this->c ontextElement(), PropertyIsAnimVal, this->attributeName()); |
| 226 | 228 |
| 227 return m_animValTearOff.get(); | 229 return m_animValTearOff.get(); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 312 , m_baseValueUpdated(false) | 314 , m_baseValueUpdated(false) |
| 313 { | 315 { |
| 314 } | 316 } |
| 315 | 317 |
| 316 bool m_baseValueUpdated; | 318 bool m_baseValueUpdated; |
| 317 }; | 319 }; |
| 318 | 320 |
| 319 } | 321 } |
| 320 | 322 |
| 321 #endif // NewSVGAnimatedProperty_h | 323 #endif // NewSVGAnimatedProperty_h |
| OLD | NEW |