| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CSSSimpleLength_h | 5 #ifndef CSSSimpleLength_h |
| 6 #define CSSSimpleLength_h | 6 #define CSSSimpleLength_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
| 9 #include "core/css/cssom/CSSLengthValue.h" | 9 #include "core/css/cssom/CSSLengthValue.h" |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 void setValue(double value) { m_value = value; } | 40 void setValue(double value) { m_value = value; } |
| 41 | 41 |
| 42 StyleValueType type() const override { return StyleValueType::SimpleLengthTy
pe; } | 42 StyleValueType type() const override { return StyleValueType::SimpleLengthTy
pe; } |
| 43 | 43 |
| 44 CSSValue* toCSSValue() const override; | 44 CSSValue* toCSSValue() const override; |
| 45 | 45 |
| 46 protected: | 46 protected: |
| 47 virtual CSSLengthValue* addInternal(const CSSLengthValue* other, ExceptionSt
ate&); | 47 virtual CSSLengthValue* addInternal(const CSSLengthValue* other, ExceptionSt
ate&); |
| 48 virtual CSSLengthValue* subtractInternal(const CSSLengthValue* other, Except
ionState&); | 48 virtual CSSLengthValue* subtractInternal(const CSSLengthValue* other, Except
ionState&); |
| 49 virtual CSSLengthValue* multiplyInternal(double, ExceptionState&); | 49 virtual CSSLengthValue* multiplyInternal(double); |
| 50 virtual CSSLengthValue* divideInternal(double, ExceptionState&); | 50 virtual CSSLengthValue* divideInternal(double); |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 CSSSimpleLength(double value, CSSPrimitiveValue::UnitType unit) : CSSLengthV
alue(), m_unit(unit), m_value(value) {} | 53 CSSSimpleLength(double value, CSSPrimitiveValue::UnitType unit) : CSSLengthV
alue(), m_unit(unit), m_value(value) {} |
| 54 | 54 |
| 55 CSSPrimitiveValue::UnitType m_unit; | 55 CSSPrimitiveValue::UnitType m_unit; |
| 56 double m_value; | 56 double m_value; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 #define DEFINE_SIMPLE_LENGTH_TYPE_CASTS(argumentType) \ | 59 #define DEFINE_SIMPLE_LENGTH_TYPE_CASTS(argumentType) \ |
| 60 DEFINE_TYPE_CASTS(CSSSimpleLength, argumentType, value, \ | 60 DEFINE_TYPE_CASTS(CSSSimpleLength, argumentType, value, \ |
| 61 value->type() == CSSLengthValue::StyleValueType::SimpleLengthType, \ | 61 value->type() == CSSLengthValue::StyleValueType::SimpleLengthType, \ |
| 62 value.type() == CSSLengthValue::StyleValueType::SimpleLengthType) | 62 value.type() == CSSLengthValue::StyleValueType::SimpleLengthType) |
| 63 | 63 |
| 64 DEFINE_SIMPLE_LENGTH_TYPE_CASTS(CSSLengthValue); | 64 DEFINE_SIMPLE_LENGTH_TYPE_CASTS(CSSLengthValue); |
| 65 DEFINE_SIMPLE_LENGTH_TYPE_CASTS(CSSStyleValue); | 65 DEFINE_SIMPLE_LENGTH_TYPE_CASTS(CSSStyleValue); |
| 66 | 66 |
| 67 } // namespace blink | 67 } // namespace blink |
| 68 | 68 |
| 69 #endif | 69 #endif |
| OLD | NEW |