mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWeb: Store ShadowStyleValue's color as a StyleValue
Colors can be specified in a way that `Gfx::Color` can't represent, such as named system colors, `currentColor`, or functions involving `calc()`.
This commit is contained in:
parent
581d00293c
commit
4e48afd9a7
Notes:
github-actions[bot]
2024-08-21 09:53:11 +00:00
Author: https://github.com/AtkinsSJ
Commit: 4e48afd9a7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1091
6 changed files with 20 additions and 21 deletions
|
@ -895,7 +895,7 @@ Vector<ShadowData> StyleProperties::shadow(PropertyID property_id, Layout::Node
|
|||
return {};
|
||||
};
|
||||
|
||||
auto make_shadow_data = [resolve_to_length](ShadowStyleValue const& value) -> Optional<ShadowData> {
|
||||
auto make_shadow_data = [resolve_to_length, &layout_node](ShadowStyleValue const& value) -> Optional<ShadowData> {
|
||||
auto maybe_offset_x = resolve_to_length(value.offset_x());
|
||||
if (!maybe_offset_x.has_value())
|
||||
return {};
|
||||
|
@ -909,7 +909,7 @@ Vector<ShadowData> StyleProperties::shadow(PropertyID property_id, Layout::Node
|
|||
if (!maybe_spread_distance.has_value())
|
||||
return {};
|
||||
return ShadowData {
|
||||
value.color(),
|
||||
value.color()->to_color(verify_cast<Layout::NodeWithStyle>(layout_node)),
|
||||
maybe_offset_x.release_value(),
|
||||
maybe_offset_y.release_value(),
|
||||
maybe_blur_radius.release_value(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue