/* * Copyright (c) 2025, Sam Atkins * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace Web::CSS { // https://drafts.css-houdini.org/css-typed-om-1/#cssscale class CSSScale final : public CSSTransformComponent { WEB_PLATFORM_OBJECT(CSSScale, CSSTransformComponent); GC_DECLARE_ALLOCATOR(CSSScale); public: [[nodiscard]] static GC::Ref create(JS::Realm&, Is2D, GC::Ref x, GC::Ref y, GC::Ref z); static WebIDL::ExceptionOr> construct_impl(JS::Realm&, CSSNumberish x, CSSNumberish y, Optional z = {}); virtual ~CSSScale() override; virtual WebIDL::ExceptionOr to_string() const override; virtual WebIDL::ExceptionOr> to_matrix() const override; CSSNumberish x() const { return GC::Root { m_x }; } CSSNumberish y() const { return GC::Root { m_y }; } CSSNumberish z() const { return GC::Root { m_z }; } WebIDL::ExceptionOr set_x(CSSNumberish value); WebIDL::ExceptionOr set_y(CSSNumberish value); WebIDL::ExceptionOr set_z(CSSNumberish value); virtual WebIDL::ExceptionOr> create_style_value(PropertyNameAndID const&) const override; private: explicit CSSScale(JS::Realm&, Is2D, GC::Ref x, GC::Ref y, GC::Ref z); virtual void initialize(JS::Realm&) override; virtual void visit_edges(Visitor&) override; GC::Ref m_x; GC::Ref m_y; GC::Ref m_z; }; }