mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:37:46 +00:00
LibWeb: Implement size attribute of CountQueuingStrategy
Co-authored-by: Matthew Olsson <mattco@serenityos.org>
This commit is contained in:
parent
6d93692bc5
commit
49689e5d8e
5 changed files with 41 additions and 1 deletions
|
@ -1,11 +1,13 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Shannon Booth <shannon.ml.booth@gmail.com>
|
||||
* Copyright (c) 2023, Matthew Olsson <mattco@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Bindings/CountQueuingStrategyPrototype.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/HTML/Window.h>
|
||||
#include <LibWeb/Streams/CountQueuingStrategy.h>
|
||||
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||
|
||||
|
@ -27,6 +29,13 @@ CountQueuingStrategy::CountQueuingStrategy(JS::Realm& realm, double high_water_m
|
|||
|
||||
CountQueuingStrategy::~CountQueuingStrategy() = default;
|
||||
|
||||
// https://streams.spec.whatwg.org/#cqs-size
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::CallbackType>> CountQueuingStrategy::size()
|
||||
{
|
||||
// 1. Return this's relevant global object's count queuing strategy size function.
|
||||
return global_object().count_queuing_strategy_size_function();
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> CountQueuingStrategy::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue