mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +00:00
LibWeb: Remove CSS::Parser::ParsingContext's default constructor
This relied on pulling the current realm from the main thread VM, which requires an execution context to be on the VM's stack. This heavily relied on the dummy execution context that is always on the stack, for example, when parsing the UA style sheets where no JavaScript is running.
This commit is contained in:
parent
54a1ec2f10
commit
f7ff1fd985
12 changed files with 73 additions and 72 deletions
|
@ -54,7 +54,8 @@ WebIDL::ExceptionOr<unsigned> CSSStyleSheet::insert_rule(StringView rule, unsign
|
|||
// FIXME: 2. If the disallow modification flag is set, throw a NotAllowedError DOMException.
|
||||
|
||||
// 3. Let parsed rule be the return value of invoking parse a rule with rule.
|
||||
auto parsed_rule = parse_css_rule(CSS::Parser::ParsingContext {}, rule);
|
||||
auto context = m_style_sheet_list ? CSS::Parser::ParsingContext { m_style_sheet_list->document() } : CSS::Parser::ParsingContext { realm() };
|
||||
auto parsed_rule = parse_css_rule(context, rule);
|
||||
|
||||
// 4. If parsed rule is a syntax error, return parsed rule.
|
||||
if (!parsed_rule)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue