| 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 #include "core/css/cssom/CSSLengthValue.h" | 5 #include "core/css/cssom/CSSLengthValue.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.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/CSSCalcLength.h" | 10 #include "core/css/cssom/CSSCalcLength.h" |
| 11 #include "core/css/cssom/CSSSimpleLength.h" | 11 #include "core/css/cssom/CSSSimpleLength.h" |
| 12 #include "wtf/HashMap.h" | 12 #include "wtf/HashMap.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 CSSPrimitiveValue::UnitType CSSLengthValue::UnitFromName(const String& name) { | 16 CSSPrimitiveValue::UnitType CSSLengthValue::UnitFromName(const String& name) { |
| 17 if (EqualIgnoringASCIICase(name, "percent") || name == "%") | 17 if (EqualIgnoringASCIICase(name, "percent") || name == "%") |
| 18 return CSSPrimitiveValue::UnitType::kPercentage; | 18 return CSSPrimitiveValue::UnitType::kPercentage; |
| 19 return CSSPrimitiveValue::StringToUnitType(name); | 19 return CSSPrimitiveValue::StringToUnitType(name); |
| 20 } | 20 } |
| 21 | 21 |
| 22 CSSLengthValue* CSSLengthValue::FromCSSValue(const CSSPrimitiveValue& value) { | 22 CSSLengthValue* CSSLengthValue::FromCSSValue(const CSSPrimitiveValue& value) { |
| 23 if (value.IsCalculated()) { | 23 if (value.IsCalculated()) { |
| 24 // TODO(meade): Implement CSSCalcLength::fromCSSValue. | 24 // TODO(meade): Implement CSSCalcLength::FromCSSValue. |
| 25 return nullptr; | 25 return nullptr; |
| 26 } | 26 } |
| 27 return CSSSimpleLength::FromCSSValue(value); | 27 return CSSSimpleLength::FromCSSValue(value); |
| 28 } | 28 } |
| 29 | 29 |
| 30 CSSLengthValue* CSSLengthValue::from(const String& css_text, | 30 CSSLengthValue* CSSLengthValue::from(const String& css_text, |
| 31 ExceptionState& exception_state) { | 31 ExceptionState& exception_state) { |
| 32 // TODO: Implement | 32 // TODO: Implement |
| 33 return nullptr; | 33 return nullptr; |
| 34 } | 34 } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 NOTREACHED(); | 101 NOTREACHED(); |
| 102 return nullptr; | 102 return nullptr; |
| 103 } | 103 } |
| 104 | 104 |
| 105 CSSLengthValue* CSSLengthValue::DivideInternal(double) { | 105 CSSLengthValue* CSSLengthValue::DivideInternal(double) { |
| 106 NOTREACHED(); | 106 NOTREACHED(); |
| 107 return nullptr; | 107 return nullptr; |
| 108 } | 108 } |
| 109 | 109 |
| 110 } // namespace blink | 110 } // namespace blink |
| OLD | NEW |