LibWeb: Report if anything is delaying load event, not the count

Some elements that delay the load event are more complicated than a
simple count will allow for. We'll implement those in a bit!
This commit is contained in:
Sam Atkins 2023-11-24 15:18:57 +00:00 committed by Andreas Kling
parent 6154681718
commit 6c5450f9ce
Notes: sideshowbarker 2024-07-16 22:34:39 +09:00
5 changed files with 14 additions and 4 deletions

View file

@ -304,9 +304,8 @@ void HTMLParser::the_end()
});
// 8. Spin the event loop until there is nothing that delays the load event in the Document.
// FIXME: Track down all the things that are supposed to delay the load event.
main_thread_event_loop().spin_until([&] {
return m_document->number_of_things_delaying_the_load_event() == 0;
return !m_document->anything_is_delaying_the_load_event();
});
// 9. Queue a global task on the DOM manipulation task source given the Document's relevant global object to run the following steps: