mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 12:20:00 +01:00
LibWeb: Adapt the parsing of script elements to accommodate TrustedTypes
This commit is contained in:
parent
f7c05013c7
commit
82f56e30ed
|
|
@ -76,6 +76,8 @@ public:
|
||||||
|
|
||||||
virtual WebIDL::ExceptionOr<void> cloned(Node&, bool) const override;
|
virtual WebIDL::ExceptionOr<void> cloned(Node&, bool) const override;
|
||||||
|
|
||||||
|
void set_string_text(Utf16String const& value) { m_script_text = value; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#implicitly-potentially-render-blocking
|
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#implicitly-potentially-render-blocking
|
||||||
virtual bool is_implicitly_potentially_render_blocking() const override;
|
virtual bool is_implicitly_potentially_render_blocking() const override;
|
||||||
|
|
|
||||||
|
|
@ -3268,6 +3268,10 @@ void HTMLParser::handle_text(HTMLToken& token)
|
||||||
// Increment the parser's script nesting level by one.
|
// Increment the parser's script nesting level by one.
|
||||||
increment_script_nesting_level();
|
increment_script_nesting_level();
|
||||||
|
|
||||||
|
// https://w3c.github.io/trusted-types/dist/spec/#setting-slot-values-from-parser
|
||||||
|
// Set script’s script text value to its child text content.
|
||||||
|
script->set_string_text(script->child_text_content());
|
||||||
|
|
||||||
// If the active speculative HTML parser is null, then prepare the script element script.
|
// If the active speculative HTML parser is null, then prepare the script element script.
|
||||||
// This might cause some script to execute, which might cause new characters to be inserted into the tokenizer,
|
// This might cause some script to execute, which might cause new characters to be inserted into the tokenizer,
|
||||||
// and might cause the tokenizer to output more tokens, resulting in a reentrant invocation of the parser.
|
// and might cause the tokenizer to output more tokens, resulting in a reentrant invocation of the parser.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user