mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
f87041bf3a
Resulting in a massive rename across almost everywhere! Alongside the namespace change, we now have the following names: * JS::NonnullGCPtr -> GC::Ref * JS::GCPtr -> GC::Ptr * JS::HeapFunction -> GC::Function * JS::CellImpl -> GC::Cell * JS::Handle -> GC::Root
42 lines
1.2 KiB
C++
42 lines
1.2 KiB
C++
/*
|
|
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/Bindings/PlatformObject.h>
|
|
#include <LibWeb/Bindings/ResizeObserverPrototype.h>
|
|
|
|
namespace Web::ResizeObserver {
|
|
|
|
// https://drafts.csswg.org/resize-observer-1/#resizeobserversize
|
|
class ResizeObserverSize : public Bindings::PlatformObject {
|
|
WEB_PLATFORM_OBJECT(ResizeObserverSize, Bindings::PlatformObject);
|
|
GC_DECLARE_ALLOCATOR(ResizeObserverSize);
|
|
|
|
public:
|
|
static GC::Ref<ResizeObserverSize> calculate_box_size(JS::Realm& realm, DOM::Element& target, Bindings::ResizeObserverBoxOptions observed_box);
|
|
|
|
double inline_size() const { return m_inline_size; }
|
|
void set_inline_size(double inline_size) { m_inline_size = inline_size; }
|
|
|
|
double block_size() const { return m_block_size; }
|
|
void set_block_size(double block_size) { m_block_size = block_size; }
|
|
|
|
bool equals(ResizeObserverSize const& other) const;
|
|
|
|
private:
|
|
explicit ResizeObserverSize(JS::Realm& realm)
|
|
: PlatformObject(realm)
|
|
{
|
|
}
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
|
|
double m_inline_size { 0 };
|
|
double m_block_size { 0 };
|
|
};
|
|
|
|
}
|