OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "core/css/cssom/CSSCalcLength.h" | 5 #include "core/css/cssom/CSSCalcLength.h" |
6 | 6 |
7 #include "core/css/CSSCalculationValue.h" | 7 #include "core/css/CSSCalculationValue.h" |
8 #include "core/css/CSSPrimitiveValue.h" | 8 #include "core/css/CSSPrimitiveValue.h" |
9 #include "core/css/cssom/CSSCalcDictionary.h" | 9 #include "core/css/cssom/CSSCalcDictionary.h" |
10 #include "core/css/cssom/CSSSimpleLength.h" | 10 #include "core/css/cssom/CSSSimpleLength.h" |
11 #include "wtf/Vector.h" | 11 #include "wtf/Vector.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
| 14 namespace cssom { |
14 | 15 |
15 CSSCalcLength::CSSCalcLength() : m_values(CSSLengthValue::kNumSupportedUnits), m
_hasValues(CSSLengthValue::kNumSupportedUnits) {} | 16 CSSCalcLength::CSSCalcLength() : m_values(CSSLengthValue::kNumSupportedUnits), m
_hasValues(CSSLengthValue::kNumSupportedUnits) {} |
16 | 17 |
17 CSSCalcLength::CSSCalcLength(const CSSCalcLength& other) : | 18 CSSCalcLength::CSSCalcLength(const CSSCalcLength& other) : |
18 m_values(other.m_values), | 19 m_values(other.m_values), |
19 m_hasValues(other.m_hasValues) | 20 m_hasValues(other.m_hasValues) |
20 {} | 21 {} |
21 | 22 |
22 CSSCalcLength::CSSCalcLength(const CSSSimpleLength& other) : | 23 CSSCalcLength::CSSCalcLength(const CSSSimpleLength& other) : |
23 m_values(CSSLengthValue::kNumSupportedUnits), m_hasValues(CSSLengthValue::kN
umSupportedUnits) | 24 m_values(CSSLengthValue::kNumSupportedUnits), m_hasValues(CSSLengthValue::kN
umSupportedUnits) |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 142 } |
142 } | 143 } |
143 return CSSPrimitiveValue::create(CSSCalcValue::create(node)); | 144 return CSSPrimitiveValue::create(CSSCalcValue::create(node)); |
144 } | 145 } |
145 | 146 |
146 int CSSCalcLength::indexForUnit(CSSPrimitiveValue::UnitType unit) | 147 int CSSCalcLength::indexForUnit(CSSPrimitiveValue::UnitType unit) |
147 { | 148 { |
148 return (static_cast<int>(unit) - static_cast<int>(CSSPrimitiveValue::UnitTyp
e::Percentage)); | 149 return (static_cast<int>(unit) - static_cast<int>(CSSPrimitiveValue::UnitTyp
e::Percentage)); |
149 } | 150 } |
150 | 151 |
| 152 } // namespace cssom |
151 } // namespace blink | 153 } // namespace blink |
| 154 |
OLD | NEW |