mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user