mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-23 19:15:55 +00:00
LibWeb: Add calls to JS_{DECLARE,DEFINE}_ALLOCATOR()
This commit is contained in:
parent
d62c0fcbdc
commit
31341b280a
|
@ -14,6 +14,8 @@
|
|||
|
||||
namespace Web::Bindings {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(AudioConstructor);
|
||||
|
||||
AudioConstructor::AudioConstructor(JS::Realm& realm)
|
||||
: NativeFunction(realm.intrinsics().function_prototype())
|
||||
{
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
namespace Web::Bindings {
|
||||
|
||||
class AudioConstructor final : public JS::NativeFunction {
|
||||
JS_OBJECT(AudioConstructor, JS::NativeFunction);
|
||||
JS_DECLARE_ALLOCATOR(AudioConstructor);
|
||||
|
||||
public:
|
||||
explicit AudioConstructor(JS::Realm&);
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
@ -22,7 +25,6 @@ public:
|
|||
|
||||
private:
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
virtual StringView class_name() const override { return "AudioConstructor"sv; }
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
|
||||
namespace Web::Bindings {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(ImageConstructor);
|
||||
|
||||
ImageConstructor::ImageConstructor(JS::Realm& realm)
|
||||
: NativeFunction(realm.intrinsics().function_prototype())
|
||||
{
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
namespace Web::Bindings {
|
||||
|
||||
class ImageConstructor final : public JS::NativeFunction {
|
||||
JS_OBJECT(ImageConstructor, JS::NativeFunction);
|
||||
JS_DECLARE_ALLOCATOR(ImageConstructor);
|
||||
|
||||
public:
|
||||
explicit ImageConstructor(JS::Realm&);
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
@ -22,7 +25,6 @@ public:
|
|||
|
||||
private:
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
virtual StringView class_name() const override { return "ImageConstructor"sv; }
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
namespace Web::Bindings {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(OptionConstructor);
|
||||
|
||||
OptionConstructor::OptionConstructor(JS::Realm& realm)
|
||||
: NativeFunction(realm.intrinsics().function_prototype())
|
||||
{
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
namespace Web::Bindings {
|
||||
|
||||
class OptionConstructor final : public JS::NativeFunction {
|
||||
JS_OBJECT(OptionConstructor, JS::NativeFunction);
|
||||
JS_DECLARE_ALLOCATOR(OptionConstructor);
|
||||
|
||||
public:
|
||||
explicit OptionConstructor(JS::Realm&);
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
@ -22,7 +25,6 @@ public:
|
|||
|
||||
private:
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
virtual StringView class_name() const override { return "OptionConstructor"sv; }
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
|
||||
namespace Web::CSS {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(AnimationEvent);
|
||||
|
||||
JS::NonnullGCPtr<AnimationEvent> AnimationEvent::create(JS::Realm& realm, FlyString const& type, AnimationEventInit const& event_init)
|
||||
{
|
||||
return realm.heap().allocate<AnimationEvent>(realm, realm, type, event_init);
|
||||
|
|
|
@ -21,6 +21,7 @@ struct AnimationEventInit : public DOM::EventInit {
|
|||
// https://www.w3.org/TR/css-animations-1/#animationevent
|
||||
class AnimationEvent : public DOM::Event {
|
||||
WEB_PLATFORM_OBJECT(AnimationEvent, DOM::Event);
|
||||
JS_DECLARE_ALLOCATOR(AnimationEvent);
|
||||
|
||||
public:
|
||||
[[nodiscard]] static JS::NonnullGCPtr<AnimationEvent> create(JS::Realm&, FlyString const& type, AnimationEventInit const& event_init = {});
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
namespace Web::CSS {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(CSSAnimation);
|
||||
|
||||
JS::NonnullGCPtr<CSSAnimation> CSSAnimation::create(JS::Realm& realm)
|
||||
{
|
||||
return realm.heap().allocate<CSSAnimation>(realm, realm);
|
||||
|
|
|
@ -15,6 +15,7 @@ namespace Web::CSS {
|
|||
// https://www.w3.org/TR/css-animations-2/#cssanimation
|
||||
class CSSAnimation : public Animations::Animation {
|
||||
WEB_PLATFORM_OBJECT(CSSAnimation, Animations::Animation);
|
||||
JS_DECLARE_ALLOCATOR(CSSAnimation);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<CSSAnimation> create(JS::Realm&);
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
namespace Web::CSS {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(CSSTransition);
|
||||
|
||||
JS::NonnullGCPtr<CSSTransition> CSSTransition::create(JS::Realm& realm, PropertyID property_id, size_t transition_generation)
|
||||
{
|
||||
return realm.heap().allocate<CSSTransition>(realm, realm, property_id, transition_generation);
|
||||
|
|
|
@ -16,6 +16,7 @@ namespace Web::CSS {
|
|||
|
||||
class CSSTransition : public Animations::Animation {
|
||||
WEB_PLATFORM_OBJECT(CSSTransition, Animations::Animation);
|
||||
JS_DECLARE_ALLOCATOR(CSSTransition);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<CSSTransition> create(JS::Realm&, PropertyID, size_t transition_generation);
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
|
||||
namespace Web::DOM {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(EventTarget);
|
||||
|
||||
EventTarget::EventTarget(JS::Realm& realm, MayInterfereWithIndexedPropertyAccess may_interfere_with_indexed_property_access)
|
||||
: PlatformObject(realm, may_interfere_with_indexed_property_access)
|
||||
{
|
||||
|
|
|
@ -19,6 +19,7 @@ namespace Web::DOM {
|
|||
|
||||
class EventTarget : public Bindings::PlatformObject {
|
||||
WEB_PLATFORM_OBJECT(EventTarget, Bindings::PlatformObject);
|
||||
JS_DECLARE_ALLOCATOR(EventTarget);
|
||||
|
||||
public:
|
||||
virtual ~EventTarget() override;
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
namespace Web::DOM {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(IDLEventListener);
|
||||
|
||||
JS::NonnullGCPtr<IDLEventListener> IDLEventListener::create(JS::Realm& realm, JS::NonnullGCPtr<WebIDL::CallbackType> callback)
|
||||
{
|
||||
return realm.heap().allocate<IDLEventListener>(realm, realm, move(callback));
|
||||
|
|
|
@ -26,6 +26,7 @@ struct AddEventListenerOptions : public EventListenerOptions {
|
|||
|
||||
class IDLEventListener final : public JS::Object {
|
||||
JS_OBJECT(IDLEventListener, JS::Object);
|
||||
JS_DECLARE_ALLOCATOR(IDLEventListener);
|
||||
|
||||
public:
|
||||
[[nodiscard]] static JS::NonnullGCPtr<IDLEventListener> create(JS::Realm&, JS::NonnullGCPtr<WebIDL::CallbackType>);
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
namespace Web::DOM {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(MutationObserver);
|
||||
JS_DEFINE_ALLOCATOR(TransientRegisteredObserver);
|
||||
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<MutationObserver>> MutationObserver::construct_impl(JS::Realm& realm, JS::GCPtr<WebIDL::CallbackType> callback)
|
||||
{
|
||||
|
|
|
@ -93,6 +93,7 @@ private:
|
|||
// https://dom.spec.whatwg.org/#transient-registered-observer
|
||||
class TransientRegisteredObserver final : public RegisteredObserver {
|
||||
JS_CELL(TransientRegisteredObserver, RegisteredObserver);
|
||||
JS_DECLARE_ALLOCATOR(TransientRegisteredObserver);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<TransientRegisteredObserver> create(MutationObserver&, MutationObserverInit const&, RegisteredObserver& source);
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
|
||||
namespace Web::DOM {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(ParentNode);
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-parentnode-queryselector
|
||||
WebIDL::ExceptionOr<JS::GCPtr<Element>> ParentNode::query_selector(StringView selector_text)
|
||||
{
|
||||
|
|
|
@ -12,6 +12,7 @@ namespace Web::DOM {
|
|||
|
||||
class ParentNode : public Node {
|
||||
WEB_PLATFORM_OBJECT(ParentNode, Node);
|
||||
JS_DECLARE_ALLOCATOR(ParentNode);
|
||||
|
||||
public:
|
||||
template<typename F>
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
namespace Web::Fetch::Infrastructure {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(FetchTimingInfo);
|
||||
|
||||
FetchTimingInfo::FetchTimingInfo() = default;
|
||||
|
||||
JS::NonnullGCPtr<FetchTimingInfo> FetchTimingInfo::create(JS::VM& vm)
|
||||
|
|
|
@ -19,6 +19,7 @@ namespace Web::Fetch::Infrastructure {
|
|||
// https://fetch.spec.whatwg.org/#fetch-timing-info
|
||||
class FetchTimingInfo : public JS::Cell {
|
||||
JS_CELL(FetchTimingInfo, JS::Cell);
|
||||
JS_DECLARE_ALLOCATOR(FetchTimingInfo);
|
||||
|
||||
public:
|
||||
[[nodiscard]] static JS::NonnullGCPtr<FetchTimingInfo> create(JS::VM&);
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
|
||||
namespace Web::Fetch::Infrastructure {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(HeaderList);
|
||||
|
||||
template<typename T>
|
||||
requires(IsSameIgnoringCV<T, u8>) struct CaseInsensitiveBytesTraits : public Traits<Span<T>> {
|
||||
static constexpr bool equals(Span<T> const& a, Span<T> const& b)
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
#include <LibJS/Heap/GCPtr.h>
|
||||
#include <LibJS/Heap/Heap.h>
|
||||
#include <LibWeb/MimeSniff/MimeType.h>
|
||||
|
||||
namespace Web::Fetch::Infrastructure {
|
||||
|
@ -35,6 +35,7 @@ class HeaderList final
|
|||
: public JS::Cell
|
||||
, Vector<Header> {
|
||||
JS_CELL(HeaderList, JS::Cell);
|
||||
JS_DECLARE_ALLOCATOR(HeaderList);
|
||||
|
||||
public:
|
||||
using Vector::begin;
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
|
||||
namespace Web::Geometry {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(DOMMatrixReadOnly);
|
||||
|
||||
// https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-dommatrixreadonly
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMMatrixReadOnly>> DOMMatrixReadOnly::construct_impl(JS::Realm& realm, Optional<Variant<String, Vector<double>>> const& init)
|
||||
{
|
||||
|
|
|
@ -52,6 +52,7 @@ class DOMMatrixReadOnly
|
|||
: public Bindings::PlatformObject
|
||||
, public Bindings::Serializable {
|
||||
WEB_PLATFORM_OBJECT(DOMMatrixReadOnly, Bindings::PlatformObject);
|
||||
JS_DECLARE_ALLOCATOR(DOMMatrixReadOnly);
|
||||
|
||||
public:
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMMatrixReadOnly>> construct_impl(JS::Realm&, Optional<Variant<String, Vector<double>>> const& init);
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
|
||||
namespace Web::HTML {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(EventLoop);
|
||||
|
||||
EventLoop::EventLoop()
|
||||
{
|
||||
m_task_queue = heap().allocate_without_realm<TaskQueue>(*this);
|
||||
|
|
|
@ -17,6 +17,7 @@ namespace Web::HTML {
|
|||
|
||||
class EventLoop : public JS::Cell {
|
||||
JS_CELL(EventLoop, Cell);
|
||||
JS_DECLARE_ALLOCATOR(EventLoop);
|
||||
|
||||
public:
|
||||
enum class Type {
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
namespace Web::HTML {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(TaskQueue);
|
||||
|
||||
TaskQueue::TaskQueue(HTML::EventLoop& event_loop)
|
||||
: m_event_loop(event_loop)
|
||||
{
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace Web::HTML {
|
|||
|
||||
class TaskQueue : public JS::Cell {
|
||||
JS_CELL(TaskQueue, Cell);
|
||||
JS_DECLARE_ALLOCATOR(TaskQueue);
|
||||
|
||||
public:
|
||||
explicit TaskQueue(HTML::EventLoop&);
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
namespace Web::HTML {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(Navigation);
|
||||
JS_DEFINE_ALLOCATOR(NavigationAPIMethodTracker);
|
||||
|
||||
static NavigationResult navigation_api_method_tracker_derived_result(JS::NonnullGCPtr<NavigationAPIMethodTracker> api_method_tracker);
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ struct NavigationResult {
|
|||
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#navigation-api-method-tracker
|
||||
struct NavigationAPIMethodTracker final : public JS::Cell {
|
||||
JS_CELL(NavigationAPIMethodTracker, JS::Cell);
|
||||
JS_DECLARE_ALLOCATOR(NavigationAPIMethodTracker);
|
||||
|
||||
NavigationAPIMethodTracker(JS::NonnullGCPtr<Navigation> navigation,
|
||||
Optional<String> key,
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
|
||||
namespace Web::HTML {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(FetchContext);
|
||||
|
||||
OnFetchScriptComplete create_on_fetch_script_complete(JS::Heap& heap, Function<void(JS::GCPtr<Script>)> function)
|
||||
{
|
||||
return JS::create_heap_function(heap, move(function));
|
||||
|
|
|
@ -56,6 +56,7 @@ ScriptFetchOptions default_classic_script_fetch_options();
|
|||
|
||||
class FetchContext : public JS::GraphLoadingState::HostDefined {
|
||||
JS_CELL(FetchContext, JS::GraphLoadingState::HostDefined);
|
||||
JS_DECLARE_ALLOCATOR(FetchContext);
|
||||
|
||||
public:
|
||||
JS::Value parse_error; // [[ParseError]]
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(AudioBox);
|
||||
|
||||
AudioBox::AudioBox(DOM::Document& document, DOM::Element& element, NonnullRefPtr<CSS::StyleProperties> style)
|
||||
: ReplacedBox(document, element, move(style))
|
||||
{
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace Web::Layout {
|
|||
|
||||
class AudioBox final : public ReplacedBox {
|
||||
JS_CELL(AudioBox, ReplacedBox);
|
||||
JS_DECLARE_ALLOCATOR(AudioBox);
|
||||
|
||||
public:
|
||||
HTML::HTMLAudioElement& dom_node();
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(BreakNode);
|
||||
|
||||
BreakNode::BreakNode(DOM::Document& document, HTML::HTMLBRElement& element, NonnullRefPtr<CSS::StyleProperties> style)
|
||||
: Layout::NodeWithStyleAndBoxModelMetrics(document, &element, move(style))
|
||||
{
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Layout {
|
|||
|
||||
class BreakNode final : public NodeWithStyleAndBoxModelMetrics {
|
||||
JS_CELL(BreakNode, NodeWithStyleAndBoxModelMetrics);
|
||||
JS_DECLARE_ALLOCATOR(BreakNode);
|
||||
|
||||
public:
|
||||
BreakNode(DOM::Document&, HTML::HTMLBRElement&, NonnullRefPtr<CSS::StyleProperties>);
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(ButtonBox);
|
||||
|
||||
ButtonBox::ButtonBox(DOM::Document& document, HTML::HTMLInputElement& element, NonnullRefPtr<CSS::StyleProperties> style)
|
||||
: FormAssociatedLabelableNode(document, element, move(style))
|
||||
{
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Layout {
|
|||
|
||||
class ButtonBox final : public FormAssociatedLabelableNode {
|
||||
JS_CELL(ButtonBox, FormAssociatedLabelableNode);
|
||||
JS_DECLARE_ALLOCATOR(ButtonBox);
|
||||
|
||||
public:
|
||||
ButtonBox(DOM::Document&, HTML::HTMLInputElement&, NonnullRefPtr<CSS::StyleProperties>);
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(CanvasBox);
|
||||
|
||||
CanvasBox::CanvasBox(DOM::Document& document, HTML::HTMLCanvasElement& element, NonnullRefPtr<CSS::StyleProperties> style)
|
||||
: ReplacedBox(document, element, move(style))
|
||||
{
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Layout {
|
|||
|
||||
class CanvasBox final : public ReplacedBox {
|
||||
JS_CELL(CanvasBox, ReplacedBox);
|
||||
JS_DECLARE_ALLOCATOR(CanvasBox);
|
||||
|
||||
public:
|
||||
CanvasBox(DOM::Document&, HTML::HTMLCanvasElement&, NonnullRefPtr<CSS::StyleProperties>);
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(CheckBox);
|
||||
|
||||
CheckBox::CheckBox(DOM::Document& document, HTML::HTMLInputElement& element, NonnullRefPtr<CSS::StyleProperties> style)
|
||||
: FormAssociatedLabelableNode(document, element, move(style))
|
||||
{
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Layout {
|
|||
|
||||
class CheckBox final : public FormAssociatedLabelableNode {
|
||||
JS_CELL(CheckBox, FormAssociatedLabelableNode);
|
||||
JS_DECLARE_ALLOCATOR(CheckBox);
|
||||
|
||||
public:
|
||||
CheckBox(DOM::Document&, HTML::HTMLInputElement&, NonnullRefPtr<CSS::StyleProperties>);
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(FrameBox);
|
||||
|
||||
FrameBox::FrameBox(DOM::Document& document, DOM::Element& element, NonnullRefPtr<CSS::StyleProperties> style)
|
||||
: ReplacedBox(document, element, move(style))
|
||||
{
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Layout {
|
|||
|
||||
class FrameBox final : public ReplacedBox {
|
||||
JS_CELL(FrameBox, ReplacedBox);
|
||||
JS_DECLARE_ALLOCATOR(FrameBox);
|
||||
|
||||
public:
|
||||
FrameBox(DOM::Document&, DOM::Element&, NonnullRefPtr<CSS::StyleProperties>);
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(ImageBox);
|
||||
|
||||
ImageBox::ImageBox(DOM::Document& document, DOM::Element& element, NonnullRefPtr<CSS::StyleProperties> style, ImageProvider const& image_provider)
|
||||
: ReplacedBox(document, element, move(style))
|
||||
, m_image_provider(image_provider)
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Layout {
|
|||
|
||||
class ImageBox final : public ReplacedBox {
|
||||
JS_CELL(ImageBox, ReplacedBox);
|
||||
JS_DECLARE_ALLOCATOR(ImageBox);
|
||||
|
||||
public:
|
||||
ImageBox(DOM::Document&, DOM::Element&, NonnullRefPtr<CSS::StyleProperties>, ImageProvider const&);
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(InlineNode);
|
||||
|
||||
InlineNode::InlineNode(DOM::Document& document, DOM::Element* element, NonnullRefPtr<CSS::StyleProperties> style)
|
||||
: Layout::NodeWithStyleAndBoxModelMetrics(document, element, move(style))
|
||||
{
|
||||
|
|
|
@ -12,6 +12,7 @@ namespace Web::Layout {
|
|||
|
||||
class InlineNode final : public NodeWithStyleAndBoxModelMetrics {
|
||||
JS_CELL(InlineNode, NodeWithStyleAndBoxModelMetrics);
|
||||
JS_DECLARE_ALLOCATOR(InlineNode);
|
||||
|
||||
public:
|
||||
InlineNode(DOM::Document&, DOM::Element*, NonnullRefPtr<CSS::StyleProperties>);
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(Label);
|
||||
|
||||
Label::Label(DOM::Document& document, HTML::HTMLLabelElement* element, NonnullRefPtr<CSS::StyleProperties> style)
|
||||
: BlockContainer(document, element, move(style))
|
||||
{
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Layout {
|
|||
|
||||
class Label final : public BlockContainer {
|
||||
JS_CELL(Label, BlockContainer);
|
||||
JS_DECLARE_ALLOCATOR(Label);
|
||||
|
||||
public:
|
||||
Label(DOM::Document&, HTML::HTMLLabelElement*, NonnullRefPtr<CSS::StyleProperties>);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(ListItemBox);
|
||||
|
||||
ListItemBox::ListItemBox(DOM::Document& document, DOM::Element* element, NonnullRefPtr<CSS::StyleProperties> style)
|
||||
: Layout::BlockContainer(document, element, move(style))
|
||||
{
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Layout {
|
|||
|
||||
class ListItemBox final : public BlockContainer {
|
||||
JS_CELL(ListItemBox, BlockContainer);
|
||||
JS_DECLARE_ALLOCATOR(ListItemBox);
|
||||
|
||||
public:
|
||||
ListItemBox(DOM::Document&, DOM::Element*, NonnullRefPtr<CSS::StyleProperties>);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(ListItemMarkerBox);
|
||||
|
||||
ListItemMarkerBox::ListItemMarkerBox(DOM::Document& document, CSS::ListStyleType style_type, CSS::ListStylePosition style_position, size_t index, NonnullRefPtr<CSS::StyleProperties> style)
|
||||
: Box(document, nullptr, move(style))
|
||||
, m_list_style_type(style_type)
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Layout {
|
|||
|
||||
class ListItemMarkerBox final : public Box {
|
||||
JS_CELL(ListItemMarkerBox, Box);
|
||||
JS_DECLARE_ALLOCATOR(ListItemMarkerBox);
|
||||
|
||||
public:
|
||||
explicit ListItemMarkerBox(DOM::Document&, CSS::ListStyleType, CSS::ListStylePosition, size_t index, NonnullRefPtr<CSS::StyleProperties>);
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(RadioButton);
|
||||
|
||||
RadioButton::RadioButton(DOM::Document& document, HTML::HTMLInputElement& element, NonnullRefPtr<CSS::StyleProperties> style)
|
||||
: FormAssociatedLabelableNode(document, element, move(style))
|
||||
{
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Layout {
|
|||
|
||||
class RadioButton final : public FormAssociatedLabelableNode {
|
||||
JS_CELL(RadioButton, FormAssociatedLabelableNode);
|
||||
JS_DECLARE_ALLOCATOR(RadioButton);
|
||||
|
||||
public:
|
||||
RadioButton(DOM::Document&, HTML::HTMLInputElement&, NonnullRefPtr<CSS::StyleProperties>);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(SVGClipBox);
|
||||
|
||||
SVGClipBox::SVGClipBox(DOM::Document& document, SVG::SVGClipPathElement& element, NonnullRefPtr<CSS::StyleProperties> properties)
|
||||
: SVGBox(document, element, properties)
|
||||
{
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace Web::Layout {
|
|||
|
||||
class SVGClipBox : public SVGBox {
|
||||
JS_CELL(SVGClipBox, SVGBox);
|
||||
JS_DECLARE_ALLOCATOR(SVGClipBox);
|
||||
|
||||
public:
|
||||
SVGClipBox(DOM::Document&, SVG::SVGClipPathElement&, NonnullRefPtr<CSS::StyleProperties>);
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(SVGGeometryBox);
|
||||
|
||||
SVGGeometryBox::SVGGeometryBox(DOM::Document& document, SVG::SVGGeometryElement& element, NonnullRefPtr<CSS::StyleProperties> properties)
|
||||
: SVGGraphicsBox(document, element, properties)
|
||||
{
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace Web::Layout {
|
|||
|
||||
class SVGGeometryBox final : public SVGGraphicsBox {
|
||||
JS_CELL(SVGGeometryBox, SVGGraphicsBox);
|
||||
JS_DECLARE_ALLOCATOR(SVGGeometryBox);
|
||||
|
||||
public:
|
||||
SVGGeometryBox(DOM::Document&, SVG::SVGGeometryElement&, NonnullRefPtr<CSS::StyleProperties>);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(SVGMaskBox);
|
||||
|
||||
SVGMaskBox::SVGMaskBox(DOM::Document& document, SVG::SVGMaskElement& element, NonnullRefPtr<CSS::StyleProperties> properties)
|
||||
: SVGGraphicsBox(document, element, properties)
|
||||
{
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace Web::Layout {
|
|||
|
||||
class SVGMaskBox : public SVGGraphicsBox {
|
||||
JS_CELL(SVGMaskBox, SVGBox);
|
||||
JS_DECLARE_ALLOCATOR(SVGMaskBox);
|
||||
|
||||
public:
|
||||
SVGMaskBox(DOM::Document&, SVG::SVGMaskElement&, NonnullRefPtr<CSS::StyleProperties>);
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(SVGSVGBox);
|
||||
|
||||
SVGSVGBox::SVGSVGBox(DOM::Document& document, SVG::SVGSVGElement& element, NonnullRefPtr<CSS::StyleProperties> properties)
|
||||
: ReplacedBox(document, element, move(properties))
|
||||
{
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Layout {
|
|||
|
||||
class SVGSVGBox final : public ReplacedBox {
|
||||
JS_CELL(SVGSVGBox, ReplacedBox);
|
||||
JS_DECLARE_ALLOCATOR(SVGSVGBox);
|
||||
|
||||
public:
|
||||
SVGSVGBox(DOM::Document&, SVG::SVGSVGElement&, NonnullRefPtr<CSS::StyleProperties>);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(SVGTextBox);
|
||||
|
||||
SVGTextBox::SVGTextBox(DOM::Document& document, SVG::SVGTextPositioningElement& element, NonnullRefPtr<CSS::StyleProperties> properties)
|
||||
: SVGGraphicsBox(document, element, properties)
|
||||
{
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace Web::Layout {
|
|||
|
||||
class SVGTextBox final : public SVGGraphicsBox {
|
||||
JS_CELL(SVGTextBox, SVGGraphicsBox);
|
||||
JS_DECLARE_ALLOCATOR(SVGTextBox);
|
||||
|
||||
public:
|
||||
SVGTextBox(DOM::Document&, SVG::SVGTextPositioningElement&, NonnullRefPtr<CSS::StyleProperties>);
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(SVGTextPathBox);
|
||||
|
||||
SVGTextPathBox::SVGTextPathBox(DOM::Document& document, SVG::SVGTextPathElement& element, NonnullRefPtr<CSS::StyleProperties> properties)
|
||||
: SVGGraphicsBox(document, element, properties)
|
||||
{
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Layout {
|
|||
|
||||
class SVGTextPathBox final : public SVGGraphicsBox {
|
||||
JS_CELL(SVGTextPathBox, SVGGraphicsBox);
|
||||
JS_DECLARE_ALLOCATOR(SVGTextPathBox);
|
||||
|
||||
public:
|
||||
SVGTextPathBox(DOM::Document&, SVG::SVGTextPathElement&, NonnullRefPtr<CSS::StyleProperties>);
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(TableWrapper);
|
||||
|
||||
TableWrapper::TableWrapper(DOM::Document& document, DOM::Node* node, NonnullRefPtr<CSS::StyleProperties> style)
|
||||
: BlockContainer(document, node, move(style))
|
||||
{
|
||||
|
|
|
@ -12,6 +12,7 @@ namespace Web::Layout {
|
|||
|
||||
class TableWrapper : public BlockContainer {
|
||||
JS_CELL(TableWrapper, BlockContainer);
|
||||
JS_DECLARE_ALLOCATOR(TableWrapper);
|
||||
|
||||
public:
|
||||
TableWrapper(DOM::Document&, DOM::Node*, NonnullRefPtr<CSS::StyleProperties>);
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(TextNode);
|
||||
|
||||
TextNode::TextNode(DOM::Document& document, DOM::Text& text)
|
||||
: Node(document, &text)
|
||||
{
|
||||
|
|
|
@ -16,6 +16,7 @@ class LineBoxFragment;
|
|||
|
||||
class TextNode final : public Node {
|
||||
JS_CELL(TextNode, Node);
|
||||
JS_DECLARE_ALLOCATOR(TextNode);
|
||||
|
||||
public:
|
||||
TextNode(DOM::Document&, DOM::Text&);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(VideoBox);
|
||||
|
||||
VideoBox::VideoBox(DOM::Document& document, DOM::Element& element, NonnullRefPtr<CSS::StyleProperties> style)
|
||||
: ReplacedBox(document, element, move(style))
|
||||
{
|
||||
|
|
|
@ -16,6 +16,7 @@ class VideoBox final
|
|||
: public ReplacedBox
|
||||
, public DOM::Document::ViewportClient {
|
||||
JS_CELL(VideoBox, ReplacedBox);
|
||||
JS_DECLARE_ALLOCATOR(VideoBox);
|
||||
|
||||
public:
|
||||
virtual void prepare_for_replaced_layout() override;
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(Viewport);
|
||||
|
||||
Viewport::Viewport(DOM::Document& document, NonnullRefPtr<CSS::StyleProperties> style)
|
||||
: BlockContainer(document, &document, move(style))
|
||||
{
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Layout {
|
|||
|
||||
class Viewport final : public BlockContainer {
|
||||
JS_CELL(Viewport, BlockContainer);
|
||||
JS_DECLARE_ALLOCATOR(Viewport);
|
||||
|
||||
public:
|
||||
explicit Viewport(DOM::Document&, NonnullRefPtr<CSS::StyleProperties>);
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(Page);
|
||||
|
||||
JS::NonnullGCPtr<Page> Page::create(JS::VM& vm, JS::NonnullGCPtr<PageClient> page_client)
|
||||
{
|
||||
return vm.heap().allocate_without_realm<Page>(page_client);
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
#include <LibGfx/Size.h>
|
||||
#include <LibGfx/StandardCursor.h>
|
||||
#include <LibIPC/Forward.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
#include <LibJS/Heap/Handle.h>
|
||||
#include <LibJS/Heap/Heap.h>
|
||||
#include <LibURL/URL.h>
|
||||
#include <LibWeb/CSS/PreferredColorScheme.h>
|
||||
#include <LibWeb/CSS/Selector.h>
|
||||
|
@ -47,6 +47,7 @@ class PageClient;
|
|||
|
||||
class Page final : public JS::Cell {
|
||||
JS_CELL(Page, JS::Cell);
|
||||
JS_DECLARE_ALLOCATOR(Page);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<Page> create(JS::VM&, JS::NonnullGCPtr<PageClient>);
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
|
||||
namespace Web::Painting {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(AudioPaintable);
|
||||
|
||||
JS::NonnullGCPtr<AudioPaintable> AudioPaintable::create(Layout::AudioBox const& layout_box)
|
||||
{
|
||||
return layout_box.heap().allocate_without_realm<AudioPaintable>(layout_box);
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Painting {
|
|||
|
||||
class AudioPaintable final : public MediaPaintable {
|
||||
JS_CELL(AudioPaintable, MediaPaintable);
|
||||
JS_DECLARE_ALLOCATOR(AudioPaintable);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<AudioPaintable> create(Layout::AudioBox const&);
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
namespace Web::Painting {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(ButtonPaintable);
|
||||
|
||||
JS::NonnullGCPtr<ButtonPaintable> ButtonPaintable::create(Layout::ButtonBox const& layout_box)
|
||||
{
|
||||
return layout_box.heap().allocate_without_realm<ButtonPaintable>(layout_box);
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Painting {
|
|||
|
||||
class ButtonPaintable final : public LabelablePaintable {
|
||||
JS_CELL(ButtonPaintable, LabelablePaintable);
|
||||
JS_DECLARE_ALLOCATOR(ButtonPaintable);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<ButtonPaintable> create(Layout::ButtonBox const&);
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
namespace Web::Painting {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(CanvasPaintable);
|
||||
|
||||
JS::NonnullGCPtr<CanvasPaintable> CanvasPaintable::create(Layout::CanvasBox const& layout_box)
|
||||
{
|
||||
return layout_box.heap().allocate_without_realm<CanvasPaintable>(layout_box);
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Painting {
|
|||
|
||||
class CanvasPaintable final : public PaintableBox {
|
||||
JS_CELL(CanvasPaintable, PaintableBox);
|
||||
JS_DECLARE_ALLOCATOR(CanvasPaintable);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<CanvasPaintable> create(Layout::CanvasBox const&);
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
|
||||
namespace Web::Painting {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(CheckBoxPaintable);
|
||||
|
||||
// A 16x16 signed distance field for the checkbox's tick (slightly rounded):
|
||||
static constexpr Array<u8, 16 * 16> s_check_mark_sdf {
|
||||
254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 251, 254, 254, 254,
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Painting {
|
|||
|
||||
class CheckBoxPaintable final : public LabelablePaintable {
|
||||
JS_CELL(CheckBoxPaintable, LabelablePaintable);
|
||||
JS_DECLARE_ALLOCATOR(CheckBoxPaintable);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<CheckBoxPaintable> create(Layout::CheckBox const&);
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
|
||||
namespace Web::Painting {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(ImagePaintable);
|
||||
|
||||
JS::NonnullGCPtr<ImagePaintable> ImagePaintable::create(Layout::ImageBox const& layout_box)
|
||||
{
|
||||
auto alt = layout_box.dom_node().get_attribute_value(HTML::AttributeNames::alt);
|
||||
|
|
|
@ -15,6 +15,7 @@ class ImagePaintable final
|
|||
: public PaintableBox
|
||||
, public DOM::Document::ViewportClient {
|
||||
JS_CELL(ImagePaintable, PaintableBox);
|
||||
JS_DECLARE_ALLOCATOR(ImagePaintable);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<ImagePaintable> create(Layout::ImageBox const&);
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
namespace Web::Painting {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(InlinePaintable);
|
||||
|
||||
JS::NonnullGCPtr<InlinePaintable> InlinePaintable::create(Layout::InlineNode const& layout_node)
|
||||
{
|
||||
return layout_node.heap().allocate_without_realm<InlinePaintable>(layout_node);
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace Web::Painting {
|
|||
|
||||
class InlinePaintable final : public Paintable {
|
||||
JS_CELL(InlinePaintable, Paintable);
|
||||
JS_DECLARE_ALLOCATOR(InlinePaintable);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<InlinePaintable> create(Layout::InlineNode const&);
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
|
||||
namespace Web::Painting {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(MarkerPaintable);
|
||||
|
||||
JS::NonnullGCPtr<MarkerPaintable> MarkerPaintable::create(Layout::ListItemMarkerBox const& layout_box)
|
||||
{
|
||||
return layout_box.heap().allocate_without_realm<MarkerPaintable>(layout_box);
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Painting {
|
|||
|
||||
class MarkerPaintable final : public PaintableBox {
|
||||
JS_CELL(MarkerPaintable, PaintableBox);
|
||||
JS_DECLARE_ALLOCATOR(MarkerPaintable);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<MarkerPaintable> create(Layout::ListItemMarkerBox const&);
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
|
||||
namespace Web::Painting {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(NestedBrowsingContextPaintable);
|
||||
|
||||
JS::NonnullGCPtr<NestedBrowsingContextPaintable> NestedBrowsingContextPaintable::create(Layout::FrameBox const& layout_box)
|
||||
{
|
||||
return layout_box.heap().allocate_without_realm<NestedBrowsingContextPaintable>(layout_box);
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Painting {
|
|||
|
||||
class NestedBrowsingContextPaintable final : public PaintableBox {
|
||||
JS_CELL(NestedBrowsingContextPaintable, PaintableBox);
|
||||
JS_DECLARE_ALLOCATOR(NestedBrowsingContextPaintable);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<NestedBrowsingContextPaintable> create(Layout::FrameBox const&);
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
namespace Web::Painting {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(RadioButtonPaintable);
|
||||
|
||||
JS::NonnullGCPtr<RadioButtonPaintable> RadioButtonPaintable::create(Layout::RadioButton const& layout_box)
|
||||
{
|
||||
return layout_box.heap().allocate_without_realm<RadioButtonPaintable>(layout_box);
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Painting {
|
|||
|
||||
class RadioButtonPaintable final : public LabelablePaintable {
|
||||
JS_CELL(RadioButtonPaintable, LabelablePaintable);
|
||||
JS_DECLARE_ALLOCATOR(RadioButtonPaintable);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<RadioButtonPaintable> create(Layout::RadioButton const&);
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
namespace Web::Painting {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(SVGClipPaintable);
|
||||
|
||||
JS::NonnullGCPtr<SVGClipPaintable> SVGClipPaintable::create(Layout::SVGClipBox const& layout_box)
|
||||
{
|
||||
return layout_box.heap().allocate_without_realm<SVGClipPaintable>(layout_box);
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Web::Painting {
|
|||
|
||||
class SVGClipPaintable : public SVGPaintable {
|
||||
JS_CELL(SVGClipPaintable, SVGPaintable);
|
||||
JS_DECLARE_ALLOCATOR(SVGClipPaintable);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<SVGClipPaintable> create(Layout::SVGClipBox const&);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue