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/CSSPrimitiveValue.h" | 8 #include "core/css/CSSPrimitiveValue.h" |
9 #include "core/css/cssom/CSSStyleValue.h" | 9 #include "core/css/cssom/CSSStyleValue.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class CSSCalcDictionary; | 13 class CSSCalcDictionary; |
14 class ExceptionState; | 14 class ExceptionState; |
15 | 15 |
16 class CORE_EXPORT CSSLengthValue : public CSSStyleValue { | 16 class CORE_EXPORT CSSLengthValue : public CSSStyleValue { |
17 WTF_MAKE_NONCOPYABLE(CSSLengthValue); | 17 WTF_MAKE_NONCOPYABLE(CSSLengthValue); |
18 DEFINE_WRAPPERTYPEINFO(); | 18 DEFINE_WRAPPERTYPEINFO(); |
19 public: | 19 public: |
20 static CSSPrimitiveValue::UnitType unitFromName(const String& name); | 20 static CSSPrimitiveValue::UnitType unitFromName(const String& name); |
21 | 21 |
22 CSSLengthValue* add(const CSSLengthValue* other, ExceptionState&); | 22 CSSLengthValue* add(const CSSLengthValue* other, ExceptionState&); |
23 CSSLengthValue* subtract(const CSSLengthValue* other, ExceptionState&); | 23 CSSLengthValue* subtract(const CSSLengthValue* other, ExceptionState&); |
24 CSSLengthValue* multiply(double, ExceptionState&); | 24 CSSLengthValue* multiply(double, ExceptionState&); |
25 CSSLengthValue* divide(double, ExceptionState&); | 25 CSSLengthValue* divide(double, ExceptionState&); |
26 | 26 |
27 virtual bool containsPercent() const = 0; | 27 virtual bool containsPercent() const = 0; |
28 | 28 |
29 static CSSLengthValue* from(const String& cssString, ExceptionState&); | 29 static CSSLengthValue* from(const String& cssText, ExceptionState&); |
30 static CSSLengthValue* from(double value, const String& typeStr, ExceptionSt
ate&); | 30 static CSSLengthValue* from(double value, const String& typeStr, ExceptionSt
ate&); |
31 static CSSLengthValue* from(const CSSCalcDictionary&, ExceptionState&); | 31 static CSSLengthValue* from(const CSSCalcDictionary&, ExceptionState&); |
32 | 32 |
33 protected: | 33 protected: |
34 CSSLengthValue() {} | 34 CSSLengthValue() {} |
35 | 35 |
36 virtual CSSLengthValue* addInternal(const CSSLengthValue* other, ExceptionSt
ate&); | 36 virtual CSSLengthValue* addInternal(const CSSLengthValue* other, ExceptionSt
ate&); |
37 virtual CSSLengthValue* subtractInternal(const CSSLengthValue* other, Except
ionState&); | 37 virtual CSSLengthValue* subtractInternal(const CSSLengthValue* other, Except
ionState&); |
38 virtual CSSLengthValue* multiplyInternal(double, ExceptionState&); | 38 virtual CSSLengthValue* multiplyInternal(double, ExceptionState&); |
39 virtual CSSLengthValue* divideInternal(double, ExceptionState&); | 39 virtual CSSLengthValue* divideInternal(double, ExceptionState&); |
(...skipping 10 matching lines...) Expand all Loading... |
50 | 50 |
51 DEFINE_TYPE_CASTS(CSSLengthValue, CSSStyleValue, value, | 51 DEFINE_TYPE_CASTS(CSSLengthValue, CSSStyleValue, value, |
52 (value->type() == CSSStyleValue::SimpleLengthType | 52 (value->type() == CSSStyleValue::SimpleLengthType |
53 || value->type() == CSSStyleValue::CalcLengthType), | 53 || value->type() == CSSStyleValue::CalcLengthType), |
54 (value.type() == CSSStyleValue::SimpleLengthType | 54 (value.type() == CSSStyleValue::SimpleLengthType |
55 || value.type() == CSSStyleValue::CalcLengthType)); | 55 || value.type() == CSSStyleValue::CalcLengthType)); |
56 | 56 |
57 } // namespace blink | 57 } // namespace blink |
58 | 58 |
59 #endif | 59 #endif |
OLD | NEW |