diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp
index 5b790bf0404..74e1a60551c 100644
--- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp
+++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp
@@ -29,6 +29,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -1788,12 +1789,22 @@ void HTMLParser::handle_in_body(HTMLToken& token)
if (!m_frameset_ok)
return;
- // FIXME: Otherwise, run the following steps:
+ // Otherwise, run the following steps:
// 1. Remove the second element on the stack of open elements from its parent node, if it has one.
+ m_stack_of_open_elements.elements().at(1)->remove(true);
+
// 2. Pop all the nodes from the bottom of the stack of open elements, from the current node up to, but not including, the root html element.
+ while (m_stack_of_open_elements.elements().size() > 1) {
+ if (is(*m_stack_of_open_elements.elements().last()))
+ break;
+ (void)m_stack_of_open_elements.pop();
+ }
+
// 3. Insert an HTML element for the token.
+ (void)insert_html_element(token);
+
// 4. Switch the insertion mode to "in frameset".
- TODO();
+ m_insertion_mode = InsertionMode::InFrameset;
}
// -> An end-of-file token