mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:28:11 +00:00
LibWeb: Parse "none" value for box-shadow property
Previously, `box-shadow: none` would fail to parse, meaning that in this example: ```css p { box-shadow: 20px 10px 5px magenta; } p.foo { box-shadow: none; } ``` ... a `<p class="foo">` would still have a box-shadow, when it should not have one. Now, we handle the `none` value. :^)
This commit is contained in:
parent
7879b98f60
commit
8b57e56d66
2 changed files with 11 additions and 1 deletions
|
@ -2571,6 +2571,13 @@ RefPtr<StyleValue> Parser::parse_border_radius_shorthand_value(ParsingContext co
|
|||
|
||||
RefPtr<StyleValue> Parser::parse_box_shadow_value(ParsingContext const& context, Vector<StyleComponentValueRule> const& component_values)
|
||||
{
|
||||
// "none"
|
||||
if (component_values.size() == 1 && component_values.first().is(Token::Type::Ident)) {
|
||||
auto ident = parse_identifier_value(context, component_values.first());
|
||||
if (ident && ident->to_identifier() == ValueID::None)
|
||||
return ident;
|
||||
}
|
||||
|
||||
// FIXME: Also support inset, spread-radius and multiple comma-separated box-shadows
|
||||
Length offset_x {};
|
||||
Length offset_y {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue