| 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/CSSPerspective.h" | 5 #include "core/css/cssom/CSSPerspective.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 namespace cssom { |
| 10 | 11 |
| 11 CSSPerspective* CSSPerspective::create(const CSSLengthValue* length, ExceptionSt
ate& exceptionState) | 12 CSSPerspective* CSSPerspective::create(const CSSLengthValue* length, ExceptionSt
ate& exceptionState) |
| 12 { | 13 { |
| 13 if (length->containsPercent()) { | 14 if (length->containsPercent()) { |
| 14 exceptionState.throwTypeError("CSSPerspective does not support CSSLength
Values with percent units"); | 15 exceptionState.throwTypeError("CSSPerspective does not support CSSLength
Values with percent units"); |
| 15 return nullptr; | 16 return nullptr; |
| 16 } | 17 } |
| 17 return new CSSPerspective(length); | 18 return new CSSPerspective(length); |
| 18 } | 19 } |
| 19 | 20 |
| 20 CSSFunctionValue* CSSPerspective::toCSSValue() const | 21 CSSFunctionValue* CSSPerspective::toCSSValue() const |
| 21 { | 22 { |
| 22 CSSFunctionValue* result = CSSFunctionValue::create(CSSValuePerspective); | 23 CSSFunctionValue* result = CSSFunctionValue::create(CSSValuePerspective); |
| 23 result->append(*m_length->toCSSValue()); | 24 result->append(*m_length->toCSSValue()); |
| 24 return result; | 25 return result; |
| 25 } | 26 } |
| 26 | 27 |
| 28 } // namespace cssom |
| 27 } // namespace blink | 29 } // namespace blink |
| 30 |
| OLD | NEW |