mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-05 08:31:51 +00:00
LibWeb: Don't serialize omitted box-shadow
and text-shadow
values
This commit is contained in:
parent
68d3ddb1a7
commit
d89a67ffee
Notes:
github-actions[bot]
2025-06-15 14:06:07 +00:00
Author: https://github.com/tcl3
Commit: d89a67ffee
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5087
7 changed files with 207 additions and 31 deletions
|
@ -1921,26 +1921,16 @@ RefPtr<CSSStyleValue const> Parser::parse_single_shadow_value(TokenStream<Compon
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
// If color is absent, default to `currentColor`
|
||||
if (!color)
|
||||
color = CSSKeywordValue::create(Keyword::Currentcolor);
|
||||
|
||||
// x/y offsets are required
|
||||
if (!offset_x || !offset_y)
|
||||
return nullptr;
|
||||
|
||||
// Other lengths default to 0
|
||||
if (!blur_radius)
|
||||
blur_radius = LengthStyleValue::create(Length::make_px(0));
|
||||
if (!spread_distance)
|
||||
spread_distance = LengthStyleValue::create(Length::make_px(0));
|
||||
|
||||
// Placement is outer by default
|
||||
if (!placement.has_value())
|
||||
placement = ShadowPlacement::Outer;
|
||||
|
||||
transaction.commit();
|
||||
return ShadowStyleValue::create(color.release_nonnull(), offset_x.release_nonnull(), offset_y.release_nonnull(), blur_radius.release_nonnull(), spread_distance.release_nonnull(), placement.release_value());
|
||||
return ShadowStyleValue::create(color, offset_x.release_nonnull(), offset_y.release_nonnull(), blur_radius, spread_distance, placement.release_value());
|
||||
}
|
||||
|
||||
RefPtr<CSSStyleValue const> Parser::parse_rotate_value(TokenStream<ComponentValue>& tokens)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue