mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-30 12:25:35 +00:00
LibWeb: Support accent-color for range input and progress element
Fixes #466
This commit is contained in:
@@ -998,7 +998,6 @@ void HTMLInputElement::create_range_input_shadow_tree()
|
||||
display: block;
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
background-color: AccentColor;
|
||||
)~~~"_string));
|
||||
MUST(slider_runnable_track->append_child(*m_range_progress_element));
|
||||
|
||||
@@ -1087,6 +1086,21 @@ void HTMLInputElement::create_range_input_shadow_tree()
|
||||
add_event_listener_without_options(UIEvents::EventNames::mousedown, DOM::IDLEventListener::create(realm(), mousedown_callback));
|
||||
}
|
||||
|
||||
void HTMLInputElement::computed_css_values_changed()
|
||||
{
|
||||
auto palette = document().page().palette();
|
||||
auto accent_color = palette.color(ColorRole::Accent).to_string();
|
||||
|
||||
auto accent_color_property = computed_css_values()->property(CSS::PropertyID::AccentColor);
|
||||
if (accent_color_property->has_color())
|
||||
accent_color = accent_color_property->to_string();
|
||||
|
||||
if (m_range_progress_element)
|
||||
MUST(m_range_progress_element->style_for_bindings()->set_property(CSS::PropertyID::BackgroundColor, accent_color));
|
||||
if (m_slider_thumb)
|
||||
MUST(m_slider_thumb->style_for_bindings()->set_property(CSS::PropertyID::BackgroundColor, accent_color));
|
||||
}
|
||||
|
||||
void HTMLInputElement::user_interaction_did_change_input_value()
|
||||
{
|
||||
// https://html.spec.whatwg.org/multipage/input.html#common-input-element-events
|
||||
|
||||
Reference in New Issue
Block a user