mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:08: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
|
@ -44,7 +44,7 @@ void MediaList::set_media_text(DeprecatedString const& text)
|
|||
m_media.clear();
|
||||
if (text.is_empty())
|
||||
return;
|
||||
m_media = parse_media_query_list({}, text);
|
||||
m_media = parse_media_query_list(Parser::ParsingContext { realm() }, text);
|
||||
}
|
||||
|
||||
bool MediaList::is_supported_property_index(u32 index) const
|
||||
|
@ -65,7 +65,7 @@ DeprecatedString MediaList::item(u32 index) const
|
|||
void MediaList::append_medium(DeprecatedString medium)
|
||||
{
|
||||
// 1. Let m be the result of parsing the given value.
|
||||
auto m = parse_media_query({}, medium);
|
||||
auto m = parse_media_query(Parser::ParsingContext { realm() }, medium);
|
||||
|
||||
// 2. If m is null, then return.
|
||||
if (!m)
|
||||
|
@ -85,7 +85,7 @@ void MediaList::append_medium(DeprecatedString medium)
|
|||
// https://www.w3.org/TR/cssom-1/#dom-medialist-deletemedium
|
||||
void MediaList::delete_medium(DeprecatedString medium)
|
||||
{
|
||||
auto m = parse_media_query({}, medium);
|
||||
auto m = parse_media_query(Parser::ParsingContext { realm() }, medium);
|
||||
if (!m)
|
||||
return;
|
||||
m_media.remove_all_matching([&](auto& existing) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue