From 8b0d2b1e386c5bf9e513126de055205bc6853371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 11 Jun 2019 17:42:58 +0000 Subject: [PATCH] style: Add a pref and enable Shadow Parts in Nightly and for chrome stylesheets. I want to enable in Nightly to evaluate (in the medium term) shipping it without the part forwarding, once the cascade order and importance issues are fixed, and that we pass all the tests that don't involve forwarding. That is, I want to monitor whether having ::part() causes compat issues or not. Differential Revision: https://phabricator.services.mozilla.com/D32649 --- components/style/gecko/selector_parser.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/components/style/gecko/selector_parser.rs b/components/style/gecko/selector_parser.rs index 18718446c1a..659200c3786 100644 --- a/components/style/gecko/selector_parser.rs +++ b/components/style/gecko/selector_parser.rs @@ -5,7 +5,7 @@ //! Gecko-specific bits for selector-parsing. use crate::element_state::{DocumentState, ElementState}; -use crate::gecko_bindings::structs::RawServoSelectorList; +use crate::gecko_bindings::structs::{self, RawServoSelectorList}; use crate::gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI}; use crate::invalidation::element::document_state::InvalidationMatchingData; use crate::selector_parser::{Direction, SelectorParser}; @@ -349,7 +349,14 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> { #[inline] fn parse_host(&self) -> bool { - self.parse_slotted() + true + } + + #[inline] + fn parse_part(&self) -> bool { + self.chrome_rules_enabled() || unsafe { + structs::StaticPrefs_sVarCache_layout_css_shadow_parts_enabled + } } fn parse_non_ts_pseudo_class(