mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:27:35 +00:00
LibWeb: Make Document::is_fully_active() more robust
We were missing a check for null browsing context container documents.
This commit is contained in:
parent
4901f69345
commit
a835f313f7
1 changed files with 12 additions and 1 deletions
|
@ -1471,7 +1471,18 @@ bool Document::is_fully_active() const
|
|||
{
|
||||
// A Document d is said to be fully active when d's browsing context is non-null, d's browsing context's active document is d,
|
||||
// and either d's browsing context is a top-level browsing context, or d's browsing context's container document is fully active.
|
||||
return browsing_context() && browsing_context()->active_document() == this && (browsing_context()->is_top_level() || browsing_context()->container_document()->is_fully_active());
|
||||
auto* browsing_context = this->browsing_context();
|
||||
if (!browsing_context)
|
||||
return false;
|
||||
if (browsing_context->active_document() != this)
|
||||
return false;
|
||||
if (browsing_context->is_top_level())
|
||||
return true;
|
||||
if (auto* browsing_context_container_document = browsing_context->container_document()) {
|
||||
if (browsing_context_container_document->is_fully_active())
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/browsers.html#active-document
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue