/* * 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/#cssrotate class CSSRotate final : public CSSTransformComponent { WEB_PLATFORM_OBJECT(CSSRotate, CSSTransformComponent); GC_DECLARE_ALLOCATOR(CSSRotate); public: [[nodiscard]] static GC::Ref create(JS::Realm&, Is2D, GC::Ref x, GC::Ref y, GC::Ref z, GC::Ref angle); static WebIDL::ExceptionOr> construct_impl(JS::Realm&, GC::Ref angle); static WebIDL::ExceptionOr> construct_impl(JS::Realm&, CSSNumberish x, CSSNumberish y, CSSNumberish z, GC::Ref angle); virtual ~CSSRotate() 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 }; } GC::Ref angle() const { return m_angle; } WebIDL::ExceptionOr set_x(CSSNumberish value); WebIDL::ExceptionOr set_y(CSSNumberish value); WebIDL::ExceptionOr set_z(CSSNumberish value); WebIDL::ExceptionOr set_angle(GC::Ref value); private: explicit CSSRotate(JS::Realm&, Is2D, GC::Ref x, GC::Ref y, GC::Ref z, GC::Ref angle); virtual void initialize(JS::Realm&) override; virtual void visit_edges(Visitor&) override; GC::Ref m_x; GC::Ref m_y; GC::Ref m_z; GC::Ref m_angle; }; }