style: Unprefix :-moz-selection.

Our implementation is totally not what the spec says, but totally what other
UAs do, see https://github.com/w3c/csswg-drafts/issues/2474.

So given this is causing webcompat pain, I think we should be pragmatic and just
unprefix this.

We could keep serialization and getComputedStyle with ::selection working with a
bit more effort, like we do for :-moz-placeholder, but I'd prefer not doing at
least the serialization bit, and just alias in nsCSSPseudoElements
:-moz-selection to selection too.

Bug: 509958
Reviewed-by: dbaron,xidorn
MozReview-Commit-ID: 6lxctozRDqv
This commit is contained in:
Emilio Cobos Álvarez 2018-03-25 17:31:55 +02:00
parent db0134e697
commit 06dbb6700d
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -216,11 +216,7 @@ impl PseudoElement {
None
}
/// Constructs an atom from a string of text, and whether we're in a
/// user-agent stylesheet.
///
/// If we're not in a user-agent stylesheet, we will never parse anonymous
/// box pseudo-elements.
/// Constructs a pseudo-element from a string of text.
///
/// Returns `None` if the pseudo-element is not recognised.
#[inline]
@ -234,6 +230,10 @@ impl PseudoElement {
return Some(${pseudo_element_variant(pseudo)})
}
% endfor
// Alias "-moz-selection" to "selection" at parse time.
"-moz-selection" => {
return Some(PseudoElement::Selection);
}
_ => {
// FIXME: -moz-tree check should probably be
// ascii-case-insensitive.