| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 inline bool isValidLengthUnit(unsigned short type) { | 54 inline bool isValidLengthUnit(unsigned short type) { |
| 55 return isValidLengthUnit(static_cast<CSSPrimitiveValue::UnitType>(type)); | 55 return isValidLengthUnit(static_cast<CSSPrimitiveValue::UnitType>(type)); |
| 56 } | 56 } |
| 57 | 57 |
| 58 inline bool canResolveRelativeUnits(const SVGElement* contextElement) { | 58 inline bool canResolveRelativeUnits(const SVGElement* contextElement) { |
| 59 return contextElement && contextElement->isConnected(); | 59 return contextElement && contextElement->isConnected(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 inline CSSPrimitiveValue::UnitType toCSSUnitType(unsigned short type) { | 62 inline CSSPrimitiveValue::UnitType toCSSUnitType(unsigned short type) { |
| 63 ASSERT(isValidLengthUnit(type)); | 63 DCHECK(isValidLengthUnit(type)); |
| 64 if (type == SVGLengthTearOff::kSvgLengthtypeNumber) | 64 if (type == SVGLengthTearOff::kSvgLengthtypeNumber) |
| 65 return CSSPrimitiveValue::UnitType::UserUnits; | 65 return CSSPrimitiveValue::UnitType::UserUnits; |
| 66 return static_cast<CSSPrimitiveValue::UnitType>(type); | 66 return static_cast<CSSPrimitiveValue::UnitType>(type); |
| 67 } | 67 } |
| 68 | 68 |
| 69 inline unsigned short toInterfaceConstant(CSSPrimitiveValue::UnitType type) { | 69 inline unsigned short toInterfaceConstant(CSSPrimitiveValue::UnitType type) { |
| 70 switch (type) { | 70 switch (type) { |
| 71 case CSSPrimitiveValue::UnitType::Unknown: | 71 case CSSPrimitiveValue::UnitType::Unknown: |
| 72 return SVGLengthTearOff::kSvgLengthtypeUnknown; | 72 return SVGLengthTearOff::kSvgLengthtypeUnknown; |
| 73 case CSSPrimitiveValue::UnitType::UserUnits: | 73 case CSSPrimitiveValue::UnitType::UserUnits: |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 : SVGPropertyTearOff<SVGLength>(target, | 241 : SVGPropertyTearOff<SVGLength>(target, |
| 242 contextElement, | 242 contextElement, |
| 243 propertyIsAnimVal, | 243 propertyIsAnimVal, |
| 244 attributeName) {} | 244 attributeName) {} |
| 245 | 245 |
| 246 DEFINE_TRACE_WRAPPERS(SVGLengthTearOff) { | 246 DEFINE_TRACE_WRAPPERS(SVGLengthTearOff) { |
| 247 visitor->traceWrappers(contextElement()); | 247 visitor->traceWrappers(contextElement()); |
| 248 } | 248 } |
| 249 | 249 |
| 250 } // namespace blink | 250 } // namespace blink |
| OLD | NEW |