mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-04 17:33:04 +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
|
@ -946,8 +946,7 @@ WebIDL::ExceptionOr<ParsedMatrix> parse_dom_matrix_init_string(JS::Realm& realm,
|
|||
// 2. Parse transformList into parsedValue given the grammar for the CSS transform property.
|
||||
// The result will be a <transform-list>, the keyword none, or failure.
|
||||
// If parsedValue is failure, or any <transform-function> has <length> values without absolute length units, or any keyword other than none is used, then return failure. [CSS3-SYNTAX] [CSS3-TRANSFORMS]
|
||||
auto parsing_context = CSS::Parser::ParsingContext { realm };
|
||||
auto transform_style_value = parse_css_value(parsing_context, transform_list, CSS::PropertyID::Transform);
|
||||
auto transform_style_value = parse_css_value(CSS::Parser::ParsingContext {}, transform_list, CSS::PropertyID::Transform);
|
||||
if (!transform_style_value)
|
||||
return WebIDL::SyntaxError::create(realm, "Failed to parse CSS transform string."_string);
|
||||
auto parsed_value = CSS::StyleProperties::transformations_for_style_value(*transform_style_value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue