| 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 #ifndef CSSTranslation_h | 5 #ifndef CSSTranslation_h |
| 6 #define CSSTranslation_h | 6 #define CSSTranslation_h |
| 7 | 7 |
| 8 #include "core/css/CSSPrimitiveValue.h" | 8 #include "core/css/CSSPrimitiveValue.h" |
| 9 #include "core/css/cssom/CSSStyleValue.h" | 9 #include "core/css/cssom/CSSStyleValue.h" |
| 10 #include "core/css/cssom/CSSTransformComponent.h" | 10 #include "core/css/cssom/CSSTransformComponent.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // Constructors defined in the IDL. | 27 // Constructors defined in the IDL. |
| 28 static CSSTranslation* Create(CSSNumericValue* x, | 28 static CSSTranslation* Create(CSSNumericValue* x, |
| 29 CSSNumericValue* y, | 29 CSSNumericValue* y, |
| 30 CSSNumericValue* z, | 30 CSSNumericValue* z, |
| 31 ExceptionState&); | 31 ExceptionState&); |
| 32 static CSSTranslation* Create(CSSNumericValue* x, | 32 static CSSTranslation* Create(CSSNumericValue* x, |
| 33 CSSNumericValue* y, | 33 CSSNumericValue* y, |
| 34 ExceptionState&); | 34 ExceptionState&); |
| 35 | 35 |
| 36 // Blink-internal ways of creating CSSTranslations. | 36 // Blink-internal ways of creating CSSTranslations. |
| 37 static CSSTranslation* FromCSSValue(const CSSFunctionValue& value) { | 37 static CSSTranslation* Create(CSSNumericValue* x, CSSNumericValue* y); |
| 38 return nullptr; | 38 static CSSTranslation* Create(CSSNumericValue* x, |
| 39 } | 39 CSSNumericValue* y, |
| 40 CSSNumericValue* z); |
| 41 static CSSTranslation* FromCSSValue(const CSSFunctionValue&); |
| 40 | 42 |
| 41 // Getters and setters for attributes defined in the IDL. | 43 // Getters and setters for attributes defined in the IDL. |
| 42 CSSNumericValue* x() const { return x_; } | 44 CSSNumericValue* x() const { return x_; } |
| 43 CSSNumericValue* y() const { return y_; } | 45 CSSNumericValue* y() const { return y_; } |
| 44 CSSNumericValue* z() const { return z_; } | 46 CSSNumericValue* z() const { return z_; } |
| 45 void setX(CSSNumericValue* x, ExceptionState&); | 47 void setX(CSSNumericValue* x, ExceptionState&); |
| 46 void setY(CSSNumericValue* y, ExceptionState&); | 48 void setY(CSSNumericValue* y, ExceptionState&); |
| 47 void setZ(CSSNumericValue* z, ExceptionState&); | 49 void setZ(CSSNumericValue* z, ExceptionState&); |
| 48 | 50 |
| 49 // Internal methods - from CSSTransformComponent. | 51 // Internal methods - from CSSTransformComponent. |
| 50 TransformComponentType GetType() const final { return kTranslationType; } | 52 TransformComponentType GetType() const final { return kTranslationType; } |
| 51 // TODO: Implement AsMatrix for CSSTranslation. | 53 DOMMatrix* AsMatrix() const final; |
| 52 DOMMatrix* AsMatrix() const final { return nullptr; } | |
| 53 CSSFunctionValue* ToCSSValue() const final; | 54 CSSFunctionValue* ToCSSValue() const final; |
| 54 | 55 |
| 55 DEFINE_INLINE_VIRTUAL_TRACE() { | 56 DEFINE_INLINE_VIRTUAL_TRACE() { |
| 56 visitor->Trace(x_); | 57 visitor->Trace(x_); |
| 57 visitor->Trace(y_); | 58 visitor->Trace(y_); |
| 58 visitor->Trace(z_); | 59 visitor->Trace(z_); |
| 59 CSSTransformComponent::Trace(visitor); | 60 CSSTransformComponent::Trace(visitor); |
| 60 } | 61 } |
| 61 | 62 |
| 62 private: | 63 private: |
| 63 CSSTranslation(CSSNumericValue* x, | 64 CSSTranslation(CSSNumericValue* x, |
| 64 CSSNumericValue* y, | 65 CSSNumericValue* y, |
| 65 CSSNumericValue* z, | 66 CSSNumericValue* z, |
| 66 bool is2D) | 67 bool is2D) |
| 67 : CSSTransformComponent(is2D), x_(x), y_(y), z_(z) {} | 68 : CSSTransformComponent(is2D), x_(x), y_(y), z_(z) {} |
| 68 | 69 |
| 69 Member<CSSNumericValue> x_; | 70 Member<CSSNumericValue> x_; |
| 70 Member<CSSNumericValue> y_; | 71 Member<CSSNumericValue> y_; |
| 71 Member<CSSNumericValue> z_; | 72 Member<CSSNumericValue> z_; |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 } // namespace blink | 75 } // namespace blink |
| 75 | 76 |
| 76 #endif | 77 #endif |
| OLD | NEW |