Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Unified Diff: third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.h

Issue 2943303002: [CSS Typed OM] Refactor is2D handling in CSSTransformComponents to match new spec (Closed)
Patch Set: rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.h
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.h b/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.h
index 1a2800dc0747f99c39c9c052d8c06bce343eb4b8..ec92f97820ce8beaa8828a1f0ef9bb2984b7bc94 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.h
@@ -7,10 +7,11 @@
#include "core/css/cssom/CSSTransformComponent.h"
#include "core/geometry/DOMMatrix.h"
+#include "core/geometry/DOMMatrixReadOnly.h"
namespace blink {
-class DOMMatrix;
+class CSSMatrixComponentOptions;
// Represents a matrix value in a CSSTransformValue used for properties like
// "transform".
@@ -20,24 +21,24 @@ class CORE_EXPORT CSSMatrixComponent final : public CSSTransformComponent {
DEFINE_WRAPPERTYPEINFO();
public:
- // Constructor defined in the IDL.
- static CSSMatrixComponent* Create(DOMMatrixReadOnly*);
+ // Constructors defined in the IDL.
+ static CSSMatrixComponent* Create(DOMMatrixReadOnly*,
+ const CSSMatrixComponentOptions&);
// Blink-internal ways of creating CSSMatrixComponents.
static CSSMatrixComponent* FromCSSValue(const CSSFunctionValue& value) {
+ // TODO(meade): Implement.
return nullptr;
}
// Getters and setters for attributes defined in the IDL.
- DOMMatrix* matrix() const { return matrix_; }
+ DOMMatrix* matrix() { return matrix_.Get(); }
void setMatrix(DOMMatrix* matrix) { matrix_ = matrix; }
// Internal methods - from CSSTransformComponent.
- TransformComponentType GetType() const override {
- return is2d_ ? kMatrixType : kMatrix3DType;
- }
- DOMMatrix* AsMatrix() const override { return matrix(); }
- CSSFunctionValue* ToCSSValue() const override;
+ TransformComponentType GetType() const final { return kMatrixType; }
+ DOMMatrix* AsMatrix() const final;
+ CSSFunctionValue* ToCSSValue() const final;
DEFINE_INLINE_VIRTUAL_TRACE() {
visitor->Trace(matrix_);
@@ -45,10 +46,10 @@ class CORE_EXPORT CSSMatrixComponent final : public CSSTransformComponent {
}
private:
- CSSMatrixComponent(DOMMatrixReadOnly*);
+ CSSMatrixComponent(DOMMatrixReadOnly* matrix, bool is2D)
+ : CSSTransformComponent(is2D), matrix_(DOMMatrix::Create(matrix)) {}
Member<DOMMatrix> matrix_;
- bool is2d_;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/core_idl_files.gni ('k') | third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698