/* * Copyright (c) 2025, Sam Atkins * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include namespace Web::CSS { // https://drafts.css-houdini.org/css-typed-om-1/#dictdef-cssmatrixcomponentoptions struct CSSMatrixComponentOptions { Optional is2d; }; // https://drafts.css-houdini.org/css-typed-om-1/#cssmatrixcomponent class CSSMatrixComponent final : public CSSTransformComponent { WEB_PLATFORM_OBJECT(CSSMatrixComponent, CSSTransformComponent); GC_DECLARE_ALLOCATOR(CSSMatrixComponent); public: [[nodiscard]] static GC::Ref create(JS::Realm&, Is2D, GC::Ref); static WebIDL::ExceptionOr> construct_impl(JS::Realm&, GC::Ref, Optional = {}); virtual ~CSSMatrixComponent() override; virtual WebIDL::ExceptionOr to_string() const override; virtual WebIDL::ExceptionOr> to_matrix() const override; GC::Ref matrix() const { return m_matrix; } WebIDL::ExceptionOr set_matrix(GC::Ref matrix); virtual WebIDL::ExceptionOr> create_style_value(PropertyNameAndID const&) const override; private: explicit CSSMatrixComponent(JS::Realm&, Is2D, GC::Ref); virtual void initialize(JS::Realm&) override; virtual void visit_edges(Visitor&) override; GC::Ref m_matrix; }; }