LibWeb: Implement getting "inclusive ancestor navigables" of a document
This commit is contained in:
parent
e211f6c925
commit
01cc14714e
Notes:
sideshowbarker
2024-07-17 11:34:34 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/01cc14714e Pull-request: https://github.com/SerenityOS/serenity/pull/20680
2 changed files with 14 additions and 0 deletions
|
@ -2584,6 +2584,19 @@ Vector<JS::Handle<HTML::Navigable>> Document::ancestor_navigables()
|
|||
return ancestors;
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/document-sequences.html#inclusive-ancestor-navigables
|
||||
Vector<JS::Handle<HTML::Navigable>> Document::inclusive_ancestor_navigables()
|
||||
{
|
||||
// 1. Let navigables be document's ancestor navigables.
|
||||
auto navigables = ancestor_navigables();
|
||||
|
||||
// 2. Append document's node navigable to navigables.
|
||||
navigables.append(*navigable());
|
||||
|
||||
// 3. Return navigables.
|
||||
return navigables;
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/browsers.html#list-of-the-descendant-browsing-contexts
|
||||
Vector<JS::Handle<HTML::BrowsingContext>> Document::list_of_descendant_browsing_contexts() const
|
||||
{
|
||||
|
|
|
@ -463,6 +463,7 @@ public:
|
|||
Vector<JS::Handle<HTML::Navigable>> descendant_navigables();
|
||||
Vector<JS::Handle<HTML::Navigable>> inclusive_descendant_navigables();
|
||||
Vector<JS::Handle<HTML::Navigable>> ancestor_navigables();
|
||||
Vector<JS::Handle<HTML::Navigable>> inclusive_ancestor_navigables();
|
||||
|
||||
void destroy();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue