diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator/IDLGenerators.cpp index 452632a234e..c62d51899eb 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator/IDLGenerators.cpp @@ -2077,7 +2077,7 @@ namespace Web::Bindings { if (interface.wrapper_base_class == "Wrapper") { generator.append(R"~~~( @wrapper_class@::@wrapper_class@(JS::Realm& realm, @fully_qualified_name@& impl) - : Wrapper(verify_cast(realm.global_object()).ensure_web_prototype<@prototype_class@>("@name@")) + : Wrapper(verify_cast(realm.global_object()).cached_web_prototype("@name@")) , m_impl(impl) { } @@ -2087,7 +2087,7 @@ namespace Web::Bindings { @wrapper_class@::@wrapper_class@(JS::Realm& realm, @fully_qualified_name@& impl) : @wrapper_base_class@(realm, impl) { - set_prototype(&verify_cast(realm.global_object()).ensure_web_prototype<@prototype_class@>("@name@")); + set_prototype(&verify_cast(realm.global_object()).cached_web_prototype("@name@")); } )~~~"); } @@ -3775,7 +3775,7 @@ namespace Web::Bindings { } @wrapper_class@::@wrapper_class@(JS::Realm& realm, @fully_qualified_name@& impl) - : Wrapper(verify_cast(realm.global_object()).ensure_web_prototype<@prototype_class@>("@name@")) + : Wrapper(verify_cast(realm.global_object()).cached_web_prototype("@name@")) , m_impl(impl) { } diff --git a/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp index ea2f9ae745f..914f91d9ebd 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(realm.global_object()); NativeFunction::initialize(realm); - define_direct_property(vm.names.prototype, &window.ensure_web_prototype("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 d7f5be791a8..4d1f313ed6f 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(realm.global_object()); NativeFunction::initialize(realm); - define_direct_property(vm.names.prototype, &window.ensure_web_prototype("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 d625e19dceb..d7f8dbc37bd 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(realm.global_object()); NativeFunction::initialize(realm); - define_direct_property(vm.names.prototype, &window.ensure_web_prototype("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 f6e27a511a6..a1091c9102e 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(realm.global_object()).ensure_web_prototype("Location")) + : Object(verify_cast(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 9448536055b..262303051e0 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(realm.global_object()); NativeFunction::initialize(realm); - define_direct_property(vm.names.prototype, &window.ensure_web_prototype("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 8db25da83f0..a85e72ddd45 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(realm.global_object()).ensure_web_prototype("Navigator")) + : Object(verify_cast(realm.global_object()).cached_web_prototype("Navigator")) { } diff --git a/Userland/Libraries/LibWeb/Bindings/OptionConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/OptionConstructor.cpp index 8c0a9984c29..c320213326f 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(realm.global_object()); NativeFunction::initialize(realm); - define_direct_property(vm.names.prototype, &window.ensure_web_prototype("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 909bd5e93b9..de00ee8b3ea 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(realm.global_object()); NativeFunction::initialize(realm); - define_direct_property(vm.names.prototype, &window.ensure_web_prototype("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 9201551da79..36fc5208a9a 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(#interface_name); \ - constructor.define_direct_property(vm.names.name, js_string(vm, #interface_name), JS::Attribute::Configurable); \ auto& prototype = ensure_web_prototype(#interface_name); \ + auto& constructor = ensure_web_constructor(#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 8f16471bc4e..013ded9522d 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(realm.global_object()).ensure_web_prototype("EventTarget")) + : JS::Object(verify_cast(realm.global_object()).cached_web_prototype("EventTarget")) { } }; diff --git a/Userland/Libraries/LibWeb/CSS/CSSConditionRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSConditionRule.cpp index 9cb51a68acc..d4057e44126 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 #include #include @@ -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("CSSConditionRule")); + set_prototype(&window_object.cached_web_prototype("CSSConditionRule")); } void CSSConditionRule::for_each_effective_style_rule(Function const& callback) const diff --git a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp index 1d5d00aafa2..b4d1a982373 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 #include #include @@ -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("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 707eab39649..ef44d0fd03b 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 #include #include #include @@ -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("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 378878253c8..46d38d6acf7 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSImportRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSImportRule.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include #include @@ -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("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 cb72a58e366..af48b8d6dd9 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 #include #include @@ -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("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 ab1e30dafbd..f04ad9033c3 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 #include #include #include @@ -14,7 +13,7 @@ namespace Web::CSS { CSSRule::CSSRule(HTML::Window& window_object) - : PlatformObject(window_object.ensure_web_prototype("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 674383f4039..b3fdde9a8d7 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp @@ -5,7 +5,6 @@ */ #include -#include #include #include #include @@ -25,7 +24,7 @@ CSSRuleList* CSSRuleList::create(HTML::Window& window_object, JS::MarkedVector("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 1cb49c536a3..2d3671f5c80 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 #include #include #include @@ -14,7 +13,7 @@ namespace Web::CSS { CSSStyleDeclaration::CSSStyleDeclaration(HTML::Window& window_object) - : PlatformObject(window_object.ensure_web_prototype("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 15bb1463e17..1ae7cb30604 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 #include #include #include @@ -21,7 +20,7 @@ CSSStyleRule::CSSStyleRule(HTML::Window& window_object, NonnullRefPtrVector("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 5d210155f7e..50e87ea2c11 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 #include #include #include @@ -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("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 860f142115c..15140c9c108 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 #include #include #include @@ -20,7 +19,7 @@ CSSSupportsRule::CSSSupportsRule(HTML::Window& window_object, NonnullRefPtr("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 7003b702b3e..224d2711e66 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 #include #include #include @@ -18,7 +17,7 @@ MediaList* MediaList::create(HTML::Window& window_object, NonnullRefPtrVector&& media) - : Bindings::LegacyPlatformObject(window_object.ensure_web_prototype("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 bbcf17a2646..554797f2600 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 #include #include #include @@ -24,7 +23,7 @@ MediaQueryList::MediaQueryList(DOM::Document& document, NonnullRefPtrVector("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 6bd7b37606f..4fedb431394 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("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 d628dd78894..82b5a6cc0aa 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 #include #include #include @@ -14,7 +13,7 @@ namespace Web::CSS { StyleSheet::StyleSheet(HTML::Window& window_object) - : PlatformObject(window_object.ensure_web_prototype("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 bcb3f470f9a..02639fe93c5 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("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 602f05bcf7e..563bb528dda 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 #include #include @@ -21,7 +20,7 @@ AbortController::AbortController(HTML::Window& window, JS::NonnullGCPtr("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 28e45ba65ea..24fa81674c9 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 #include #include #include @@ -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("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 f6254ce2e7a..36e8c931777 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 #include #include #include @@ -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("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 5203875e96b..5c1937b2316 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 #include #include @@ -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("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 0cf777aa74f..e69229cefa2 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 #include #include @@ -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("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("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 afe7045c959..1b0be32d48f 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 #include #include #include @@ -25,7 +24,7 @@ JS::NonnullGCPtr DOMImplementation::create(Document& document } DOMImplementation::DOMImplementation(Document& document) - : PlatformObject(document.window().ensure_web_prototype("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 439d9a36064..2934ead8ccb 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp +++ b/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp @@ -7,7 +7,6 @@ #include #include -#include #include #include #include @@ -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("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 a559232306f..46e978e0da3 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -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("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 58ceeb3f3c8..16d4a36daf0 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 #include #include @@ -13,7 +12,7 @@ namespace Web::DOM { DocumentFragment::DocumentFragment(Document& document) : ParentNode(document, NodeType::DOCUMENT_FRAGMENT_NODE) { - set_prototype(&window().ensure_web_prototype("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 e3b34b5fd6e..f71da375dbe 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 #include #include @@ -18,7 +17,7 @@ JS::NonnullGCPtr DocumentType::create(Document& document) DocumentType::DocumentType(Document& document) : Node(document, NodeType::DOCUMENT_TYPE_NODE) { - set_prototype(&window().ensure_web_prototype("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 4826fc8d212..52a26c928a6 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -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("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 024fa0104f6..9053ea5567e 100644 --- a/Userland/Libraries/LibWeb/DOM/Event.cpp +++ b/Userland/Libraries/LibWeb/DOM/Event.cpp @@ -7,7 +7,6 @@ */ #include -#include #include #include #include @@ -25,15 +24,15 @@ JS::NonnullGCPtr 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("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("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 d4977dab8c5..f5b807aae29 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 #include #include #include @@ -20,7 +19,7 @@ JS::NonnullGCPtr HTMLCollection::create(ParentNode& root, Functi } HTMLCollection::HTMLCollection(ParentNode& root, Function filter) - : LegacyPlatformObject(root.window().ensure_web_prototype("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 74533d32485..8a36188828c 100644 --- a/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp +++ b/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp @@ -5,7 +5,6 @@ */ #include -#include #include #include #include @@ -22,7 +21,7 @@ MutationObserver::MutationObserver(HTML::Window& window, JS::GCPtr("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 bb66e5e5ea1..3eee96fa9ff 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 #include #include #include @@ -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("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 3a80acc7489..fddcf1906eb 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 #include #include #include @@ -20,7 +19,7 @@ JS::NonnullGCPtr NamedNodeMap::create(Element& element) } NamedNodeMap::NamedNodeMap(Element& element) - : Bindings::LegacyPlatformObject(element.document().window().ensure_web_prototype("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 f57e7777dbc..923f66be679 100644 --- a/Userland/Libraries/LibWeb/DOM/NodeIterator.cpp +++ b/Userland/Libraries/LibWeb/DOM/NodeIterator.cpp @@ -6,7 +6,6 @@ #include #include -#include #include #include #include @@ -14,7 +13,7 @@ namespace Web::DOM { NodeIterator::NodeIterator(Node& root) - : PlatformObject(root.document().window().ensure_web_prototype("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 4bd7eb86f00..f70b3890cf9 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 #include #include #include @@ -12,7 +11,7 @@ namespace Web::DOM { NodeList::NodeList(HTML::Window& window) - : LegacyPlatformObject(window.ensure_web_prototype("NodeList")) + : LegacyPlatformObject(window.cached_web_prototype("NodeList")) { } diff --git a/Userland/Libraries/LibWeb/DOM/Range.cpp b/Userland/Libraries/LibWeb/DOM/Range.cpp index d362577c365..cfe2709016f 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 #include #include #include @@ -50,13 +49,13 @@ JS::NonnullGCPtr Range::create_with_global_object(HTML::Window& window) Range::Range(Document& document) : Range(document, 0, document, 0) { - set_prototype(&document.window().ensure_web_prototype("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("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 8d825110eea..3396d1aeb3c 100644 --- a/Userland/Libraries/LibWeb/DOM/StaticRange.cpp +++ b/Userland/Libraries/LibWeb/DOM/StaticRange.cpp @@ -6,7 +6,6 @@ */ #include -#include #include #include #include @@ -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("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 0b8262cd264..c6a4d0ad66d 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 #include #include #include @@ -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("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("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 7021233b114..c07b2ba6662 100644 --- a/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp +++ b/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp @@ -6,7 +6,6 @@ #include #include -#include #include #include #include @@ -17,7 +16,7 @@ namespace Web::DOM { TreeWalker::TreeWalker(Node& root) - : PlatformObject(root.document().window().ensure_web_prototype("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 948b6ad6001..6a7f99121d5 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 #include #include #include @@ -29,7 +28,7 @@ JS::NonnullGCPtr XMLSerializer::create_with_global_object(HTML::W XMLSerializer::XMLSerializer(HTML::Window& window) : PlatformObject(window.realm()) { - set_prototype(&window.ensure_web_prototype("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 ffe65f2924c..56e0971d4ec 100644 --- a/Userland/Libraries/LibWeb/HTML/CanvasGradient.cpp +++ b/Userland/Libraries/LibWeb/HTML/CanvasGradient.cpp @@ -5,7 +5,6 @@ */ #include -#include #include #include #include @@ -44,7 +43,7 @@ CanvasGradient::CanvasGradient(HTML::Window& window, Type type) : PlatformObject(window.realm()) , m_type(type) { - set_prototype(&window.ensure_web_prototype("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 d0c5e2ff039..287e03e5d95 100644 --- a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp +++ b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -32,7 +31,7 @@ CanvasRenderingContext2D::CanvasRenderingContext2D(HTML::Window& window, HTMLCan : PlatformObject(window.realm()) , m_element(element) { - set_prototype(&window.ensure_web_prototype("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 047cac83062..4fc7808ef83 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 #include #include @@ -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("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 f7846e0fb40..f55851c7576 100644 --- a/Userland/Libraries/LibWeb/HTML/DOMParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/DOMParser.cpp @@ -21,7 +21,7 @@ DOM::ExceptionOr> DOMParser::create_with_global_obje DOMParser::DOMParser(HTML::Window& window) : PlatformObject(window.realm()) { - set_prototype(&window.ensure_web_prototype("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 6b6a0a85c31..8909953dcbd 100644 --- a/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp +++ b/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp @@ -5,7 +5,6 @@ */ #include -#include #include #include #include @@ -20,7 +19,7 @@ JS::NonnullGCPtr DOMStringMap::create(DOM::Element& element) } DOMStringMap::DOMStringMap(DOM::Element& element) - : PlatformObject(element.document().window().ensure_web_prototype("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 7a9654c538b..4a2fe17b6df 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 #include #include @@ -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("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 8c19a47fab4..0ac6ec956da 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 #include #include @@ -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("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 c941ef98bc9..74026bf2e4a 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 #include #include @@ -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("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 97befd800fc..19e6645e13b 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 #include #include @@ -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("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 9cf419290ae..bde4a474ea6 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 #include #include #include @@ -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("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 66f3b44bed5..090bd75a4d1 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 #include #include @@ -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("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 17b4bc7a768..38165dddbbe 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 #include #include #include @@ -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("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 e8c9399a46a..7aea6bf9934 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 #include #include #include @@ -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("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 21a2f0b820a..fb9324f82ff 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -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("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 e280e16342d..a9b14514190 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 #include #include @@ -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("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 4740335f44a..9270655d7f8 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 #include #include @@ -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("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 b3866d30fb8..9f0db05519f 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 #include #include @@ -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("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 f2d6ac5a777..b0b8312c63e 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 #include #include @@ -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("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 9aa1666f03f..d6960cbe0b6 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 #include #include @@ -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("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 743a234ba63..576c588d696 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 #include #include @@ -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("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 22bc02ebc5d..28ba8e5498b 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 #include #include @@ -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("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 05350872c72..05111ab5ef9 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include @@ -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("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 d6d036c1b85..c62afdd6cbb 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 #include #include @@ -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("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 fe2f968a66e..4090cb0c074 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 #include #include @@ -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("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 f969f036584..dd104088cbd 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 #include #include #include @@ -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("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 acce37c42d2..9599f9390f8 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp @@ -5,7 +5,6 @@ */ #include -#include #include #include #include @@ -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("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 c5ae687c058..9e0b3653b7e 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 #include #include @@ -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("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 52d06e95400..33054ee584b 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 #include #include #include @@ -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("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 89d19cb1e5b..00a89cab778 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 #include #include @@ -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("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 fa351267972..0740228b11a 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 #include #include @@ -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("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 28b276f17ad..165fd4832a0 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 #include #include @@ -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("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 90fe7f8c52f..22eab1230c3 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 #include #include @@ -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("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 2ee367455e5..ef3f3e2a6cd 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 #include #include #include @@ -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("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 4e2d0d39117..c36a4845f3b 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp @@ -5,7 +5,6 @@ */ #include -#include #include #include #include @@ -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("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 4ca7cc2f057..1d3f4eb77fd 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 #include #include #include @@ -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("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 1c85241a0aa..c7f99a26142 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 #include #include @@ -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("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 31398d3c902..b3c6b7ab9a9 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 #include #include #include @@ -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("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 7cdaae70162..c4781885b48 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("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 c2365ab4298..9fd5d9024c0 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -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("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 e02e7374f0d..5f8ef1f9e16 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 #include #include @@ -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("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 9c9bebbb465..496e5912054 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 #include #include @@ -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("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 2d53b2e716b..793510c5d47 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("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 65528d30785..01aa6c3c7ab 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 #include #include @@ -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("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 66eaf3cc03b..b263fd28d92 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 #include #include @@ -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("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 6d33d2e4141..7938a3e7980 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 #include #include @@ -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("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 b4d7325868f..e510e47e326 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 #include #include @@ -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("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 a397c00a574..7a02c49eadf 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 #include #include @@ -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("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 678a058256b..42133c30db3 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp @@ -5,7 +5,6 @@ */ #include -#include #include #include #include @@ -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("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 2460f1fe253..97a61dd588e 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 #include #include @@ -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("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 06c27df4b9c..2c9ffd95949 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp @@ -6,7 +6,6 @@ */ #include -#include #include #include #include @@ -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("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 1763ad2c58b..dc1a8109ccd 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 #include #include #include @@ -22,7 +21,7 @@ JS::NonnullGCPtr HTMLOptionsCollection::create(DOM::Paren HTMLOptionsCollection::HTMLOptionsCollection(DOM::ParentNode& root, Function filter) : DOM::HTMLCollection(root, move(filter)) { - set_prototype(&root.window().ensure_web_prototype("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 b5f8f5d07de..08b9fbedeea 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 #include #include @@ -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("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 b8dabd218ab..0311b98bfda 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 #include #include @@ -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("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 9e41a5f4024..1698471a13e 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 #include #include @@ -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("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 6dcd14db66c..0f21efb14aa 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 #include #include @@ -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("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 400e9978aba..8461ebeea88 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 #include #include @@ -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("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 d3e8bcd5008..cc31d8e0d59 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 #include #include #include @@ -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("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 daed2603af6..fdeae0a18ef 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 #include #include @@ -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("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 3b6f000e0f7..8f1775d522b 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include @@ -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("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 3aacee7155f..534e75225d6 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 #include #include #include @@ -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("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 36d316516c3..5964546ddf9 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 #include #include @@ -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("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 38c3172e567..4e22808d5fb 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 #include #include @@ -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("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 8f3c0177f46..31881bb054f 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 #include #include @@ -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("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 1013e8b2bf9..f59055aa3fe 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 #include #include #include @@ -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("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 27b7a0d80d9..ef1bf755fbe 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 #include #include @@ -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("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 9f97fa75409..845496c96d5 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 #include #include #include @@ -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("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 f48bbbb9bca..b1d5c8585d3 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 #include #include @@ -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("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 6bc0ee1faee..8e9566e0ddf 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 #include #include #include @@ -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("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 0a2012de0ce..c26307bbaf1 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 #include #include #include @@ -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("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 cc227cae63b..a4aa6212370 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 #include #include #include @@ -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("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 b32e5a8dd93..9dd5b927e0a 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 #include #include #include @@ -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("HTMLTemplateElement")); + set_prototype(&window().cached_web_prototype("HTMLTemplateElement")); m_content = heap().allocate(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 70ea1f21d09..6988607f00c 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 #include #include @@ -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("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 94647997409..9c6061be896 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 #include #include @@ -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("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 e5568632788..f6c75ec1fb6 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 #include #include #include @@ -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("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 eadfacaf69c..78e3394c514 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 #include #include @@ -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("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 71eb3820a96..89164939edc 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 #include #include @@ -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("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 b5df91ad7dd..1f07432f311 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 #include #include @@ -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("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 76b3941e27b..beb9feb413a 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 #include #include @@ -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("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 52f4d0908b6..4dce0e22ad5 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 #include #include @@ -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("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 e70c40b18a4..4cff7f58138 100644 --- a/Userland/Libraries/LibWeb/HTML/ImageData.cpp +++ b/Userland/Libraries/LibWeb/HTML/ImageData.cpp @@ -6,7 +6,6 @@ #include #include -#include #include #include @@ -38,7 +37,7 @@ ImageData::ImageData(HTML::Window& window, NonnullRefPtr bitmap, JS , m_bitmap(move(bitmap)) , m_data(move(data)) { - set_prototype(&window.ensure_web_prototype("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 378256f46a9..767c515b45e 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 #include #include #include @@ -20,7 +19,7 @@ JS::NonnullGCPtr MessageChannel::create_with_global_object(HTML: MessageChannel::MessageChannel(HTML::Window& window) : PlatformObject(window.realm()) { - set_prototype(&window.ensure_web_prototype("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 b993d22a66c..98eb672e82f 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 #include #include @@ -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("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 9e4bb941010..aa92b46dedb 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 #include #include #include @@ -22,7 +21,7 @@ JS::NonnullGCPtr MessagePort::create(HTML::Window& window) MessagePort::MessagePort(HTML::Window& window) : DOM::EventTarget(window.realm()) { - set_prototype(&window.ensure_web_prototype("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 450be24913c..d2d62270356 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 #include #include @@ -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("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 165d04f7a92..69ac6e18714 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 #include #include @@ -19,7 +18,7 @@ JS::NonnullGCPtr Path2D::create_with_global_object(HTML::Window& window, Path2D::Path2D(HTML::Window& window, Optional, String>> const& path) : PlatformObject(window.realm()) { - set_prototype(&window.ensure_web_prototype("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 a7b246fa067..e4654a0fc12 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 #include #include @@ -25,7 +24,7 @@ PromiseRejectionEvent::PromiseRejectionEvent(HTML::Window& window_object, FlyStr , m_promise(const_cast(event_init.promise.cell())) , m_reason(event_init.reason) { - set_prototype(&window_object.ensure_web_prototype("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 2aa2c2650a5..684e4763413 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 #include #include @@ -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("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 289ede7bba6..16327dfc3f1 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 #include #include @@ -18,7 +17,7 @@ JS::NonnullGCPtr TextMetrics::create(HTML::Window& window) TextMetrics::TextMetrics(HTML::Window& window) : PlatformObject(window.realm()) { - set_prototype(&window.ensure_web_prototype("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 ef6e1c66f97..8051bd63326 100644 --- a/Userland/Libraries/LibWeb/HTML/Worker.cpp +++ b/Userland/Libraries/LibWeb/HTML/Worker.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -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("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 f35a6addc98..84c8ac48e3a 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 #include #include #include @@ -18,7 +17,7 @@ Performance::Performance(HTML::Window& window) : DOM::EventTarget(window.realm()) , m_window(window) { - set_prototype(&window.ensure_web_prototype("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 87ac513cb4f..36417552896 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 #include #include @@ -20,7 +19,7 @@ SVGAnimatedLength::SVGAnimatedLength(HTML::Window& window, JS::NonnullGCPtr("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 b77779a53b1..9f49512c2b0 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 #include #include #include @@ -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("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 0fd56590092..d83755c2599 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 #include #include @@ -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("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 9787a68df81..882084e5e8c 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 #include #include @@ -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("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 e4dac180cca..328d9e6a7fe 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 #include #include @@ -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("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 dc9bbd2b2fd..83eead0c8fe 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 #include #include #include @@ -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("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 51292000f5a..1fe2677c435 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 #include #include #include @@ -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("SVGGeometryElement")); + set_prototype(&window().cached_web_prototype("SVGGeometryElement")); } RefPtr SVGGeometryElement::create_layout_node(NonnullRefPtr style) diff --git a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp index fc938c062ad..68234dc4cb6 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 #include #include #include @@ -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("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 912feee65b5..b84073c281d 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 #include #include @@ -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("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 c02ce0f6b96..c165cd31eff 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 #include #include #include @@ -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("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 48867f7e8cb..78fec142517 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -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("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 a38fc7240a1..00d2644b6d0 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 #include #include #include @@ -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("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 0b43e1b1184..38ff8c81c9b 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 #include #include #include @@ -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("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 357dd578095..d3930d331b2 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 #include #include #include #include #include +#include namespace Web::SVG { SVGRectElement::SVGRectElement(DOM::Document& document, DOM::QualifiedName qualified_name) : SVGGeometryElement(document, qualified_name) { - set_prototype(&window().ensure_web_prototype("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 e0d5bd64f29..00574762f1c 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp @@ -6,7 +6,6 @@ */ #include -#include #include #include #include @@ -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("SVGSVGElement")); + set_prototype(&window().cached_web_prototype("SVGSVGElement")); } RefPtr SVGSVGElement::create_layout_node(NonnullRefPtr style) diff --git a/Userland/Libraries/LibWeb/SVG/SVGTextContentElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGTextContentElement.cpp index 89eca8deaba..948377ef3f9 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTextContentElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGTextContentElement.cpp @@ -5,7 +5,6 @@ */ #include -#include #include #include @@ -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("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 31c1085383d..ac4d321fb3e 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 #include #include @@ -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("FocusEvent")); + set_prototype(&window_object.cached_web_prototype("FocusEvent")); set_related_target(const_cast(event_init.related_target.ptr())); } diff --git a/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp index 6aceb572231..853a4bd55aa 100644 --- a/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp @@ -5,7 +5,6 @@ */ #include -#include #include #include @@ -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("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 6b09d4947e3..047ff967f8a 100644 --- a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp @@ -6,7 +6,6 @@ */ #include -#include #include #include #include @@ -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("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 48f3cb6424f..15ede7319df 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 #include #include @@ -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("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("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 78fab5996cb..363bdeeec59 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 #include #include @@ -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("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 3fea5c92ed9..6cb25310263 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 #include #include #include @@ -60,7 +59,7 @@ JS::ThrowCompletionOr> WebGLRenderingContext::c WebGLRenderingContext::WebGLRenderingContext(HTML::Window& window, HTML::HTMLCanvasElement& canvas_element, NonnullOwnPtr 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("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 69e0ba15487..e8380d71571 100644 --- a/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp +++ b/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -66,7 +65,7 @@ WebSocket::WebSocket(HTML::Window& window, AK::URL& url) : EventTarget(window.realm()) , m_window(window) { - set_prototype(&window.ensure_web_prototype("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 7157babd19e..0fc456c430e 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 #include #include @@ -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("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 a8886eac58f..ef447298c12 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("XMLHttpRequest")); + set_prototype(&window.cached_web_prototype("XMLHttpRequest")); } XMLHttpRequest::~XMLHttpRequest() = default;