mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
LibWeb: Handle EOF tokens during "text" insertion
This commit is contained in:
parent
38ada2d102
commit
be6abce44f
2 changed files with 10 additions and 0 deletions
|
@ -44,6 +44,7 @@ public:
|
|||
|
||||
void set_parser_document(Badge<HTMLDocumentParser>, Document&);
|
||||
void set_non_blocking(Badge<HTMLDocumentParser>, bool);
|
||||
void set_already_started(Badge<HTMLDocumentParser>, bool b) { m_already_started = b; }
|
||||
void prepare_script(Badge<HTMLDocumentParser>);
|
||||
void execute_script();
|
||||
|
||||
|
|
|
@ -1431,6 +1431,15 @@ void HTMLDocumentParser::handle_text(HTMLToken& token)
|
|||
insert_character(token.codepoint());
|
||||
return;
|
||||
}
|
||||
if (token.is_end_of_file()) {
|
||||
PARSE_ERROR();
|
||||
if (current_node().tag_name() == "script")
|
||||
to<HTMLScriptElement>(current_node()).set_already_started({}, true);
|
||||
m_stack_of_open_elements.pop();
|
||||
m_insertion_mode = m_original_insertion_mode;
|
||||
process_using_the_rules_for(m_insertion_mode, token);
|
||||
return;
|
||||
}
|
||||
if (token.is_end_tag() && token.tag_name() == "script") {
|
||||
NonnullRefPtr<HTMLScriptElement> script = to<HTMLScriptElement>(current_node());
|
||||
m_stack_of_open_elements.pop();
|
||||
|
|
Loading…
Add table
Reference in a new issue