mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 18:27:39 +00:00
LibWeb: Stub out a basic ResizeObserver interface
This patch establishes scaffolding for the ResizeObserver API.
This commit is contained in:
parent
5c9ca5c2dc
commit
fdc1c15064
7 changed files with 121 additions and 1 deletions
33
Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.h
Normal file
33
Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* 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>
|
||||
|
||||
namespace Web::ResizeObserver {
|
||||
|
||||
struct ResizeObserverOptions {
|
||||
String 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&, JS::Value callback);
|
||||
|
||||
void observe(DOM::Element& target, ResizeObserverOptions);
|
||||
void unobserve(DOM::Element& target);
|
||||
void disconnect();
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue