mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +00:00
LibWeb: Stop passing Realm unnecessarily to parse CSS properties
Also use the parse_css_value() helper in cases where we previously constructed a Parser manually.
This commit is contained in:
committed by
Alexander Kalenik
parent
ee9db99961
commit
bc77f84359
@@ -22,14 +22,12 @@ WebIDL::ExceptionOr<String> escape(JS::VM&, StringView identifier)
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/css-conditional-3/#dom-css-supports
|
||||
bool supports(JS::VM& vm, StringView property, StringView value)
|
||||
bool supports(JS::VM&, StringView property, StringView value)
|
||||
{
|
||||
auto& realm = *vm.current_realm();
|
||||
|
||||
// 1. If property is an ASCII case-insensitive match for any defined CSS property that the UA supports,
|
||||
// and value successfully parses according to that property’s grammar, return true.
|
||||
if (auto property_id = property_id_from_string(property); property_id.has_value()) {
|
||||
if (parse_css_value(Parser::ParsingContext { realm }, value, property_id.value()))
|
||||
if (parse_css_value(Parser::ParsingContext {}, value, property_id.value()))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user