From 9845a857ce73fc714982d80b1f75db36aa11d0d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 8 Nov 2018 13:33:59 +0000 Subject: [PATCH] style: Allow ::slotted()::placeholder. Differential Revision: https://phabricator.services.mozilla.com/D11132 --- components/style/gecko/pseudo_element.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/components/style/gecko/pseudo_element.rs b/components/style/gecko/pseudo_element.rs index 21eb2322a00..0b527e623e5 100644 --- a/components/style/gecko/pseudo_element.rs +++ b/components/style/gecko/pseudo_element.rs @@ -27,12 +27,16 @@ include!(concat!( impl ::selectors::parser::PseudoElement for PseudoElement { type Impl = SelectorImpl; + // ::slotted() should support all tree-abiding pseudo-elements, see + // https://drafts.csswg.org/css-scoping/#slotted-pseudo + // https://drafts.csswg.org/css-pseudo-4/#treelike fn valid_after_slotted(&self) -> bool { - // TODO(emilio): Remove this function or this comment after [1] is - // resolved. - // - // [1]: https://github.com/w3c/csswg-drafts/issues/3150 - self.is_before_or_after() + matches!( + *self, + PseudoElement::Before | + PseudoElement::After | + PseudoElement::Placeholder + ) } fn supports_pseudo_class(&self, pseudo_class: &NonTSPseudoClass) -> bool {