| 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 25 matching lines...) Expand all Loading... |
| 36 #include "core/svg/SVGLength.h" | 36 #include "core/svg/SVGLength.h" |
| 37 #include "core/svg/properties/SVGPropertyTearOff.h" | 37 #include "core/svg/properties/SVGPropertyTearOff.h" |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 class SVGLengthTearOff final : public SVGPropertyTearOff<SVGLength>, public Scri
ptWrappable { | 41 class SVGLengthTearOff final : public SVGPropertyTearOff<SVGLength>, public Scri
ptWrappable { |
| 42 DEFINE_WRAPPERTYPEINFO(); | 42 DEFINE_WRAPPERTYPEINFO(); |
| 43 public: | 43 public: |
| 44 // Forward declare these enums in the w3c naming scheme, for IDL generation | 44 // Forward declare these enums in the w3c naming scheme, for IDL generation |
| 45 enum { | 45 enum { |
| 46 SVG_LENGTHTYPE_UNKNOWN = LengthTypeUnknown, | 46 kSvgLengthtypeUnknown = LengthTypeUnknown, |
| 47 SVG_LENGTHTYPE_NUMBER = LengthTypeNumber, | 47 kSvgLengthtypeNumber = LengthTypeNumber, |
| 48 SVG_LENGTHTYPE_PERCENTAGE = LengthTypePercentage, | 48 kSvgLengthtypePercentage = LengthTypePercentage, |
| 49 SVG_LENGTHTYPE_EMS = LengthTypeEMS, | 49 kSvgLengthtypeEms = LengthTypeEMS, |
| 50 SVG_LENGTHTYPE_EXS = LengthTypeEXS, | 50 kSvgLengthtypeExs = LengthTypeEXS, |
| 51 SVG_LENGTHTYPE_PX = LengthTypePX, | 51 kSvgLengthtypePx = LengthTypePX, |
| 52 SVG_LENGTHTYPE_CM = LengthTypeCM, | 52 kSvgLengthtypeCm = LengthTypeCM, |
| 53 SVG_LENGTHTYPE_MM = LengthTypeMM, | 53 kSvgLengthtypeMm = LengthTypeMM, |
| 54 SVG_LENGTHTYPE_IN = LengthTypeIN, | 54 kSvgLengthtypeIn = LengthTypeIN, |
| 55 SVG_LENGTHTYPE_PT = LengthTypePT, | 55 kSvgLengthtypePt = LengthTypePT, |
| 56 SVG_LENGTHTYPE_PC = LengthTypePC | 56 kSvgLengthtypePc = LengthTypePC |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 static SVGLengthTearOff* create(SVGLength* target, SVGElement* contextElemen
t, PropertyIsAnimValType propertyIsAnimVal, const QualifiedName& attributeName =
QualifiedName::null()) | 59 static SVGLengthTearOff* create(SVGLength* target, SVGElement* contextElemen
t, PropertyIsAnimValType propertyIsAnimVal, const QualifiedName& attributeName =
QualifiedName::null()) |
| 60 { | 60 { |
| 61 return new SVGLengthTearOff(target, contextElement, propertyIsAnimVal, a
ttributeName); | 61 return new SVGLengthTearOff(target, contextElement, propertyIsAnimVal, a
ttributeName); |
| 62 } | 62 } |
| 63 | 63 |
| 64 SVGLengthType unitType(); | 64 SVGLengthType unitType(); |
| 65 SVGLengthMode unitMode(); | 65 SVGLengthMode unitMode(); |
| 66 float value(ExceptionState&); | 66 float value(ExceptionState&); |
| 67 void setValue(float value, ExceptionState&); | 67 void setValue(float value, ExceptionState&); |
| 68 float valueInSpecifiedUnits(); | 68 float valueInSpecifiedUnits(); |
| 69 void setValueInSpecifiedUnits(float value, ExceptionState&); | 69 void setValueInSpecifiedUnits(float value, ExceptionState&); |
| 70 String valueAsString(); | 70 String valueAsString(); |
| 71 void setValueAsString(const String&, ExceptionState&); | 71 void setValueAsString(const String&, ExceptionState&); |
| 72 void newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedU
nits, ExceptionState&); | 72 void newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedU
nits, ExceptionState&); |
| 73 void convertToSpecifiedUnits(unsigned short unitType, ExceptionState&); | 73 void convertToSpecifiedUnits(unsigned short unitType, ExceptionState&); |
| 74 | 74 |
| 75 bool hasExposedLengthUnit(); | 75 bool hasExposedLengthUnit(); |
| 76 | 76 |
| 77 DECLARE_VIRTUAL_TRACE_WRAPPERS(); | 77 DECLARE_VIRTUAL_TRACE_WRAPPERS(); |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 SVGLengthTearOff(SVGLength*, SVGElement* contextElement, PropertyIsAnimValTy
pe, const QualifiedName& attributeName = QualifiedName::null()); | 80 SVGLengthTearOff(SVGLength*, SVGElement* contextElement, PropertyIsAnimValTy
pe, const QualifiedName& attributeName = QualifiedName::null()); |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 } // namespace blink | 83 } // namespace blink |
| 84 | 84 |
| 85 #endif // SVGLengthTearOff_h | 85 #endif // SVGLengthTearOff_h |
| OLD | NEW |