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 CSSLengthValue_h | 5 #ifndef CSSLengthValue_h |
6 #define CSSLengthValue_h | 6 #define CSSLengthValue_h |
7 | 7 |
8 #include "core/css/cssom/StyleValue.h" | 8 #include "core/css/cssom/CSSStyleValue.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 class CalcDictionary; | 12 class CalcDictionary; |
13 class ExceptionState; | 13 class ExceptionState; |
14 | 14 |
15 class CORE_EXPORT CSSLengthValue : public StyleValue { | 15 class CORE_EXPORT CSSLengthValue : public CSSStyleValue { |
16 WTF_MAKE_NONCOPYABLE(CSSLengthValue); | 16 WTF_MAKE_NONCOPYABLE(CSSLengthValue); |
17 DEFINE_WRAPPERTYPEINFO(); | 17 DEFINE_WRAPPERTYPEINFO(); |
18 public: | 18 public: |
19 static CSSPrimitiveValue::UnitType unitFromName(const String& name); | 19 static CSSPrimitiveValue::UnitType unitFromName(const String& name); |
20 | 20 |
21 CSSLengthValue* add(const CSSLengthValue* other, ExceptionState&); | 21 CSSLengthValue* add(const CSSLengthValue* other, ExceptionState&); |
22 CSSLengthValue* subtract(const CSSLengthValue* other, ExceptionState&); | 22 CSSLengthValue* subtract(const CSSLengthValue* other, ExceptionState&); |
23 CSSLengthValue* multiply(double, ExceptionState&); | 23 CSSLengthValue* multiply(double, ExceptionState&); |
24 CSSLengthValue* divide(double, ExceptionState&); | 24 CSSLengthValue* divide(double, ExceptionState&); |
25 | 25 |
(...skipping 14 matching lines...) Expand all Loading... |
40 static bool isSupportedLengthUnit(CSSPrimitiveValue::UnitType unit) | 40 static bool isSupportedLengthUnit(CSSPrimitiveValue::UnitType unit) |
41 { | 41 { |
42 return (CSSPrimitiveValue::isLength(unit) || unit == CSSPrimitiveValue::
UnitType::Percentage) | 42 return (CSSPrimitiveValue::isLength(unit) || unit == CSSPrimitiveValue::
UnitType::Percentage) |
43 && unit != CSSPrimitiveValue::UnitType::QuirkyEms | 43 && unit != CSSPrimitiveValue::UnitType::QuirkyEms |
44 && unit != CSSPrimitiveValue::UnitType::UserUnits; | 44 && unit != CSSPrimitiveValue::UnitType::UserUnits; |
45 } | 45 } |
46 | 46 |
47 static const int kNumSupportedUnits = 15; | 47 static const int kNumSupportedUnits = 15; |
48 }; | 48 }; |
49 | 49 |
50 DEFINE_TYPE_CASTS(CSSLengthValue, StyleValue, value, | 50 DEFINE_TYPE_CASTS(CSSLengthValue, CSSStyleValue, value, |
51 (value->type() == StyleValue::SimpleLengthType | 51 (value->type() == CSSStyleValue::SimpleLengthType |
52 || value->type() == StyleValue::CalcLengthType), | 52 || value->type() == CSSStyleValue::CalcLengthType), |
53 (value.type() == StyleValue::SimpleLengthType | 53 (value.type() == CSSStyleValue::SimpleLengthType |
54 || value.type() == StyleValue::CalcLengthType)); | 54 || value.type() == CSSStyleValue::CalcLengthType)); |
55 | 55 |
56 } // namespace blink | 56 } // namespace blink |
57 | 57 |
58 #endif | 58 #endif |
OLD | NEW |