mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb/HTML: Update BroadcastChannel::is_eligible_for_messaging() spec
Corresponds to part of:
e9ccb97eb1
The majority of that spec change is in algorithms that we don't yet
implement. So this is just a small text change and an update to use
as_if() instead of static_cast().
This commit is contained in:
parent
ed5169af8d
commit
04f1dbce2e
Notes:
github-actions[bot]
2025-12-01 11:09:19 +00:00
Author: https://github.com/AtkinsSJ
Commit: 04f1dbce2e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6960
1 changed files with 6 additions and 5 deletions
|
|
@ -88,13 +88,14 @@ bool BroadcastChannel::is_eligible_for_messaging() const
|
|||
auto const& global = relevant_global_object(*this);
|
||||
|
||||
// * a Window object whose associated Document is fully active, or
|
||||
if (is<Window>(global))
|
||||
return static_cast<Window const&>(global).associated_document().is_fully_active();
|
||||
if (auto* window = as_if<Window>(global))
|
||||
return window->associated_document().is_fully_active();
|
||||
|
||||
// * a WorkerGlobalScope object whose closing flag is false and whose worker is not a suspendable worker.
|
||||
// * a WorkerGlobalScope object whose closing flag is false and is not suspendable.
|
||||
// FIXME: Suspendable worker
|
||||
if (is<WorkerGlobalScope>(global))
|
||||
return !static_cast<WorkerGlobalScope const&>(global).is_closing();
|
||||
if (auto* worker_global_scope = as_if<WorkerGlobalScope>(global)) {
|
||||
return !worker_global_scope->is_closing();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue