mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
LibWeb: Set HTMLParser::m_scripting_enabled as according to the spec
This allows <noscript> elements to display their content as proper HTML instead of raw text when scripting is disabled.
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 07:43:44 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/7b8a6b8e7a Pull-request: https://github.com/SerenityOS/serenity/pull/15330
@@ -121,6 +121,7 @@ static bool is_html_integration_point(DOM::Element const& element)
|
||||
|
||||
HTMLParser::HTMLParser(DOM::Document& document, StringView input, String const& encoding)
|
||||
: m_tokenizer(input, encoding)
|
||||
, m_scripting_enabled(document.is_scripting_enabled())
|
||||
, m_document(JS::make_handle(document))
|
||||
{
|
||||
m_tokenizer.set_parser({}, *this);
|
||||
@@ -132,7 +133,8 @@ HTMLParser::HTMLParser(DOM::Document& document, StringView input, String const&
|
||||
}
|
||||
|
||||
HTMLParser::HTMLParser(DOM::Document& document)
|
||||
: m_document(JS::make_handle(document))
|
||||
: m_scripting_enabled(document.is_scripting_enabled())
|
||||
, m_document(JS::make_handle(document))
|
||||
{
|
||||
m_document->set_parser({}, *this);
|
||||
m_tokenizer.set_parser({}, *this);
|
||||
|
||||
Reference in New Issue
Block a user