@@ -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 @@
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; }
};
}
+JS_DEFINE_ALLOCATOR(ImageConstructor);
ImageConstructor::ImageConstructor(JS::Realm& realm)
class ImageConstructor final : public JS::NativeFunction {
+ JS_OBJECT(ImageConstructor, JS::NativeFunction);
+ JS_DECLARE_ALLOCATOR(ImageConstructor);
explicit ImageConstructor(JS::Realm&);
- virtual StringView class_name() const override { return "ImageConstructor"sv; }
@@ -17,6 +17,8 @@
+JS_DEFINE_ALLOCATOR(OptionConstructor);
OptionConstructor::OptionConstructor(JS::Realm& realm)
class OptionConstructor final : public JS::NativeFunction {
+ JS_OBJECT(OptionConstructor, JS::NativeFunction);
+ JS_DECLARE_ALLOCATOR(OptionConstructor);
explicit OptionConstructor(JS::Realm&);
- 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);
[[nodiscard]] static JS::NonnullGCPtr<AnimationEvent> create(JS::Realm&, FlyString const& type, AnimationEventInit const& event_init = {});
@@ -11,6 +11,8 @@
+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);
static JS::NonnullGCPtr<CSSAnimation> create(JS::Realm&);
+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);
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);
virtual ~EventTarget() override;
@@ -10,6 +10,8 @@
+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);
[[nodiscard]] static JS::NonnullGCPtr<IDLEventListener> create(JS::Realm&, JS::NonnullGCPtr<WebIDL::CallbackType>);
@@ -12,6 +12,7 @@
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);
static JS::NonnullGCPtr<TransientRegisteredObserver> create(MutationObserver&, MutationObserverInit const&, RegisteredObserver& source);
@@ -19,6 +19,8 @@
+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);
template<typename F>
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);
[[nodiscard]] static JS::NonnullGCPtr<FetchTimingInfo> create(JS::VM&);
@@ -25,6 +25,8 @@
+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>
@@ -35,6 +35,7 @@ class HeaderList final
: public JS::Cell
, Vector<Header> {
JS_CELL(HeaderList, JS::Cell);
+ JS_DECLARE_ALLOCATOR(HeaderList);
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);
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);
enum class Type {
+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);
explicit TaskQueue(HTML::EventLoop&);
@@ -31,6 +31,7 @@
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 @@
+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);
JS::Value parse_error; // [[ParseError]]
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);
HTML::HTMLAudioElement& dom_node();
+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);
BreakNode(DOM::Document&, HTML::HTMLBRElement&, NonnullRefPtr<CSS::StyleProperties>);
+JS_DEFINE_ALLOCATOR(ButtonBox);
ButtonBox::ButtonBox(DOM::Document& document, HTML::HTMLInputElement& element, NonnullRefPtr<CSS::StyleProperties> style)
: FormAssociatedLabelableNode(document, element, move(style))
class ButtonBox final : public FormAssociatedLabelableNode {
JS_CELL(ButtonBox, FormAssociatedLabelableNode);
+ JS_DECLARE_ALLOCATOR(ButtonBox);
ButtonBox(DOM::Document&, HTML::HTMLInputElement&, NonnullRefPtr<CSS::StyleProperties>);
+JS_DEFINE_ALLOCATOR(CanvasBox);
CanvasBox::CanvasBox(DOM::Document& document, HTML::HTMLCanvasElement& element, NonnullRefPtr<CSS::StyleProperties> style)
class CanvasBox final : public ReplacedBox {
JS_CELL(CanvasBox, ReplacedBox);
+ JS_DECLARE_ALLOCATOR(CanvasBox);
CanvasBox(DOM::Document&, HTML::HTMLCanvasElement&, NonnullRefPtr<CSS::StyleProperties>);
@@ -13,6 +13,8 @@
+JS_DEFINE_ALLOCATOR(CheckBox);
CheckBox::CheckBox(DOM::Document& document, HTML::HTMLInputElement& element, NonnullRefPtr<CSS::StyleProperties> style)
class CheckBox final : public FormAssociatedLabelableNode {
JS_CELL(CheckBox, FormAssociatedLabelableNode);
+ JS_DECLARE_ALLOCATOR(CheckBox);
CheckBox(DOM::Document&, HTML::HTMLInputElement&, NonnullRefPtr<CSS::StyleProperties>);
+JS_DEFINE_ALLOCATOR(FrameBox);
FrameBox::FrameBox(DOM::Document& document, DOM::Element& element, NonnullRefPtr<CSS::StyleProperties> style)
class FrameBox final : public ReplacedBox {
JS_CELL(FrameBox, ReplacedBox);
+ JS_DECLARE_ALLOCATOR(FrameBox);
FrameBox(DOM::Document&, DOM::Element&, NonnullRefPtr<CSS::StyleProperties>);
+JS_DEFINE_ALLOCATOR(ImageBox);
ImageBox::ImageBox(DOM::Document& document, DOM::Element& element, NonnullRefPtr<CSS::StyleProperties> style, ImageProvider const& image_provider)
, m_image_provider(image_provider)
class ImageBox final : public ReplacedBox {
JS_CELL(ImageBox, ReplacedBox);
+ JS_DECLARE_ALLOCATOR(ImageBox);
ImageBox(DOM::Document&, DOM::Element&, NonnullRefPtr<CSS::StyleProperties>, ImageProvider const&);
+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);
InlineNode(DOM::Document&, DOM::Element*, NonnullRefPtr<CSS::StyleProperties>);
@@ -15,6 +15,8 @@
+JS_DEFINE_ALLOCATOR(Label);
Label::Label(DOM::Document& document, HTML::HTMLLabelElement* element, NonnullRefPtr<CSS::StyleProperties> style)
: BlockContainer(document, element, move(style))
class Label final : public BlockContainer {
JS_CELL(Label, BlockContainer);
+ JS_DECLARE_ALLOCATOR(Label);
Label(DOM::Document&, HTML::HTMLLabelElement*, NonnullRefPtr<CSS::StyleProperties>);
+JS_DEFINE_ALLOCATOR(ListItemBox);
ListItemBox::ListItemBox(DOM::Document& document, DOM::Element* element, NonnullRefPtr<CSS::StyleProperties> style)
: Layout::BlockContainer(document, element, move(style))
class ListItemBox final : public BlockContainer {
JS_CELL(ListItemBox, BlockContainer);
+ JS_DECLARE_ALLOCATOR(ListItemBox);
ListItemBox(DOM::Document&, DOM::Element*, NonnullRefPtr<CSS::StyleProperties>);
+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)
class ListItemMarkerBox final : public Box {
JS_CELL(ListItemMarkerBox, Box);
+ JS_DECLARE_ALLOCATOR(ListItemMarkerBox);
explicit ListItemMarkerBox(DOM::Document&, CSS::ListStyleType, CSS::ListStylePosition, size_t index, NonnullRefPtr<CSS::StyleProperties>);
+JS_DEFINE_ALLOCATOR(RadioButton);
RadioButton::RadioButton(DOM::Document& document, HTML::HTMLInputElement& element, NonnullRefPtr<CSS::StyleProperties> style)
class RadioButton final : public FormAssociatedLabelableNode {
JS_CELL(RadioButton, FormAssociatedLabelableNode);
+ JS_DECLARE_ALLOCATOR(RadioButton);
RadioButton(DOM::Document&, HTML::HTMLInputElement&, NonnullRefPtr<CSS::StyleProperties>);
+JS_DEFINE_ALLOCATOR(SVGClipBox);
SVGClipBox::SVGClipBox(DOM::Document& document, SVG::SVGClipPathElement& element, NonnullRefPtr<CSS::StyleProperties> properties)
: SVGBox(document, element, properties)
class SVGClipBox : public SVGBox {
JS_CELL(SVGClipBox, SVGBox);
+ JS_DECLARE_ALLOCATOR(SVGClipBox);
SVGClipBox(DOM::Document&, SVG::SVGClipPathElement&, NonnullRefPtr<CSS::StyleProperties>);
@@ -12,6 +12,8 @@
+JS_DEFINE_ALLOCATOR(SVGGeometryBox);
SVGGeometryBox::SVGGeometryBox(DOM::Document& document, SVG::SVGGeometryElement& element, NonnullRefPtr<CSS::StyleProperties> properties)
: SVGGraphicsBox(document, element, properties)
class SVGGeometryBox final : public SVGGraphicsBox {
JS_CELL(SVGGeometryBox, SVGGraphicsBox);
+ JS_DECLARE_ALLOCATOR(SVGGeometryBox);
SVGGeometryBox(DOM::Document&, SVG::SVGGeometryElement&, NonnullRefPtr<CSS::StyleProperties>);
+JS_DEFINE_ALLOCATOR(SVGMaskBox);
SVGMaskBox::SVGMaskBox(DOM::Document& document, SVG::SVGMaskElement& element, NonnullRefPtr<CSS::StyleProperties> properties)
class SVGMaskBox : public SVGGraphicsBox {
JS_CELL(SVGMaskBox, SVGBox);
+ JS_DECLARE_ALLOCATOR(SVGMaskBox);
SVGMaskBox(DOM::Document&, SVG::SVGMaskElement&, NonnullRefPtr<CSS::StyleProperties>);
+JS_DEFINE_ALLOCATOR(SVGSVGBox);
SVGSVGBox::SVGSVGBox(DOM::Document& document, SVG::SVGSVGElement& element, NonnullRefPtr<CSS::StyleProperties> properties)
: ReplacedBox(document, element, move(properties))
class SVGSVGBox final : public ReplacedBox {
JS_CELL(SVGSVGBox, ReplacedBox);
+ JS_DECLARE_ALLOCATOR(SVGSVGBox);
SVGSVGBox(DOM::Document&, SVG::SVGSVGElement&, NonnullRefPtr<CSS::StyleProperties>);
+JS_DEFINE_ALLOCATOR(SVGTextBox);
SVGTextBox::SVGTextBox(DOM::Document& document, SVG::SVGTextPositioningElement& element, NonnullRefPtr<CSS::StyleProperties> properties)
class SVGTextBox final : public SVGGraphicsBox {
JS_CELL(SVGTextBox, SVGGraphicsBox);
+ JS_DECLARE_ALLOCATOR(SVGTextBox);
SVGTextBox(DOM::Document&, SVG::SVGTextPositioningElement&, NonnullRefPtr<CSS::StyleProperties>);
+JS_DEFINE_ALLOCATOR(SVGTextPathBox);
SVGTextPathBox::SVGTextPathBox(DOM::Document& document, SVG::SVGTextPathElement& element, NonnullRefPtr<CSS::StyleProperties> properties)
class SVGTextPathBox final : public SVGGraphicsBox {
JS_CELL(SVGTextPathBox, SVGGraphicsBox);
+ JS_DECLARE_ALLOCATOR(SVGTextPathBox);
SVGTextPathBox(DOM::Document&, SVG::SVGTextPathElement&, NonnullRefPtr<CSS::StyleProperties>);
@@ -8,6 +8,8 @@
+JS_DEFINE_ALLOCATOR(TableWrapper);
TableWrapper::TableWrapper(DOM::Document& document, DOM::Node* node, NonnullRefPtr<CSS::StyleProperties> style)
: BlockContainer(document, node, move(style))
class TableWrapper : public BlockContainer {
JS_CELL(TableWrapper, BlockContainer);
+ JS_DECLARE_ALLOCATOR(TableWrapper);
TableWrapper(DOM::Document&, DOM::Node*, NonnullRefPtr<CSS::StyleProperties>);
@@ -16,6 +16,8 @@
+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);
TextNode(DOM::Document&, DOM::Text&);
+JS_DEFINE_ALLOCATOR(VideoBox);
VideoBox::VideoBox(DOM::Document& document, DOM::Element& element, NonnullRefPtr<CSS::StyleProperties> style)
@@ -16,6 +16,7 @@ class VideoBox final
: public ReplacedBox
, public DOM::Document::ViewportClient {
JS_CELL(VideoBox, ReplacedBox);
+ JS_DECLARE_ALLOCATOR(VideoBox);
virtual void prepare_for_replaced_layout() override;
+JS_DEFINE_ALLOCATOR(Viewport);
Viewport::Viewport(DOM::Document& document, NonnullRefPtr<CSS::StyleProperties> style)
: BlockContainer(document, &document, move(style))
class Viewport final : public BlockContainer {
JS_CELL(Viewport, BlockContainer);
+ JS_DECLARE_ALLOCATOR(Viewport);
explicit Viewport(DOM::Document&, NonnullRefPtr<CSS::StyleProperties>);
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/Handle.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);
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);
static JS::NonnullGCPtr<AudioPaintable> create(Layout::AudioBox const&);
+JS_DEFINE_ALLOCATOR(ButtonPaintable);
JS::NonnullGCPtr<ButtonPaintable> ButtonPaintable::create(Layout::ButtonBox const& layout_box)
return layout_box.heap().allocate_without_realm<ButtonPaintable>(layout_box);
class ButtonPaintable final : public LabelablePaintable {
JS_CELL(ButtonPaintable, LabelablePaintable);
+ JS_DECLARE_ALLOCATOR(ButtonPaintable);
static JS::NonnullGCPtr<ButtonPaintable> create(Layout::ButtonBox const&);
+JS_DEFINE_ALLOCATOR(CanvasPaintable);
JS::NonnullGCPtr<CanvasPaintable> CanvasPaintable::create(Layout::CanvasBox const& layout_box)
return layout_box.heap().allocate_without_realm<CanvasPaintable>(layout_box);
class CanvasPaintable final : public PaintableBox {
JS_CELL(CanvasPaintable, PaintableBox);
+ JS_DECLARE_ALLOCATOR(CanvasPaintable);
static JS::NonnullGCPtr<CanvasPaintable> create(Layout::CanvasBox const&);
+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,
class CheckBoxPaintable final : public LabelablePaintable {
JS_CELL(CheckBoxPaintable, LabelablePaintable);
+ JS_DECLARE_ALLOCATOR(CheckBoxPaintable);
static JS::NonnullGCPtr<CheckBoxPaintable> create(Layout::CheckBox const&);
+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
JS_CELL(ImagePaintable, PaintableBox);
+ JS_DECLARE_ALLOCATOR(ImagePaintable);
static JS::NonnullGCPtr<ImagePaintable> create(Layout::ImageBox const&);
+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);
static JS::NonnullGCPtr<InlinePaintable> create(Layout::InlineNode const&);
+JS_DEFINE_ALLOCATOR(MarkerPaintable);
JS::NonnullGCPtr<MarkerPaintable> MarkerPaintable::create(Layout::ListItemMarkerBox const& layout_box)
return layout_box.heap().allocate_without_realm<MarkerPaintable>(layout_box);
class MarkerPaintable final : public PaintableBox {
JS_CELL(MarkerPaintable, PaintableBox);
+ JS_DECLARE_ALLOCATOR(MarkerPaintable);
static JS::NonnullGCPtr<MarkerPaintable> create(Layout::ListItemMarkerBox const&);
+JS_DEFINE_ALLOCATOR(NestedBrowsingContextPaintable);
JS::NonnullGCPtr<NestedBrowsingContextPaintable> NestedBrowsingContextPaintable::create(Layout::FrameBox const& layout_box)
return layout_box.heap().allocate_without_realm<NestedBrowsingContextPaintable>(layout_box);
class NestedBrowsingContextPaintable final : public PaintableBox {
JS_CELL(NestedBrowsingContextPaintable, PaintableBox);
+ JS_DECLARE_ALLOCATOR(NestedBrowsingContextPaintable);
static JS::NonnullGCPtr<NestedBrowsingContextPaintable> create(Layout::FrameBox const&);
+JS_DEFINE_ALLOCATOR(RadioButtonPaintable);
JS::NonnullGCPtr<RadioButtonPaintable> RadioButtonPaintable::create(Layout::RadioButton const& layout_box)
return layout_box.heap().allocate_without_realm<RadioButtonPaintable>(layout_box);
class RadioButtonPaintable final : public LabelablePaintable {
JS_CELL(RadioButtonPaintable, LabelablePaintable);
+ JS_DECLARE_ALLOCATOR(RadioButtonPaintable);
static JS::NonnullGCPtr<RadioButtonPaintable> create(Layout::RadioButton const&);
+JS_DEFINE_ALLOCATOR(SVGClipPaintable);
JS::NonnullGCPtr<SVGClipPaintable> SVGClipPaintable::create(Layout::SVGClipBox const& layout_box)
return layout_box.heap().allocate_without_realm<SVGClipPaintable>(layout_box);
class SVGClipPaintable : public SVGPaintable {
JS_CELL(SVGClipPaintable, SVGPaintable);
+ JS_DECLARE_ALLOCATOR(SVGClipPaintable);
static JS::NonnullGCPtr<SVGClipPaintable> create(Layout::SVGClipBox const&);