mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +00:00

This patch moves the following things to being GC-allocated: - Bindings::CallbackType - HTML::EventHandler - DOM::IDLEventListener - DOM::DOMEventListener - DOM::NodeFilter Note that we only use PlatformObject for things that might be exposed to web content. Anything that is only used internally inherits directly from JS::Cell instead, making them a bit more lightweight.
34 lines
852 B
C++
34 lines
852 B
C++
/*
|
|
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/NonnullRefPtr.h>
|
|
#include <AK/RefCounted.h>
|
|
#include <LibWeb/Bindings/Wrappable.h>
|
|
#include <LibWeb/Forward.h>
|
|
|
|
namespace Web::ResizeObserver {
|
|
|
|
struct ResizeObserverOptions {
|
|
Bindings::ResizeObserverBoxOptions box;
|
|
};
|
|
|
|
// https://drafts.csswg.org/resize-observer/#resize-observer-interface
|
|
class ResizeObserver
|
|
: public RefCounted<ResizeObserver>
|
|
, public Bindings::Wrappable {
|
|
public:
|
|
using WrapperType = Bindings::ResizeObserverWrapper;
|
|
|
|
static NonnullRefPtr<ResizeObserver> create_with_global_object(JS::GlobalObject&, Bindings::CallbackType* callback);
|
|
|
|
void observe(DOM::Element& target, ResizeObserverOptions);
|
|
void unobserve(DOM::Element& target);
|
|
void disconnect();
|
|
};
|
|
|
|
}
|