1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 13:45:08 +00:00
serenity/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.h
Linus Groh 4f73851afc LibWeb: Move CallbackType from Bindings/ to WebIDL/
Let's stop putting generic types and AOs from the Web IDL spec into
the Bindings namespace and directory in LibWeb, and instead follow our
usual naming rules of 'directory = namespace = spec name'. The IDL
namespace is already used by LibIDL, so Web::WebIDL seems like a good
choice.
2022-09-24 19:31:39 +01:00

34 lines
835 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> create_with_global_object(HTML::Window&, WebIDL::CallbackType* callback);
virtual ~ResizeObserver() override;
void observe(DOM::Element& target, ResizeObserverOptions);
void unobserve(DOM::Element& target);
void disconnect();
private:
explicit ResizeObserver(HTML::Window&);
};
}