Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: third_party/WebKit/Source/core/css/cssom/SimpleLength.h

Issue 1689573002: CSS Typed OM: asMatrix for TransformComponent with LengthValue types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@asMatrixMethod
Patch Set: Add in Translation and use exceptionState.hadException Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 SimpleLength_h 5 #ifndef SimpleLength_h
6 #define SimpleLength_h 6 #define SimpleLength_h
7 7
8 #include "bindings/core/v8/ExceptionState.h" 8 #include "bindings/core/v8/ExceptionState.h"
9 #include "core/css/cssom/LengthValue.h" 9 #include "core/css/cssom/LengthValue.h"
10 10
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 return new SimpleLength(value, unit); 26 return new SimpleLength(value, unit);
27 } 27 }
28 28
29 static SimpleLength* create(double value, CSSPrimitiveValue::UnitType type) 29 static SimpleLength* create(double value, CSSPrimitiveValue::UnitType type)
30 { 30 {
31 return new SimpleLength(value, type); 31 return new SimpleLength(value, type);
32 } 32 }
33 33
34 bool containsPercent() const override; 34 bool containsPercent() const override;
35 bool isRelative() const override { return CSSPrimitiveValue::isRelativeUnit( lengthUnit()); }
35 36
36 double value() const { return m_value; } 37 double value() const { return m_value; }
37 String unit() const { return String(CSSPrimitiveValue::unitTypeToString(m_un it)); } 38 String unit() const { return String(CSSPrimitiveValue::unitTypeToString(m_un it)); }
38 CSSPrimitiveValue::UnitType lengthUnit() const { return m_unit; } 39 CSSPrimitiveValue::UnitType lengthUnit() const { return m_unit; }
39 40
40 void setValue(double value) { m_value = value; } 41 void setValue(double value) { m_value = value; }
41 42
42 StyleValueType type() const override { return StyleValueType::SimpleLengthTy pe; } 43 StyleValueType type() const override { return StyleValueType::SimpleLengthTy pe; }
43 44
44 PassRefPtrWillBeRawPtr<CSSValue> toCSSValue() const override; 45 PassRefPtrWillBeRawPtr<CSSValue> toCSSValue() const override;
(...skipping 15 matching lines...) Expand all
60 DEFINE_TYPE_CASTS(SimpleLength, argumentType, value, \ 61 DEFINE_TYPE_CASTS(SimpleLength, argumentType, value, \
61 value->type() == LengthValue::StyleValueType::SimpleLengthType, \ 62 value->type() == LengthValue::StyleValueType::SimpleLengthType, \
62 value.type() == LengthValue::StyleValueType::SimpleLengthType) 63 value.type() == LengthValue::StyleValueType::SimpleLengthType)
63 64
64 DEFINE_SIMPLE_LENGTH_TYPE_CASTS(LengthValue); 65 DEFINE_SIMPLE_LENGTH_TYPE_CASTS(LengthValue);
65 DEFINE_SIMPLE_LENGTH_TYPE_CASTS(StyleValue); 66 DEFINE_SIMPLE_LENGTH_TYPE_CASTS(StyleValue);
66 67
67 } // namespace blink 68 } // namespace blink
68 69
69 #endif 70 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698