mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 07:22:21 +00:00
LibWeb: Throw SyntaxError when FontFaceSet contains var
This commit is contained in:
parent
863092afdc
commit
0e3386bb4c
Notes:
github-actions[bot]
2025-07-01 10:51:32 +00:00
Author: https://github.com/Gingeh
Commit: 0e3386bb4c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5263
Reviewed-by: https://github.com/AtkinsSJ ✅
3 changed files with 55 additions and 3 deletions
|
@ -175,12 +175,11 @@ static WebIDL::ExceptionOr<GC::Ref<JS::Set>> find_matching_font_faces(JS::Realm&
|
|||
{
|
||||
// 1. Parse font using the CSS value syntax of the font property. If a syntax error occurs, return a syntax error.
|
||||
auto property = parse_css_value(CSS::Parser::ParsingParams(), font, PropertyID::Font);
|
||||
if (!property)
|
||||
if (!property || !property->is_shorthand())
|
||||
return WebIDL::SyntaxError::create(realm, "Unable to parse font"_string);
|
||||
|
||||
// If the parsed value is a CSS-wide keyword, return a syntax error.
|
||||
if (property->is_css_wide_keyword())
|
||||
return WebIDL::SyntaxError::create(realm, "Parsed font is a CSS-wide keyword"_string);
|
||||
// Note: This case is already caught by the is_shorthand check.
|
||||
|
||||
// FIXME: Absolutize all relative lengths against the initial values of the corresponding properties. (For example, a
|
||||
// relative font weight like bolder is evaluated against the initial value normal.)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue