mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 06:18:59 +00:00
LibWeb: Implement progress/range-input accent color in CSS
The `AccentColor` keyword does this in a simpler way, and allows authors to override it.
This commit is contained in:
parent
3ebdb64fed
commit
4c3c907041
Notes:
github-actions[bot]
2025-03-19 10:11:10 +00:00
Author: https://github.com/AtkinsSJ
Commit: 4c3c907041
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3991
5 changed files with 3 additions and 32 deletions
|
@ -133,16 +133,4 @@ void HTMLProgressElement::update_progress_value_element()
|
|||
MUST(m_progress_value_element->style_for_bindings()->set_property(CSS::PropertyID::Width, MUST(String::formatted("{}%", position() * 100))));
|
||||
}
|
||||
|
||||
void HTMLProgressElement::computed_properties_changed()
|
||||
{
|
||||
auto accent_color = MUST(String::from_utf8(CSS::string_from_keyword(CSS::Keyword::Accentcolor)));
|
||||
|
||||
auto const& accent_color_property = computed_properties()->property(CSS::PropertyID::AccentColor);
|
||||
if (accent_color_property.has_color())
|
||||
accent_color = accent_color_property.to_string(Web::CSS::CSSStyleValue::SerializationMode::Normal);
|
||||
|
||||
if (m_progress_value_element)
|
||||
MUST(m_progress_value_element->style_for_bindings()->set_property(CSS::PropertyID::BackgroundColor, accent_color));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue