LibWeb: Implement document ready state

This commit is contained in:
Luke 2020-08-31 13:56:16 +01:00 committed by Andreas Kling
parent 8aabec1c94
commit 124c52b3b5
Notes: sideshowbarker 2024-07-19 02:57:34 +09:00
5 changed files with 49 additions and 0 deletions

View file

@ -156,6 +156,8 @@ void HTMLDocumentParser::run(const URL& url)
// "The end"
m_document->set_ready_state("interactive");
auto scripts_to_execute_when_parsing_has_finished = m_document->take_scripts_to_execute_when_parsing_has_finished({});
for (auto& script : scripts_to_execute_when_parsing_has_finished) {
script.execute_script();
@ -167,6 +169,8 @@ void HTMLDocumentParser::run(const URL& url)
for (auto& script : scripts_to_execute_as_soon_as_possible) {
script.execute_script();
}
m_document->set_ready_state("complete");
}
void HTMLDocumentParser::process_using_the_rules_for(InsertionMode mode, HTMLToken& token)