mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-10 21:22:53 +00:00
LibWeb: Parse enough to handle a <style> inside a <head> :^)
This commit is contained in:
parent
af8a9331b2
commit
5d332c1f11
Notes:
sideshowbarker
2024-07-19 06:10:18 +09:00
Author: https://github.com/awesomekling
Commit: 5d332c1f11
3 changed files with 103 additions and 0 deletions
|
@ -207,6 +207,11 @@ void HTMLDocumentParser::handle_in_head(HTMLToken& token)
|
|||
return;
|
||||
}
|
||||
|
||||
if (token.is_start_tag() && ((token.tag_name() == "noscript" && m_scripting_enabled) || token.tag_name() == "noframes" || token.tag_name() == "style")) {
|
||||
parse_generic_raw_text_element(token);
|
||||
return;
|
||||
}
|
||||
|
||||
if (token.is_start_tag() && token.tag_name() == "meta") {
|
||||
auto element = insert_html_element(token);
|
||||
m_stack_of_open_elements.pop();
|
||||
|
@ -228,6 +233,14 @@ void HTMLDocumentParser::handle_in_head_noscript(HTMLToken&)
|
|||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
void HTMLDocumentParser::parse_generic_raw_text_element(HTMLToken& token)
|
||||
{
|
||||
insert_html_element(token);
|
||||
m_tokenizer.switch_to({}, HTMLTokenizer::State::RAWTEXT);
|
||||
m_original_insertion_mode = m_insertion_mode;
|
||||
m_insertion_mode = InsertionMode::Text;
|
||||
}
|
||||
|
||||
void HTMLDocumentParser::insert_character(u32 data)
|
||||
{
|
||||
auto adjusted_insertion_location = find_appropriate_place_for_inserting_node();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue