| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 void SVGAngleTearOff::newValueSpecifiedUnits(unsigned short unitType, | 69 void SVGAngleTearOff::newValueSpecifiedUnits(unsigned short unitType, |
| 70 float valueInSpecifiedUnits, | 70 float valueInSpecifiedUnits, |
| 71 ExceptionState& exceptionState) { | 71 ExceptionState& exceptionState) { |
| 72 if (isImmutable()) { | 72 if (isImmutable()) { |
| 73 throwReadOnly(exceptionState); | 73 throwReadOnly(exceptionState); |
| 74 return; | 74 return; |
| 75 } | 75 } |
| 76 if (unitType == SVGAngle::kSvgAngletypeUnknown || | 76 if (unitType == SVGAngle::kSvgAngletypeUnknown || |
| 77 unitType > SVGAngle::kSvgAngletypeGrad) { | 77 unitType > SVGAngle::kSvgAngletypeGrad) { |
| 78 exceptionState.throwDOMException( | 78 exceptionState.throwDOMException( |
| 79 NotSupportedError, "Cannot set value with unknown or invalid units (" + | 79 NotSupportedError, |
| 80 String::number(unitType) + ")."); | 80 "Cannot set value with unknown or invalid units (" + |
| 81 String::number(unitType) + ")."); |
| 81 return; | 82 return; |
| 82 } | 83 } |
| 83 target()->newValueSpecifiedUnits( | 84 target()->newValueSpecifiedUnits( |
| 84 static_cast<SVGAngle::SVGAngleType>(unitType), valueInSpecifiedUnits); | 85 static_cast<SVGAngle::SVGAngleType>(unitType), valueInSpecifiedUnits); |
| 85 commitChange(); | 86 commitChange(); |
| 86 } | 87 } |
| 87 | 88 |
| 88 void SVGAngleTearOff::convertToSpecifiedUnits(unsigned short unitType, | 89 void SVGAngleTearOff::convertToSpecifiedUnits(unsigned short unitType, |
| 89 ExceptionState& exceptionState) { | 90 ExceptionState& exceptionState) { |
| 90 if (isImmutable()) { | 91 if (isImmutable()) { |
| 91 throwReadOnly(exceptionState); | 92 throwReadOnly(exceptionState); |
| 92 return; | 93 return; |
| 93 } | 94 } |
| 94 if (unitType == SVGAngle::kSvgAngletypeUnknown || | 95 if (unitType == SVGAngle::kSvgAngletypeUnknown || |
| 95 unitType > SVGAngle::kSvgAngletypeGrad) { | 96 unitType > SVGAngle::kSvgAngletypeGrad) { |
| 96 exceptionState.throwDOMException( | 97 exceptionState.throwDOMException( |
| 97 NotSupportedError, "Cannot convert to unknown or invalid units (" + | 98 NotSupportedError, |
| 98 String::number(unitType) + ")."); | 99 "Cannot convert to unknown or invalid units (" + |
| 100 String::number(unitType) + ")."); |
| 99 return; | 101 return; |
| 100 } | 102 } |
| 101 if (target()->unitType() == SVGAngle::kSvgAngletypeUnknown) { | 103 if (target()->unitType() == SVGAngle::kSvgAngletypeUnknown) { |
| 102 exceptionState.throwDOMException( | 104 exceptionState.throwDOMException( |
| 103 NotSupportedError, "Cannot convert from unknown or invalid units."); | 105 NotSupportedError, "Cannot convert from unknown or invalid units."); |
| 104 return; | 106 return; |
| 105 } | 107 } |
| 106 target()->convertToSpecifiedUnits( | 108 target()->convertToSpecifiedUnits( |
| 107 static_cast<SVGAngle::SVGAngleType>(unitType)); | 109 static_cast<SVGAngle::SVGAngleType>(unitType)); |
| 108 commitChange(); | 110 commitChange(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 126 return; | 128 return; |
| 127 } | 129 } |
| 128 commitChange(); | 130 commitChange(); |
| 129 } | 131 } |
| 130 | 132 |
| 131 DEFINE_TRACE_WRAPPERS(SVGAngleTearOff) { | 133 DEFINE_TRACE_WRAPPERS(SVGAngleTearOff) { |
| 132 visitor->traceWrappers(contextElement()); | 134 visitor->traceWrappers(contextElement()); |
| 133 } | 135 } |
| 134 | 136 |
| 135 } // namespace blink | 137 } // namespace blink |
| OLD | NEW |