LibWeb: Remove uses of obsolete PlatformObject::global_object()

This API is a relic from the time when it was important for objects to
have easy access to the Window, and to know it was the global object.

We now have more spec-related concepts like relevant_global_object and
current_global_object to pull the Window out of thin air.
This commit is contained in:
Andrew Kaster
2024-09-04 19:22:48 -06:00
committed by Andreas Kling
parent 4df280689b
commit 02a56f6480
10 changed files with 36 additions and 28 deletions

View File

@@ -34,7 +34,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<CSSStyleSheet>> CSSStyleSheet::construct_im
auto sheet = create(realm, CSSRuleList::create_empty(realm), CSS::MediaList::create(realm, {}), {});
// 2. Set sheets location to the base URL of the associated Document for the current global object.
auto associated_document = sheet->global_object().document();
auto associated_document = verify_cast<HTML::Window>(HTML::current_global_object()).document();
sheet->set_location(MUST(associated_document->base_url().to_string()));
// 3. Set sheets stylesheet base URL to the baseURL attribute value from options.