mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +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:
parent
ee9db99961
commit
bc77f84359
Notes:
github-actions[bot]
2024-12-05 19:00:42 +00:00
Author: https://github.com/AtkinsSJ
Commit: bc77f84359
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2783
11 changed files with 20 additions and 46 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue