From 06dbb6700d7ca7e217765045bcb0f3936e2d02b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 25 Mar 2018 17:31:55 +0200 Subject: [PATCH] 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 --- .../style/gecko/pseudo_element_definition.mako.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/style/gecko/pseudo_element_definition.mako.rs b/components/style/gecko/pseudo_element_definition.mako.rs index 275a04e5bc4..caaeeac629d 100644 --- a/components/style/gecko/pseudo_element_definition.mako.rs +++ b/components/style/gecko/pseudo_element_definition.mako.rs @@ -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.