diff options
author | Andrew Kaster <akaster@serenityos.org> | 2022-09-25 16:38:21 -0600 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-10-01 21:05:32 +0100 |
commit | f0c5f77f99801441db1d8e99c14dae2ab1357b47 (patch) | |
tree | 4c96ecfef6414f247421a8abf52168592fd0ab92 /Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp | |
parent | a2ccb00e1da76b9b80fe1a804b5cbf87af91770f (diff) | |
download | serenity-f0c5f77f99801441db1d8e99c14dae2ab1357b47.zip |
LibWeb: Remove unecessary dependence on Window from HTML classes
These classes only needed Window to get at its realm. Pass a realm
directly to construct HTML classes.
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp index c2e2ff598d..9baefaf7d3 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp @@ -17,7 +17,7 @@ namespace Web::HTML { HTMLTableSectionElement::HTMLTableSectionElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - set_prototype(&window().cached_web_prototype("HTMLTableSectionElement")); + set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLTableSectionElement")); } HTMLTableSectionElement::~HTMLTableSectionElement() = default; @@ -43,7 +43,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<HTMLTableRowElement>> HTMLTableSectionEleme // 1. If index is less than −1 or greater than the number of elements in the rows collection, throw an "IndexSizeError" DOMException. if (index < -1 || index > rows_collection_size) - return WebIDL::IndexSizeError::create(global_object(), "Index is negative or greater than the number of rows"); + return WebIDL::IndexSizeError::create(realm(), "Index is negative or greater than the number of rows"); // 2. Let table row be the result of creating an element given this element's node document, tr, and the HTML namespace. auto& table_row = static_cast<HTMLTableRowElement&>(*DOM::create_element(document(), TagNames::tr, Namespace::HTML)); @@ -67,7 +67,7 @@ WebIDL::ExceptionOr<void> HTMLTableSectionElement::delete_row(long index) // 1. If index is less than −1 or greater than or equal to the number of elements in the rows collection, then throw an "IndexSizeError" DOMException. if (index < -1 || index >= rows_collection_size) - return WebIDL::IndexSizeError::create(global_object(), "Index is negative or greater than or equal to the number of rows"); + return WebIDL::IndexSizeError::create(realm(), "Index is negative or greater than or equal to the number of rows"); // 2. If index is −1, then remove the last element in the rows collection from this element, or do nothing if the rows collection is empty. if (index == -1) { |