ladybird
ladybird copied to clipboard
LibWeb: Reject invalid CSS `background` property values
Fixes 12 WPT subtests in the css/css-backgrounds directory.
A couple of commit titles you've written "selector" when you want "property".
We generate some bounds-checking code for properties (in PropertyID.h) that you can use in some of these, though not all of them:
bool property_accepts_angle(PropertyID, Angle const&);
bool property_accepts_flex(PropertyID, Flex const&);
bool property_accepts_frequency(PropertyID, Frequency const&);
bool property_accepts_integer(PropertyID, i64 const&);
bool property_accepts_length(PropertyID, Length const&);
bool property_accepts_number(PropertyID, double const&);
bool property_accepts_percentage(PropertyID, Percentage const&);
bool property_accepts_resolution(PropertyID, Resolution const&);
bool property_accepts_time(PropertyID, Time const&);
For example, the border-radius and background-position-* parsing could use property_accepts_length() and property_accepts_percentage(). Though the shadow one can't, currently.