1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:28:12 +00:00

LibWeb: Use cached_web_prototype() as much as possible

Unlike ensure_web_prototype<T>(), the cached version doesn't require the
prototype type to be fully formed, so we can use it without including
the FooPrototype.h header. It's also a bit less verbose. :^)
This commit is contained in:
Andreas Kling 2022-09-03 18:43:24 +02:00
parent a85542958c
commit ffad902c07
165 changed files with 176 additions and 325 deletions

View file

@ -2077,7 +2077,7 @@ namespace Web::Bindings {
if (interface.wrapper_base_class == "Wrapper") { if (interface.wrapper_base_class == "Wrapper") {
generator.append(R"~~~( generator.append(R"~~~(
@wrapper_class@::@wrapper_class@(JS::Realm& realm, @fully_qualified_name@& impl) @wrapper_class@::@wrapper_class@(JS::Realm& realm, @fully_qualified_name@& impl)
: Wrapper(verify_cast<HTML::Window>(realm.global_object()).ensure_web_prototype<@prototype_class@>("@name@")) : Wrapper(verify_cast<HTML::Window>(realm.global_object()).cached_web_prototype("@name@"))
, m_impl(impl) , m_impl(impl)
{ {
} }
@ -2087,7 +2087,7 @@ namespace Web::Bindings {
@wrapper_class@::@wrapper_class@(JS::Realm& realm, @fully_qualified_name@& impl) @wrapper_class@::@wrapper_class@(JS::Realm& realm, @fully_qualified_name@& impl)
: @wrapper_base_class@(realm, impl) : @wrapper_base_class@(realm, impl)
{ {
set_prototype(&verify_cast<HTML::Window>(realm.global_object()).ensure_web_prototype<@prototype_class@>("@name@")); set_prototype(&verify_cast<HTML::Window>(realm.global_object()).cached_web_prototype("@name@"));
} }
)~~~"); )~~~");
} }
@ -3775,7 +3775,7 @@ namespace Web::Bindings {
} }
@wrapper_class@::@wrapper_class@(JS::Realm& realm, @fully_qualified_name@& impl) @wrapper_class@::@wrapper_class@(JS::Realm& realm, @fully_qualified_name@& impl)
: Wrapper(verify_cast<HTML::Window>(realm.global_object()).ensure_web_prototype<@prototype_class@>("@name@")) : Wrapper(verify_cast<HTML::Window>(realm.global_object()).cached_web_prototype("@name@"))
, m_impl(impl) , m_impl(impl)
{ {
} }

View file

@ -24,7 +24,7 @@ void AudioConstructor::initialize(JS::Realm& realm)
auto& window = verify_cast<HTML::Window>(realm.global_object()); auto& window = verify_cast<HTML::Window>(realm.global_object());
NativeFunction::initialize(realm); NativeFunction::initialize(realm);
define_direct_property(vm.names.prototype, &window.ensure_web_prototype<HTMLAudioElementPrototype>("HTMLAudioElement"), 0); define_direct_property(vm.names.prototype, &window.cached_web_prototype("HTMLAudioElement"), 0);
define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable); define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable);
} }

View file

@ -24,7 +24,7 @@ void ImageConstructor::initialize(JS::Realm& realm)
auto& window = verify_cast<HTML::Window>(realm.global_object()); auto& window = verify_cast<HTML::Window>(realm.global_object());
NativeFunction::initialize(realm); NativeFunction::initialize(realm);
define_direct_property(vm.names.prototype, &window.ensure_web_prototype<HTMLImageElementPrototype>("HTMLImageElement"), 0); define_direct_property(vm.names.prototype, &window.cached_web_prototype("HTMLImageElement"), 0);
define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable); define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable);
} }

View file

@ -34,7 +34,7 @@ void LocationConstructor::initialize(JS::Realm& realm)
auto& window = verify_cast<HTML::Window>(realm.global_object()); auto& window = verify_cast<HTML::Window>(realm.global_object());
NativeFunction::initialize(realm); NativeFunction::initialize(realm);
define_direct_property(vm.names.prototype, &window.ensure_web_prototype<LocationPrototype>("Location"), 0); define_direct_property(vm.names.prototype, &window.cached_web_prototype("Location"), 0);
define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable); define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable);
} }

View file

@ -23,7 +23,7 @@ namespace Web::Bindings {
// https://html.spec.whatwg.org/multipage/history.html#the-location-interface // https://html.spec.whatwg.org/multipage/history.html#the-location-interface
LocationObject::LocationObject(JS::Realm& realm) LocationObject::LocationObject(JS::Realm& realm)
: Object(verify_cast<HTML::Window>(realm.global_object()).ensure_web_prototype<LocationPrototype>("Location")) : Object(verify_cast<HTML::Window>(realm.global_object()).cached_web_prototype("Location"))
, m_default_properties(heap()) , m_default_properties(heap())
{ {
} }

View file

@ -34,7 +34,7 @@ void NavigatorConstructor::initialize(JS::Realm& realm)
auto& window = verify_cast<HTML::Window>(realm.global_object()); auto& window = verify_cast<HTML::Window>(realm.global_object());
NativeFunction::initialize(realm); NativeFunction::initialize(realm);
define_direct_property(vm.names.prototype, &window.ensure_web_prototype<NavigatorPrototype>("Navigator"), 0); define_direct_property(vm.names.prototype, &window.cached_web_prototype("Navigator"), 0);
define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable); define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable);
} }

View file

@ -14,7 +14,7 @@ namespace Web {
namespace Bindings { namespace Bindings {
NavigatorObject::NavigatorObject(JS::Realm& realm) NavigatorObject::NavigatorObject(JS::Realm& realm)
: Object(verify_cast<HTML::Window>(realm.global_object()).ensure_web_prototype<NavigatorPrototype>("Navigator")) : Object(verify_cast<HTML::Window>(realm.global_object()).cached_web_prototype("Navigator"))
{ {
} }

View file

@ -26,7 +26,7 @@ void OptionConstructor::initialize(JS::Realm& realm)
auto& window = verify_cast<HTML::Window>(realm.global_object()); auto& window = verify_cast<HTML::Window>(realm.global_object());
NativeFunction::initialize(realm); NativeFunction::initialize(realm);
define_direct_property(vm.names.prototype, &window.ensure_web_prototype<HTMLOptionElementPrototype>("HTMLOptionElement"), 0); define_direct_property(vm.names.prototype, &window.cached_web_prototype("HTMLOptionElement"), 0);
define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable); define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable);
} }

View file

@ -34,7 +34,7 @@ void WindowConstructor::initialize(JS::Realm& realm)
auto& window = verify_cast<HTML::Window>(realm.global_object()); auto& window = verify_cast<HTML::Window>(realm.global_object());
NativeFunction::initialize(realm); NativeFunction::initialize(realm);
define_direct_property(vm.names.prototype, &window.ensure_web_prototype<WindowPrototype>("Window"), 0); define_direct_property(vm.names.prototype, &window.cached_web_prototype("Window"), 0);
define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable); define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable);
} }

View file

@ -388,10 +388,10 @@
#define ADD_WINDOW_OBJECT_CONSTRUCTOR_AND_PROTOTYPE(interface_name, constructor_name, prototype_name) \ #define ADD_WINDOW_OBJECT_CONSTRUCTOR_AND_PROTOTYPE(interface_name, constructor_name, prototype_name) \
{ \ { \
auto& constructor = ensure_web_constructor<Bindings::constructor_name>(#interface_name); \
constructor.define_direct_property(vm.names.name, js_string(vm, #interface_name), JS::Attribute::Configurable); \
auto& prototype = ensure_web_prototype<Bindings::prototype_name>(#interface_name); \ auto& prototype = ensure_web_prototype<Bindings::prototype_name>(#interface_name); \
auto& constructor = ensure_web_constructor<Bindings::constructor_name>(#interface_name); \
prototype.define_direct_property(vm.names.constructor, &constructor, JS::Attribute::Writable | JS::Attribute::Configurable); \ prototype.define_direct_property(vm.names.constructor, &constructor, JS::Attribute::Writable | JS::Attribute::Configurable); \
constructor.define_direct_property(vm.names.name, js_string(vm, #interface_name), JS::Attribute::Configurable); \
} }
#define ADD_WINDOW_OBJECT_INTERFACE(interface_name) \ #define ADD_WINDOW_OBJECT_INTERFACE(interface_name) \

View file

@ -20,7 +20,7 @@ class WindowPrototype final : public JS::Object {
public: public:
explicit WindowPrototype(JS::Realm& realm) explicit WindowPrototype(JS::Realm& realm)
: JS::Object(verify_cast<HTML::Window>(realm.global_object()).ensure_web_prototype<EventTargetPrototype>("EventTarget")) : JS::Object(verify_cast<HTML::Window>(realm.global_object()).cached_web_prototype("EventTarget"))
{ {
} }
}; };

View file

@ -5,7 +5,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/CSSConditionRulePrototype.h>
#include <LibWeb/CSS/CSSConditionRule.h> #include <LibWeb/CSS/CSSConditionRule.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -14,7 +13,7 @@ namespace Web::CSS {
CSSConditionRule::CSSConditionRule(HTML::Window& window_object, CSSRuleList& rules) CSSConditionRule::CSSConditionRule(HTML::Window& window_object, CSSRuleList& rules)
: CSSGroupingRule(window_object, rules) : CSSGroupingRule(window_object, rules)
{ {
set_prototype(&window_object.ensure_web_prototype<Bindings::CSSConditionRulePrototype>("CSSConditionRule")); set_prototype(&window_object.cached_web_prototype("CSSConditionRule"));
} }
void CSSConditionRule::for_each_effective_style_rule(Function<void(CSSStyleRule const&)> const& callback) const void CSSConditionRule::for_each_effective_style_rule(Function<void(CSSStyleRule const&)> const& callback) const

View file

@ -5,7 +5,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/CSSFontFaceRulePrototype.h>
#include <LibWeb/CSS/CSSFontFaceRule.h> #include <LibWeb/CSS/CSSFontFaceRule.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -20,7 +19,7 @@ CSSFontFaceRule::CSSFontFaceRule(HTML::Window& window_object, FontFace&& font_fa
: CSSRule(window_object) : CSSRule(window_object)
, m_font_face(move(font_face)) , m_font_face(move(font_face))
{ {
set_prototype(&window_object.ensure_web_prototype<Bindings::CSSFontFaceRulePrototype>("CSSFontFaceRule")); set_prototype(&window_object.cached_web_prototype("CSSFontFaceRule"));
} }
CSSStyleDeclaration* CSSFontFaceRule::style() CSSStyleDeclaration* CSSFontFaceRule::style()

View file

@ -5,7 +5,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/CSSGroupingRulePrototype.h>
#include <LibWeb/Bindings/MainThreadVM.h> #include <LibWeb/Bindings/MainThreadVM.h>
#include <LibWeb/CSS/CSSGroupingRule.h> #include <LibWeb/CSS/CSSGroupingRule.h>
#include <LibWeb/CSS/CSSRuleList.h> #include <LibWeb/CSS/CSSRuleList.h>
@ -17,7 +16,7 @@ CSSGroupingRule::CSSGroupingRule(HTML::Window& window_object, CSSRuleList& rules
: CSSRule(window_object) : CSSRule(window_object)
, m_rules(rules) , m_rules(rules)
{ {
set_prototype(&window_object.ensure_web_prototype<Bindings::CSSGroupingRulePrototype>("CSSGroupingRule")); set_prototype(&window_object.cached_web_prototype("CSSGroupingRule"));
for (auto& rule : m_rules) for (auto& rule : m_rules)
rule.set_parent_rule(this); rule.set_parent_rule(this);
} }

View file

@ -8,7 +8,6 @@
#include <AK/Debug.h> #include <AK/Debug.h>
#include <AK/URL.h> #include <AK/URL.h>
#include <LibWeb/Bindings/CSSImportRulePrototype.h>
#include <LibWeb/CSS/CSSImportRule.h> #include <LibWeb/CSS/CSSImportRule.h>
#include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/CSS/Parser/Parser.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
@ -28,7 +27,7 @@ CSSImportRule::CSSImportRule(AK::URL url, DOM::Document& document)
, m_url(move(url)) , m_url(move(url))
, m_document(document) , m_document(document)
{ {
set_prototype(&document.window().ensure_web_prototype<Bindings::CSSImportRulePrototype>("CSSImportRule")); set_prototype(&document.window().cached_web_prototype("CSSImportRule"));
dbgln_if(CSS_LOADER_DEBUG, "CSSImportRule: Loading import URL: {}", m_url); dbgln_if(CSS_LOADER_DEBUG, "CSSImportRule: Loading import URL: {}", m_url);
auto request = LoadRequest::create_for_url_on_page(m_url, document.page()); auto request = LoadRequest::create_for_url_on_page(m_url, document.page());

View file

@ -5,7 +5,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/CSSMediaRulePrototype.h>
#include <LibWeb/CSS/CSSMediaRule.h> #include <LibWeb/CSS/CSSMediaRule.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -20,7 +19,7 @@ CSSMediaRule::CSSMediaRule(HTML::Window& window_object, MediaList& media, CSSRul
: CSSConditionRule(window_object, rules) : CSSConditionRule(window_object, rules)
, m_media(media) , m_media(media)
{ {
set_prototype(&window_object.ensure_web_prototype<Bindings::CSSMediaRulePrototype>("CSSMediaRule")); set_prototype(&window_object.cached_web_prototype("CSSMediaRule"));
} }
void CSSMediaRule::visit_edges(Cell::Visitor& visitor) void CSSMediaRule::visit_edges(Cell::Visitor& visitor)

View file

@ -6,7 +6,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/CSSRulePrototype.h>
#include <LibWeb/CSS/CSSRule.h> #include <LibWeb/CSS/CSSRule.h>
#include <LibWeb/CSS/CSSStyleSheet.h> #include <LibWeb/CSS/CSSStyleSheet.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -14,7 +13,7 @@
namespace Web::CSS { namespace Web::CSS {
CSSRule::CSSRule(HTML::Window& window_object) CSSRule::CSSRule(HTML::Window& window_object)
: PlatformObject(window_object.ensure_web_prototype<Bindings::CSSRulePrototype>("CSSRule")) : PlatformObject(window_object.cached_web_prototype("CSSRule"))
{ {
} }

View file

@ -5,7 +5,6 @@
*/ */
#include <AK/TypeCasts.h> #include <AK/TypeCasts.h>
#include <LibWeb/Bindings/CSSRuleListPrototype.h>
#include <LibWeb/CSS/CSSImportRule.h> #include <LibWeb/CSS/CSSImportRule.h>
#include <LibWeb/CSS/CSSMediaRule.h> #include <LibWeb/CSS/CSSMediaRule.h>
#include <LibWeb/CSS/CSSRule.h> #include <LibWeb/CSS/CSSRule.h>
@ -25,7 +24,7 @@ CSSRuleList* CSSRuleList::create(HTML::Window& window_object, JS::MarkedVector<C
} }
CSSRuleList::CSSRuleList(HTML::Window& window_object) CSSRuleList::CSSRuleList(HTML::Window& window_object)
: Bindings::LegacyPlatformObject(window_object.ensure_web_prototype<Bindings::CSSRuleListPrototype>("CSSRuleList")) : Bindings::LegacyPlatformObject(window_object.cached_web_prototype("CSSRuleList"))
{ {
} }

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/CSSStyleDeclarationPrototype.h>
#include <LibWeb/CSS/CSSStyleDeclaration.h> #include <LibWeb/CSS/CSSStyleDeclaration.h>
#include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/CSS/Parser/Parser.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
@ -14,7 +13,7 @@
namespace Web::CSS { namespace Web::CSS {
CSSStyleDeclaration::CSSStyleDeclaration(HTML::Window& window_object) CSSStyleDeclaration::CSSStyleDeclaration(HTML::Window& window_object)
: PlatformObject(window_object.ensure_web_prototype<Bindings::CSSStyleDeclarationPrototype>("CSSStyleDeclaration")) : PlatformObject(window_object.cached_web_prototype("CSSStyleDeclaration"))
{ {
} }

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/CSSStyleRulePrototype.h>
#include <LibWeb/CSS/CSSStyleRule.h> #include <LibWeb/CSS/CSSStyleRule.h>
#include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/CSS/Parser/Parser.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -21,7 +20,7 @@ CSSStyleRule::CSSStyleRule(HTML::Window& window_object, NonnullRefPtrVector<Sele
, m_selectors(move(selectors)) , m_selectors(move(selectors))
, m_declaration(declaration) , m_declaration(declaration)
{ {
set_prototype(&window_object.ensure_web_prototype<Bindings::CSSStyleRulePrototype>("CSSStyleRule")); set_prototype(&window_object.cached_web_prototype("CSSStyleRule"));
} }
void CSSStyleRule::visit_edges(Cell::Visitor& visitor) void CSSStyleRule::visit_edges(Cell::Visitor& visitor)

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/CSSStyleSheetPrototype.h>
#include <LibWeb/CSS/CSSStyleSheet.h> #include <LibWeb/CSS/CSSStyleSheet.h>
#include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/CSS/Parser/Parser.h>
#include <LibWeb/CSS/StyleSheetList.h> #include <LibWeb/CSS/StyleSheetList.h>
@ -22,7 +21,7 @@ CSSStyleSheet::CSSStyleSheet(HTML::Window& window_object, CSSRuleList& rules, Op
: StyleSheet(window_object) : StyleSheet(window_object)
, m_rules(&rules) , m_rules(&rules)
{ {
set_prototype(&window_object.ensure_web_prototype<Bindings::CSSStyleSheetPrototype>("CSSStyleSheet")); set_prototype(&window_object.cached_web_prototype("CSSStyleSheet"));
if (location.has_value()) if (location.has_value())
set_location(location->to_string()); set_location(location->to_string());

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/CSSSupportsRulePrototype.h>
#include <LibWeb/CSS/CSSSupportsRule.h> #include <LibWeb/CSS/CSSSupportsRule.h>
#include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/CSS/Parser/Parser.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -20,7 +19,7 @@ CSSSupportsRule::CSSSupportsRule(HTML::Window& window_object, NonnullRefPtr<Supp
: CSSConditionRule(window_object, rules) : CSSConditionRule(window_object, rules)
, m_supports(move(supports)) , m_supports(move(supports))
{ {
set_prototype(&window_object.ensure_web_prototype<Bindings::CSSSupportsRulePrototype>("CSSSupportsRule")); set_prototype(&window_object.cached_web_prototype("CSSSupportsRule"));
} }
String CSSSupportsRule::condition_text() const String CSSSupportsRule::condition_text() const

View file

@ -5,7 +5,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/MediaListPrototype.h>
#include <LibWeb/CSS/MediaList.h> #include <LibWeb/CSS/MediaList.h>
#include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/CSS/Parser/Parser.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -18,7 +17,7 @@ MediaList* MediaList::create(HTML::Window& window_object, NonnullRefPtrVector<Me
} }
MediaList::MediaList(HTML::Window& window_object, NonnullRefPtrVector<MediaQuery>&& media) MediaList::MediaList(HTML::Window& window_object, NonnullRefPtrVector<MediaQuery>&& media)
: Bindings::LegacyPlatformObject(window_object.ensure_web_prototype<Bindings::MediaListPrototype>("MediaList")) : Bindings::LegacyPlatformObject(window_object.cached_web_prototype("MediaList"))
, m_media(move(media)) , m_media(move(media))
{ {
} }

View file

@ -5,7 +5,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/MediaQueryListPrototype.h>
#include <LibWeb/CSS/MediaQueryList.h> #include <LibWeb/CSS/MediaQueryList.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/EventDispatcher.h> #include <LibWeb/DOM/EventDispatcher.h>
@ -24,7 +23,7 @@ MediaQueryList::MediaQueryList(DOM::Document& document, NonnullRefPtrVector<Medi
, m_document(document) , m_document(document)
, m_media(move(media)) , m_media(move(media))
{ {
set_prototype(&document.window().ensure_web_prototype<Bindings::MediaQueryListPrototype>("MediaQueryList")); set_prototype(&document.window().cached_web_prototype("MediaQueryList"));
evaluate(); evaluate();
} }

View file

@ -25,7 +25,7 @@ MediaQueryListEvent::MediaQueryListEvent(HTML::Window& window_object, FlyString
, m_media(event_init.media) , m_media(event_init.media)
, m_matches(event_init.matches) , m_matches(event_init.matches)
{ {
set_prototype(&window_object.ensure_web_prototype<Bindings::MediaQueryListEventPrototype>("MediaQueryListEvent")); set_prototype(&window_object.cached_web_prototype("MediaQueryListEvent"));
} }
MediaQueryListEvent::~MediaQueryListEvent() = default; MediaQueryListEvent::~MediaQueryListEvent() = default;

View file

@ -5,7 +5,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/StyleSheetPrototype.h>
#include <LibWeb/CSS/CSSStyleSheet.h> #include <LibWeb/CSS/CSSStyleSheet.h>
#include <LibWeb/CSS/StyleSheet.h> #include <LibWeb/CSS/StyleSheet.h>
#include <LibWeb/DOM/Element.h> #include <LibWeb/DOM/Element.h>
@ -14,7 +13,7 @@
namespace Web::CSS { namespace Web::CSS {
StyleSheet::StyleSheet(HTML::Window& window_object) StyleSheet::StyleSheet(HTML::Window& window_object)
: PlatformObject(window_object.ensure_web_prototype<Bindings::StyleSheetPrototype>("StyleSheet")) : PlatformObject(window_object.cached_web_prototype("StyleSheet"))
{ {
} }

View file

@ -36,7 +36,7 @@ StyleSheetList* StyleSheetList::create(DOM::Document& document)
} }
StyleSheetList::StyleSheetList(DOM::Document& document) StyleSheetList::StyleSheetList(DOM::Document& document)
: Bindings::LegacyPlatformObject(document.window().ensure_web_prototype<Bindings::StyleSheetListPrototype>("StyleSheetList")) : Bindings::LegacyPlatformObject(document.window().cached_web_prototype("StyleSheetList"))
, m_document(document) , m_document(document)
{ {
} }

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/AbortControllerPrototype.h>
#include <LibWeb/DOM/AbortController.h> #include <LibWeb/DOM/AbortController.h>
#include <LibWeb/DOM/AbortSignal.h> #include <LibWeb/DOM/AbortSignal.h>
@ -21,7 +20,7 @@ AbortController::AbortController(HTML::Window& window, JS::NonnullGCPtr<AbortSig
: PlatformObject(window.realm()) : PlatformObject(window.realm())
, m_signal(move(signal)) , m_signal(move(signal))
{ {
set_prototype(&window.ensure_web_prototype<Bindings::AbortControllerPrototype>("AbortController")); set_prototype(&window.cached_web_prototype("AbortController"));
} }
AbortController::~AbortController() = default; AbortController::~AbortController() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/AbstractRangePrototype.h>
#include <LibWeb/DOM/AbstractRange.h> #include <LibWeb/DOM/AbstractRange.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -12,7 +11,7 @@
namespace Web::DOM { namespace Web::DOM {
AbstractRange::AbstractRange(Node& start_container, u32 start_offset, Node& end_container, u32 end_offset) AbstractRange::AbstractRange(Node& start_container, u32 start_offset, Node& end_container, u32 end_offset)
: Bindings::PlatformObject(start_container.document().window().ensure_web_prototype<Bindings::AbstractRangePrototype>("AbstractRange")) : Bindings::PlatformObject(start_container.document().window().cached_web_prototype("AbstractRange"))
, m_start_container(start_container) , m_start_container(start_container)
, m_start_offset(start_offset) , m_start_offset(start_offset)
, m_end_container(end_container) , m_end_container(end_container)

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/AttributePrototype.h>
#include <LibWeb/DOM/Attribute.h> #include <LibWeb/DOM/Attribute.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Element.h> #include <LibWeb/DOM/Element.h>
@ -24,7 +23,7 @@ Attribute::Attribute(Document& document, FlyString local_name, String value, Ele
, m_value(move(value)) , m_value(move(value))
, m_owner_element(owner_element) , m_owner_element(owner_element)
{ {
set_prototype(&window().ensure_web_prototype<Bindings::AttributePrototype>("Attribute")); set_prototype(&window().cached_web_prototype("Attribute"));
} }
void Attribute::visit_edges(Cell::Visitor& visitor) void Attribute::visit_edges(Cell::Visitor& visitor)

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/CDATASectionPrototype.h>
#include <LibWeb/DOM/CDATASection.h> #include <LibWeb/DOM/CDATASection.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::DOM {
CDATASection::CDATASection(Document& document, String const& data) CDATASection::CDATASection(Document& document, String const& data)
: Text(document, NodeType::CDATA_SECTION_NODE, data) : Text(document, NodeType::CDATA_SECTION_NODE, data)
{ {
set_prototype(&window().ensure_web_prototype<Bindings::CDATASectionPrototype>("CDATASection")); set_prototype(&window().cached_web_prototype("CDATASection"));
} }
CDATASection::~CDATASection() = default; CDATASection::~CDATASection() = default;

View file

@ -5,7 +5,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/CustomEventPrototype.h>
#include <LibWeb/DOM/CustomEvent.h> #include <LibWeb/DOM/CustomEvent.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -24,14 +23,14 @@ CustomEvent* CustomEvent::create_with_global_object(HTML::Window& window_object,
CustomEvent::CustomEvent(HTML::Window& window_object, FlyString const& event_name) CustomEvent::CustomEvent(HTML::Window& window_object, FlyString const& event_name)
: Event(window_object, event_name) : Event(window_object, event_name)
{ {
set_prototype(&window_object.ensure_web_prototype<Bindings::CustomEventPrototype>("CustomEvent")); set_prototype(&window_object.cached_web_prototype("CustomEvent"));
} }
CustomEvent::CustomEvent(HTML::Window& window_object, FlyString const& event_name, CustomEventInit const& event_init) CustomEvent::CustomEvent(HTML::Window& window_object, FlyString const& event_name, CustomEventInit const& event_init)
: Event(window_object, event_name, event_init) : Event(window_object, event_name, event_init)
, m_detail(event_init.detail) , m_detail(event_init.detail)
{ {
set_prototype(&window_object.ensure_web_prototype<Bindings::CustomEventPrototype>("CustomEvent")); set_prototype(&window_object.cached_web_prototype("CustomEvent"));
} }
CustomEvent::~CustomEvent() = default; CustomEvent::~CustomEvent() = default;

View file

@ -5,7 +5,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/DOMImplementationPrototype.h>
#include <LibWeb/Bindings/MainThreadVM.h> #include <LibWeb/Bindings/MainThreadVM.h>
#include <LibWeb/DOM/DOMImplementation.h> #include <LibWeb/DOM/DOMImplementation.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
@ -25,7 +24,7 @@ JS::NonnullGCPtr<DOMImplementation> DOMImplementation::create(Document& document
} }
DOMImplementation::DOMImplementation(Document& document) DOMImplementation::DOMImplementation(Document& document)
: PlatformObject(document.window().ensure_web_prototype<Bindings::DOMImplementationPrototype>("DOMImplementation")) : PlatformObject(document.window().cached_web_prototype("DOMImplementation"))
, m_document(document) , m_document(document)
{ {
} }

View file

@ -7,7 +7,6 @@
#include <AK/CharacterTypes.h> #include <AK/CharacterTypes.h>
#include <AK/StringBuilder.h> #include <AK/StringBuilder.h>
#include <LibWeb/Bindings/DOMTokenListPrototype.h>
#include <LibWeb/DOM/DOMException.h> #include <LibWeb/DOM/DOMException.h>
#include <LibWeb/DOM/DOMTokenList.h> #include <LibWeb/DOM/DOMTokenList.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
@ -62,7 +61,7 @@ DOMTokenList* DOMTokenList::create(Element const& associated_element, FlyString
// https://dom.spec.whatwg.org/#ref-for-domtokenlist%E2%91%A0%E2%91%A2 // https://dom.spec.whatwg.org/#ref-for-domtokenlist%E2%91%A0%E2%91%A2
DOMTokenList::DOMTokenList(Element const& associated_element, FlyString associated_attribute) DOMTokenList::DOMTokenList(Element const& associated_element, FlyString associated_attribute)
: Bindings::LegacyPlatformObject(associated_element.document().window().ensure_web_prototype<Bindings::DOMTokenListPrototype>("DOMTokenList")) : Bindings::LegacyPlatformObject(associated_element.window().cached_web_prototype("DOMTokenList"))
, m_associated_element(associated_element) , m_associated_element(associated_element)
, m_associated_attribute(move(associated_attribute)) , m_associated_attribute(move(associated_attribute))
{ {

View file

@ -14,7 +14,6 @@
#include <LibJS/Interpreter.h> #include <LibJS/Interpreter.h>
#include <LibJS/Parser.h> #include <LibJS/Parser.h>
#include <LibJS/Runtime/FunctionObject.h> #include <LibJS/Runtime/FunctionObject.h>
#include <LibWeb/Bindings/DocumentPrototype.h>
#include <LibWeb/Bindings/MainThreadVM.h> #include <LibWeb/Bindings/MainThreadVM.h>
#include <LibWeb/CSS/MediaQueryList.h> #include <LibWeb/CSS/MediaQueryList.h>
#include <LibWeb/CSS/MediaQueryListEvent.h> #include <LibWeb/CSS/MediaQueryListEvent.h>
@ -283,7 +282,7 @@ Document::Document(HTML::Window& window, const AK::URL& url)
, m_url(url) , m_url(url)
, m_window(window) , m_window(window)
{ {
set_prototype(&window.ensure_web_prototype<Bindings::DocumentPrototype>("Document")); set_prototype(&window.cached_web_prototype("Document"));
HTML::main_thread_event_loop().register_document({}, *this); HTML::main_thread_event_loop().register_document({}, *this);

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/DocumentFragmentPrototype.h>
#include <LibWeb/DOM/DocumentFragment.h> #include <LibWeb/DOM/DocumentFragment.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::DOM {
DocumentFragment::DocumentFragment(Document& document) DocumentFragment::DocumentFragment(Document& document)
: ParentNode(document, NodeType::DOCUMENT_FRAGMENT_NODE) : ParentNode(document, NodeType::DOCUMENT_FRAGMENT_NODE)
{ {
set_prototype(&window().ensure_web_prototype<Bindings::DocumentFragmentPrototype>("DocumentFragment")); set_prototype(&window().cached_web_prototype("DocumentFragment"));
} }
void DocumentFragment::visit_edges(Cell::Visitor& visitor) void DocumentFragment::visit_edges(Cell::Visitor& visitor)

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/DocumentTypePrototype.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/DocumentType.h> #include <LibWeb/DOM/DocumentType.h>
@ -18,7 +17,7 @@ JS::NonnullGCPtr<DocumentType> DocumentType::create(Document& document)
DocumentType::DocumentType(Document& document) DocumentType::DocumentType(Document& document)
: Node(document, NodeType::DOCUMENT_TYPE_NODE) : Node(document, NodeType::DOCUMENT_TYPE_NODE)
{ {
set_prototype(&window().ensure_web_prototype<Bindings::DocumentTypePrototype>("DocumentType")); set_prototype(&window().cached_web_prototype("DocumentType"));
} }
} }

View file

@ -8,7 +8,6 @@
#include <AK/CharacterTypes.h> #include <AK/CharacterTypes.h>
#include <AK/Debug.h> #include <AK/Debug.h>
#include <AK/StringBuilder.h> #include <AK/StringBuilder.h>
#include <LibWeb/Bindings/ElementPrototype.h>
#include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/CSS/Parser/Parser.h>
#include <LibWeb/CSS/PropertyID.h> #include <LibWeb/CSS/PropertyID.h>
#include <LibWeb/CSS/ResolvedCSSStyleDeclaration.h> #include <LibWeb/CSS/ResolvedCSSStyleDeclaration.h>
@ -48,8 +47,7 @@ Element::Element(Document& document, DOM::QualifiedName qualified_name)
, m_qualified_name(move(qualified_name)) , m_qualified_name(move(qualified_name))
, m_attributes(NamedNodeMap::create(*this)) , m_attributes(NamedNodeMap::create(*this))
{ {
set_prototype(&document.window().ensure_web_prototype<Bindings::ElementPrototype>("Element")); set_prototype(&window().cached_web_prototype("Element"));
make_html_uppercased_qualified_name(); make_html_uppercased_qualified_name();
} }

View file

@ -7,7 +7,6 @@
*/ */
#include <AK/TypeCasts.h> #include <AK/TypeCasts.h>
#include <LibWeb/Bindings/EventPrototype.h>
#include <LibWeb/DOM/Event.h> #include <LibWeb/DOM/Event.h>
#include <LibWeb/DOM/Node.h> #include <LibWeb/DOM/Node.h>
#include <LibWeb/DOM/ShadowRoot.h> #include <LibWeb/DOM/ShadowRoot.h>
@ -25,15 +24,15 @@ JS::NonnullGCPtr<Event> Event::create_with_global_object(HTML::Window& window_ob
return create(window_object, event_name, event_init); return create(window_object, event_name, event_init);
} }
Event::Event(HTML::Window& window_object, FlyString const& type) Event::Event(HTML::Window& window, FlyString const& type)
: PlatformObject(window_object.ensure_web_prototype<Bindings::EventPrototype>("Event")) : PlatformObject(window.cached_web_prototype("Event"))
, m_type(type) , m_type(type)
, m_initialized(true) , m_initialized(true)
{ {
} }
Event::Event(HTML::Window& window_object, FlyString const& type, EventInit const& event_init) Event::Event(HTML::Window& window, FlyString const& type, EventInit const& event_init)
: PlatformObject(window_object.ensure_web_prototype<Bindings::EventPrototype>("Event")) : PlatformObject(window.cached_web_prototype("Event"))
, m_type(type) , m_type(type)
, m_bubbles(event_init.bubbles) , m_bubbles(event_init.bubbles)
, m_cancelable(event_init.cancelable) , m_cancelable(event_init.cancelable)

View file

@ -5,7 +5,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLCollectionPrototype.h>
#include <LibWeb/DOM/Element.h> #include <LibWeb/DOM/Element.h>
#include <LibWeb/DOM/HTMLCollection.h> #include <LibWeb/DOM/HTMLCollection.h>
#include <LibWeb/DOM/ParentNode.h> #include <LibWeb/DOM/ParentNode.h>
@ -20,7 +19,7 @@ JS::NonnullGCPtr<HTMLCollection> HTMLCollection::create(ParentNode& root, Functi
} }
HTMLCollection::HTMLCollection(ParentNode& root, Function<bool(Element const&)> filter) HTMLCollection::HTMLCollection(ParentNode& root, Function<bool(Element const&)> filter)
: LegacyPlatformObject(root.window().ensure_web_prototype<Bindings::HTMLCollectionPrototype>("HTMLCollection")) : LegacyPlatformObject(root.window().cached_web_prototype("HTMLCollection"))
, m_root(root) , m_root(root)
, m_filter(move(filter)) , m_filter(move(filter))
{ {

View file

@ -5,7 +5,6 @@
*/ */
#include <LibWeb/Bindings/MainThreadVM.h> #include <LibWeb/Bindings/MainThreadVM.h>
#include <LibWeb/Bindings/MutationObserverPrototype.h>
#include <LibWeb/DOM/MutationObserver.h> #include <LibWeb/DOM/MutationObserver.h>
#include <LibWeb/DOM/Node.h> #include <LibWeb/DOM/Node.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -22,7 +21,7 @@ MutationObserver::MutationObserver(HTML::Window& window, JS::GCPtr<Bindings::Cal
: PlatformObject(window.realm()) : PlatformObject(window.realm())
, m_callback(move(callback)) , m_callback(move(callback))
{ {
set_prototype(&window.ensure_web_prototype<Bindings::MutationObserverPrototype>("MutationObserver")); set_prototype(&window.cached_web_prototype("MutationObserver"));
// 1. Set thiss callback to callback. // 1. Set thiss callback to callback.

View file

@ -5,7 +5,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/MutationRecordPrototype.h>
#include <LibWeb/DOM/MutationRecord.h> #include <LibWeb/DOM/MutationRecord.h>
#include <LibWeb/DOM/Node.h> #include <LibWeb/DOM/Node.h>
#include <LibWeb/DOM/NodeList.h> #include <LibWeb/DOM/NodeList.h>
@ -30,7 +29,7 @@ MutationRecord::MutationRecord(HTML::Window& window, FlyString const& type, Node
, m_attribute_namespace(attribute_namespace) , m_attribute_namespace(attribute_namespace)
, m_old_value(old_value) , m_old_value(old_value)
{ {
set_prototype(&window.ensure_web_prototype<Bindings::MutationRecordPrototype>("MutationRecord")); set_prototype(&window.cached_web_prototype("MutationRecord"));
} }
MutationRecord::~MutationRecord() = default; MutationRecord::~MutationRecord() = default;

View file

@ -5,7 +5,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/NamedNodeMapPrototype.h>
#include <LibWeb/DOM/Attribute.h> #include <LibWeb/DOM/Attribute.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/NamedNodeMap.h> #include <LibWeb/DOM/NamedNodeMap.h>
@ -20,7 +19,7 @@ JS::NonnullGCPtr<NamedNodeMap> NamedNodeMap::create(Element& element)
} }
NamedNodeMap::NamedNodeMap(Element& element) NamedNodeMap::NamedNodeMap(Element& element)
: Bindings::LegacyPlatformObject(element.document().window().ensure_web_prototype<Bindings::NamedNodeMapPrototype>("NamedNodeMap")) : Bindings::LegacyPlatformObject(element.window().cached_web_prototype("NamedNodeMap"))
, m_element(element) , m_element(element)
{ {
} }

View file

@ -6,7 +6,6 @@
#include <LibWeb/Bindings/DOMExceptionWrapper.h> #include <LibWeb/Bindings/DOMExceptionWrapper.h>
#include <LibWeb/Bindings/IDLAbstractOperations.h> #include <LibWeb/Bindings/IDLAbstractOperations.h>
#include <LibWeb/Bindings/NodeIteratorPrototype.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Node.h> #include <LibWeb/DOM/Node.h>
#include <LibWeb/DOM/NodeIterator.h> #include <LibWeb/DOM/NodeIterator.h>
@ -14,7 +13,7 @@
namespace Web::DOM { namespace Web::DOM {
NodeIterator::NodeIterator(Node& root) NodeIterator::NodeIterator(Node& root)
: PlatformObject(root.document().window().ensure_web_prototype<Bindings::NodeIteratorPrototype>("NodeIterator")) : PlatformObject(root.window().cached_web_prototype("NodeIterator"))
, m_root(root) , m_root(root)
, m_reference({ root }) , m_reference({ root })
{ {

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/NodeListPrototype.h>
#include <LibWeb/DOM/Node.h> #include <LibWeb/DOM/Node.h>
#include <LibWeb/DOM/NodeList.h> #include <LibWeb/DOM/NodeList.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -12,7 +11,7 @@
namespace Web::DOM { namespace Web::DOM {
NodeList::NodeList(HTML::Window& window) NodeList::NodeList(HTML::Window& window)
: LegacyPlatformObject(window.ensure_web_prototype<Bindings::NodeListPrototype>("NodeList")) : LegacyPlatformObject(window.cached_web_prototype("NodeList"))
{ {
} }

View file

@ -6,7 +6,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/RangePrototype.h>
#include <LibWeb/DOM/Comment.h> #include <LibWeb/DOM/Comment.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/DocumentFragment.h> #include <LibWeb/DOM/DocumentFragment.h>
@ -50,13 +49,13 @@ JS::NonnullGCPtr<Range> Range::create_with_global_object(HTML::Window& window)
Range::Range(Document& document) Range::Range(Document& document)
: Range(document, 0, document, 0) : Range(document, 0, document, 0)
{ {
set_prototype(&document.window().ensure_web_prototype<Bindings::RangePrototype>("Range")); set_prototype(&document.window().cached_web_prototype("Range"));
} }
Range::Range(Node& start_container, u32 start_offset, Node& end_container, u32 end_offset) Range::Range(Node& start_container, u32 start_offset, Node& end_container, u32 end_offset)
: AbstractRange(start_container, start_offset, end_container, end_offset) : AbstractRange(start_container, start_offset, end_container, end_offset)
{ {
set_prototype(&start_container.document().window().ensure_web_prototype<Bindings::RangePrototype>("Range")); set_prototype(&start_container.window().cached_web_prototype("Range"));
live_ranges().set(this); live_ranges().set(this);
} }

View file

@ -6,7 +6,6 @@
*/ */
#include <AK/TypeCasts.h> #include <AK/TypeCasts.h>
#include <LibWeb/Bindings/StaticRangePrototype.h>
#include <LibWeb/DOM/Attribute.h> #include <LibWeb/DOM/Attribute.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/DocumentType.h> #include <LibWeb/DOM/DocumentType.h>
@ -18,7 +17,7 @@ namespace Web::DOM {
StaticRange::StaticRange(Node& start_container, u32 start_offset, Node& end_container, u32 end_offset) StaticRange::StaticRange(Node& start_container, u32 start_offset, Node& end_container, u32 end_offset)
: AbstractRange(start_container, start_offset, end_container, end_offset) : AbstractRange(start_container, start_offset, end_container, end_offset)
{ {
set_prototype(&start_container.document().window().ensure_web_prototype<Bindings::StaticRangePrototype>("StaticRange")); set_prototype(&start_container.document().window().cached_web_prototype("StaticRange"));
} }
StaticRange::~StaticRange() = default; StaticRange::~StaticRange() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/TextPrototype.h>
#include <LibWeb/DOM/Range.h> #include <LibWeb/DOM/Range.h>
#include <LibWeb/DOM/Text.h> #include <LibWeb/DOM/Text.h>
#include <LibWeb/HTML/HTMLInputElement.h> #include <LibWeb/HTML/HTMLInputElement.h>
@ -16,13 +15,13 @@ namespace Web::DOM {
Text::Text(Document& document, String const& data) Text::Text(Document& document, String const& data)
: CharacterData(document, NodeType::TEXT_NODE, data) : CharacterData(document, NodeType::TEXT_NODE, data)
{ {
set_prototype(&window().ensure_web_prototype<Bindings::TextPrototype>("Text")); set_prototype(&window().cached_web_prototype("Text"));
} }
Text::Text(Document& document, NodeType type, String const& data) Text::Text(Document& document, NodeType type, String const& data)
: CharacterData(document, type, data) : CharacterData(document, type, data)
{ {
set_prototype(&window().ensure_web_prototype<Bindings::TextPrototype>("Text")); set_prototype(&window().cached_web_prototype("Text"));
} }
void Text::visit_edges(Cell::Visitor& visitor) void Text::visit_edges(Cell::Visitor& visitor)

View file

@ -6,7 +6,6 @@
#include <LibWeb/Bindings/DOMExceptionWrapper.h> #include <LibWeb/Bindings/DOMExceptionWrapper.h>
#include <LibWeb/Bindings/IDLAbstractOperations.h> #include <LibWeb/Bindings/IDLAbstractOperations.h>
#include <LibWeb/Bindings/TreeWalkerPrototype.h>
#include <LibWeb/Bindings/Wrapper.h> #include <LibWeb/Bindings/Wrapper.h>
#include <LibWeb/DOM/DOMException.h> #include <LibWeb/DOM/DOMException.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
@ -17,7 +16,7 @@
namespace Web::DOM { namespace Web::DOM {
TreeWalker::TreeWalker(Node& root) TreeWalker::TreeWalker(Node& root)
: PlatformObject(root.document().window().ensure_web_prototype<Bindings::TreeWalkerPrototype>("TreeWalker")) : PlatformObject(root.window().cached_web_prototype("TreeWalker"))
, m_root(root) , m_root(root)
, m_current(root) , m_current(root)
{ {

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/XMLSerializerPrototype.h>
#include <LibWeb/DOM/CDATASection.h> #include <LibWeb/DOM/CDATASection.h>
#include <LibWeb/DOM/Comment.h> #include <LibWeb/DOM/Comment.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
@ -29,7 +28,7 @@ JS::NonnullGCPtr<XMLSerializer> XMLSerializer::create_with_global_object(HTML::W
XMLSerializer::XMLSerializer(HTML::Window& window) XMLSerializer::XMLSerializer(HTML::Window& window)
: PlatformObject(window.realm()) : PlatformObject(window.realm())
{ {
set_prototype(&window.ensure_web_prototype<Bindings::XMLSerializerPrototype>("XMLSerializer")); set_prototype(&window.cached_web_prototype("XMLSerializer"));
} }
XMLSerializer::~XMLSerializer() = default; XMLSerializer::~XMLSerializer() = default;

View file

@ -5,7 +5,6 @@
*/ */
#include <AK/QuickSort.h> #include <AK/QuickSort.h>
#include <LibWeb/Bindings/CanvasGradientPrototype.h>
#include <LibWeb/DOM/ExceptionOr.h> #include <LibWeb/DOM/ExceptionOr.h>
#include <LibWeb/HTML/CanvasGradient.h> #include <LibWeb/HTML/CanvasGradient.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -44,7 +43,7 @@ CanvasGradient::CanvasGradient(HTML::Window& window, Type type)
: PlatformObject(window.realm()) : PlatformObject(window.realm())
, m_type(type) , m_type(type)
{ {
set_prototype(&window.ensure_web_prototype<Bindings::CanvasGradientPrototype>("CanvasGradient")); set_prototype(&window.cached_web_prototype("CanvasGradient"));
} }
CanvasGradient::~CanvasGradient() = default; CanvasGradient::~CanvasGradient() = default;

View file

@ -10,7 +10,6 @@
#include <LibGfx/Painter.h> #include <LibGfx/Painter.h>
#include <LibGfx/Quad.h> #include <LibGfx/Quad.h>
#include <LibGfx/Rect.h> #include <LibGfx/Rect.h>
#include <LibWeb/Bindings/CanvasRenderingContext2DPrototype.h>
#include <LibWeb/DOM/ExceptionOr.h> #include <LibWeb/DOM/ExceptionOr.h>
#include <LibWeb/HTML/CanvasRenderingContext2D.h> #include <LibWeb/HTML/CanvasRenderingContext2D.h>
#include <LibWeb/HTML/HTMLCanvasElement.h> #include <LibWeb/HTML/HTMLCanvasElement.h>
@ -32,7 +31,7 @@ CanvasRenderingContext2D::CanvasRenderingContext2D(HTML::Window& window, HTMLCan
: PlatformObject(window.realm()) : PlatformObject(window.realm())
, m_element(element) , m_element(element)
{ {
set_prototype(&window.ensure_web_prototype<Bindings::CanvasRenderingContext2DPrototype>("CanvasRenderingContext2D")); set_prototype(&window.cached_web_prototype("CanvasRenderingContext2D"));
} }
CanvasRenderingContext2D::~CanvasRenderingContext2D() = default; CanvasRenderingContext2D::~CanvasRenderingContext2D() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/CloseEventPrototype.h>
#include <LibWeb/HTML/CloseEvent.h> #include <LibWeb/HTML/CloseEvent.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -26,7 +25,7 @@ CloseEvent::CloseEvent(HTML::Window& window_object, FlyString const& event_name,
, m_code(event_init.code) , m_code(event_init.code)
, m_reason(event_init.reason) , m_reason(event_init.reason)
{ {
set_prototype(&window_object.ensure_web_prototype<Bindings::CloseEventPrototype>("CloseEvent")); set_prototype(&window_object.cached_web_prototype("CloseEvent"));
} }
CloseEvent::~CloseEvent() = default; CloseEvent::~CloseEvent() = default;

View file

@ -21,7 +21,7 @@ DOM::ExceptionOr<JS::NonnullGCPtr<DOMParser>> DOMParser::create_with_global_obje
DOMParser::DOMParser(HTML::Window& window) DOMParser::DOMParser(HTML::Window& window)
: PlatformObject(window.realm()) : PlatformObject(window.realm())
{ {
set_prototype(&window.ensure_web_prototype<Bindings::DOMParserPrototype>("DOMParser")); set_prototype(&window.cached_web_prototype("DOMParser"));
} }
DOMParser::~DOMParser() = default; DOMParser::~DOMParser() = default;

View file

@ -5,7 +5,6 @@
*/ */
#include <AK/CharacterTypes.h> #include <AK/CharacterTypes.h>
#include <LibWeb/Bindings/DOMStringMapPrototype.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Element.h> #include <LibWeb/DOM/Element.h>
#include <LibWeb/HTML/DOMStringMap.h> #include <LibWeb/HTML/DOMStringMap.h>
@ -20,7 +19,7 @@ JS::NonnullGCPtr<DOMStringMap> DOMStringMap::create(DOM::Element& element)
} }
DOMStringMap::DOMStringMap(DOM::Element& element) DOMStringMap::DOMStringMap(DOM::Element& element)
: PlatformObject(element.document().window().ensure_web_prototype<Bindings::DOMStringMapPrototype>("DOMStringMap")) : PlatformObject(element.window().cached_web_prototype("DOMStringMap"))
, m_associated_element(element) , m_associated_element(element)
{ {
} }

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/ErrorEventPrototype.h>
#include <LibWeb/HTML/ErrorEvent.h> #include <LibWeb/HTML/ErrorEvent.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -28,7 +27,7 @@ ErrorEvent::ErrorEvent(HTML::Window& window_object, FlyString const& event_name,
, m_colno(event_init.colno) , m_colno(event_init.colno)
, m_error(event_init.error) , m_error(event_init.error)
{ {
set_prototype(&window_object.ensure_web_prototype<Bindings::ErrorEventPrototype>("ErrorEvent")); set_prototype(&window_object.cached_web_prototype("ErrorEvent"));
} }
ErrorEvent::~ErrorEvent() = default; ErrorEvent::~ErrorEvent() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLAnchorElementPrototype.h>
#include <LibWeb/HTML/HTMLAnchorElement.h> #include <LibWeb/HTML/HTMLAnchorElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLAnchorElement::HTMLAnchorElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLAnchorElement::HTMLAnchorElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLAnchorElementPrototype>("HTMLAnchorElement")); set_prototype(&window().cached_web_prototype("HTMLAnchorElement"));
activation_behavior = [this](auto const& event) { activation_behavior = [this](auto const& event) {
run_activation_behavior(event); run_activation_behavior(event);

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLAreaElementPrototype.h>
#include <LibWeb/HTML/HTMLAreaElement.h> #include <LibWeb/HTML/HTMLAreaElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLAreaElement::HTMLAreaElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLAreaElement::HTMLAreaElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLAreaElementPrototype>("HTMLAreaElement")); set_prototype(&window().cached_web_prototype("HTMLAreaElement"));
} }
HTMLAreaElement::~HTMLAreaElement() = default; HTMLAreaElement::~HTMLAreaElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLAudioElementPrototype.h>
#include <LibWeb/HTML/HTMLAudioElement.h> #include <LibWeb/HTML/HTMLAudioElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLAudioElement::HTMLAudioElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLAudioElement::HTMLAudioElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLMediaElement(document, move(qualified_name)) : HTMLMediaElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLAudioElementPrototype>("HTMLAudioElement")); set_prototype(&window().cached_web_prototype("HTMLAudioElement"));
} }
HTMLAudioElement::~HTMLAudioElement() = default; HTMLAudioElement::~HTMLAudioElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLBRElementPrototype.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/HTMLBRElement.h> #include <LibWeb/HTML/HTMLBRElement.h>
#include <LibWeb/Layout/BreakNode.h> #include <LibWeb/Layout/BreakNode.h>
@ -14,7 +13,7 @@ namespace Web::HTML {
HTMLBRElement::HTMLBRElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLBRElement::HTMLBRElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLBRElementPrototype>("HTMLBRElement")); set_prototype(&window().cached_web_prototype("HTMLBRElement"));
} }
HTMLBRElement::~HTMLBRElement() = default; HTMLBRElement::~HTMLBRElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLBaseElementPrototype.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/HTMLBaseElement.h> #include <LibWeb/HTML/HTMLBaseElement.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLBaseElement::HTMLBaseElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLBaseElement::HTMLBaseElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLBaseElementPrototype>("HTMLBaseElement")); set_prototype(&window().cached_web_prototype("HTMLBaseElement"));
} }
HTMLBaseElement::~HTMLBaseElement() = default; HTMLBaseElement::~HTMLBaseElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLBodyElementPrototype.h>
#include <LibWeb/CSS/StyleProperties.h> #include <LibWeb/CSS/StyleProperties.h>
#include <LibWeb/CSS/StyleValue.h> #include <LibWeb/CSS/StyleValue.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
@ -16,7 +15,7 @@ namespace Web::HTML {
HTMLBodyElement::HTMLBodyElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLBodyElement::HTMLBodyElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLBodyElementPrototype>("HTMLBodyElement")); set_prototype(&window().cached_web_prototype("HTMLBodyElement"));
} }
HTMLBodyElement::~HTMLBodyElement() = default; HTMLBodyElement::~HTMLBodyElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLButtonElementPrototype.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/HTMLButtonElement.h> #include <LibWeb/HTML/HTMLButtonElement.h>
#include <LibWeb/HTML/HTMLFormElement.h> #include <LibWeb/HTML/HTMLFormElement.h>
@ -14,7 +13,7 @@ namespace Web::HTML {
HTMLButtonElement::HTMLButtonElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLButtonElement::HTMLButtonElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLButtonElementPrototype>("HTMLButtonElement")); set_prototype(&window().cached_web_prototype("HTMLButtonElement"));
// https://html.spec.whatwg.org/multipage/form-elements.html#the-button-element:activation-behaviour // https://html.spec.whatwg.org/multipage/form-elements.html#the-button-element:activation-behaviour
activation_behavior = [this](auto&) { activation_behavior = [this](auto&) {

View file

@ -8,7 +8,6 @@
#include <AK/Checked.h> #include <AK/Checked.h>
#include <LibGfx/Bitmap.h> #include <LibGfx/Bitmap.h>
#include <LibGfx/PNGWriter.h> #include <LibGfx/PNGWriter.h>
#include <LibWeb/Bindings/HTMLCanvasElementPrototype.h>
#include <LibWeb/CSS/StyleComputer.h> #include <LibWeb/CSS/StyleComputer.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/CanvasRenderingContext2D.h> #include <LibWeb/HTML/CanvasRenderingContext2D.h>
@ -22,7 +21,7 @@ static constexpr auto max_canvas_area = 16384 * 16384;
HTMLCanvasElement::HTMLCanvasElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLCanvasElement::HTMLCanvasElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&document.window().ensure_web_prototype<Bindings::HTMLCanvasElementPrototype>("HTMLCanvasElement")); set_prototype(&document.window().cached_web_prototype("HTMLCanvasElement"));
} }
HTMLCanvasElement::~HTMLCanvasElement() = default; HTMLCanvasElement::~HTMLCanvasElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLDListElementPrototype.h>
#include <LibWeb/HTML/HTMLDListElement.h> #include <LibWeb/HTML/HTMLDListElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLDListElement::HTMLDListElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLDListElement::HTMLDListElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLDListElementPrototype>("HTMLDListElement")); set_prototype(&window().cached_web_prototype("HTMLDListElement"));
} }
HTMLDListElement::~HTMLDListElement() = default; HTMLDListElement::~HTMLDListElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLDataElementPrototype.h>
#include <LibWeb/HTML/HTMLDataElement.h> #include <LibWeb/HTML/HTMLDataElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLDataElement::HTMLDataElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLDataElement::HTMLDataElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLDataElementPrototype>("HTMLDataElement")); set_prototype(&window().cached_web_prototype("HTMLDataElement"));
} }
HTMLDataElement::~HTMLDataElement() = default; HTMLDataElement::~HTMLDataElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLDataListElementPrototype.h>
#include <LibWeb/HTML/HTMLDataListElement.h> #include <LibWeb/HTML/HTMLDataListElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLDataListElement::HTMLDataListElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLDataListElement::HTMLDataListElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLDataListElementPrototype>("HTMLDataListElement")); set_prototype(&window().cached_web_prototype("HTMLDataListElement"));
} }
HTMLDataListElement::~HTMLDataListElement() = default; HTMLDataListElement::~HTMLDataListElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLDetailsElementPrototype.h>
#include <LibWeb/HTML/HTMLDetailsElement.h> #include <LibWeb/HTML/HTMLDetailsElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLDetailsElement::HTMLDetailsElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLDetailsElement::HTMLDetailsElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLDetailsElementPrototype>("HTMLDetailsElement")); set_prototype(&window().cached_web_prototype("HTMLDetailsElement"));
} }
HTMLDetailsElement::~HTMLDetailsElement() = default; HTMLDetailsElement::~HTMLDetailsElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLDialogElementPrototype.h>
#include <LibWeb/HTML/HTMLDialogElement.h> #include <LibWeb/HTML/HTMLDialogElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLDialogElement::HTMLDialogElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLDialogElement::HTMLDialogElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLDialogElementPrototype>("HTMLDialogElement")); set_prototype(&window().cached_web_prototype("HTMLDialogElement"));
} }
HTMLDialogElement::~HTMLDialogElement() = default; HTMLDialogElement::~HTMLDialogElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLDirectoryElementPrototype.h>
#include <LibWeb/HTML/HTMLDirectoryElement.h> #include <LibWeb/HTML/HTMLDirectoryElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLDirectoryElement::HTMLDirectoryElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLDirectoryElement::HTMLDirectoryElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLDirectoryElementPrototype>("HTMLDirectoryElement")); set_prototype(&window().cached_web_prototype("HTMLDirectoryElement"));
} }
HTMLDirectoryElement::~HTMLDirectoryElement() = default; HTMLDirectoryElement::~HTMLDirectoryElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLDivElementPrototype.h>
#include <LibWeb/HTML/HTMLDivElement.h> #include <LibWeb/HTML/HTMLDivElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLDivElement::HTMLDivElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLDivElement::HTMLDivElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLDivElementPrototype>("HTMLDivElement")); set_prototype(&window().cached_web_prototype("HTMLDivElement"));
} }
HTMLDivElement::~HTMLDivElement() = default; HTMLDivElement::~HTMLDivElement() = default;

View file

@ -7,7 +7,6 @@
#include <AK/StringBuilder.h> #include <AK/StringBuilder.h>
#include <LibJS/Interpreter.h> #include <LibJS/Interpreter.h>
#include <LibJS/Parser.h> #include <LibJS/Parser.h>
#include <LibWeb/Bindings/HTMLElementPrototype.h>
#include <LibWeb/DOM/DOMException.h> #include <LibWeb/DOM/DOMException.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/ExceptionOr.h> #include <LibWeb/DOM/ExceptionOr.h>
@ -33,7 +32,7 @@ HTMLElement::HTMLElement(DOM::Document& document, DOM::QualifiedName qualified_n
: Element(document, move(qualified_name)) : Element(document, move(qualified_name))
, m_dataset(DOMStringMap::create(*this)) , m_dataset(DOMStringMap::create(*this))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLElementPrototype>("HTMLElement")); set_prototype(&window().cached_web_prototype("HTMLElement"));
} }
HTMLElement::~HTMLElement() = default; HTMLElement::~HTMLElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLEmbedElementPrototype.h>
#include <LibWeb/HTML/HTMLEmbedElement.h> #include <LibWeb/HTML/HTMLEmbedElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLEmbedElement::HTMLEmbedElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLEmbedElement::HTMLEmbedElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLEmbedElementPrototype>("HTMLEmbedElement")); set_prototype(&window().cached_web_prototype("HTMLEmbedElement"));
} }
HTMLEmbedElement::~HTMLEmbedElement() = default; HTMLEmbedElement::~HTMLEmbedElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLFieldSetElementPrototype.h>
#include <LibWeb/HTML/HTMLFieldSetElement.h> #include <LibWeb/HTML/HTMLFieldSetElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLFieldSetElement::HTMLFieldSetElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLFieldSetElement::HTMLFieldSetElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLFieldSetElementPrototype>("HTMLFieldSetElement")); set_prototype(&window().cached_web_prototype("HTMLFieldSetElement"));
} }
HTMLFieldSetElement::~HTMLFieldSetElement() = default; HTMLFieldSetElement::~HTMLFieldSetElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLFontElementPrototype.h>
#include <LibWeb/CSS/StyleProperties.h> #include <LibWeb/CSS/StyleProperties.h>
#include <LibWeb/CSS/StyleValue.h> #include <LibWeb/CSS/StyleValue.h>
#include <LibWeb/HTML/HTMLFontElement.h> #include <LibWeb/HTML/HTMLFontElement.h>
@ -15,7 +14,7 @@ namespace Web::HTML {
HTMLFontElement::HTMLFontElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLFontElement::HTMLFontElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLFontElementPrototype>("HTMLFontElement")); set_prototype(&window().cached_web_prototype("HTMLFontElement"));
} }
HTMLFontElement::~HTMLFontElement() = default; HTMLFontElement::~HTMLFontElement() = default;

View file

@ -5,7 +5,6 @@
*/ */
#include <AK/StringBuilder.h> #include <AK/StringBuilder.h>
#include <LibWeb/Bindings/HTMLFormElementPrototype.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/EventNames.h> #include <LibWeb/HTML/EventNames.h>
@ -26,7 +25,7 @@ namespace Web::HTML {
HTMLFormElement::HTMLFormElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLFormElement::HTMLFormElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLFormElementPrototype>("HTMLFormElement")); set_prototype(&window().cached_web_prototype("HTMLFormElement"));
} }
HTMLFormElement::~HTMLFormElement() = default; HTMLFormElement::~HTMLFormElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLFrameElementPrototype.h>
#include <LibWeb/HTML/HTMLFrameElement.h> #include <LibWeb/HTML/HTMLFrameElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLFrameElement::HTMLFrameElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLFrameElement::HTMLFrameElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLFrameElementPrototype>("HTMLFrameElement")); set_prototype(&window().cached_web_prototype("HTMLFrameElement"));
} }
HTMLFrameElement::~HTMLFrameElement() = default; HTMLFrameElement::~HTMLFrameElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLFrameSetElementPrototype.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/HTMLFrameSetElement.h> #include <LibWeb/HTML/HTMLFrameSetElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -14,7 +13,7 @@ namespace Web::HTML {
HTMLFrameSetElement::HTMLFrameSetElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLFrameSetElement::HTMLFrameSetElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLFrameSetElementPrototype>("HTMLFrameSetElement")); set_prototype(&window().cached_web_prototype("HTMLFrameSetElement"));
} }
HTMLFrameSetElement::~HTMLFrameSetElement() = default; HTMLFrameSetElement::~HTMLFrameSetElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLHRElementPrototype.h>
#include <LibWeb/HTML/HTMLHRElement.h> #include <LibWeb/HTML/HTMLHRElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLHRElement::HTMLHRElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLHRElement::HTMLHRElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLHRElementPrototype>("HTMLHRElement")); set_prototype(&window().cached_web_prototype("HTMLHRElement"));
} }
HTMLHRElement::~HTMLHRElement() = default; HTMLHRElement::~HTMLHRElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLHeadElementPrototype.h>
#include <LibWeb/HTML/HTMLHeadElement.h> #include <LibWeb/HTML/HTMLHeadElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLHeadElement::HTMLHeadElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLHeadElement::HTMLHeadElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLHeadElementPrototype>("HTMLHeadElement")); set_prototype(&window().cached_web_prototype("HTMLHeadElement"));
} }
HTMLHeadElement::~HTMLHeadElement() = default; HTMLHeadElement::~HTMLHeadElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLHeadingElementPrototype.h>
#include <LibWeb/HTML/HTMLHeadingElement.h> #include <LibWeb/HTML/HTMLHeadingElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLHeadingElement::HTMLHeadingElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLHeadingElement::HTMLHeadingElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLHeadingElementPrototype>("HTMLHeadingElement")); set_prototype(&window().cached_web_prototype("HTMLHeadingElement"));
} }
HTMLHeadingElement::~HTMLHeadingElement() = default; HTMLHeadingElement::~HTMLHeadingElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLHtmlElementPrototype.h>
#include <LibWeb/HTML/HTMLHtmlElement.h> #include <LibWeb/HTML/HTMLHtmlElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLHtmlElement::HTMLHtmlElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLHtmlElement::HTMLHtmlElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLHtmlElementPrototype>("HTMLHtmlElement")); set_prototype(&window().cached_web_prototype("HTMLHtmlElement"));
} }
HTMLHtmlElement::~HTMLHtmlElement() = default; HTMLHtmlElement::~HTMLHtmlElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLIFrameElementPrototype.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Event.h> #include <LibWeb/DOM/Event.h>
#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/BrowsingContext.h>
@ -17,7 +16,7 @@ namespace Web::HTML {
HTMLIFrameElement::HTMLIFrameElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLIFrameElement::HTMLIFrameElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: BrowsingContextContainer(document, move(qualified_name)) : BrowsingContextContainer(document, move(qualified_name))
{ {
set_prototype(&document.window().ensure_web_prototype<Bindings::HTMLIFrameElementPrototype>("HTMLIFrameElement")); set_prototype(&document.window().cached_web_prototype("HTMLIFrameElement"));
} }
HTMLIFrameElement::~HTMLIFrameElement() = default; HTMLIFrameElement::~HTMLIFrameElement() = default;

View file

@ -5,7 +5,6 @@
*/ */
#include <LibGfx/Bitmap.h> #include <LibGfx/Bitmap.h>
#include <LibWeb/Bindings/HTMLImageElementPrototype.h>
#include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/CSS/Parser/Parser.h>
#include <LibWeb/CSS/StyleComputer.h> #include <LibWeb/CSS/StyleComputer.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
@ -23,7 +22,7 @@ HTMLImageElement::HTMLImageElement(DOM::Document& document, DOM::QualifiedName q
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
, m_image_loader(*this) , m_image_loader(*this)
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLImageElementPrototype>("HTMLImageElement")); set_prototype(&window().cached_web_prototype("HTMLImageElement"));
m_image_loader.on_load = [this] { m_image_loader.on_load = [this] {
set_needs_style_update(true); set_needs_style_update(true);

View file

@ -5,7 +5,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLInputElementPrototype.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Event.h> #include <LibWeb/DOM/Event.h>
#include <LibWeb/DOM/ShadowRoot.h> #include <LibWeb/DOM/ShadowRoot.h>
@ -25,7 +24,7 @@ HTMLInputElement::HTMLInputElement(DOM::Document& document, DOM::QualifiedName q
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
, m_value(String::empty()) , m_value(String::empty())
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLInputElementPrototype>("HTMLInputElement")); set_prototype(&window().cached_web_prototype("HTMLInputElement"));
activation_behavior = [this](auto&) { activation_behavior = [this](auto&) {
// The activation behavior for input elements are these steps: // The activation behavior for input elements are these steps:

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLLIElementPrototype.h>
#include <LibWeb/HTML/HTMLLIElement.h> #include <LibWeb/HTML/HTMLLIElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLLIElement::HTMLLIElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLLIElement::HTMLLIElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLLIElementPrototype>("HTMLLIElement")); set_prototype(&window().cached_web_prototype("HTMLLIElement"));
} }
HTMLLIElement::~HTMLLIElement() = default; HTMLLIElement::~HTMLLIElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLLabelElementPrototype.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/HTMLLabelElement.h> #include <LibWeb/HTML/HTMLLabelElement.h>
#include <LibWeb/Layout/Label.h> #include <LibWeb/Layout/Label.h>
@ -14,7 +13,7 @@ namespace Web::HTML {
HTMLLabelElement::HTMLLabelElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLLabelElement::HTMLLabelElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLLabelElementPrototype>("HTMLLabelElement")); set_prototype(&window().cached_web_prototype("HTMLLabelElement"));
} }
HTMLLabelElement::~HTMLLabelElement() = default; HTMLLabelElement::~HTMLLabelElement() = default;

View file

@ -13,7 +13,7 @@ namespace Web::HTML {
HTMLLegendElement::HTMLLegendElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLLegendElement::HTMLLegendElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLLegendElementPrototype>("HTMLLegendElement")); set_prototype(&window().cached_web_prototype("HTMLLegendElement"));
} }
HTMLLegendElement::~HTMLLegendElement() = default; HTMLLegendElement::~HTMLLegendElement() = default;

View file

@ -9,7 +9,6 @@
#include <AK/ByteBuffer.h> #include <AK/ByteBuffer.h>
#include <AK/Debug.h> #include <AK/Debug.h>
#include <AK/URL.h> #include <AK/URL.h>
#include <LibWeb/Bindings/HTMLLinkElementPrototype.h>
#include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/CSS/Parser/Parser.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/HTMLLinkElement.h> #include <LibWeb/HTML/HTMLLinkElement.h>
@ -22,7 +21,7 @@ namespace Web::HTML {
HTMLLinkElement::HTMLLinkElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLLinkElement::HTMLLinkElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLLinkElementPrototype>("HTMLLinkElement")); set_prototype(&window().cached_web_prototype("HTMLLinkElement"));
} }
HTMLLinkElement::~HTMLLinkElement() = default; HTMLLinkElement::~HTMLLinkElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLMapElementPrototype.h>
#include <LibWeb/HTML/HTMLMapElement.h> #include <LibWeb/HTML/HTMLMapElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLMapElement::HTMLMapElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLMapElement::HTMLMapElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLMapElementPrototype>("HTMLMapElement")); set_prototype(&window().cached_web_prototype("HTMLMapElement"));
} }
HTMLMapElement::~HTMLMapElement() = default; HTMLMapElement::~HTMLMapElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLMarqueeElementPrototype.h>
#include <LibWeb/HTML/HTMLMarqueeElement.h> #include <LibWeb/HTML/HTMLMarqueeElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLMarqueeElement::HTMLMarqueeElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLMarqueeElement::HTMLMarqueeElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLMarqueeElementPrototype>("HTMLMarqueeElement")); set_prototype(&window().cached_web_prototype("HTMLMarqueeElement"));
} }
HTMLMarqueeElement::~HTMLMarqueeElement() = default; HTMLMarqueeElement::~HTMLMarqueeElement() = default;

View file

@ -13,7 +13,7 @@ namespace Web::HTML {
HTMLMediaElement::HTMLMediaElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLMediaElement::HTMLMediaElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLMediaElementPrototype>("HTMLMediaElement")); set_prototype(&window().cached_web_prototype("HTMLMediaElement"));
} }
HTMLMediaElement::~HTMLMediaElement() = default; HTMLMediaElement::~HTMLMediaElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLMenuElementPrototype.h>
#include <LibWeb/HTML/HTMLMenuElement.h> #include <LibWeb/HTML/HTMLMenuElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLMenuElement::HTMLMenuElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLMenuElement::HTMLMenuElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLMenuElementPrototype>("HTMLMenuElement")); set_prototype(&window().cached_web_prototype("HTMLMenuElement"));
} }
HTMLMenuElement::~HTMLMenuElement() = default; HTMLMenuElement::~HTMLMenuElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLMetaElementPrototype.h>
#include <LibWeb/HTML/HTMLMetaElement.h> #include <LibWeb/HTML/HTMLMetaElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLMetaElement::HTMLMetaElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLMetaElement::HTMLMetaElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLMetaElementPrototype>("HTMLMetaElement")); set_prototype(&window().cached_web_prototype("HTMLMetaElement"));
} }
HTMLMetaElement::~HTMLMetaElement() = default; HTMLMetaElement::~HTMLMetaElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLMeterElementPrototype.h>
#include <LibWeb/HTML/HTMLMeterElement.h> #include <LibWeb/HTML/HTMLMeterElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLMeterElement::HTMLMeterElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLMeterElement::HTMLMeterElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLMeterElementPrototype>("HTMLMeterElement")); set_prototype(&window().cached_web_prototype("HTMLMeterElement"));
} }
HTMLMeterElement::~HTMLMeterElement() = default; HTMLMeterElement::~HTMLMeterElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLModElementPrototype.h>
#include <LibWeb/HTML/HTMLModElement.h> #include <LibWeb/HTML/HTMLModElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLModElement::HTMLModElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLModElement::HTMLModElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLModElementPrototype>("HTMLModElement")); set_prototype(&window().cached_web_prototype("HTMLModElement"));
} }
HTMLModElement::~HTMLModElement() = default; HTMLModElement::~HTMLModElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLOListElementPrototype.h>
#include <LibWeb/HTML/HTMLOListElement.h> #include <LibWeb/HTML/HTMLOListElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLOListElement::HTMLOListElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLOListElement::HTMLOListElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLOListElementPrototype>("HTMLOListElement")); set_prototype(&window().cached_web_prototype("HTMLOListElement"));
} }
HTMLOListElement::~HTMLOListElement() = default; HTMLOListElement::~HTMLOListElement() = default;

View file

@ -5,7 +5,6 @@
*/ */
#include <LibGfx/Bitmap.h> #include <LibGfx/Bitmap.h>
#include <LibWeb/Bindings/HTMLObjectElementPrototype.h>
#include <LibWeb/CSS/StyleComputer.h> #include <LibWeb/CSS/StyleComputer.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Event.h> #include <LibWeb/DOM/Event.h>
@ -20,7 +19,7 @@ namespace Web::HTML {
HTMLObjectElement::HTMLObjectElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLObjectElement::HTMLObjectElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: BrowsingContextContainer(document, move(qualified_name)) : BrowsingContextContainer(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLObjectElementPrototype>("HTMLObjectElement")); set_prototype(&window().cached_web_prototype("HTMLObjectElement"));
} }
HTMLObjectElement::~HTMLObjectElement() = default; HTMLObjectElement::~HTMLObjectElement() = default;

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Bindings/HTMLOptGroupElementPrototype.h>
#include <LibWeb/HTML/HTMLOptGroupElement.h> #include <LibWeb/HTML/HTMLOptGroupElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
@ -13,7 +12,7 @@ namespace Web::HTML {
HTMLOptGroupElement::HTMLOptGroupElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLOptGroupElement::HTMLOptGroupElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLOptGroupElementPrototype>("HTMLOptGroupElement")); set_prototype(&window().cached_web_prototype("HTMLOptGroupElement"));
} }
HTMLOptGroupElement::~HTMLOptGroupElement() = default; HTMLOptGroupElement::~HTMLOptGroupElement() = default;

View file

@ -6,7 +6,6 @@
*/ */
#include <AK/StringBuilder.h> #include <AK/StringBuilder.h>
#include <LibWeb/Bindings/HTMLOptionElementPrototype.h>
#include <LibWeb/DOM/Node.h> #include <LibWeb/DOM/Node.h>
#include <LibWeb/DOM/Text.h> #include <LibWeb/DOM/Text.h>
#include <LibWeb/HTML/HTMLOptionElement.h> #include <LibWeb/HTML/HTMLOptionElement.h>
@ -20,7 +19,7 @@ namespace Web::HTML {
HTMLOptionElement::HTMLOptionElement(DOM::Document& document, DOM::QualifiedName qualified_name) HTMLOptionElement::HTMLOptionElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name)) : HTMLElement(document, move(qualified_name))
{ {
set_prototype(&window().ensure_web_prototype<Bindings::HTMLOptionElementPrototype>("HTMLOptionElement")); set_prototype(&window().cached_web_prototype("HTMLOptionElement"));
} }
HTMLOptionElement::~HTMLOptionElement() = default; HTMLOptionElement::~HTMLOptionElement() = default;

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