1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:57:44 +00:00

LibWeb: Move setting of Web object prototypes to initialize()

This needs to happen before prototype/constructor intitialization can be
made lazy. Otherwise, GC could run during the C++ constructor and try to
collect the object currently being created.
This commit is contained in:
Timothy Flynn 2023-01-10 06:28:20 -05:00 committed by Andreas Kling
parent 7bd8fd000f
commit 834202aeb9
339 changed files with 1294 additions and 187 deletions

View file

@ -43,11 +43,16 @@ CanvasGradient::CanvasGradient(JS::Realm& realm, Type type)
: PlatformObject(realm)
, m_type(type)
{
set_prototype(&Bindings::cached_web_prototype(realm, "CanvasGradient"));
}
CanvasGradient::~CanvasGradient() = default;
void CanvasGradient::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::CanvasGradientPrototype>(realm, "CanvasGradient"));
}
// https://html.spec.whatwg.org/multipage/canvas.html#dom-canvasgradient-addcolorstop
WebIDL::ExceptionOr<void> CanvasGradient::add_color_stop(double offset, DeprecatedString const& color)
{

View file

@ -32,6 +32,8 @@ public:
private:
CanvasGradient(JS::Realm&, Type);
virtual void initialize(JS::Realm&) override;
Type m_type {};
struct ColorStop {

View file

@ -33,11 +33,16 @@ CanvasRenderingContext2D::CanvasRenderingContext2D(JS::Realm& realm, HTMLCanvasE
, CanvasPath(static_cast<Bindings::PlatformObject&>(*this))
, m_element(element)
{
set_prototype(&Bindings::cached_web_prototype(realm, "CanvasRenderingContext2D"));
}
CanvasRenderingContext2D::~CanvasRenderingContext2D() = default;
void CanvasRenderingContext2D::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::CanvasRenderingContext2DPrototype>(realm, "CanvasRenderingContext2D"));
}
void CanvasRenderingContext2D::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);

View file

@ -86,6 +86,7 @@ public:
private:
explicit CanvasRenderingContext2D(JS::Realm&, HTMLCanvasElement&);
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;
struct PreparedTextGlyph {

View file

@ -25,9 +25,14 @@ CloseEvent::CloseEvent(JS::Realm& realm, DeprecatedFlyString const& event_name,
, m_code(event_init.code)
, m_reason(event_init.reason)
{
set_prototype(&Bindings::cached_web_prototype(realm, "CloseEvent"));
}
CloseEvent::~CloseEvent() = default;
void CloseEvent::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::CloseEventPrototype>(realm, "CloseEvent"));
}
}

View file

@ -33,6 +33,8 @@ public:
private:
CloseEvent(JS::Realm&, DeprecatedFlyString const& event_name, CloseEventInit const& event_init);
virtual void initialize(JS::Realm&) override;
bool m_was_clean { false };
u16 m_code { 0 };
DeprecatedString m_reason;

View file

@ -21,11 +21,16 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMParser>> DOMParser::construct_impl(JS::R
DOMParser::DOMParser(JS::Realm& realm)
: PlatformObject(realm)
{
set_prototype(&Bindings::cached_web_prototype(realm, "DOMParser"));
}
DOMParser::~DOMParser() = default;
void DOMParser::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::DOMParserPrototype>(realm, "DOMParser"));
}
// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring
JS::NonnullGCPtr<DOM::Document> DOMParser::parse_from_string(DeprecatedString const& string, Bindings::DOMParserSupportedType type)
{

View file

@ -27,6 +27,8 @@ public:
private:
explicit DOMParser(JS::Realm&);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -27,11 +27,16 @@ ErrorEvent::ErrorEvent(JS::Realm& realm, DeprecatedFlyString const& event_name,
, m_colno(event_init.colno)
, m_error(event_init.error)
{
set_prototype(&Bindings::cached_web_prototype(realm, "ErrorEvent"));
}
ErrorEvent::~ErrorEvent() = default;
void ErrorEvent::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::ErrorEventPrototype>(realm, "ErrorEvent"));
}
void ErrorEvent::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);

View file

@ -47,6 +47,7 @@ public:
private:
ErrorEvent(JS::Realm&, DeprecatedFlyString const& event_name, ErrorEventInit const& event_init);
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;
DeprecatedString m_message { "" };

View file

@ -13,8 +13,6 @@ namespace Web::HTML {
HTMLAnchorElement::HTMLAnchorElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLAnchorElement"));
activation_behavior = [this](auto const& event) {
run_activation_behavior(event);
};
@ -22,6 +20,12 @@ HTMLAnchorElement::HTMLAnchorElement(DOM::Document& document, DOM::QualifiedName
HTMLAnchorElement::~HTMLAnchorElement() = default;
void HTMLAnchorElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLAnchorElementPrototype>(realm, "HTMLAnchorElement"));
}
void HTMLAnchorElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
{
HTMLElement::parse_attribute(name, value);

View file

@ -32,6 +32,8 @@ public:
private:
HTMLAnchorElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
void run_activation_behavior(Web::DOM::Event const&);
// ^DOM::Element

View file

@ -13,11 +13,16 @@ namespace Web::HTML {
HTMLAreaElement::HTMLAreaElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLAreaElement"));
}
HTMLAreaElement::~HTMLAreaElement() = default;
void HTMLAreaElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLAreaElementPrototype>(realm, "HTMLAreaElement"));
}
void HTMLAreaElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
{
HTMLElement::parse_attribute(name, value);

View file

@ -23,6 +23,8 @@ public:
private:
HTMLAreaElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
// ^DOM::Element
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
virtual i32 default_tab_index_value() const override;

View file

@ -12,8 +12,14 @@ namespace Web::HTML {
HTMLAudioElement::HTMLAudioElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLMediaElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLAudioElement"));
}
HTMLAudioElement::~HTMLAudioElement() = default;
void HTMLAudioElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLAudioElementPrototype>(realm, "HTMLAudioElement"));
}
}

View file

@ -18,6 +18,8 @@ public:
private:
HTMLAudioElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -13,11 +13,16 @@ namespace Web::HTML {
HTMLBRElement::HTMLBRElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLBRElement"));
}
HTMLBRElement::~HTMLBRElement() = default;
void HTMLBRElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLBRElementPrototype>(realm, "HTMLBRElement"));
}
JS::GCPtr<Layout::Node> HTMLBRElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
{
return heap().allocate_without_realm<Layout::BreakNode>(document(), *this, move(style));

View file

@ -20,6 +20,8 @@ public:
private:
HTMLBRElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -12,11 +12,16 @@ namespace Web::HTML {
HTMLBaseElement::HTMLBaseElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLBaseElement"));
}
HTMLBaseElement::~HTMLBaseElement() = default;
void HTMLBaseElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLBaseElementPrototype>(realm, "HTMLBaseElement"));
}
void HTMLBaseElement::inserted()
{
HTMLElement::inserted();

View file

@ -28,6 +28,7 @@ public:
private:
HTMLBaseElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
virtual bool is_html_base_element() const override { return true; }
// https://html.spec.whatwg.org/multipage/semantics.html#frozen-base-url

View file

@ -15,11 +15,16 @@ namespace Web::HTML {
HTMLBodyElement::HTMLBodyElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLBodyElement"));
}
HTMLBodyElement::~HTMLBodyElement() = default;
void HTMLBodyElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLBodyElementPrototype>(realm, "HTMLBodyElement"));
}
void HTMLBodyElement::apply_presentational_hints(CSS::StyleProperties& style) const
{
for_each_attribute([&](auto& name, auto& value) {

View file

@ -29,6 +29,8 @@ public:
private:
HTMLBodyElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
// ^HTML::GlobalEventHandlers
virtual EventTarget& global_event_handlers_to_event_target(DeprecatedFlyString const& event_name) override;

View file

@ -13,8 +13,6 @@ namespace Web::HTML {
HTMLButtonElement::HTMLButtonElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLButtonElement"));
// https://html.spec.whatwg.org/multipage/form-elements.html#the-button-element:activation-behaviour
activation_behavior = [this](auto&) {
// 1. If element is disabled, then return.
@ -53,6 +51,12 @@ HTMLButtonElement::HTMLButtonElement(DOM::Document& document, DOM::QualifiedName
HTMLButtonElement::~HTMLButtonElement() = default;
void HTMLButtonElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLButtonElementPrototype>(realm, "HTMLButtonElement"));
}
DeprecatedString HTMLButtonElement::type() const
{
auto value = attribute(HTML::AttributeNames::type);

View file

@ -26,6 +26,8 @@ class HTMLButtonElement final
public:
virtual ~HTMLButtonElement() override;
virtual void initialize(JS::Realm&) override;
enum class TypeAttributeState {
#define __ENUMERATE_HTML_BUTTON_TYPE_ATTRIBUTE(_, state) state,
ENUMERATE_HTML_BUTTON_TYPE_ATTRIBUTES

View file

@ -21,11 +21,16 @@ static constexpr auto max_canvas_area = 16384 * 16384;
HTMLCanvasElement::HTMLCanvasElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLCanvasElement"));
}
HTMLCanvasElement::~HTMLCanvasElement() = default;
void HTMLCanvasElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLCanvasElementPrototype>(realm, "HTMLCanvasElement"));
}
void HTMLCanvasElement::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);

View file

@ -40,6 +40,7 @@ public:
private:
HTMLCanvasElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;
virtual JS::GCPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;

View file

@ -12,8 +12,14 @@ namespace Web::HTML {
HTMLDListElement::HTMLDListElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLDListElement"));
}
HTMLDListElement::~HTMLDListElement() = default;
void HTMLDListElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLDListElementPrototype>(realm, "HTMLDListElement"));
}
}

View file

@ -18,6 +18,8 @@ public:
private:
HTMLDListElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -12,8 +12,14 @@ namespace Web::HTML {
HTMLDataElement::HTMLDataElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLDataElement"));
}
HTMLDataElement::~HTMLDataElement() = default;
void HTMLDataElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLDataElementPrototype>(realm, "HTMLDataElement"));
}
}

View file

@ -22,6 +22,8 @@ public:
private:
HTMLDataElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -12,8 +12,14 @@ namespace Web::HTML {
HTMLDataListElement::HTMLDataListElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLDataListElement"));
}
HTMLDataListElement::~HTMLDataListElement() = default;
void HTMLDataListElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLDataListElementPrototype>(realm, "HTMLDataListElement"));
}
}

View file

@ -21,6 +21,8 @@ public:
private:
HTMLDataListElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -12,8 +12,14 @@ namespace Web::HTML {
HTMLDetailsElement::HTMLDetailsElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLDetailsElement"));
}
HTMLDetailsElement::~HTMLDetailsElement() = default;
void HTMLDetailsElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLDetailsElementPrototype>(realm, "HTMLDetailsElement"));
}
}

View file

@ -22,6 +22,8 @@ public:
private:
HTMLDetailsElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -12,8 +12,14 @@ namespace Web::HTML {
HTMLDialogElement::HTMLDialogElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLDialogElement"));
}
HTMLDialogElement::~HTMLDialogElement() = default;
void HTMLDialogElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLDialogElementPrototype>(realm, "HTMLDialogElement"));
}
}

View file

@ -22,6 +22,8 @@ public:
private:
HTMLDialogElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -12,8 +12,14 @@ namespace Web::HTML {
HTMLDirectoryElement::HTMLDirectoryElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLDirectoryElement"));
}
HTMLDirectoryElement::~HTMLDirectoryElement() = default;
void HTMLDirectoryElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLDirectoryElementPrototype>(realm, "HTMLDirectoryElement"));
}
}

View file

@ -19,6 +19,8 @@ public:
private:
HTMLDirectoryElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -12,8 +12,14 @@ namespace Web::HTML {
HTMLDivElement::HTMLDivElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLDivElement"));
}
HTMLDivElement::~HTMLDivElement() = default;
void HTMLDivElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLDivElementPrototype>(realm, "HTMLDivElement"));
}
}

View file

@ -22,6 +22,8 @@ public:
private:
HTMLDivElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -36,7 +36,6 @@ namespace Web::HTML {
HTMLElement::HTMLElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: Element(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLElement"));
}
HTMLElement::~HTMLElement() = default;
@ -44,6 +43,8 @@ HTMLElement::~HTMLElement() = default;
void HTMLElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLElementPrototype>(realm, "HTMLElement"));
m_dataset = DOMStringMap::create(*this);
}

View file

@ -12,8 +12,14 @@ namespace Web::HTML {
HTMLEmbedElement::HTMLEmbedElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLEmbedElement"));
}
HTMLEmbedElement::~HTMLEmbedElement() = default;
void HTMLEmbedElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLEmbedElementPrototype>(realm, "HTMLEmbedElement"));
}
}

View file

@ -18,6 +18,8 @@ public:
private:
HTMLEmbedElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -13,11 +13,16 @@ namespace Web::HTML {
HTMLFieldSetElement::HTMLFieldSetElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLFieldSetElement"));
}
HTMLFieldSetElement::~HTMLFieldSetElement() = default;
void HTMLFieldSetElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLFieldSetElementPrototype>(realm, "HTMLFieldSetElement"));
}
// https://html.spec.whatwg.org/multipage/form-elements.html#concept-fieldset-disabled
bool HTMLFieldSetElement::is_disabled() const
{

View file

@ -40,6 +40,8 @@ public:
private:
HTMLFieldSetElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -14,11 +14,16 @@ namespace Web::HTML {
HTMLFontElement::HTMLFontElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLFontElement"));
}
HTMLFontElement::~HTMLFontElement() = default;
void HTMLFontElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLFontElementPrototype>(realm, "HTMLFontElement"));
}
void HTMLFontElement::apply_presentational_hints(CSS::StyleProperties& style) const
{
for_each_attribute([&](auto& name, auto& value) {

View file

@ -20,6 +20,8 @@ public:
private:
HTMLFontElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -26,11 +26,16 @@ namespace Web::HTML {
HTMLFormElement::HTMLFormElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLFormElement"));
}
HTMLFormElement::~HTMLFormElement() = default;
void HTMLFormElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLFormElementPrototype>(realm, "HTMLFormElement"));
}
void HTMLFormElement::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);

View file

@ -43,6 +43,7 @@ public:
private:
HTMLFormElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;
bool m_firing_submission_events { false };

View file

@ -12,11 +12,16 @@ namespace Web::HTML {
HTMLFrameElement::HTMLFrameElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLFrameElement"));
}
HTMLFrameElement::~HTMLFrameElement() = default;
void HTMLFrameElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLFrameElementPrototype>(realm, "HTMLFrameElement"));
}
// https://html.spec.whatwg.org/multipage/interaction.html#dom-tabindex
i32 HTMLFrameElement::default_tab_index_value() const
{

View file

@ -19,6 +19,9 @@ public:
private:
HTMLFrameElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
// ^DOM::Element
virtual i32 default_tab_index_value() const override;
};

View file

@ -13,11 +13,16 @@ namespace Web::HTML {
HTMLFrameSetElement::HTMLFrameSetElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLFrameSetElement"));
}
HTMLFrameSetElement::~HTMLFrameSetElement() = default;
void HTMLFrameSetElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLFrameSetElementPrototype>(realm, "HTMLFrameSetElement"));
}
void HTMLFrameSetElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
{
HTMLElement::parse_attribute(name, value);

View file

@ -23,9 +23,9 @@ public:
private:
HTMLFrameSetElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
virtual void parse_attribute(DeprecatedFlyString const&, DeprecatedString const&) override;
private:
// ^HTML::GlobalEventHandlers
virtual EventTarget& global_event_handlers_to_event_target(DeprecatedFlyString const& event_name) override;

View file

@ -12,8 +12,14 @@ namespace Web::HTML {
HTMLHRElement::HTMLHRElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLHRElement"));
}
HTMLHRElement::~HTMLHRElement() = default;
void HTMLHRElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLHRElementPrototype>(realm, "HTMLHRElement"));
}
}

View file

@ -22,6 +22,8 @@ public:
private:
HTMLHRElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -12,8 +12,14 @@ namespace Web::HTML {
HTMLHeadElement::HTMLHeadElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLHeadElement"));
}
HTMLHeadElement::~HTMLHeadElement() = default;
void HTMLHeadElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLHeadElementPrototype>(realm, "HTMLHeadElement"));
}
}

View file

@ -18,6 +18,8 @@ public:
private:
HTMLHeadElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -12,11 +12,16 @@ namespace Web::HTML {
HTMLHeadingElement::HTMLHeadingElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLHeadingElement"));
}
HTMLHeadingElement::~HTMLHeadingElement() = default;
void HTMLHeadingElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLHeadingElementPrototype>(realm, "HTMLHeadingElement"));
}
// https://html.spec.whatwg.org/multipage/rendering.html#tables-2
void HTMLHeadingElement::apply_presentational_hints(CSS::StyleProperties& style) const
{

View file

@ -29,6 +29,8 @@ public:
private:
HTMLHeadingElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -12,11 +12,16 @@ namespace Web::HTML {
HTMLHtmlElement::HTMLHtmlElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLHtmlElement"));
}
HTMLHtmlElement::~HTMLHtmlElement() = default;
void HTMLHtmlElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLHtmlElementPrototype>(realm, "HTMLHtmlElement"));
}
bool HTMLHtmlElement::should_use_body_background_properties() const
{
auto background_color = layout_node()->computed_values().background_color();

View file

@ -25,6 +25,7 @@ public:
private:
HTMLHtmlElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
virtual bool is_html_html_element() const override { return true; }
};

View file

@ -17,11 +17,16 @@ namespace Web::HTML {
HTMLIFrameElement::HTMLIFrameElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: BrowsingContextContainer(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLIFrameElement"));
}
HTMLIFrameElement::~HTMLIFrameElement() = default;
void HTMLIFrameElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLIFrameElementPrototype>(realm, "HTMLIFrameElement"));
}
JS::GCPtr<Layout::Node> HTMLIFrameElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
{
return heap().allocate_without_realm<Layout::FrameBox>(document(), *this, move(style));

View file

@ -28,6 +28,8 @@ public:
private:
HTMLIFrameElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
// ^DOM::Element
virtual void inserted() override;
virtual void removed_from(Node*) override;

View file

@ -23,8 +23,6 @@ HTMLImageElement::HTMLImageElement(DOM::Document& document, DOM::QualifiedName q
: HTMLElement(document, move(qualified_name))
, m_image_loader(*this)
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLImageElement"));
m_image_loader.on_load = [this] {
set_needs_style_update(true);
this->document().set_needs_layout();
@ -50,6 +48,12 @@ HTMLImageElement::HTMLImageElement(DOM::Document& document, DOM::QualifiedName q
HTMLImageElement::~HTMLImageElement() = default;
void HTMLImageElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLImageElementPrototype>(realm, "HTMLImageElement"));
}
void HTMLImageElement::apply_presentational_hints(CSS::StyleProperties& style) const
{
for_each_attribute([&](auto& name, auto& value) {

View file

@ -48,6 +48,7 @@ public:
private:
HTMLImageElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
void animate();

View file

@ -29,8 +29,6 @@ HTMLInputElement::HTMLInputElement(DOM::Document& document, DOM::QualifiedName q
: HTMLElement(document, move(qualified_name))
, m_value(DeprecatedString::empty())
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLInputElement"));
activation_behavior = [this](auto&) {
// The activation behavior for input elements are these steps:
@ -43,6 +41,12 @@ HTMLInputElement::HTMLInputElement(DOM::Document& document, DOM::QualifiedName q
HTMLInputElement::~HTMLInputElement() = default;
void HTMLInputElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLInputElementPrototype>(realm, "HTMLInputElement"));
}
void HTMLInputElement::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);

View file

@ -134,6 +134,7 @@ private:
// ^DOM::Element
virtual i32 default_tab_index_value() const override;
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;
static TypeAttributeState parse_type_attribute(StringView);

View file

@ -12,8 +12,14 @@ namespace Web::HTML {
HTMLLIElement::HTMLLIElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLLIElement"));
}
HTMLLIElement::~HTMLLIElement() = default;
void HTMLLIElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLLIElementPrototype>(realm, "HTMLLIElement"));
}
}

View file

@ -22,6 +22,8 @@ public:
private:
HTMLLIElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -13,11 +13,16 @@ namespace Web::HTML {
HTMLLabelElement::HTMLLabelElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLLabelElement"));
}
HTMLLabelElement::~HTMLLabelElement() = default;
void HTMLLabelElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLLabelElementPrototype>(realm, "HTMLLabelElement"));
}
JS::GCPtr<Layout::Node> HTMLLabelElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
{
return heap().allocate_without_realm<Layout::Label>(document(), this, move(style));

View file

@ -22,6 +22,8 @@ public:
private:
HTMLLabelElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -12,8 +12,14 @@ namespace Web::HTML {
HTMLLegendElement::HTMLLegendElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLLegendElement"));
}
HTMLLegendElement::~HTMLLegendElement() = default;
void HTMLLegendElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLLegendElementPrototype>(realm, "HTMLLegendElement"));
}
}

View file

@ -18,6 +18,8 @@ public:
private:
HTMLLegendElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -22,11 +22,16 @@ namespace Web::HTML {
HTMLLinkElement::HTMLLinkElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLLinkElement"));
}
HTMLLinkElement::~HTMLLinkElement() = default;
void HTMLLinkElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLLinkElementPrototype>(realm, "HTMLLinkElement"));
}
void HTMLLinkElement::inserted()
{
if (has_attribute(AttributeNames::disabled) && (m_relationship & Relationship::Stylesheet))

View file

@ -33,6 +33,7 @@ public:
private:
HTMLLinkElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
void parse_attribute(DeprecatedFlyString const&, DeprecatedString const&) override;
// ^ResourceClient

View file

@ -12,8 +12,14 @@ namespace Web::HTML {
HTMLMapElement::HTMLMapElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLMapElement"));
}
HTMLMapElement::~HTMLMapElement() = default;
void HTMLMapElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLMapElementPrototype>(realm, "HTMLMapElement"));
}
}

View file

@ -18,6 +18,8 @@ public:
private:
HTMLMapElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -12,11 +12,16 @@ namespace Web::HTML {
HTMLMarqueeElement::HTMLMarqueeElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLMarqueeElement"));
}
HTMLMarqueeElement::~HTMLMarqueeElement() = default;
void HTMLMarqueeElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLMarqueeElementPrototype>(realm, "HTMLMarqueeElement"));
}
void HTMLMarqueeElement::apply_presentational_hints(CSS::StyleProperties& style) const
{
HTMLElement::apply_presentational_hints(style);

View file

@ -19,6 +19,8 @@ public:
private:
HTMLMarqueeElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
};

View file

@ -13,11 +13,16 @@ namespace Web::HTML {
HTMLMediaElement::HTMLMediaElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLMediaElement"));
}
HTMLMediaElement::~HTMLMediaElement() = default;
void HTMLMediaElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLMediaElementPrototype>(realm, "HTMLMediaElement"));
}
// https://html.spec.whatwg.org/multipage/media.html#dom-navigator-canplaytype
Bindings::CanPlayTypeResult HTMLMediaElement::can_play_type(DeprecatedString const& type) const
{

View file

@ -23,6 +23,8 @@ public:
protected:
HTMLMediaElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -12,9 +12,14 @@ namespace Web::HTML {
HTMLMenuElement::HTMLMenuElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLMenuElement"));
}
HTMLMenuElement::~HTMLMenuElement() = default;
void HTMLMenuElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLMenuElementPrototype>(realm, "HTMLMenuElement"));
}
}

View file

@ -22,6 +22,8 @@ public:
private:
HTMLMenuElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -12,9 +12,14 @@ namespace Web::HTML {
HTMLMetaElement::HTMLMetaElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLMetaElement"));
}
HTMLMetaElement::~HTMLMetaElement() = default;
void HTMLMetaElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLMetaElementPrototype>(realm, "HTMLMetaElement"));
}
}

View file

@ -18,6 +18,8 @@ public:
private:
HTMLMetaElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -12,9 +12,14 @@ namespace Web::HTML {
HTMLMeterElement::HTMLMeterElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLMeterElement"));
}
HTMLMeterElement::~HTMLMeterElement() = default;
void HTMLMeterElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLMeterElementPrototype>(realm, "HTMLMeterElement"));
}
}

View file

@ -27,6 +27,8 @@ public:
private:
HTMLMeterElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -13,11 +13,16 @@ namespace Web::HTML {
HTMLModElement::HTMLModElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLModElement"));
}
HTMLModElement::~HTMLModElement() = default;
void HTMLModElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLModElementPrototype>(realm, "HTMLModElement"));
}
DeprecatedFlyString HTMLModElement::default_role() const
{
// https://www.w3.org/TR/html-aria/#el-del

View file

@ -21,6 +21,8 @@ public:
private:
HTMLModElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -12,9 +12,14 @@ namespace Web::HTML {
HTMLOListElement::HTMLOListElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLOListElement"));
}
HTMLOListElement::~HTMLOListElement() = default;
void HTMLOListElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLOListElementPrototype>(realm, "HTMLOListElement"));
}
}

View file

@ -22,6 +22,8 @@ public:
private:
HTMLOListElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -19,8 +19,6 @@ namespace Web::HTML {
HTMLObjectElement::HTMLObjectElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: BrowsingContextContainer(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLObjectElement"));
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-object-element
// Whenever one of the following conditions occur:
// - the element is created,
@ -32,6 +30,12 @@ HTMLObjectElement::HTMLObjectElement(DOM::Document& document, DOM::QualifiedName
HTMLObjectElement::~HTMLObjectElement() = default;
void HTMLObjectElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLObjectElementPrototype>(realm, "HTMLObjectElement"));
}
void HTMLObjectElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
{
BrowsingContextContainer::parse_attribute(name, value);

View file

@ -46,6 +46,8 @@ public:
private:
HTMLObjectElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
virtual JS::GCPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
bool has_ancestor_media_element_or_object_element_not_showing_fallback_content() const;

View file

@ -12,9 +12,14 @@ namespace Web::HTML {
HTMLOptGroupElement::HTMLOptGroupElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLOptGroupElement"));
}
HTMLOptGroupElement::~HTMLOptGroupElement() = default;
void HTMLOptGroupElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLOptGroupElementPrototype>(realm, "HTMLOptGroupElement"));
}
}

View file

@ -22,6 +22,8 @@ public:
private:
HTMLOptGroupElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -21,11 +21,16 @@ namespace Web::HTML {
HTMLOptionElement::HTMLOptionElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLOptionElement"));
}
HTMLOptionElement::~HTMLOptionElement() = default;
void HTMLOptionElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLOptionElementPrototype>(realm, "HTMLOptionElement"));
}
void HTMLOptionElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
{
HTMLElement::parse_attribute(name, value);

View file

@ -38,6 +38,8 @@ private:
HTMLOptionElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
void did_remove_attribute(DeprecatedFlyString const& name) override;

View file

@ -21,11 +21,16 @@ JS::NonnullGCPtr<HTMLOptionsCollection> HTMLOptionsCollection::create(DOM::Paren
HTMLOptionsCollection::HTMLOptionsCollection(DOM::ParentNode& root, Function<bool(DOM::Element const&)> filter)
: DOM::HTMLCollection(root, move(filter))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLOptionsCollection"));
}
HTMLOptionsCollection::~HTMLOptionsCollection() = default;
void HTMLOptionsCollection::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLOptionsCollectionPrototype>(realm, "HTMLOptionsCollection"));
}
// https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#dom-htmloptionscollection-add
WebIDL::ExceptionOr<void> HTMLOptionsCollection::add(HTMLOptionOrOptGroupElement element, Optional<HTMLElementOrElementIndex> before)
{

View file

@ -26,6 +26,8 @@ public:
private:
HTMLOptionsCollection(DOM::ParentNode& root, Function<bool(DOM::Element const&)> filter);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -12,11 +12,16 @@ namespace Web::HTML {
HTMLOutputElement::HTMLOutputElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
{
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLOutputElement"));
}
HTMLOutputElement::~HTMLOutputElement() = default;
void HTMLOutputElement::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLOutputElementPrototype>(realm, "HTMLOutputElement"));
}
// https://html.spec.whatwg.org/multipage/form-elements.html#the-output-element:concept-form-reset-control
void HTMLOutputElement::reset_algorithm()
{

Some files were not shown because too many files have changed in this diff Show more