mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +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
|
@ -174,8 +174,7 @@ WebIDL::CallbackType* FontFaceSet::onloadingerror()
|
|||
static WebIDL::ExceptionOr<GC::Ref<JS::Set>> find_matching_font_faces(JS::Realm& realm, FontFaceSet& font_face_set, String const& font, String const&)
|
||||
{
|
||||
// 1. Parse font using the CSS value syntax of the font property. If a syntax error occurs, return a syntax error.
|
||||
auto parser = CSS::Parser::Parser::create(CSS::Parser::ParsingContext(realm), font);
|
||||
auto property = parser.parse_as_css_value(PropertyID::Font);
|
||||
auto property = parse_css_value(CSS::Parser::ParsingContext(), font, PropertyID::Font);
|
||||
if (!property)
|
||||
return WebIDL::SyntaxError::create(realm, "Unable to parse font"_string);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue