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
This commit is contained in:
Emilio Cobos Álvarez 2019-06-11 17:42:58 +00:00
parent e272bfed70
commit 8b0d2b1e38
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A

View file

@ -5,7 +5,7 @@
//! Gecko-specific bits for selector-parsing. //! Gecko-specific bits for selector-parsing.
use crate::element_state::{DocumentState, ElementState}; 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::gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI};
use crate::invalidation::element::document_state::InvalidationMatchingData; use crate::invalidation::element::document_state::InvalidationMatchingData;
use crate::selector_parser::{Direction, SelectorParser}; use crate::selector_parser::{Direction, SelectorParser};
@ -349,7 +349,14 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> {
#[inline] #[inline]
fn parse_host(&self) -> bool { 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( fn parse_non_ts_pseudo_class(