mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 09:47:35 +00:00
LibWeb: Implement getting "inclusive ancestor navigables" of a document
This commit is contained in:
parent
e211f6c925
commit
01cc14714e
2 changed files with 14 additions and 0 deletions
|
@ -2584,6 +2584,19 @@ Vector<JS::Handle<HTML::Navigable>> Document::ancestor_navigables()
|
||||||
return ancestors;
|
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
|
// 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
|
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>> descendant_navigables();
|
||||||
Vector<JS::Handle<HTML::Navigable>> inclusive_descendant_navigables();
|
Vector<JS::Handle<HTML::Navigable>> inclusive_descendant_navigables();
|
||||||
Vector<JS::Handle<HTML::Navigable>> ancestor_navigables();
|
Vector<JS::Handle<HTML::Navigable>> ancestor_navigables();
|
||||||
|
Vector<JS::Handle<HTML::Navigable>> inclusive_ancestor_navigables();
|
||||||
|
|
||||||
void destroy();
|
void destroy();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue