mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Allow using queuing strategies on globals other than Window
These interfaces are exposed on *, meaning it should work for workers and our newly added shadow realm global object by being stored on the universal global scope mixin.
This commit is contained in:
parent
13f349aea2
commit
d527c5df5d
Notes:
github-actions[bot]
2024-11-21 01:10:37 +00:00
Author: https://github.com/shannonbooth
Commit: d527c5df5d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2416
Reviewed-by: https://github.com/ADKaster ✅
10 changed files with 89 additions and 61 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include <LibWeb/Bindings/ByteLengthQueuingStrategyPrototype.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/HTML/Window.h>
|
||||
#include <LibWeb/HTML/UniversalGlobalScope.h>
|
||||
#include <LibWeb/Streams/ByteLengthQueuingStrategy.h>
|
||||
|
||||
namespace Web::Streams {
|
||||
|
@ -34,7 +34,9 @@ ByteLengthQueuingStrategy::~ByteLengthQueuingStrategy() = default;
|
|||
GC::Ref<WebIDL::CallbackType> ByteLengthQueuingStrategy::size()
|
||||
{
|
||||
// 1. Return this's relevant global object's byte length queuing strategy size function.
|
||||
return verify_cast<HTML::Window>(HTML::relevant_global_object(*this)).byte_length_queuing_strategy_size_function();
|
||||
auto* global = dynamic_cast<HTML::UniversalGlobalScopeMixin*>(&HTML::relevant_global_object(*this));
|
||||
VERIFY(global);
|
||||
return global->byte_length_queuing_strategy_size_function();
|
||||
}
|
||||
|
||||
void ByteLengthQueuingStrategy::initialize(JS::Realm& realm)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue