mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 11:20:03 +00:00
LibWeb: Implement child_navigables() for navigables
This commit is contained in:
committed by
Andreas Kling
parent
5f8b9f7936
commit
eb4db6057d
@@ -28,6 +28,18 @@ static HashTable<Navigable*>& all_navigables()
|
||||
return set;
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/document-sequences.html#child-navigable
|
||||
Vector<JS::Handle<Navigable>> Navigable::child_navigables() const
|
||||
{
|
||||
Vector<JS::Handle<Navigable>> results;
|
||||
for (auto& entry : all_navigables()) {
|
||||
if (entry->parent() == this)
|
||||
results.append(entry);
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
Navigable::Navigable()
|
||||
{
|
||||
all_navigables().set(this);
|
||||
|
||||
Reference in New Issue
Block a user