Bug 1735575 - Add aliases for webkit-slider pseudos. r=boris

See discussion in the bug.

Differential Revision: https://phabricator.services.mozilla.com/D128392
This commit is contained in:
Emilio Cobos Álvarez 2023-07-06 21:43:09 +00:00
parent 2fddbb74c5
commit 1705f02eea
6 changed files with 39 additions and 0 deletions

View File

@ -59,3 +59,6 @@ skip-if(Android) == range-border-background.html range-border-background-ref.htm
fails-if(Android) fuzzy(0-2,0-80) == auto-size.html auto-size-ref.html # Snapping, bug 1621141
== range-track-bg.html range-track-bg-ref.html
!= track-default-rendering.html track-default-rendering-ref.html
test-pref(layout.css.webkit-range-pseudos.enabled,true) == webkit.html webkit-ref.html
test-pref(layout.css.webkit-range-pseudos.enabled,true) != webkit.html webkit-notref.html

View File

@ -0,0 +1,2 @@
<!doctype html>
<input type=range>

View File

@ -0,0 +1,10 @@
<!doctype html>
<style>
input::-moz-range-thumb {
background: blue;
}
input::-moz-range-track {
background: green;
}
</style>
<input type=range>

View File

@ -0,0 +1,10 @@
<!doctype html>
<style>
input::-webkit-slider-thumb {
background: blue;
}
input::-webkit-slider-runnable-track {
background: green;
}
</style>
<input type=range>

View File

@ -9340,6 +9340,13 @@
value: false
mirror: always
# Is support for -webkit-slider* pseudos enabled?
- name: layout.css.webkit-range-pseudos.enabled
type: RelaxedAtomicBool
value: @IS_NIGHTLY_BUILD@
mirror: always
rust: true
# Is 'content:none' supported on (non-pseudo) elements?
- name: layout.css.element-content-none.enabled
type: RelaxedAtomicBool

View File

@ -208,6 +208,13 @@ impl PseudoElement {
"-moz-list-bullet" | "-moz-list-number" => {
return Some(PseudoElement::Marker);
},
// Compat aliases for some `::-webkit-` pseudo-elements.
"-webkit-slider-runnable-track" if static_prefs::pref!("layout.css.webkit-range-pseudos.enabled") => {
return Some(PseudoElement::MozRangeTrack);
},
"-webkit-slider-thumb" if static_prefs::pref!("layout.css.webkit-range-pseudos.enabled") => {
return Some(PseudoElement::MozRangeThumb);
},
_ => {
if starts_with_ignore_ascii_case(name, "-moz-tree-") {
return PseudoElement::tree_pseudo_element(name, Default::default())