Chromium Code Reviews| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 159 return; | 159 return; |
| 160 } | 160 } |
| 161 if (target()->isCalculated()) | 161 if (target()->isCalculated()) |
| 162 target()->setValueAsNumber(value); | 162 target()->setValueAsNumber(value); |
| 163 else | 163 else |
| 164 target()->setValueInSpecifiedUnits(value); | 164 target()->setValueInSpecifiedUnits(value); |
| 165 commitChange(); | 165 commitChange(); |
| 166 } | 166 } |
| 167 | 167 |
| 168 String SVGLengthTearOff::valueAsString() { | 168 String SVGLengthTearOff::valueAsString() { |
| 169 // TODO(shanmuga.m@samsung.com): Not all <length> properties have 0 (with no u nit) as the default (lacuna) value, Need to return default value instead of 0 | 169 // TODO(shanmuga.m@samsung.com): Not all <length> properties have 0 (with no |
| 170 // unit) as the default (lacuna) value, Need to return default value instead | |
| 171 // of 0 | |
|
pdr.
2016/10/04 21:05:30
Nit: lets make this a complete sentence: Add a per
Nico
2016/10/04 21:10:23
Done.
| |
| 170 return hasExposedLengthUnit() ? target()->valueAsString() : String::number(0); | 172 return hasExposedLengthUnit() ? target()->valueAsString() : String::number(0); |
| 171 } | 173 } |
| 172 | 174 |
| 173 void SVGLengthTearOff::setValueAsString(const String& str, | 175 void SVGLengthTearOff::setValueAsString(const String& str, |
| 174 ExceptionState& exceptionState) { | 176 ExceptionState& exceptionState) { |
| 175 if (isImmutable()) { | 177 if (isImmutable()) { |
| 176 throwReadOnly(exceptionState); | 178 throwReadOnly(exceptionState); |
| 177 return; | 179 return; |
| 178 } | 180 } |
| 179 String oldValue = target()->valueAsString(); | 181 String oldValue = target()->valueAsString(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 239 : SVGPropertyTearOff<SVGLength>(target, | 241 : SVGPropertyTearOff<SVGLength>(target, |
| 240 contextElement, | 242 contextElement, |
| 241 propertyIsAnimVal, | 243 propertyIsAnimVal, |
| 242 attributeName) {} | 244 attributeName) {} |
| 243 | 245 |
| 244 DEFINE_TRACE_WRAPPERS(SVGLengthTearOff) { | 246 DEFINE_TRACE_WRAPPERS(SVGLengthTearOff) { |
| 245 visitor->traceWrappers(contextElement()); | 247 visitor->traceWrappers(contextElement()); |
| 246 } | 248 } |
| 247 | 249 |
| 248 } // namespace blink | 250 } // namespace blink |
| OLD | NEW |