summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/Parser
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-20 17:04:55 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-20 17:22:25 +0200
commite11ae33c664a3873ca3383ac4582f2ed9ccc5f1e (patch)
treedb58f014b7726fce47c936424a5eae90e4bed87e /Userland/Libraries/LibWeb/HTML/Parser
parent398692722bb31e6f07efa2e212d0ec526963c4a0 (diff)
downloadserenity-e11ae33c664a3873ca3383ac4582f2ed9ccc5f1e.zip
LibWeb: Pop entire stack of open elements at the end of parsing
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/Parser')
-rw-r--r--Userland/Libraries/LibWeb/HTML/Parser/HTMLDocumentParser.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLDocumentParser.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLDocumentParser.cpp
index dad672ce76..88e4493257 100644
--- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLDocumentParser.cpp
+++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLDocumentParser.cpp
@@ -179,6 +179,10 @@ void HTMLDocumentParser::run(const AK::URL& url)
m_document->set_ready_state("interactive");
+ // 3. Pop all the nodes off the stack of open elements.
+ while (!m_stack_of_open_elements.is_empty())
+ m_stack_of_open_elements.pop();
+
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) {
// FIXME: Spin the event loop until the script is ready to be parser executed and there's no style sheets blocking scripts.