| 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/CSSSimpleLength.h" | 5 #include "core/css/cssom/CSSSimpleLength.h" |
| 6 | 6 |
| 7 #include "core/css/CSSPrimitiveValue.h" | 7 #include "core/css/CSSPrimitiveValue.h" |
| 8 #include "core/css/cssom/CSSCalcLength.h" | 8 #include "core/css/cssom/CSSCalcLength.h" |
| 9 #include "wtf/text/StringBuilder.h" | 9 #include "wtf/text/StringBuilder.h" |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 { | 35 { |
| 36 const CSSSimpleLength* o = toCSSSimpleLength(other); | 36 const CSSSimpleLength* o = toCSSSimpleLength(other); |
| 37 if (m_unit == o->m_unit) | 37 if (m_unit == o->m_unit) |
| 38 return create(m_value - o->value(), m_unit); | 38 return create(m_value - o->value(), m_unit); |
| 39 | 39 |
| 40 // Different units resolve to a calc. | 40 // Different units resolve to a calc. |
| 41 CSSCalcLength* result = CSSCalcLength::create(this, exceptionState); | 41 CSSCalcLength* result = CSSCalcLength::create(this, exceptionState); |
| 42 return result->subtract(other, exceptionState); | 42 return result->subtract(other, exceptionState); |
| 43 } | 43 } |
| 44 | 44 |
| 45 CSSLengthValue* CSSSimpleLength::multiplyInternal(double x, ExceptionState& exce
ptionState) | 45 CSSLengthValue* CSSSimpleLength::multiplyInternal(double x) |
| 46 { | 46 { |
| 47 return create(m_value * x, m_unit); | 47 return create(m_value * x, m_unit); |
| 48 } | 48 } |
| 49 | 49 |
| 50 CSSLengthValue* CSSSimpleLength::divideInternal(double x, ExceptionState& except
ionState) | 50 CSSLengthValue* CSSSimpleLength::divideInternal(double x) |
| 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 |