mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Replace cached navigable with Navigable-maintained back-pointer
Now that Navigable directly owns its active document (m_active_document) we can have Navigable maintain a back-pointer on Document instead of using the old cache-with-validation pattern that fell back to a linear scan of all navigables via navigable_with_active_document().
This commit is contained in:
committed by
Alexander Kalenik
parent
2645695fdd
commit
4985dabf3d
Notes:
github-actions[bot]
2026-04-01 09:52:45 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/4985dabf3dd Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8726
@@ -4608,7 +4608,7 @@ void Document::destroy()
|
||||
// Not in the spec:
|
||||
for (auto& navigable_container : HTML::NavigableContainer::all_instances()) {
|
||||
if (&navigable_container->document() == this && navigable_container->content_navigable())
|
||||
HTML::all_navigables().remove(*navigable_container->content_navigable());
|
||||
navigable_container->content_navigable()->remove_from_all_navigables();
|
||||
}
|
||||
|
||||
// 9. Set document's node navigable's active session history entry's document state's document to null.
|
||||
@@ -7323,14 +7323,14 @@ GC::Ptr<DOM::Document> Document::container_document() const
|
||||
return node_navigable->container_document();
|
||||
}
|
||||
|
||||
GC::Ptr<HTML::Navigable> Document::cached_navigable()
|
||||
GC::Ptr<HTML::Navigable> Document::navigable() const
|
||||
{
|
||||
return m_cached_navigable.ptr();
|
||||
return m_navigable.ptr();
|
||||
}
|
||||
|
||||
void Document::set_cached_navigable(GC::Ptr<HTML::Navigable> navigable)
|
||||
void Document::set_navigable(GC::Ptr<HTML::Navigable> navigable)
|
||||
{
|
||||
m_cached_navigable = navigable.ptr();
|
||||
m_navigable = navigable.ptr();
|
||||
}
|
||||
|
||||
void Document::notify_css_background_image_loaded()
|
||||
|
||||
Reference in New Issue
Block a user