mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Simplify handling of {text,box}-shadow
We know that shadow values are always parsed as a `KeywordStyleValue` with `Keyword::None` or a `StyleValueList`
This commit is contained in:
parent
4c4fa5c9cd
commit
0595d52be2
Notes:
github-actions[bot]
2025-12-01 10:18:46 +00:00
Author: https://github.com/Calme1709
Commit: 0595d52be2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6972
Reviewed-by: https://github.com/AtkinsSJ ✅
2 changed files with 14 additions and 30 deletions
|
|
@ -1381,29 +1381,21 @@ Vector<ShadowData> ComputedProperties::shadow(PropertyID property_id, Layout::No
|
|||
};
|
||||
};
|
||||
|
||||
if (value.is_value_list()) {
|
||||
auto const& value_list = value.as_value_list();
|
||||
if (value.to_keyword() == Keyword::None)
|
||||
return {};
|
||||
|
||||
Vector<ShadowData> shadow_data;
|
||||
shadow_data.ensure_capacity(value_list.size());
|
||||
for (auto const& layer_value : value_list.values()) {
|
||||
auto maybe_shadow_data = make_shadow_data(layer_value->as_shadow());
|
||||
if (!maybe_shadow_data.has_value())
|
||||
return {};
|
||||
shadow_data.append(maybe_shadow_data.release_value());
|
||||
}
|
||||
auto const& value_list = value.as_value_list();
|
||||
|
||||
return shadow_data;
|
||||
}
|
||||
|
||||
if (value.is_shadow()) {
|
||||
auto maybe_shadow_data = make_shadow_data(value.as_shadow());
|
||||
Vector<ShadowData> shadow_data;
|
||||
shadow_data.ensure_capacity(value_list.size());
|
||||
for (auto const& layer_value : value_list.values()) {
|
||||
auto maybe_shadow_data = make_shadow_data(layer_value->as_shadow());
|
||||
if (!maybe_shadow_data.has_value())
|
||||
return {};
|
||||
return { maybe_shadow_data.release_value() };
|
||||
shadow_data.append(maybe_shadow_data.release_value());
|
||||
}
|
||||
|
||||
return {};
|
||||
return shadow_data;
|
||||
}
|
||||
|
||||
Vector<ShadowData> ComputedProperties::box_shadow(Layout::Node const& layout_node) const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue