1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +00:00

LibWeb: Add API for finding NavigableContainer by content navigable

This is only needed because currently spec doesn't explicitly define
that navigable should have a pointer to associated container and when
this pointer should be set.
This commit is contained in:
Aliaksandr Kalenik 2023-04-23 17:50:08 +03:00 committed by Andreas Kling
parent 85a3a1c085
commit d85bdd3ac5
4 changed files with 17 additions and 8 deletions

View file

@ -190,12 +190,7 @@ String Navigable::target_name() const
JS::GCPtr<NavigableContainer> Navigable::container() const
{
// The container of a navigable navigable is the navigable container whose nested navigable is navigable, or null if there is no such element.
return m_container;
}
void Navigable::set_container(JS::GCPtr<NavigableContainer> container)
{
m_container = container;
return NavigableContainer::navigable_container_with_content_navigable(const_cast<Navigable&>(*this));
}
// https://html.spec.whatwg.org/multipage/document-sequences.html#nav-traversable