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:
parent
7bd8fd000f
commit
834202aeb9
339 changed files with 1294 additions and 187 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -32,6 +32,8 @@ public:
|
|||
private:
|
||||
CanvasGradient(JS::Realm&, Type);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
Type m_type {};
|
||||
|
||||
struct ColorStop {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -27,6 +27,8 @@ public:
|
|||
|
||||
private:
|
||||
explicit DOMParser(JS::Realm&);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 { "" };
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,6 +18,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLAudioElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -20,6 +20,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLBRElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,6 +18,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLDListElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLDataElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,6 +21,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLDataListElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLDetailsElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLDialogElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLDirectoryElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLDivElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,6 +18,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLEmbedElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -40,6 +40,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLFieldSetElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -20,6 +20,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLFontElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLHRElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,6 +18,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLHeadElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -29,6 +29,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLHeadingElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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; }
|
||||
};
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLLIElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -22,6 +22,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLLabelElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,6 +18,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLLegendElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,6 +18,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLMapElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -23,6 +23,8 @@ public:
|
|||
|
||||
protected:
|
||||
HTMLMediaElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLMenuElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,6 +18,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLMetaElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -27,6 +27,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLMeterElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -21,6 +21,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLModElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLOListElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLOptGroupElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -26,6 +26,8 @@ public:
|
|||
|
||||
private:
|
||||
HTMLOptionsCollection(DOM::ParentNode& root, Function<bool(DOM::Element const&)> filter);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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
Loading…
Add table
Add a link
Reference in a new issue