mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +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
|
|
@ -1341,19 +1341,11 @@ RefPtr<StyleValue const> interpolate_box_shadow(DOM::Element& element, Calculati
|
|||
// (transparent 0 0 0 0) with a corresponding inset keyword as needed to match the longer list if
|
||||
// the shorter list is otherwise compatible with the longer one
|
||||
|
||||
static constexpr auto process_list = [](StyleValue const& value) {
|
||||
StyleValueVector shadows;
|
||||
if (value.is_value_list()) {
|
||||
for (auto const& element : value.as_value_list().values()) {
|
||||
if (element->is_shadow())
|
||||
shadows.append(element);
|
||||
}
|
||||
} else if (value.is_shadow()) {
|
||||
shadows.append(value);
|
||||
} else if (!value.is_keyword() || value.as_keyword().keyword() != Keyword::None) {
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
return shadows;
|
||||
static constexpr auto process_list = [](StyleValue const& value) -> StyleValueVector {
|
||||
if (value.to_keyword() == Keyword::None)
|
||||
return {};
|
||||
|
||||
return value.as_value_list().values();
|
||||
};
|
||||
|
||||
static constexpr auto extend_list_if_necessary = [](StyleValueVector& values, StyleValueVector const& other) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue