LibWeb: Replace ::-webkit pseudo-elements with ones from CSS Forms spec

This spec is very early on, and likely to change. However, it still
feels preferable to use these rather than the prefixed -webkit ones.

Plus, as we have a `::fill` on range inputs, we can use that for styling
the bar instead of inserting CSS from C++.
This commit is contained in:
Sam Atkins 2025-03-18 15:57:43 +00:00
parent f5a6704219
commit 3ebdb64fed
Notes: github-actions[bot] 2025-03-19 10:11:17 +00:00
6 changed files with 85 additions and 81 deletions

View file

@ -1183,19 +1183,15 @@ void HTMLInputElement::create_range_input_shadow_tree()
set_shadow_root(shadow_root);
m_slider_runnable_track = MUST(DOM::create_element(document(), HTML::TagNames::div, Namespace::HTML));
m_slider_runnable_track->set_use_pseudo_element(CSS::Selector::PseudoElement::Type::SliderRunnableTrack);
m_slider_runnable_track->set_use_pseudo_element(CSS::Selector::PseudoElement::Type::Track);
MUST(shadow_root->append_child(*m_slider_runnable_track));
m_slider_progress_element = MUST(DOM::create_element(document(), HTML::TagNames::div, Namespace::HTML));
MUST(m_slider_progress_element->set_attribute(HTML::AttributeNames::style, R"~~~(
display: block;
position: absolute;
height: 100%;
)~~~"_string));
m_slider_progress_element->set_use_pseudo_element(CSS::Selector::PseudoElement::Type::Fill);
MUST(m_slider_runnable_track->append_child(*m_slider_progress_element));
m_slider_thumb = MUST(DOM::create_element(document(), HTML::TagNames::div, Namespace::HTML));
m_slider_thumb->set_use_pseudo_element(CSS::Selector::PseudoElement::Type::SliderThumb);
m_slider_thumb->set_use_pseudo_element(CSS::Selector::PseudoElement::Type::Thumb);
MUST(m_slider_runnable_track->append_child(*m_slider_thumb));
update_slider_shadow_tree_elements();