LibWeb/CSS: Implement the caret-color property

This commit is contained in:
Tim Ledbetter 2025-03-09 13:59:33 +00:00 committed by Alexander Kalenik
commit 88d35c547c
Notes: github-actions[bot] 2025-03-09 18:37:22 +00:00
16 changed files with 381 additions and 218 deletions

View file

@ -832,6 +832,18 @@ Float ComputedProperties::float_() const
return keyword_to_float(value.to_keyword()).release_value();
}
Color ComputedProperties::caret_color(Layout::NodeWithStyle const& node) const
{
auto const& value = property(PropertyID::CaretColor);
if (value.is_keyword() && value.to_keyword() == Keyword::Auto)
return node.computed_values().color();
if (value.has_color())
return value.to_color(node);
return InitialValues::caret_color();
}
Clear ComputedProperties::clear() const
{
auto const& value = property(PropertyID::Clear);