diff options
author | Andreas Kling <kling@serenityos.org> | 2022-09-03 18:43:24 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-09-06 00:27:09 +0200 |
commit | ffad902c0740d397faefb5ac02ff44bbbc92e713 (patch) | |
tree | 30e67424e99f181587a03c0626f511fec4e2d28b /Userland/Libraries/LibWeb | |
parent | a85542958cb42c981019d5b4f05b17d8dd268d9d (diff) | |
download | serenity-ffad902c0740d397faefb5ac02ff44bbbc92e713.zip |
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. :^)
Diffstat (limited to 'Userland/Libraries/LibWeb')
164 files changed, 173 insertions, 322 deletions
diff --git a/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp index ea2f9ae745..914f91d9eb 100644 --- a/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp +++ b/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp @@ -24,7 +24,7 @@ void AudioConstructor::initialize(JS::Realm& realm) auto& window = verify_cast<HTML::Window>(realm.global_object()); 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); } diff --git a/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp index d7f5be791a..4d1f313ed6 100644 --- a/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp +++ b/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp @@ -24,7 +24,7 @@ void ImageConstructor::initialize(JS::Realm& realm) auto& window = verify_cast<HTML::Window>(realm.global_object()); 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); } diff --git a/Userland/Libraries/LibWeb/Bindings/LocationConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/LocationConstructor.cpp index d625e19dce..d7f8dbc37b 100644 --- a/Userland/Libraries/LibWeb/Bindings/LocationConstructor.cpp +++ b/Userland/Libraries/LibWeb/Bindings/LocationConstructor.cpp @@ -34,7 +34,7 @@ void LocationConstructor::initialize(JS::Realm& realm) auto& window = verify_cast<HTML::Window>(realm.global_object()); 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); } diff --git a/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp b/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp index f6e27a511a..a1091c9102 100644 --- a/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp +++ b/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp @@ -23,7 +23,7 @@ namespace Web::Bindings { // https://html.spec.whatwg.org/multipage/history.html#the-location-interface 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()) { } diff --git a/Userland/Libraries/LibWeb/Bindings/NavigatorConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/NavigatorConstructor.cpp index 9448536055..262303051e 100644 --- a/Userland/Libraries/LibWeb/Bindings/NavigatorConstructor.cpp +++ b/Userland/Libraries/LibWeb/Bindings/NavigatorConstructor.cpp @@ -34,7 +34,7 @@ void NavigatorConstructor::initialize(JS::Realm& realm) auto& window = verify_cast<HTML::Window>(realm.global_object()); 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); } diff --git a/Userland/Libraries/LibWeb/Bindings/NavigatorObject.cpp b/Userland/Libraries/LibWeb/Bindings/NavigatorObject.cpp index 8db25da83f..a85e72ddd4 100644 --- a/Userland/Libraries/LibWeb/Bindings/NavigatorObject.cpp +++ b/Userland/Libraries/LibWeb/Bindings/NavigatorObject.cpp @@ -14,7 +14,7 @@ namespace Web { namespace Bindings { 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")) { } diff --git a/Userland/Libraries/LibWeb/Bindings/OptionConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/OptionConstructor.cpp index 8c0a9984c2..c320213326 100644 --- a/Userland/Libraries/LibWeb/Bindings/OptionConstructor.cpp +++ b/Userland/Libraries/LibWeb/Bindings/OptionConstructor.cpp @@ -26,7 +26,7 @@ void OptionConstructor::initialize(JS::Realm& realm) auto& window = verify_cast<HTML::Window>(realm.global_object()); 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); } diff --git a/Userland/Libraries/LibWeb/Bindings/WindowConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/WindowConstructor.cpp index 909bd5e93b..de00ee8b3e 100644 --- a/Userland/Libraries/LibWeb/Bindings/WindowConstructor.cpp +++ b/Userland/Libraries/LibWeb/Bindings/WindowConstructor.cpp @@ -34,7 +34,7 @@ void WindowConstructor::initialize(JS::Realm& realm) auto& window = verify_cast<HTML::Window>(realm.global_object()); 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); } diff --git a/Userland/Libraries/LibWeb/Bindings/WindowObjectHelper.h b/Userland/Libraries/LibWeb/Bindings/WindowObjectHelper.h index 9201551da7..36fc5208a9 100644 --- a/Userland/Libraries/LibWeb/Bindings/WindowObjectHelper.h +++ b/Userland/Libraries/LibWeb/Bindings/WindowObjectHelper.h @@ -388,10 +388,10 @@ #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& constructor = ensure_web_constructor<Bindings::constructor_name>(#interface_name); \ 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) \ diff --git a/Userland/Libraries/LibWeb/Bindings/WindowPrototype.h b/Userland/Libraries/LibWeb/Bindings/WindowPrototype.h index 8f16471bc4..013ded9522 100644 --- a/Userland/Libraries/LibWeb/Bindings/WindowPrototype.h +++ b/Userland/Libraries/LibWeb/Bindings/WindowPrototype.h @@ -20,7 +20,7 @@ class WindowPrototype final : public JS::Object { public: 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")) { } }; diff --git a/Userland/Libraries/LibWeb/CSS/CSSConditionRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSConditionRule.cpp index 9cb51a68ac..d4057e4412 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSConditionRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSConditionRule.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/CSSConditionRulePrototype.h> #include <LibWeb/CSS/CSSConditionRule.h> #include <LibWeb/HTML/Window.h> @@ -14,7 +13,7 @@ namespace Web::CSS { CSSConditionRule::CSSConditionRule(HTML::Window& window_object, CSSRuleList& 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 diff --git a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp index 1d5d00aafa..b4d1a98237 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/CSSFontFaceRulePrototype.h> #include <LibWeb/CSS/CSSFontFaceRule.h> #include <LibWeb/HTML/Window.h> @@ -20,7 +19,7 @@ CSSFontFaceRule::CSSFontFaceRule(HTML::Window& window_object, FontFace&& font_fa : CSSRule(window_object) , 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() diff --git a/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.cpp index 707eab3964..ef44d0fd03 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/CSSGroupingRulePrototype.h> #include <LibWeb/Bindings/MainThreadVM.h> #include <LibWeb/CSS/CSSGroupingRule.h> #include <LibWeb/CSS/CSSRuleList.h> @@ -17,7 +16,7 @@ CSSGroupingRule::CSSGroupingRule(HTML::Window& window_object, CSSRuleList& rules : CSSRule(window_object) , 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) rule.set_parent_rule(this); } diff --git a/Userland/Libraries/LibWeb/CSS/CSSImportRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSImportRule.cpp index 378878253c..46d38d6acf 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSImportRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSImportRule.cpp @@ -8,7 +8,6 @@ #include <AK/Debug.h> #include <AK/URL.h> -#include <LibWeb/Bindings/CSSImportRulePrototype.h> #include <LibWeb/CSS/CSSImportRule.h> #include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/DOM/Document.h> @@ -28,7 +27,7 @@ CSSImportRule::CSSImportRule(AK::URL url, DOM::Document& document) , m_url(move(url)) , 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); auto request = LoadRequest::create_for_url_on_page(m_url, document.page()); diff --git a/Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp index cb72a58e36..af48b8d6dd 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/CSSMediaRulePrototype.h> #include <LibWeb/CSS/CSSMediaRule.h> #include <LibWeb/HTML/Window.h> @@ -20,7 +19,7 @@ CSSMediaRule::CSSMediaRule(HTML::Window& window_object, MediaList& media, CSSRul : CSSConditionRule(window_object, rules) , 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) diff --git a/Userland/Libraries/LibWeb/CSS/CSSRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSRule.cpp index ab1e30dafb..f04ad9033c 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSRule.cpp @@ -6,7 +6,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/CSSRulePrototype.h> #include <LibWeb/CSS/CSSRule.h> #include <LibWeb/CSS/CSSStyleSheet.h> #include <LibWeb/HTML/Window.h> @@ -14,7 +13,7 @@ namespace Web::CSS { CSSRule::CSSRule(HTML::Window& window_object) - : PlatformObject(window_object.ensure_web_prototype<Bindings::CSSRulePrototype>("CSSRule")) + : PlatformObject(window_object.cached_web_prototype("CSSRule")) { } diff --git a/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp b/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp index 674383f403..b3fdde9a8d 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp @@ -5,7 +5,6 @@ */ #include <AK/TypeCasts.h> -#include <LibWeb/Bindings/CSSRuleListPrototype.h> #include <LibWeb/CSS/CSSImportRule.h> #include <LibWeb/CSS/CSSMediaRule.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) - : Bindings::LegacyPlatformObject(window_object.ensure_web_prototype<Bindings::CSSRuleListPrototype>("CSSRuleList")) + : Bindings::LegacyPlatformObject(window_object.cached_web_prototype("CSSRuleList")) { } diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp index 1cb49c536a..2d3671f5c8 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/CSSStyleDeclarationPrototype.h> #include <LibWeb/CSS/CSSStyleDeclaration.h> #include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/DOM/Document.h> @@ -14,7 +13,7 @@ namespace Web::CSS { CSSStyleDeclaration::CSSStyleDeclaration(HTML::Window& window_object) - : PlatformObject(window_object.ensure_web_prototype<Bindings::CSSStyleDeclarationPrototype>("CSSStyleDeclaration")) + : PlatformObject(window_object.cached_web_prototype("CSSStyleDeclaration")) { } diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp index 15bb1463e1..1ae7cb3060 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/CSSStyleRulePrototype.h> #include <LibWeb/CSS/CSSStyleRule.h> #include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/HTML/Window.h> @@ -21,7 +20,7 @@ CSSStyleRule::CSSStyleRule(HTML::Window& window_object, NonnullRefPtrVector<Sele , m_selectors(move(selectors)) , 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) diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp index 5d210155f7..50e87ea2c1 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/CSSStyleSheetPrototype.h> #include <LibWeb/CSS/CSSStyleSheet.h> #include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/CSS/StyleSheetList.h> @@ -22,7 +21,7 @@ CSSStyleSheet::CSSStyleSheet(HTML::Window& window_object, CSSRuleList& rules, Op : StyleSheet(window_object) , 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()) set_location(location->to_string()); diff --git a/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp index 860f142115..15140c9c10 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/CSSSupportsRulePrototype.h> #include <LibWeb/CSS/CSSSupportsRule.h> #include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/HTML/Window.h> @@ -20,7 +19,7 @@ CSSSupportsRule::CSSSupportsRule(HTML::Window& window_object, NonnullRefPtr<Supp : CSSConditionRule(window_object, rules) , 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 diff --git a/Userland/Libraries/LibWeb/CSS/MediaList.cpp b/Userland/Libraries/LibWeb/CSS/MediaList.cpp index 7003b702b3..224d2711e6 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaList.cpp +++ b/Userland/Libraries/LibWeb/CSS/MediaList.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/MediaListPrototype.h> #include <LibWeb/CSS/MediaList.h> #include <LibWeb/CSS/Parser/Parser.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) - : Bindings::LegacyPlatformObject(window_object.ensure_web_prototype<Bindings::MediaListPrototype>("MediaList")) + : Bindings::LegacyPlatformObject(window_object.cached_web_prototype("MediaList")) , m_media(move(media)) { } diff --git a/Userland/Libraries/LibWeb/CSS/MediaQueryList.cpp b/Userland/Libraries/LibWeb/CSS/MediaQueryList.cpp index bbcf17a264..554797f260 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaQueryList.cpp +++ b/Userland/Libraries/LibWeb/CSS/MediaQueryList.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/MediaQueryListPrototype.h> #include <LibWeb/CSS/MediaQueryList.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/EventDispatcher.h> @@ -24,7 +23,7 @@ MediaQueryList::MediaQueryList(DOM::Document& document, NonnullRefPtrVector<Medi , m_document(document) , m_media(move(media)) { - set_prototype(&document.window().ensure_web_prototype<Bindings::MediaQueryListPrototype>("MediaQueryList")); + set_prototype(&document.window().cached_web_prototype("MediaQueryList")); evaluate(); } diff --git a/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.cpp b/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.cpp index 6bd7b37606..4fedb43139 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.cpp +++ b/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.cpp @@ -25,7 +25,7 @@ MediaQueryListEvent::MediaQueryListEvent(HTML::Window& window_object, FlyString , m_media(event_init.media) , 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; diff --git a/Userland/Libraries/LibWeb/CSS/StyleSheet.cpp b/Userland/Libraries/LibWeb/CSS/StyleSheet.cpp index d628dd7889..82b5a6cc0a 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleSheet.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleSheet.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/StyleSheetPrototype.h> #include <LibWeb/CSS/CSSStyleSheet.h> #include <LibWeb/CSS/StyleSheet.h> #include <LibWeb/DOM/Element.h> @@ -14,7 +13,7 @@ namespace Web::CSS { StyleSheet::StyleSheet(HTML::Window& window_object) - : PlatformObject(window_object.ensure_web_prototype<Bindings::StyleSheetPrototype>("StyleSheet")) + : PlatformObject(window_object.cached_web_prototype("StyleSheet")) { } diff --git a/Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp b/Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp index bcb3f470f9..02639fe93c 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp @@ -36,7 +36,7 @@ StyleSheetList* StyleSheetList::create(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) { } diff --git a/Userland/Libraries/LibWeb/DOM/AbortController.cpp b/Userland/Libraries/LibWeb/DOM/AbortController.cpp index 602f05bcf7..563bb528dd 100644 --- a/Userland/Libraries/LibWeb/DOM/AbortController.cpp +++ b/Userland/Libraries/LibWeb/DOM/AbortController.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/AbortControllerPrototype.h> #include <LibWeb/DOM/AbortController.h> #include <LibWeb/DOM/AbortSignal.h> @@ -21,7 +20,7 @@ AbortController::AbortController(HTML::Window& window, JS::NonnullGCPtr<AbortSig : PlatformObject(window.realm()) , m_signal(move(signal)) { - set_prototype(&window.ensure_web_prototype<Bindings::AbortControllerPrototype>("AbortController")); + set_prototype(&window.cached_web_prototype("AbortController")); } AbortController::~AbortController() = default; diff --git a/Userland/Libraries/LibWeb/DOM/AbstractRange.cpp b/Userland/Libraries/LibWeb/DOM/AbstractRange.cpp index 28e45ba65e..24fa81674c 100644 --- a/Userland/Libraries/LibWeb/DOM/AbstractRange.cpp +++ b/Userland/Libraries/LibWeb/DOM/AbstractRange.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/AbstractRangePrototype.h> #include <LibWeb/DOM/AbstractRange.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/HTML/Window.h> @@ -12,7 +11,7 @@ namespace Web::DOM { 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_offset(start_offset) , m_end_container(end_container) diff --git a/Userland/Libraries/LibWeb/DOM/Attribute.cpp b/Userland/Libraries/LibWeb/DOM/Attribute.cpp index f6254ce2e7..36e8c93177 100644 --- a/Userland/Libraries/LibWeb/DOM/Attribute.cpp +++ b/Userland/Libraries/LibWeb/DOM/Attribute.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/AttributePrototype.h> #include <LibWeb/DOM/Attribute.h> #include <LibWeb/DOM/Document.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_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) diff --git a/Userland/Libraries/LibWeb/DOM/CDATASection.cpp b/Userland/Libraries/LibWeb/DOM/CDATASection.cpp index 5203875e96..5c1937b231 100644 --- a/Userland/Libraries/LibWeb/DOM/CDATASection.cpp +++ b/Userland/Libraries/LibWeb/DOM/CDATASection.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/CDATASectionPrototype.h> #include <LibWeb/DOM/CDATASection.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::DOM { CDATASection::CDATASection(Document& document, String const& 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; diff --git a/Userland/Libraries/LibWeb/DOM/CustomEvent.cpp b/Userland/Libraries/LibWeb/DOM/CustomEvent.cpp index 0cf777aa74..e69229cefa 100644 --- a/Userland/Libraries/LibWeb/DOM/CustomEvent.cpp +++ b/Userland/Libraries/LibWeb/DOM/CustomEvent.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/CustomEventPrototype.h> #include <LibWeb/DOM/CustomEvent.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) : 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) : Event(window_object, event_name, event_init) , 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; diff --git a/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp b/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp index afe7045c95..1b0be32d48 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp +++ b/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/DOMImplementationPrototype.h> #include <LibWeb/Bindings/MainThreadVM.h> #include <LibWeb/DOM/DOMImplementation.h> #include <LibWeb/DOM/Document.h> @@ -25,7 +24,7 @@ JS::NonnullGCPtr<DOMImplementation> DOMImplementation::create(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) { } diff --git a/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp b/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp index 439d9a3606..2934ead8cc 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp +++ b/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp @@ -7,7 +7,6 @@ #include <AK/CharacterTypes.h> #include <AK/StringBuilder.h> -#include <LibWeb/Bindings/DOMTokenListPrototype.h> #include <LibWeb/DOM/DOMException.h> #include <LibWeb/DOM/DOMTokenList.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 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_attribute(move(associated_attribute)) { diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index a559232306..46e978e0da 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -14,7 +14,6 @@ #include <LibJS/Interpreter.h> #include <LibJS/Parser.h> #include <LibJS/Runtime/FunctionObject.h> -#include <LibWeb/Bindings/DocumentPrototype.h> #include <LibWeb/Bindings/MainThreadVM.h> #include <LibWeb/CSS/MediaQueryList.h> #include <LibWeb/CSS/MediaQueryListEvent.h> @@ -283,7 +282,7 @@ Document::Document(HTML::Window& window, const AK::URL& url) , m_url(url) , 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); diff --git a/Userland/Libraries/LibWeb/DOM/DocumentFragment.cpp b/Userland/Libraries/LibWeb/DOM/DocumentFragment.cpp index 58ceeb3f3c..16d4a36daf 100644 --- a/Userland/Libraries/LibWeb/DOM/DocumentFragment.cpp +++ b/Userland/Libraries/LibWeb/DOM/DocumentFragment.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/DocumentFragmentPrototype.h> #include <LibWeb/DOM/DocumentFragment.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::DOM { DocumentFragment::DocumentFragment(Document& document) : 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) diff --git a/Userland/Libraries/LibWeb/DOM/DocumentType.cpp b/Userland/Libraries/LibWeb/DOM/DocumentType.cpp index e3b34b5fd6..f71da375db 100644 --- a/Userland/Libraries/LibWeb/DOM/DocumentType.cpp +++ b/Userland/Libraries/LibWeb/DOM/DocumentType.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/DocumentTypePrototype.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/DocumentType.h> @@ -18,7 +17,7 @@ JS::NonnullGCPtr<DocumentType> DocumentType::create(Document& document) DocumentType::DocumentType(Document& document) : Node(document, NodeType::DOCUMENT_TYPE_NODE) { - set_prototype(&window().ensure_web_prototype<Bindings::DocumentTypePrototype>("DocumentType")); + set_prototype(&window().cached_web_prototype("DocumentType")); } } diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index 4826fc8d21..52a26c928a 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -8,7 +8,6 @@ #include <AK/CharacterTypes.h> #include <AK/Debug.h> #include <AK/StringBuilder.h> -#include <LibWeb/Bindings/ElementPrototype.h> #include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/CSS/PropertyID.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_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(); } diff --git a/Userland/Libraries/LibWeb/DOM/Event.cpp b/Userland/Libraries/LibWeb/DOM/Event.cpp index 024fa0104f..9053ea5567 100644 --- a/Userland/Libraries/LibWeb/DOM/Event.cpp +++ b/Userland/Libraries/LibWeb/DOM/Event.cpp @@ -7,7 +7,6 @@ */ #include <AK/TypeCasts.h> -#include <LibWeb/Bindings/EventPrototype.h> #include <LibWeb/DOM/Event.h> #include <LibWeb/DOM/Node.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); } -Event::Event(HTML::Window& window_object, FlyString const& type) - : PlatformObject(window_object.ensure_web_prototype<Bindings::EventPrototype>("Event")) +Event::Event(HTML::Window& window, FlyString const& type) + : PlatformObject(window.cached_web_prototype("Event")) , m_type(type) , m_initialized(true) { } -Event::Event(HTML::Window& window_object, FlyString const& type, EventInit const& event_init) - : PlatformObject(window_object.ensure_web_prototype<Bindings::EventPrototype>("Event")) +Event::Event(HTML::Window& window, FlyString const& type, EventInit const& event_init) + : PlatformObject(window.cached_web_prototype("Event")) , m_type(type) , m_bubbles(event_init.bubbles) , m_cancelable(event_init.cancelable) diff --git a/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp b/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp index d4977dab8c..f5b807aae2 100644 --- a/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp +++ b/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLCollectionPrototype.h> #include <LibWeb/DOM/Element.h> #include <LibWeb/DOM/HTMLCollection.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) - : LegacyPlatformObject(root.window().ensure_web_prototype<Bindings::HTMLCollectionPrototype>("HTMLCollection")) + : LegacyPlatformObject(root.window().cached_web_prototype("HTMLCollection")) , m_root(root) , m_filter(move(filter)) { diff --git a/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp b/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp index 74533d3248..8a36188828 100644 --- a/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp +++ b/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp @@ -5,7 +5,6 @@ */ #include <LibWeb/Bindings/MainThreadVM.h> -#include <LibWeb/Bindings/MutationObserverPrototype.h> #include <LibWeb/DOM/MutationObserver.h> #include <LibWeb/DOM/Node.h> #include <LibWeb/HTML/Window.h> @@ -22,7 +21,7 @@ MutationObserver::MutationObserver(HTML::Window& window, JS::GCPtr<Bindings::Cal : PlatformObject(window.realm()) , m_callback(move(callback)) { - set_prototype(&window.ensure_web_prototype<Bindings::MutationObserverPrototype>("MutationObserver")); + set_prototype(&window.cached_web_prototype("MutationObserver")); // 1. Set this’s callback to callback. diff --git a/Userland/Libraries/LibWeb/DOM/MutationRecord.cpp b/Userland/Libraries/LibWeb/DOM/MutationRecord.cpp index bb66e5e5ea..3eee96fa9f 100644 --- a/Userland/Libraries/LibWeb/DOM/MutationRecord.cpp +++ b/Userland/Libraries/LibWeb/DOM/MutationRecord.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/MutationRecordPrototype.h> #include <LibWeb/DOM/MutationRecord.h> #include <LibWeb/DOM/Node.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_old_value(old_value) { - set_prototype(&window.ensure_web_prototype<Bindings::MutationRecordPrototype>("MutationRecord")); + set_prototype(&window.cached_web_prototype("MutationRecord")); } MutationRecord::~MutationRecord() = default; diff --git a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp index 3a80acc748..fddcf1906e 100644 --- a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp +++ b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/NamedNodeMapPrototype.h> #include <LibWeb/DOM/Attribute.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/NamedNodeMap.h> @@ -20,7 +19,7 @@ JS::NonnullGCPtr<NamedNodeMap> NamedNodeMap::create(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) { } diff --git a/Userland/Libraries/LibWeb/DOM/NodeIterator.cpp b/Userland/Libraries/LibWeb/DOM/NodeIterator.cpp index f57e7777db..923f66be67 100644 --- a/Userland/Libraries/LibWeb/DOM/NodeIterator.cpp +++ b/Userland/Libraries/LibWeb/DOM/NodeIterator.cpp @@ -6,7 +6,6 @@ #include <LibWeb/Bindings/DOMExceptionWrapper.h> #include <LibWeb/Bindings/IDLAbstractOperations.h> -#include <LibWeb/Bindings/NodeIteratorPrototype.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Node.h> #include <LibWeb/DOM/NodeIterator.h> @@ -14,7 +13,7 @@ namespace Web::DOM { 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_reference({ root }) { diff --git a/Userland/Libraries/LibWeb/DOM/NodeList.cpp b/Userland/Libraries/LibWeb/DOM/NodeList.cpp index 4bd7eb86f0..f70b3890cf 100644 --- a/Userland/Libraries/LibWeb/DOM/NodeList.cpp +++ b/Userland/Libraries/LibWeb/DOM/NodeList.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/NodeListPrototype.h> #include <LibWeb/DOM/Node.h> #include <LibWeb/DOM/NodeList.h> #include <LibWeb/HTML/Window.h> @@ -12,7 +11,7 @@ namespace Web::DOM { NodeList::NodeList(HTML::Window& window) - : LegacyPlatformObject(window.ensure_web_prototype<Bindings::NodeListPrototype>("NodeList")) + : LegacyPlatformObject(window.cached_web_prototype("NodeList")) { } diff --git a/Userland/Libraries/LibWeb/DOM/Range.cpp b/Userland/Libraries/LibWeb/DOM/Range.cpp index d362577c36..cfe2709016 100644 --- a/Userland/Libraries/LibWeb/DOM/Range.cpp +++ b/Userland/Libraries/LibWeb/DOM/Range.cpp @@ -6,7 +6,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/RangePrototype.h> #include <LibWeb/DOM/Comment.h> #include <LibWeb/DOM/Document.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(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) : 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); } diff --git a/Userland/Libraries/LibWeb/DOM/StaticRange.cpp b/Userland/Libraries/LibWeb/DOM/StaticRange.cpp index 8d825110ee..3396d1aeb3 100644 --- a/Userland/Libraries/LibWeb/DOM/StaticRange.cpp +++ b/Userland/Libraries/LibWeb/DOM/StaticRange.cpp @@ -6,7 +6,6 @@ */ #include <AK/TypeCasts.h> -#include <LibWeb/Bindings/StaticRangePrototype.h> #include <LibWeb/DOM/Attribute.h> #include <LibWeb/DOM/Document.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) : 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; diff --git a/Userland/Libraries/LibWeb/DOM/Text.cpp b/Userland/Libraries/LibWeb/DOM/Text.cpp index 0b8262cd26..c6a4d0ad66 100644 --- a/Userland/Libraries/LibWeb/DOM/Text.cpp +++ b/Userland/Libraries/LibWeb/DOM/Text.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/TextPrototype.h> #include <LibWeb/DOM/Range.h> #include <LibWeb/DOM/Text.h> #include <LibWeb/HTML/HTMLInputElement.h> @@ -16,13 +15,13 @@ namespace Web::DOM { Text::Text(Document& document, String const& 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) : 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) diff --git a/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp b/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp index 7021233b11..c07b2ba666 100644 --- a/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp +++ b/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp @@ -6,7 +6,6 @@ #include <LibWeb/Bindings/DOMExceptionWrapper.h> #include <LibWeb/Bindings/IDLAbstractOperations.h> -#include <LibWeb/Bindings/TreeWalkerPrototype.h> #include <LibWeb/Bindings/Wrapper.h> #include <LibWeb/DOM/DOMException.h> #include <LibWeb/DOM/Document.h> @@ -17,7 +16,7 @@ namespace Web::DOM { 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_current(root) { diff --git a/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp b/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp index 948b6ad600..6a7f99121d 100644 --- a/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp +++ b/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/XMLSerializerPrototype.h> #include <LibWeb/DOM/CDATASection.h> #include <LibWeb/DOM/Comment.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) : PlatformObject(window.realm()) { - set_prototype(&window.ensure_web_prototype<Bindings::XMLSerializerPrototype>("XMLSerializer")); + set_prototype(&window.cached_web_prototype("XMLSerializer")); } XMLSerializer::~XMLSerializer() = default; diff --git a/Userland/Libraries/LibWeb/HTML/CanvasGradient.cpp b/Userland/Libraries/LibWeb/HTML/CanvasGradient.cpp index ffe65f2924..56e0971d4e 100644 --- a/Userland/Libraries/LibWeb/HTML/CanvasGradient.cpp +++ b/Userland/Libraries/LibWeb/HTML/CanvasGradient.cpp @@ -5,7 +5,6 @@ */ #include <AK/QuickSort.h> -#include <LibWeb/Bindings/CanvasGradientPrototype.h> #include <LibWeb/DOM/ExceptionOr.h> #include <LibWeb/HTML/CanvasGradient.h> #include <LibWeb/HTML/Window.h> @@ -44,7 +43,7 @@ CanvasGradient::CanvasGradient(HTML::Window& window, Type type) : PlatformObject(window.realm()) , m_type(type) { - set_prototype(&window.ensure_web_prototype<Bindings::CanvasGradientPrototype>("CanvasGradient")); + set_prototype(&window.cached_web_prototype("CanvasGradient")); } CanvasGradient::~CanvasGradient() = default; diff --git a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp index d0c5e2ff03..287e03e5d9 100644 --- a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp +++ b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp @@ -10,7 +10,6 @@ #include <LibGfx/Painter.h> #include <LibGfx/Quad.h> #include <LibGfx/Rect.h> -#include <LibWeb/Bindings/CanvasRenderingContext2DPrototype.h> #include <LibWeb/DOM/ExceptionOr.h> #include <LibWeb/HTML/CanvasRenderingContext2D.h> #include <LibWeb/HTML/HTMLCanvasElement.h> @@ -32,7 +31,7 @@ CanvasRenderingContext2D::CanvasRenderingContext2D(HTML::Window& window, HTMLCan : PlatformObject(window.realm()) , m_element(element) { - set_prototype(&window.ensure_web_prototype<Bindings::CanvasRenderingContext2DPrototype>("CanvasRenderingContext2D")); + set_prototype(&window.cached_web_prototype("CanvasRenderingContext2D")); } CanvasRenderingContext2D::~CanvasRenderingContext2D() = default; diff --git a/Userland/Libraries/LibWeb/HTML/CloseEvent.cpp b/Userland/Libraries/LibWeb/HTML/CloseEvent.cpp index 047cac8306..4fc7808ef8 100644 --- a/Userland/Libraries/LibWeb/HTML/CloseEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/CloseEvent.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/CloseEventPrototype.h> #include <LibWeb/HTML/CloseEvent.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_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; diff --git a/Userland/Libraries/LibWeb/HTML/DOMParser.cpp b/Userland/Libraries/LibWeb/HTML/DOMParser.cpp index f7846e0fb4..f55851c757 100644 --- a/Userland/Libraries/LibWeb/HTML/DOMParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/DOMParser.cpp @@ -21,7 +21,7 @@ DOM::ExceptionOr<JS::NonnullGCPtr<DOMParser>> DOMParser::create_with_global_obje DOMParser::DOMParser(HTML::Window& window) : PlatformObject(window.realm()) { - set_prototype(&window.ensure_web_prototype<Bindings::DOMParserPrototype>("DOMParser")); + set_prototype(&window.cached_web_prototype("DOMParser")); } DOMParser::~DOMParser() = default; diff --git a/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp b/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp index 6b6a0a85c3..8909953dcb 100644 --- a/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp +++ b/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp @@ -5,7 +5,6 @@ */ #include <AK/CharacterTypes.h> -#include <LibWeb/Bindings/DOMStringMapPrototype.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Element.h> #include <LibWeb/HTML/DOMStringMap.h> @@ -20,7 +19,7 @@ JS::NonnullGCPtr<DOMStringMap> DOMStringMap::create(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) { } diff --git a/Userland/Libraries/LibWeb/HTML/ErrorEvent.cpp b/Userland/Libraries/LibWeb/HTML/ErrorEvent.cpp index 7a9654c538..4a2fe17b6d 100644 --- a/Userland/Libraries/LibWeb/HTML/ErrorEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/ErrorEvent.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/ErrorEventPrototype.h> #include <LibWeb/HTML/ErrorEvent.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_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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp index 8c19a47fab..0ac6ec956d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLAnchorElementPrototype.h> #include <LibWeb/HTML/HTMLAnchorElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLAnchorElement::HTMLAnchorElement(DOM::Document& document, DOM::QualifiedName 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) { run_activation_behavior(event); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp index c941ef98bc..74026bf2e4 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLAreaElementPrototype.h> #include <LibWeb/HTML/HTMLAreaElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLAreaElement::HTMLAreaElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAudioElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLAudioElement.cpp index 97befd800f..19e6645e13 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAudioElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLAudioElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLAudioElementPrototype.h> #include <LibWeb/HTML/HTMLAudioElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLAudioElement::HTMLAudioElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBRElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBRElement.cpp index 9cf419290a..bde4a474ea 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBRElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLBRElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLBRElementPrototype.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/HTML/HTMLBRElement.h> #include <LibWeb/Layout/BreakNode.h> @@ -14,7 +13,7 @@ namespace Web::HTML { HTMLBRElement::HTMLBRElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp index 66f3b44bed..090bd75a4d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLBaseElementPrototype.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/HTML/HTMLBaseElement.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLBaseElement::HTMLBaseElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp index 17b4bc7a76..38165dddbb 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLBodyElementPrototype.h> #include <LibWeb/CSS/StyleProperties.h> #include <LibWeb/CSS/StyleValue.h> #include <LibWeb/DOM/Document.h> @@ -16,7 +15,7 @@ namespace Web::HTML { HTMLBodyElement::HTMLBodyElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.cpp index e8c9399a46..7aea6bf993 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLButtonElementPrototype.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/HTML/HTMLButtonElement.h> #include <LibWeb/HTML/HTMLFormElement.h> @@ -14,7 +13,7 @@ namespace Web::HTML { HTMLButtonElement::HTMLButtonElement(DOM::Document& document, DOM::QualifiedName 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 activation_behavior = [this](auto&) { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp index 21a2f0b820..fb9324f82f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp @@ -8,7 +8,6 @@ #include <AK/Checked.h> #include <LibGfx/Bitmap.h> #include <LibGfx/PNGWriter.h> -#include <LibWeb/Bindings/HTMLCanvasElementPrototype.h> #include <LibWeb/CSS/StyleComputer.h> #include <LibWeb/DOM/Document.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) : 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDListElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDListElement.cpp index e280e16342..a9b1451419 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDListElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDListElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLDListElementPrototype.h> #include <LibWeb/HTML/HTMLDListElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLDListElement::HTMLDListElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDataElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDataElement.cpp index 4740335f44..9270655d7f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDataElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDataElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLDataElementPrototype.h> #include <LibWeb/HTML/HTMLDataElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLDataElement::HTMLDataElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp index b3866d30fb..9f0db05519 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLDataListElementPrototype.h> #include <LibWeb/HTML/HTMLDataListElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLDataListElement::HTMLDataListElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp index f2d6ac5a77..b0b8312c63 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLDetailsElementPrototype.h> #include <LibWeb/HTML/HTMLDetailsElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLDetailsElement::HTMLDetailsElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.cpp index 9aa1666f03..d6960cbe0b 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLDialogElementPrototype.h> #include <LibWeb/HTML/HTMLDialogElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLDialogElement::HTMLDialogElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDirectoryElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDirectoryElement.cpp index 743a234ba6..576c588d69 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDirectoryElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDirectoryElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLDirectoryElementPrototype.h> #include <LibWeb/HTML/HTMLDirectoryElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLDirectoryElement::HTMLDirectoryElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp index 22bc02ebc5..28ba8e5498 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLDivElementPrototype.h> #include <LibWeb/HTML/HTMLDivElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLDivElement::HTMLDivElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp index 05350872c7..05111ab5ef 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp @@ -7,7 +7,6 @@ #include <AK/StringBuilder.h> #include <LibJS/Interpreter.h> #include <LibJS/Parser.h> -#include <LibWeb/Bindings/HTMLElementPrototype.h> #include <LibWeb/DOM/DOMException.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/ExceptionOr.h> @@ -33,7 +32,7 @@ HTMLElement::HTMLElement(DOM::Document& document, DOM::QualifiedName qualified_n : Element(document, move(qualified_name)) , m_dataset(DOMStringMap::create(*this)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLElementPrototype>("HTMLElement")); + set_prototype(&window().cached_web_prototype("HTMLElement")); } HTMLElement::~HTMLElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp index d6d036c1b8..c62afdd6cb 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLEmbedElementPrototype.h> #include <LibWeb/HTML/HTMLEmbedElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLEmbedElement::HTMLEmbedElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp index fe2f968a66..4090cb0c07 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLFieldSetElementPrototype.h> #include <LibWeb/HTML/HTMLFieldSetElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLFieldSetElement::HTMLFieldSetElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp index f969f03658..dd104088cb 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLFontElementPrototype.h> #include <LibWeb/CSS/StyleProperties.h> #include <LibWeb/CSS/StyleValue.h> #include <LibWeb/HTML/HTMLFontElement.h> @@ -15,7 +14,7 @@ namespace Web::HTML { HTMLFontElement::HTMLFontElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp index acce37c42d..9599f9390f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp @@ -5,7 +5,6 @@ */ #include <AK/StringBuilder.h> -#include <LibWeb/Bindings/HTMLFormElementPrototype.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/EventNames.h> @@ -26,7 +25,7 @@ namespace Web::HTML { HTMLFormElement::HTMLFormElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFrameElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFrameElement.cpp index c5ae687c05..9e0b3653b7 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFrameElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFrameElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLFrameElementPrototype.h> #include <LibWeb/HTML/HTMLFrameElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLFrameElement::HTMLFrameElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp index 52d06e9540..33054ee584 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLFrameSetElementPrototype.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/HTML/HTMLFrameSetElement.h> #include <LibWeb/HTML/Window.h> @@ -14,7 +13,7 @@ namespace Web::HTML { HTMLFrameSetElement::HTMLFrameSetElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHRElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHRElement.cpp index 89d19cb1e5..00a89cab77 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHRElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLHRElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLHRElementPrototype.h> #include <LibWeb/HTML/HTMLHRElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLHRElement::HTMLHRElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHeadElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHeadElement.cpp index fa35126797..0740228b11 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHeadElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLHeadElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLHeadElementPrototype.h> #include <LibWeb/HTML/HTMLHeadElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLHeadElement::HTMLHeadElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp index 28b276f17a..165fd4832a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLHeadingElementPrototype.h> #include <LibWeb/HTML/HTMLHeadingElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLHeadingElement::HTMLHeadingElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp index 90fe7f8c52..22eab1230c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLHtmlElementPrototype.h> #include <LibWeb/HTML/HTMLHtmlElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLHtmlElement::HTMLHtmlElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp index 2ee367455e..ef3f3e2a6c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLIFrameElementPrototype.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Event.h> #include <LibWeb/HTML/BrowsingContext.h> @@ -17,7 +16,7 @@ namespace Web::HTML { HTMLIFrameElement::HTMLIFrameElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp index 4e2d0d3911..c36a4845f3 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp @@ -5,7 +5,6 @@ */ #include <LibGfx/Bitmap.h> -#include <LibWeb/Bindings/HTMLImageElementPrototype.h> #include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/CSS/StyleComputer.h> #include <LibWeb/DOM/Document.h> @@ -23,7 +22,7 @@ HTMLImageElement::HTMLImageElement(DOM::Document& document, DOM::QualifiedName q : HTMLElement(document, move(qualified_name)) , 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] { set_needs_style_update(true); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp index 4ca7cc2f05..1d3f4eb77f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLInputElementPrototype.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Event.h> #include <LibWeb/DOM/ShadowRoot.h> @@ -25,7 +24,7 @@ HTMLInputElement::HTMLInputElement(DOM::Document& document, DOM::QualifiedName q : HTMLElement(document, move(qualified_name)) , m_value(String::empty()) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLInputElementPrototype>("HTMLInputElement")); + set_prototype(&window().cached_web_prototype("HTMLInputElement")); activation_behavior = [this](auto&) { // The activation behavior for input elements are these steps: diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLIElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLIElement.cpp index 1c85241a0a..c7f99a2614 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLIElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLIElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLLIElementPrototype.h> #include <LibWeb/HTML/HTMLLIElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLLIElement::HTMLLIElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLabelElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLabelElement.cpp index 31398d3c90..b3c6b7ab9a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLabelElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLabelElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLLabelElementPrototype.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/HTML/HTMLLabelElement.h> #include <LibWeb/Layout/Label.h> @@ -14,7 +13,7 @@ namespace Web::HTML { HTMLLabelElement::HTMLLabelElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLegendElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLegendElement.cpp index 7cdaae7016..c4781885b4 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLegendElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLegendElement.cpp @@ -13,7 +13,7 @@ namespace Web::HTML { HTMLLegendElement::HTMLLegendElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp index c2365ab429..9fd5d9024c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp @@ -9,7 +9,6 @@ #include <AK/ByteBuffer.h> #include <AK/Debug.h> #include <AK/URL.h> -#include <LibWeb/Bindings/HTMLLinkElementPrototype.h> #include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/HTML/HTMLLinkElement.h> @@ -22,7 +21,7 @@ namespace Web::HTML { HTMLLinkElement::HTMLLinkElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMapElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMapElement.cpp index e02e7374f0..5f8ef1f9e1 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMapElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMapElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLMapElementPrototype.h> #include <LibWeb/HTML/HTMLMapElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLMapElement::HTMLMapElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp index 9c9bebbb46..496e591205 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLMarqueeElementPrototype.h> #include <LibWeb/HTML/HTMLMarqueeElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLMarqueeElement::HTMLMarqueeElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp index 2d53b2e716..793510c5d4 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp @@ -13,7 +13,7 @@ namespace Web::HTML { HTMLMediaElement::HTMLMediaElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.cpp index 65528d3078..01aa6c3c7a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLMenuElementPrototype.h> #include <LibWeb/HTML/HTMLMenuElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLMenuElement::HTMLMenuElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp index 66eaf3cc03..b263fd28d9 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLMetaElementPrototype.h> #include <LibWeb/HTML/HTMLMetaElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLMetaElement::HTMLMetaElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp index 6d33d2e414..7938a3e798 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLMeterElementPrototype.h> #include <LibWeb/HTML/HTMLMeterElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLMeterElement::HTMLMeterElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp index b4d7325868..e510e47e32 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLModElementPrototype.h> #include <LibWeb/HTML/HTMLModElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLModElement::HTMLModElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOListElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOListElement.cpp index a397c00a57..7a02c49ead 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOListElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOListElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLOListElementPrototype.h> #include <LibWeb/HTML/HTMLOListElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLOListElement::HTMLOListElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp index 678a058256..42133c30db 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp @@ -5,7 +5,6 @@ */ #include <LibGfx/Bitmap.h> -#include <LibWeb/Bindings/HTMLObjectElementPrototype.h> #include <LibWeb/CSS/StyleComputer.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Event.h> @@ -20,7 +19,7 @@ namespace Web::HTML { HTMLObjectElement::HTMLObjectElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.cpp index 2460f1fe25..97a61dd588 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLOptGroupElementPrototype.h> #include <LibWeb/HTML/HTMLOptGroupElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLOptGroupElement::HTMLOptGroupElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp index 06c27df4b9..2c9ffd9594 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp @@ -6,7 +6,6 @@ */ #include <AK/StringBuilder.h> -#include <LibWeb/Bindings/HTMLOptionElementPrototype.h> #include <LibWeb/DOM/Node.h> #include <LibWeb/DOM/Text.h> #include <LibWeb/HTML/HTMLOptionElement.h> @@ -20,7 +19,7 @@ namespace Web::HTML { HTMLOptionElement::HTMLOptionElement(DOM::Document& document, DOM::QualifiedName 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; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp index 1763ad2c58..dc1a8109cc 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLOptionsCollectionPrototype.h> #include <LibWeb/DOM/DOMException.h> #include <LibWeb/HTML/HTMLOptGroupElement.h> #include <LibWeb/HTML/HTMLOptionElement.h> @@ -22,7 +21,7 @@ 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(&root.window().ensure_web_prototype<Bindings::HTMLOptionsCollectionPrototype>("HTMLOptionsCollection")); + set_prototype(&root.window().cached_web_prototype("HTMLOptionsCollection")); } HTMLOptionsCollection::~HTMLOptionsCollection() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.cpp index b5f8f5d07d..08b9fbedee 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLOutputElementPrototype.h> #include <LibWeb/HTML/HTMLOutputElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLOutputElement::HTMLOutputElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLOutputElementPrototype>("HTMLOutputElement")); + set_prototype(&window().cached_web_prototype("HTMLOutputElement")); } HTMLOutputElement::~HTMLOutputElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp index b8dabd218a..0311b98bfd 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLParagraphElementPrototype.h> #include <LibWeb/HTML/HTMLParagraphElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLParagraphElement::HTMLParagraphElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLParagraphElementPrototype>("HTMLParagraphElement")); + set_prototype(&window().cached_web_prototype("HTMLParagraphElement")); } HTMLParagraphElement::~HTMLParagraphElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLParamElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLParamElement.cpp index 9e41a5f402..1698471a13 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLParamElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLParamElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLParamElementPrototype.h> #include <LibWeb/HTML/HTMLParamElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLParamElement::HTMLParamElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLParamElementPrototype>("HTMLParamElement")); + set_prototype(&window().cached_web_prototype("HTMLParamElement")); } HTMLParamElement::~HTMLParamElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLPictureElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLPictureElement.cpp index 6dcd14db66..0f21efb14a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLPictureElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLPictureElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLPictureElementPrototype.h> #include <LibWeb/HTML/HTMLPictureElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLPictureElement::HTMLPictureElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLPictureElementPrototype>("HTMLPictureElement")); + set_prototype(&window().cached_web_prototype("HTMLPictureElement")); } HTMLPictureElement::~HTMLPictureElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp index 400e9978ab..8461ebeea8 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLPreElementPrototype.h> #include <LibWeb/HTML/HTMLPreElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLPreElement::HTMLPreElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLPreElementPrototype>("HTMLPreElement")); + set_prototype(&window().cached_web_prototype("HTMLPreElement")); } HTMLPreElement::~HTMLPreElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.cpp index d3e8bcd500..cc31d8e0d5 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLProgressElementPrototype.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/ShadowRoot.h> #include <LibWeb/HTML/HTMLProgressElement.h> @@ -19,7 +18,7 @@ namespace Web::HTML { HTMLProgressElement::HTMLProgressElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLProgressElementPrototype>("HTMLProgressElement")); + set_prototype(&window().cached_web_prototype("HTMLProgressElement")); } HTMLProgressElement::~HTMLProgressElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp index daed2603af..fdeae0a18e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLQuoteElementPrototype.h> #include <LibWeb/HTML/HTMLQuoteElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLQuoteElement::HTMLQuoteElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLQuoteElementPrototype>("HTMLQuoteElement")); + set_prototype(&window().cached_web_prototype("HTMLQuoteElement")); } HTMLQuoteElement::~HTMLQuoteElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp index 3b6f000e0f..8f1775d522 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp @@ -7,7 +7,6 @@ #include <AK/Debug.h> #include <AK/StringBuilder.h> #include <LibTextCodec/Decoder.h> -#include <LibWeb/Bindings/HTMLScriptElementPrototype.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Event.h> #include <LibWeb/DOM/ShadowRoot.h> @@ -23,7 +22,7 @@ namespace Web::HTML { HTMLScriptElement::HTMLScriptElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLScriptElementPrototype>("HTMLScriptElement")); + set_prototype(&window().cached_web_prototype("HTMLScriptElement")); } HTMLScriptElement::~HTMLScriptElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp index 3aacee7155..534e75225d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLSelectElementPrototype.h> #include <LibWeb/HTML/HTMLFormElement.h> #include <LibWeb/HTML/HTMLOptGroupElement.h> #include <LibWeb/HTML/HTMLOptionElement.h> @@ -17,7 +16,7 @@ namespace Web::HTML { HTMLSelectElement::HTMLSelectElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLSelectElementPrototype>("HTMLSelectElement")); + set_prototype(&window().cached_web_prototype("HTMLSelectElement")); } HTMLSelectElement::~HTMLSelectElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSlotElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSlotElement.cpp index 36d316516c..5964546ddf 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSlotElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSlotElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLSlotElementPrototype.h> #include <LibWeb/HTML/HTMLSlotElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLSlotElement::HTMLSlotElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLSlotElementPrototype>("HTMLSlotElement")); + set_prototype(&window().cached_web_prototype("HTMLSlotElement")); } HTMLSlotElement::~HTMLSlotElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSourceElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSourceElement.cpp index 38c3172e56..4e22808d5f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSourceElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSourceElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLSourceElementPrototype.h> #include <LibWeb/HTML/HTMLSourceElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLSourceElement::HTMLSourceElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLSourceElementPrototype>("HTMLSourceElement")); + set_prototype(&window().cached_web_prototype("HTMLSourceElement")); } HTMLSourceElement::~HTMLSourceElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.cpp index 8f3c0177f4..31881bb054 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLSpanElementPrototype.h> #include <LibWeb/HTML/HTMLSpanElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLSpanElement::HTMLSpanElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLSpanElementPrototype>("HTMLSpanElement")); + set_prototype(&window().cached_web_prototype("HTMLSpanElement")); } HTMLSpanElement::~HTMLSpanElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp index 1013e8b2bf..f59055aa3f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLStyleElementPrototype.h> #include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/HTML/HTMLStyleElement.h> @@ -15,7 +14,7 @@ namespace Web::HTML { HTMLStyleElement::HTMLStyleElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLStyleElementPrototype>("HTMLStyleElement")); + set_prototype(&window().cached_web_prototype("HTMLStyleElement")); } HTMLStyleElement::~HTMLStyleElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp index 27b7a0d80d..ef1bf755fb 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLTableCaptionElementPrototype.h> #include <LibWeb/HTML/HTMLTableCaptionElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLTableCaptionElement::HTMLTableCaptionElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLTableCaptionElementPrototype>("HTMLTableCaptionElement")); + set_prototype(&window().cached_web_prototype("HTMLTableCaptionElement")); } HTMLTableCaptionElement::~HTMLTableCaptionElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp index 9f97fa7540..845496c96d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLTableCellElementPrototype.h> #include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/HTML/HTMLTableCellElement.h> #include <LibWeb/HTML/Parser/HTMLParser.h> @@ -15,7 +14,7 @@ namespace Web::HTML { HTMLTableCellElement::HTMLTableCellElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLTableCellElementPrototype>("HTMLTableCellElement")); + set_prototype(&window().cached_web_prototype("HTMLTableCellElement")); } HTMLTableCellElement::~HTMLTableCellElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp index f48bbbb9bc..b1d5c8585d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLTableColElementPrototype.h> #include <LibWeb/HTML/HTMLTableColElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLTableColElement::HTMLTableColElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLTableColElementPrototype>("HTMLTableColElement")); + set_prototype(&window().cached_web_prototype("HTMLTableColElement")); } HTMLTableColElement::~HTMLTableColElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp index 6bc0ee1fae..8e9566e0dd 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLTableElementPrototype.h> #include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/DOM/ElementFactory.h> #include <LibWeb/DOM/HTMLCollection.h> @@ -21,7 +20,7 @@ namespace Web::HTML { HTMLTableElement::HTMLTableElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLTableElementPrototype>("HTMLTableElement")); + set_prototype(&window().cached_web_prototype("HTMLTableElement")); } HTMLTableElement::~HTMLTableElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp index 0a2012de0c..c26307bbaf 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLTableRowElementPrototype.h> #include <LibWeb/DOM/HTMLCollection.h> #include <LibWeb/HTML/HTMLTableCellElement.h> #include <LibWeb/HTML/HTMLTableElement.h> @@ -17,7 +16,7 @@ namespace Web::HTML { HTMLTableRowElement::HTMLTableRowElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLTableRowElementPrototype>("HTMLTableRowElement")); + set_prototype(&window().cached_web_prototype("HTMLTableRowElement")); } HTMLTableRowElement::~HTMLTableRowElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp index cc227cae63..a4aa621237 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLTableSectionElementPrototype.h> #include <LibWeb/DOM/ElementFactory.h> #include <LibWeb/DOM/HTMLCollection.h> #include <LibWeb/HTML/HTMLTableRowElement.h> @@ -18,7 +17,7 @@ namespace Web::HTML { HTMLTableSectionElement::HTMLTableSectionElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLTableSectionElementPrototype>("HTMLTableSectionElement")); + set_prototype(&window().cached_web_prototype("HTMLTableSectionElement")); } HTMLTableSectionElement::~HTMLTableSectionElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.cpp index b32e5a8dd9..9dd5b927e0 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLTemplateElementPrototype.h> #include <LibWeb/Bindings/MainThreadVM.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/HTML/HTMLTemplateElement.h> @@ -14,7 +13,7 @@ namespace Web::HTML { HTMLTemplateElement::HTMLTemplateElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLTemplateElementPrototype>("HTMLTemplateElement")); + set_prototype(&window().cached_web_prototype("HTMLTemplateElement")); m_content = heap().allocate<DOM::DocumentFragment>(realm(), appropriate_template_contents_owner_document(document)); m_content->set_host(this); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp index 70ea1f21d0..6988607f00 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLTextAreaElementPrototype.h> #include <LibWeb/HTML/HTMLTextAreaElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLTextAreaElement::HTMLTextAreaElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLTextAreaElementPrototype>("HTMLTextAreaElement")); + set_prototype(&window().cached_web_prototype("HTMLTextAreaElement")); } HTMLTextAreaElement::~HTMLTextAreaElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.cpp index 9464799740..9c6061be89 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLTextAreaElementPrototype.h> #include <LibWeb/HTML/HTMLTimeElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLTimeElement::HTMLTimeElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLTextAreaElementPrototype>("HTMLTextAreaElement")); + set_prototype(&window().cached_web_prototype("HTMLTimeElement")); } HTMLTimeElement::~HTMLTimeElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp index e556863278..f6c75ec1fb 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLTitleElementPrototype.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/HTML/HTMLTitleElement.h> #include <LibWeb/Page/Page.h> @@ -14,7 +13,7 @@ namespace Web::HTML { HTMLTitleElement::HTMLTitleElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLTitleElementPrototype>("HTMLTitleElement")); + set_prototype(&window().cached_web_prototype("HTMLTitleElement")); } HTMLTitleElement::~HTMLTitleElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp index eadfacaf69..78e3394c51 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLTrackElementPrototype.h> #include <LibWeb/HTML/HTMLTrackElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLTrackElement::HTMLTrackElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLTrackElementPrototype>("HTMLTrackElement")); + set_prototype(&window().cached_web_prototype("HTMLTrackElement")); } HTMLTrackElement::~HTMLTrackElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLUListElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLUListElement.cpp index 71eb3820a9..89164939ed 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLUListElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLUListElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLUListElementPrototype.h> #include <LibWeb/HTML/HTMLUListElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLUListElement::HTMLUListElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLUListElementPrototype>("HTMLUListElement")); + set_prototype(&window().cached_web_prototype("HTMLUListElement")); } HTMLUListElement::~HTMLUListElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.cpp index b5df91ad7d..1f07432f31 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLUnknownElementPrototype.h> #include <LibWeb/HTML/HTMLUnknownElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLUnknownElement::HTMLUnknownElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLUnknownElementPrototype>("HTMLUnknownElement")); + set_prototype(&window().cached_web_prototype("HTMLUnknownElement")); } HTMLUnknownElement::~HTMLUnknownElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp index 76b3941e27..beb9feb413 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HTMLVideoElementPrototype.h> #include <LibWeb/HTML/HTMLVideoElement.h> #include <LibWeb/HTML/Window.h> @@ -13,7 +12,7 @@ namespace Web::HTML { HTMLVideoElement::HTMLVideoElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLMediaElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::HTMLVideoElementPrototype>("HTMLVideoElement")); + set_prototype(&window().cached_web_prototype("HTMLVideoElement")); } HTMLVideoElement::~HTMLVideoElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/History.cpp b/Userland/Libraries/LibWeb/HTML/History.cpp index 52f4d0908b..4dce0e22ad 100644 --- a/Userland/Libraries/LibWeb/HTML/History.cpp +++ b/Userland/Libraries/LibWeb/HTML/History.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/HistoryPrototype.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/HTML/History.h> @@ -19,7 +18,7 @@ History::History(HTML::Window& window, DOM::Document& document) : PlatformObject(window.realm()) , m_associated_document(document) { - set_prototype(&window.ensure_web_prototype<Bindings::HistoryPrototype>("History")); + set_prototype(&window.cached_web_prototype("History")); } History::~History() = default; diff --git a/Userland/Libraries/LibWeb/HTML/ImageData.cpp b/Userland/Libraries/LibWeb/HTML/ImageData.cpp index e70c40b18a..4cff7f5813 100644 --- a/Userland/Libraries/LibWeb/HTML/ImageData.cpp +++ b/Userland/Libraries/LibWeb/HTML/ImageData.cpp @@ -6,7 +6,6 @@ #include <LibGfx/Bitmap.h> #include <LibJS/Runtime/TypedArray.h> -#include <LibWeb/Bindings/ImageDataPrototype.h> #include <LibWeb/HTML/ImageData.h> #include <LibWeb/HTML/Window.h> @@ -38,7 +37,7 @@ ImageData::ImageData(HTML::Window& window, NonnullRefPtr<Gfx::Bitmap> bitmap, JS , m_bitmap(move(bitmap)) , m_data(move(data)) { - set_prototype(&window.ensure_web_prototype<Bindings::ImageDataPrototype>("ImageData")); + set_prototype(&window.cached_web_prototype("ImageData")); } ImageData::~ImageData() = default; diff --git a/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp b/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp index 378256f46a..767c515b45 100644 --- a/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp +++ b/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/MessageChannelPrototype.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/HTML/MessageChannel.h> #include <LibWeb/HTML/MessagePort.h> @@ -20,7 +19,7 @@ JS::NonnullGCPtr<MessageChannel> MessageChannel::create_with_global_object(HTML: MessageChannel::MessageChannel(HTML::Window& window) : PlatformObject(window.realm()) { - set_prototype(&window.ensure_web_prototype<Bindings::MessageChannelPrototype>("MessageChannel")); + set_prototype(&window.cached_web_prototype("MessageChannel")); // 1. Set this's port 1 to a new MessagePort in this's relevant Realm. m_port1 = MessagePort::create(window); diff --git a/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp b/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp index b993d22a66..98eb672e82 100644 --- a/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/MessageEventPrototype.h> #include <LibWeb/HTML/MessageEvent.h> #include <LibWeb/HTML/Window.h> @@ -26,7 +25,7 @@ MessageEvent::MessageEvent(HTML::Window& window_object, FlyString const& event_n , m_origin(event_init.origin) , m_last_event_id(event_init.last_event_id) { - set_prototype(&window_object.ensure_web_prototype<Bindings::MessageEventPrototype>("MessageEvent")); + set_prototype(&window_object.cached_web_prototype("MessageEvent")); } MessageEvent::~MessageEvent() = default; diff --git a/Userland/Libraries/LibWeb/HTML/MessagePort.cpp b/Userland/Libraries/LibWeb/HTML/MessagePort.cpp index 9e4bb94101..aa92b46ded 100644 --- a/Userland/Libraries/LibWeb/HTML/MessagePort.cpp +++ b/Userland/Libraries/LibWeb/HTML/MessagePort.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/MessagePortPrototype.h> #include <LibWeb/DOM/EventDispatcher.h> #include <LibWeb/HTML/EventHandler.h> #include <LibWeb/HTML/EventLoop/EventLoop.h> @@ -22,7 +21,7 @@ JS::NonnullGCPtr<MessagePort> MessagePort::create(HTML::Window& window) MessagePort::MessagePort(HTML::Window& window) : DOM::EventTarget(window.realm()) { - set_prototype(&window.ensure_web_prototype<Bindings::MessagePortPrototype>("MessagePort")); + set_prototype(&window.cached_web_prototype("MessagePort")); } MessagePort::~MessagePort() = default; diff --git a/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.cpp b/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.cpp index 450be24913..d2d6227035 100644 --- a/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/PageTransitionEventPrototype.h> #include <LibWeb/HTML/PageTransitionEvent.h> #include <LibWeb/HTML/Window.h> @@ -24,7 +23,7 @@ PageTransitionEvent::PageTransitionEvent(HTML::Window& window_object, FlyString : DOM::Event(window_object, event_name, event_init) , m_persisted(event_init.persisted) { - set_prototype(&window_object.ensure_web_prototype<Bindings::PageTransitionEventPrototype>("PageTransitionEvent")); + set_prototype(&window_object.cached_web_prototype("PageTransitionEvent")); } PageTransitionEvent::~PageTransitionEvent() = default; diff --git a/Userland/Libraries/LibWeb/HTML/Path2D.cpp b/Userland/Libraries/LibWeb/HTML/Path2D.cpp index 165d04f7a9..69ac6e1871 100644 --- a/Userland/Libraries/LibWeb/HTML/Path2D.cpp +++ b/Userland/Libraries/LibWeb/HTML/Path2D.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/Path2DPrototype.h> #include <LibWeb/HTML/Path2D.h> #include <LibWeb/HTML/Window.h> @@ -19,7 +18,7 @@ JS::NonnullGCPtr<Path2D> Path2D::create_with_global_object(HTML::Window& window, Path2D::Path2D(HTML::Window& window, Optional<Variant<JS::Handle<Path2D>, String>> const& path) : PlatformObject(window.realm()) { - set_prototype(&window.ensure_web_prototype<Bindings::Path2DPrototype>("Path2D")); + set_prototype(&window.cached_web_prototype("Path2D")); // 1. Let output be a new Path2D object. // 2. If path is not given, then return output. diff --git a/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp b/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp index a7b246fa06..e4654a0fc1 100644 --- a/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/PromiseRejectionEventPrototype.h> #include <LibWeb/HTML/PromiseRejectionEvent.h> #include <LibWeb/HTML/Window.h> @@ -25,7 +24,7 @@ PromiseRejectionEvent::PromiseRejectionEvent(HTML::Window& window_object, FlyStr , m_promise(const_cast<JS::Promise*>(event_init.promise.cell())) , m_reason(event_init.reason) { - set_prototype(&window_object.ensure_web_prototype<Bindings::PromiseRejectionEventPrototype>("PromiseRejectionEvent")); + set_prototype(&window_object.cached_web_prototype("PromiseRejectionEvent")); } PromiseRejectionEvent::~PromiseRejectionEvent() = default; diff --git a/Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp b/Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp index 2aa2c2650a..684e476341 100644 --- a/Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/SubmitEventPrototype.h> #include <LibWeb/HTML/SubmitEvent.h> #include <LibWeb/HTML/Window.h> @@ -24,7 +23,7 @@ SubmitEvent::SubmitEvent(HTML::Window& window_object, FlyString const& event_nam : DOM::Event(window_object, event_name, event_init) , m_submitter(event_init.submitter) { - set_prototype(&window_object.ensure_web_prototype<Bindings::SubmitEventPrototype>("SubmitEvent")); + set_prototype(&window_object.cached_web_prototype("SubmitEvent")); } SubmitEvent::~SubmitEvent() = default; diff --git a/Userland/Libraries/LibWeb/HTML/TextMetrics.cpp b/Userland/Libraries/LibWeb/HTML/TextMetrics.cpp index 289ede7bba..16327dfc3f 100644 --- a/Userland/Libraries/LibWeb/HTML/TextMetrics.cpp +++ b/Userland/Libraries/LibWeb/HTML/TextMetrics.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/TextMetricsPrototype.h> #include <LibWeb/HTML/TextMetrics.h> #include <LibWeb/HTML/Window.h> @@ -18,7 +17,7 @@ JS::NonnullGCPtr<TextMetrics> TextMetrics::create(HTML::Window& window) TextMetrics::TextMetrics(HTML::Window& window) : PlatformObject(window.realm()) { - set_prototype(&window.ensure_web_prototype<Bindings::TextMetricsPrototype>("TextMetrics")); + set_prototype(&window.cached_web_prototype("TextMetrics")); } TextMetrics::~TextMetrics() = default; diff --git a/Userland/Libraries/LibWeb/HTML/Worker.cpp b/Userland/Libraries/LibWeb/HTML/Worker.cpp index ef6e1c66f9..8051bd6332 100644 --- a/Userland/Libraries/LibWeb/HTML/Worker.cpp +++ b/Userland/Libraries/LibWeb/HTML/Worker.cpp @@ -8,7 +8,6 @@ #include <LibJS/Runtime/ConsoleObject.h> #include <LibJS/Runtime/Realm.h> #include <LibWeb/Bindings/MainThreadVM.h> -#include <LibWeb/Bindings/WorkerPrototype.h> #include <LibWeb/DOM/ExceptionOr.h> #include <LibWeb/HTML/Scripting/Environments.h> #include <LibWeb/HTML/Worker.h> @@ -28,7 +27,7 @@ Worker::Worker(FlyString const& script_url, WorkerOptions const options, DOM::Do , m_interpreter_scope(*m_interpreter) , m_implicit_port(MessagePort::create(document.window())) { - set_prototype(&document.window().ensure_web_prototype<Bindings::WorkerPrototype>("Worker")); + set_prototype(&document.window().cached_web_prototype("Worker")); } void Worker::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp b/Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp index f35a6addc9..84c8ac48e3 100644 --- a/Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp +++ b/Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/PerformancePrototype.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Event.h> #include <LibWeb/DOM/EventDispatcher.h> @@ -18,7 +17,7 @@ Performance::Performance(HTML::Window& window) : DOM::EventTarget(window.realm()) , m_window(window) { - set_prototype(&window.ensure_web_prototype<Bindings::PerformancePrototype>("Performance")); + set_prototype(&window.cached_web_prototype("Performance")); m_timer.start(); } diff --git a/Userland/Libraries/LibWeb/SVG/SVGAnimatedLength.cpp b/Userland/Libraries/LibWeb/SVG/SVGAnimatedLength.cpp index 87ac513cb4..3641755289 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGAnimatedLength.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGAnimatedLength.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/SVGAnimatedLengthPrototype.h> #include <LibWeb/HTML/Window.h> #include <LibWeb/SVG/SVGAnimatedLength.h> @@ -20,7 +19,7 @@ SVGAnimatedLength::SVGAnimatedLength(HTML::Window& window, JS::NonnullGCPtr<SVGL , m_base_val(move(base_val)) , m_anim_val(move(anim_val)) { - set_prototype(&window.ensure_web_prototype<Bindings::SVGAnimatedLengthPrototype>("SVGAnimatedLength")); + set_prototype(&window.cached_web_prototype("SVGAnimatedLength")); // The object referenced by animVal will always be distinct from the one referenced by baseVal, even when the attribute is not animated. VERIFY(m_base_val.ptr() != m_anim_val.ptr()); diff --git a/Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp index b77779a53b..9f49512c2b 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/SVGCircleElementPrototype.h> #include <LibWeb/HTML/Window.h> #include <LibWeb/SVG/AttributeNames.h> #include <LibWeb/SVG/AttributeParser.h> @@ -15,7 +14,7 @@ namespace Web::SVG { SVGCircleElement::SVGCircleElement(DOM::Document& document, DOM::QualifiedName qualified_name) : SVGGeometryElement(document, qualified_name) { - set_prototype(&window().ensure_web_prototype<Bindings::SVGCircleElementPrototype>("SVGCircleElement")); + set_prototype(&window().cached_web_prototype("SVGCircleElement")); } void SVGCircleElement::parse_attribute(FlyString const& name, String const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp index 0fd5659009..d83755c259 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/SVGClipPathElementPrototype.h> #include <LibWeb/HTML/Window.h> #include <LibWeb/SVG/SVGClipPathElement.h> @@ -13,7 +12,7 @@ namespace Web::SVG { SVGClipPathElement::SVGClipPathElement(DOM::Document& document, DOM::QualifiedName qualified_name) : SVGElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::SVGClipPathElementPrototype>("SVGClipPathElement")); + set_prototype(&window().cached_web_prototype("SVGClipPathElement")); } SVGClipPathElement::~SVGClipPathElement() diff --git a/Userland/Libraries/LibWeb/SVG/SVGDefsElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGDefsElement.cpp index 9787a68df8..882084e5e8 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGDefsElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGDefsElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/SVGDefsElementPrototype.h> #include <LibWeb/HTML/Window.h> #include <LibWeb/SVG/SVGDefsElement.h> @@ -13,7 +12,7 @@ namespace Web::SVG { SVGDefsElement::SVGDefsElement(DOM::Document& document, DOM::QualifiedName qualified_name) : SVGGraphicsElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::SVGDefsElementPrototype>("SVGDefsElement")); + set_prototype(&window().cached_web_prototype("SVGDefsElement")); } SVGDefsElement::~SVGDefsElement() diff --git a/Userland/Libraries/LibWeb/SVG/SVGElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGElement.cpp index e4dac180cc..328d9e6a7f 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/SVGElementPrototype.h> #include <LibWeb/HTML/Window.h> #include <LibWeb/SVG/SVGElement.h> @@ -14,7 +13,7 @@ SVGElement::SVGElement(DOM::Document& document, DOM::QualifiedName qualified_nam : Element(document, move(qualified_name)) , m_dataset(HTML::DOMStringMap::create(*this)) { - set_prototype(&window().ensure_web_prototype<Bindings::SVGElementPrototype>("SVGElement")); + set_prototype(&window().cached_web_prototype("SVGElement")); } void SVGElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp index dc9bbd2b2f..83eead0c8f 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/SVGEllipseElementPrototype.h> #include <LibWeb/HTML/Window.h> #include <LibWeb/SVG/AttributeNames.h> #include <LibWeb/SVG/AttributeParser.h> @@ -15,7 +14,7 @@ namespace Web::SVG { SVGEllipseElement::SVGEllipseElement(DOM::Document& document, DOM::QualifiedName qualified_name) : SVGGeometryElement(document, qualified_name) { - set_prototype(&window().ensure_web_prototype<Bindings::SVGEllipseElementPrototype>("SVGEllipseElement")); + set_prototype(&window().cached_web_prototype("SVGEllipseElement")); } void SVGEllipseElement::parse_attribute(FlyString const& name, String const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.cpp index 51292000f5..1fe2677c43 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/SVGGeometryElementPrototype.h> #include <LibWeb/HTML/Window.h> #include <LibWeb/Layout/SVGGeometryBox.h> #include <LibWeb/SVG/SVGGeometryElement.h> @@ -14,7 +13,7 @@ namespace Web::SVG { SVGGeometryElement::SVGGeometryElement(DOM::Document& document, DOM::QualifiedName qualified_name) : SVGGraphicsElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::SVGGeometryElementPrototype>("SVGGeometryElement")); + set_prototype(&window().cached_web_prototype("SVGGeometryElement")); } RefPtr<Layout::Node> SVGGeometryElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style) diff --git a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp index fc938c062a..68234dc4cb 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/SVGGraphicsElementPrototype.h> #include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/HTML/Window.h> #include <LibWeb/Layout/Node.h> @@ -17,7 +16,7 @@ namespace Web::SVG { SVGGraphicsElement::SVGGraphicsElement(DOM::Document& document, DOM::QualifiedName qualified_name) : SVGElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::SVGGraphicsElementPrototype>("SVGGraphicsElement")); + set_prototype(&window().cached_web_prototype("SVGGraphicsElement")); } void SVGGraphicsElement::apply_presentational_hints(CSS::StyleProperties& style) const diff --git a/Userland/Libraries/LibWeb/SVG/SVGLength.cpp b/Userland/Libraries/LibWeb/SVG/SVGLength.cpp index 912feee65b..b84073c281 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLength.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGLength.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/SVGLengthPrototype.h> #include <LibWeb/HTML/Window.h> #include <LibWeb/SVG/SVGLength.h> @@ -20,7 +19,7 @@ SVGLength::SVGLength(HTML::Window& window, u8 unit_type, float value) , m_unit_type(unit_type) , m_value(value) { - set_prototype(&window.ensure_web_prototype<Bindings::SVGLengthPrototype>("SVGLength")); + set_prototype(&window.cached_web_prototype("SVGLength")); } SVGLength::~SVGLength() = default; diff --git a/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp index c02ce0f6b9..c165cd31ef 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/SVGLineElementPrototype.h> #include <LibWeb/HTML/Window.h> #include <LibWeb/SVG/AttributeNames.h> #include <LibWeb/SVG/AttributeParser.h> @@ -15,7 +14,7 @@ namespace Web::SVG { SVGLineElement::SVGLineElement(DOM::Document& document, DOM::QualifiedName qualified_name) : SVGGeometryElement(document, qualified_name) { - set_prototype(&window().ensure_web_prototype<Bindings::SVGLineElementPrototype>("SVGLineElement")); + set_prototype(&window().cached_web_prototype("SVGLineElement")); } void SVGLineElement::parse_attribute(FlyString const& name, String const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp index 48867f7e8c..78fec14251 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp @@ -8,7 +8,6 @@ #include <AK/ExtraMathConstants.h> #include <LibGfx/Painter.h> #include <LibGfx/Path.h> -#include <LibWeb/Bindings/SVGPathElementPrototype.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Event.h> #include <LibWeb/Layout/SVGGeometryBox.h> @@ -87,7 +86,7 @@ namespace Web::SVG { SVGPathElement::SVGPathElement(DOM::Document& document, DOM::QualifiedName qualified_name) : SVGGeometryElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::SVGPathElementPrototype>("SVGPathElement")); + set_prototype(&window().cached_web_prototype("SVGPathElement")); } void SVGPathElement::parse_attribute(FlyString const& name, String const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp index a38fc7240a..00d2644b6d 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/SVGPolygonElementPrototype.h> #include <LibWeb/HTML/Window.h> #include <LibWeb/SVG/AttributeNames.h> #include <LibWeb/SVG/AttributeParser.h> @@ -15,7 +14,7 @@ namespace Web::SVG { SVGPolygonElement::SVGPolygonElement(DOM::Document& document, DOM::QualifiedName qualified_name) : SVGGeometryElement(document, qualified_name) { - set_prototype(&window().ensure_web_prototype<Bindings::SVGPolygonElementPrototype>("SVGPolygonElement")); + set_prototype(&window().cached_web_prototype("SVGPolygonElement")); } void SVGPolygonElement::parse_attribute(FlyString const& name, String const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp index 0b43e1b118..38ff8c81c9 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/SVGPolylineElementPrototype.h> #include <LibWeb/HTML/Window.h> #include <LibWeb/SVG/AttributeNames.h> #include <LibWeb/SVG/AttributeParser.h> @@ -15,7 +14,7 @@ namespace Web::SVG { SVGPolylineElement::SVGPolylineElement(DOM::Document& document, DOM::QualifiedName qualified_name) : SVGGeometryElement(document, qualified_name) { - set_prototype(&window().ensure_web_prototype<Bindings::SVGPolylineElementPrototype>("SVGPolylineElement")); + set_prototype(&window().cached_web_prototype("SVGPolylineElement")); } void SVGPolylineElement::parse_attribute(FlyString const& name, String const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp index 357dd57809..d3930d331b 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp @@ -4,20 +4,19 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include "SVGRectElement.h" -#include <LibWeb/Bindings/SVGRectElementPrototype.h> #include <LibWeb/HTML/Window.h> #include <LibWeb/SVG/AttributeNames.h> #include <LibWeb/SVG/AttributeParser.h> #include <LibWeb/SVG/SVGAnimatedLength.h> #include <LibWeb/SVG/SVGLength.h> +#include <LibWeb/SVG/SVGRectElement.h> namespace Web::SVG { SVGRectElement::SVGRectElement(DOM::Document& document, DOM::QualifiedName qualified_name) : SVGGeometryElement(document, qualified_name) { - set_prototype(&window().ensure_web_prototype<Bindings::SVGRectElementPrototype>("SVGRectElement")); + set_prototype(&window().cached_web_prototype("SVGRectElement")); } void SVGRectElement::parse_attribute(FlyString const& name, String const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp index e0d5bd64f2..00574762f1 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp @@ -6,7 +6,6 @@ */ #include <LibGfx/Painter.h> -#include <LibWeb/Bindings/SVGSVGElementPrototype.h> #include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/CSS/StyleComputer.h> #include <LibWeb/DOM/Document.h> @@ -21,7 +20,7 @@ namespace Web::SVG { SVGSVGElement::SVGSVGElement(DOM::Document& document, DOM::QualifiedName qualified_name) : SVGGraphicsElement(document, qualified_name) { - set_prototype(&window().ensure_web_prototype<Bindings::SVGSVGElementPrototype>("SVGSVGElement")); + set_prototype(&window().cached_web_prototype("SVGSVGElement")); } RefPtr<Layout::Node> SVGSVGElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style) diff --git a/Userland/Libraries/LibWeb/SVG/SVGTextContentElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGTextContentElement.cpp index 89eca8deab..948377ef3f 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTextContentElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGTextContentElement.cpp @@ -5,7 +5,6 @@ */ #include <AK/Utf16View.h> -#include <LibWeb/Bindings/SVGTextContentElementPrototype.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/SVG/SVGTextContentElement.h> @@ -14,7 +13,7 @@ namespace Web::SVG { SVGTextContentElement::SVGTextContentElement(DOM::Document& document, DOM::QualifiedName qualified_name) : SVGGraphicsElement(document, move(qualified_name)) { - set_prototype(&window().ensure_web_prototype<Bindings::SVGTextContentElementPrototype>("SVGTextContentElement")); + set_prototype(&window().cached_web_prototype("SVGTextContentElement")); } // https://svgwg.org/svg2-draft/text.html#__svg__SVGTextContentElement__getNumberOfChars diff --git a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp index 31c1085383..ac4d321fb3 100644 --- a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/FocusEventPrototype.h> #include <LibWeb/HTML/Window.h> #include <LibWeb/UIEvents/FocusEvent.h> @@ -18,7 +17,7 @@ FocusEvent* FocusEvent::create_with_global_object(HTML::Window& window_object, F FocusEvent::FocusEvent(HTML::Window& window_object, FlyString const& event_name, FocusEventInit const& event_init) : UIEvent(window_object, event_name) { - set_prototype(&window_object.ensure_web_prototype<Bindings::FocusEventPrototype>("FocusEvent")); + set_prototype(&window_object.cached_web_prototype("FocusEvent")); set_related_target(const_cast<DOM::EventTarget*>(event_init.related_target.ptr())); } diff --git a/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp index 6aceb57223..853a4bd55a 100644 --- a/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp @@ -5,7 +5,6 @@ */ #include <AK/CharacterTypes.h> -#include <LibWeb/Bindings/KeyboardEventPrototype.h> #include <LibWeb/HTML/Window.h> #include <LibWeb/UIEvents/KeyboardEvent.h> @@ -129,7 +128,7 @@ KeyboardEvent::KeyboardEvent(HTML::Window& window_object, FlyString const& event , m_key_code(event_init.key_code) , m_char_code(event_init.char_code) { - set_prototype(&window_object.ensure_web_prototype<Bindings::KeyboardEventPrototype>("KeyboardEvent")); + set_prototype(&window_object.cached_web_prototype("KeyboardEvent")); } KeyboardEvent::~KeyboardEvent() = default; diff --git a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp index 6b09d4947e..047ff967f8 100644 --- a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp @@ -6,7 +6,6 @@ */ #include <LibGUI/Event.h> -#include <LibWeb/Bindings/MouseEventPrototype.h> #include <LibWeb/HTML/EventNames.h> #include <LibWeb/HTML/Window.h> #include <LibWeb/UIEvents/EventNames.h> @@ -22,7 +21,7 @@ MouseEvent::MouseEvent(HTML::Window& window_object, FlyString const& event_name, , m_client_y(event_init.client_y) , m_button(event_init.button) { - set_prototype(&window_object.ensure_web_prototype<Bindings::MouseEventPrototype>("MouseEvent")); + set_prototype(&window_object.cached_web_prototype("MouseEvent")); set_event_characteristics(); } diff --git a/Userland/Libraries/LibWeb/UIEvents/UIEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/UIEvent.cpp index 48f3cb6424..15ede7319d 100644 --- a/Userland/Libraries/LibWeb/UIEvents/UIEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/UIEvent.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/UIEventPrototype.h> #include <LibWeb/HTML/Window.h> #include <LibWeb/UIEvents/UIEvent.h> @@ -23,7 +22,7 @@ UIEvent* UIEvent::create_with_global_object(HTML::Window& window_object, FlyStri UIEvent::UIEvent(HTML::Window& window_object, FlyString const& event_name) : Event(window_object, event_name) { - set_prototype(&window_object.ensure_web_prototype<Bindings::UIEventPrototype>("UIEvent")); + set_prototype(&window_object.cached_web_prototype("UIEvent")); } UIEvent::UIEvent(HTML::Window& window_object, FlyString const& event_name, UIEventInit const& event_init) @@ -31,7 +30,7 @@ UIEvent::UIEvent(HTML::Window& window_object, FlyString const& event_name, UIEve , m_view(event_init.view) , m_detail(event_init.detail) { - set_prototype(&window_object.ensure_web_prototype<Bindings::UIEventPrototype>("UIEvent")); + set_prototype(&window_object.cached_web_prototype("UIEvent")); } UIEvent::~UIEvent() = default; diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp b/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp index 78fab5996c..363bdeeec5 100644 --- a/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp +++ b/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/WebGLContextEventPrototype.h> #include <LibWeb/HTML/Window.h> #include <LibWeb/WebGL/WebGLContextEvent.h> @@ -24,7 +23,7 @@ WebGLContextEvent::WebGLContextEvent(HTML::Window& window_object, FlyString cons : DOM::Event(window_object, type, event_init) , m_status_message(event_init.status_message) { - set_prototype(&window_object.ensure_web_prototype<Bindings::WebGLContextEventPrototype>("WebGLContextEvent")); + set_prototype(&window_object.cached_web_prototype("WebGLContextEvent")); } WebGLContextEvent::~WebGLContextEvent() = default; diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp index 3fea5c92ed..6cb2531026 100644 --- a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp +++ b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/WebGLRenderingContextPrototype.h> #include <LibWeb/Bindings/Wrapper.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/HTML/HTMLCanvasElement.h> @@ -60,7 +59,7 @@ JS::ThrowCompletionOr<JS::GCPtr<WebGLRenderingContext>> WebGLRenderingContext::c WebGLRenderingContext::WebGLRenderingContext(HTML::Window& window, HTML::HTMLCanvasElement& canvas_element, NonnullOwnPtr<GL::GLContext> context, WebGLContextAttributes context_creation_parameters, WebGLContextAttributes actual_context_parameters) : WebGLRenderingContextBase(window, canvas_element, move(context), move(context_creation_parameters), move(actual_context_parameters)) { - set_prototype(&window.ensure_web_prototype<Bindings::WebGLRenderingContextPrototype>("WebGLRenderingContext")); + set_prototype(&window.cached_web_prototype("WebGLRenderingContext")); } WebGLRenderingContext::~WebGLRenderingContext() = default; diff --git a/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp b/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp index 69e0ba1548..e8380d7157 100644 --- a/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp +++ b/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp @@ -8,7 +8,6 @@ #include <LibJS/Parser.h> #include <LibJS/Runtime/ArrayBuffer.h> #include <LibJS/Runtime/FunctionObject.h> -#include <LibWeb/Bindings/WebSocketPrototype.h> #include <LibWeb/DOM/DOMException.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Event.h> @@ -66,7 +65,7 @@ WebSocket::WebSocket(HTML::Window& window, AK::URL& url) : EventTarget(window.realm()) , m_window(window) { - set_prototype(&window.ensure_web_prototype<Bindings::WebSocketPrototype>("WebSocket")); + set_prototype(&window.cached_web_prototype("WebSocket")); // FIXME: Integrate properly with FETCH as per https://fetch.spec.whatwg.org/#websocket-opening-handshake auto origin_string = m_window->associated_document().origin().serialize(); diff --git a/Userland/Libraries/LibWeb/XHR/ProgressEvent.cpp b/Userland/Libraries/LibWeb/XHR/ProgressEvent.cpp index 7157babd19..0fc456c430 100644 --- a/Userland/Libraries/LibWeb/XHR/ProgressEvent.cpp +++ b/Userland/Libraries/LibWeb/XHR/ProgressEvent.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/Bindings/ProgressEventPrototype.h> #include <LibWeb/HTML/Window.h> #include <LibWeb/XHR/ProgressEvent.h> @@ -26,7 +25,7 @@ ProgressEvent::ProgressEvent(HTML::Window& window_object, FlyString const& event , m_loaded(event_init.loaded) , m_total(event_init.total) { - set_prototype(&window_object.ensure_web_prototype<Bindings::ProgressEventPrototype>("ProgressEvent")); + set_prototype(&window_object.cached_web_prototype("ProgressEvent")); } ProgressEvent::~ProgressEvent() = default; diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp index a8886eac58..ef447298c1 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp @@ -51,7 +51,7 @@ XMLHttpRequest::XMLHttpRequest(HTML::Window& window) , m_window(window) , m_response_type(Bindings::XMLHttpRequestResponseType::Empty) { - set_prototype(&window.ensure_web_prototype<Bindings::XMLHttpRequestPrototype>("XMLHttpRequest")); + set_prototype(&window.cached_web_prototype("XMLHttpRequest")); } XMLHttpRequest::~XMLHttpRequest() = default; |