ladybird/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.h
Andrew Kaster 4bb6345b2f LibWeb: Remove unecessary dependence on Window from assorted classes
These classes only needed Window to get at its realm. Pass a realm
directly to construct Crypto, Encoding, HRT, IntersectionObserver,
NavigationTiming, Page, RequestIdleCallback, Selection, Streams, URL,
and XML classes.
2022-10-01 21:05:32 +01:00

34 lines
818 B
C++

/*
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Bindings/PlatformObject.h>
namespace Web::ResizeObserver {
struct ResizeObserverOptions {
Bindings::ResizeObserverBoxOptions box;
};
// https://drafts.csswg.org/resize-observer/#resize-observer-interface
class ResizeObserver : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(ResizeObserver, Bindings::PlatformObject);
public:
static JS::NonnullGCPtr<ResizeObserver> construct_impl(JS::Realm&, WebIDL::CallbackType* callback);
virtual ~ResizeObserver() override;
void observe(DOM::Element& target, ResizeObserverOptions);
void unobserve(DOM::Element& target);
void disconnect();
private:
explicit ResizeObserver(JS::Realm&);
};
}