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

This is a monster patch that turns all EventTargets into GC-allocated PlatformObjects. Their C++ wrapper classes are removed, and the LibJS garbage collector is now responsible for their lifetimes. There's a fair amount of hacks and band-aids in this patch, and we'll have a lot of cleanup to do after this.
34 lines
848 B
C++
34 lines
848 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(HTML::Window&, Bindings::CallbackType* callback);
|
|
|
|
void observe(DOM::Element& target, ResizeObserverOptions);
|
|
void unobserve(DOM::Element& target);
|
|
void disconnect();
|
|
};
|
|
|
|
}
|