/* * 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/#csstranslate class CSSTranslate final : public CSSTransformComponent { WEB_PLATFORM_OBJECT(CSSTranslate, CSSTransformComponent); GC_DECLARE_ALLOCATOR(CSSTranslate); 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&, GC::Ref x, GC::Ref y, GC::Ptr z = {}); virtual ~CSSTranslate() override; virtual WebIDL::ExceptionOr to_string() const override; virtual WebIDL::ExceptionOr> to_matrix() const override; GC::Ref x() const { return m_x; } GC::Ref y() const { return m_y; } GC::Ref z() const { return m_z; } WebIDL::ExceptionOr set_x(GC::Ref value); WebIDL::ExceptionOr set_y(GC::Ref value); WebIDL::ExceptionOr set_z(GC::Ref value); private: explicit CSSTranslate(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; }; }