1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 10:01:13 +09:00

LibWeb: Use DocumentLoadEventDelayer to delay load event in Navigable

Use a delayer object that actually delays load event for child
navigables instead of boolean flag that does nothing.
This commit is contained in:
Aliaksandr Kalenik 2023-09-14 01:22:00 +02:00 committed by Andreas Kling
parent b398d6a35c
commit 6522fa8933
Notes: sideshowbarker 2024-07-17 05:58:46 +09:00
2 changed files with 14 additions and 3 deletions

View file

@ -90,6 +90,17 @@ void Navigable::visit_edges(Cell::Visitor& visitor)
visitor.visit(m_container);
}
void Navigable::set_delaying_load_events(bool value)
{
if (value) {
auto document = container_document();
VERIFY(document);
m_delaying_the_load_event.emplace(*document);
} else {
m_delaying_the_load_event.clear();
}
}
JS::GCPtr<Navigable> Navigable::navigable_with_active_document(JS::NonnullGCPtr<DOM::Document> document)
{
for (auto* navigable : all_navigables()) {