mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-04 08:36:12 +00:00
LibWeb: Add {,de}serialization steps for DOMPointReadonly
This commit is contained in:
parent
8d2f7cfb58
commit
bf4fb39bfb
Notes:
sideshowbarker
2024-07-16 23:34:49 +09:00
Author: https://github.com/kennethmyhra
Commit: bf4fb39bfb
Pull-request: https://github.com/SerenityOS/serenity/pull/23538
Reviewed-by: https://github.com/ADKaster
5 changed files with 59 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
|
||||
* Copyright (c) 2024, Kenneth Myhra <kennethmyhra@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -9,6 +10,7 @@
|
|||
|
||||
#include <LibGfx/Point.h>
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
#include <LibWeb/Bindings/Serializable.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
namespace Web::Geometry {
|
||||
|
@ -21,12 +23,15 @@ struct DOMPointInit {
|
|||
};
|
||||
|
||||
// https://drafts.fxtf.org/geometry/#dompointreadonly
|
||||
class DOMPointReadOnly : public Bindings::PlatformObject {
|
||||
class DOMPointReadOnly
|
||||
: public Bindings::PlatformObject
|
||||
, public Bindings::Serializable {
|
||||
WEB_PLATFORM_OBJECT(DOMPointReadOnly, Bindings::PlatformObject);
|
||||
JS_DECLARE_ALLOCATOR(DOMPointReadOnly);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<DOMPointReadOnly> construct_impl(JS::Realm&, double x = 0, double y = 0, double z = 0, double w = 1);
|
||||
static JS::NonnullGCPtr<DOMPointReadOnly> create(JS::Realm&);
|
||||
|
||||
static JS::NonnullGCPtr<DOMPointReadOnly> from_point(JS::VM&, DOMPointInit const&);
|
||||
|
||||
|
@ -39,8 +44,13 @@ public:
|
|||
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMPoint>> matrix_transform(DOMMatrixInit&) const;
|
||||
|
||||
virtual StringView interface_name() const override { return "DOMPointReadOnly"sv; }
|
||||
virtual WebIDL::ExceptionOr<void> serialization_steps(HTML::SerializationRecord&, bool for_storage) override;
|
||||
virtual WebIDL::ExceptionOr<void> deserialization_steps(ReadonlySpan<u32> const&, size_t& position) override;
|
||||
|
||||
protected:
|
||||
DOMPointReadOnly(JS::Realm&, double x, double y, double z, double w);
|
||||
explicit DOMPointReadOnly(JS::Realm&);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue