| 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/SimpleLength.h" | 5 #include "core/css/cssom/SimpleLength.h" |
| 6 | 6 |
| 7 #include "core/css/CSSPrimitiveValue.h" | 7 #include "core/css/CSSPrimitiveValue.h" |
| 8 #include "core/css/cssom/StyleCalcLength.h" | 8 #include "core/css/cssom/StyleCalcLength.h" |
| 9 #include "wtf/text/StringBuilder.h" | 9 #include "wtf/text/StringBuilder.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 RawPtr<CSSValue> SimpleLength::toCSSValue() const | 13 CSSValue* SimpleLength::toCSSValue() const |
| 14 { | 14 { |
| 15 return cssValuePool().createValue(m_value, m_unit); | 15 return cssValuePool().createValue(m_value, m_unit); |
| 16 } | 16 } |
| 17 | 17 |
| 18 bool SimpleLength::containsPercent() const | 18 bool SimpleLength::containsPercent() const |
| 19 { | 19 { |
| 20 return lengthUnit() == CSSPrimitiveValue::UnitType::Percentage; | 20 return lengthUnit() == CSSPrimitiveValue::UnitType::Percentage; |
| 21 } | 21 } |
| 22 | 22 |
| 23 LengthValue* SimpleLength::addInternal(const LengthValue* other, ExceptionState&
exceptionState) | 23 LengthValue* SimpleLength::addInternal(const LengthValue* other, ExceptionState&
exceptionState) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 46 { | 46 { |
| 47 return create(m_value * x, m_unit); | 47 return create(m_value * x, m_unit); |
| 48 } | 48 } |
| 49 | 49 |
| 50 LengthValue* SimpleLength::divideInternal(double x, ExceptionState& exceptionSta
te) | 50 LengthValue* SimpleLength::divideInternal(double x, ExceptionState& exceptionSta
te) |
| 51 { | 51 { |
| 52 return create(m_value / x, m_unit); | 52 return create(m_value / x, m_unit); |
| 53 } | 53 } |
| 54 | 54 |
| 55 } // namespace blink | 55 } // namespace blink |
| OLD | NEW |