LibWeb: Add Document::is_fully_active
This is used in a bunch of places in the HTML spec. The current use case for this is History.
This commit is contained in:
parent
f5c988b3ce
commit
3eca8cb243
Notes:
sideshowbarker
2024-07-18 04:12:45 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/3eca8cb2435 Pull-request: https://github.com/SerenityOS/serenity/pull/9981 Reviewed-by: https://github.com/linusg ✅
2 changed files with 10 additions and 0 deletions
|
@ -970,4 +970,12 @@ String Document::referrer() const
|
|||
return "";
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/browsers.html#fully-active
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -274,6 +274,8 @@ public:
|
|||
|
||||
bool has_a_style_sheet_that_is_blocking_scripts() const;
|
||||
|
||||
bool is_fully_active() const;
|
||||
|
||||
private:
|
||||
explicit Document(const URL&);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue