mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Parse ::slotted() if the webcomponents pref is on.
Bug: 1425834 Reviewed-by: heycam MozReview-Commit-ID: IOFneIgu7Rm
This commit is contained in:
parent
b73fe2d698
commit
d88696023f
1 changed files with 8 additions and 1 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
use cssparser::{BasicParseError, BasicParseErrorKind, Parser, ToCss, Token, CowRcStr, SourceLocation};
|
||||
use element_state::{DocumentState, ElementState};
|
||||
use gecko_bindings::structs::CSSPseudoClassType;
|
||||
use gecko_bindings::structs::{self, CSSPseudoClassType};
|
||||
use gecko_bindings::structs::RawServoSelectorList;
|
||||
use gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI};
|
||||
use selector_parser::{Direction, SelectorParser};
|
||||
|
@ -333,6 +333,13 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> {
|
|||
type Impl = SelectorImpl;
|
||||
type Error = StyleParseErrorKind<'i>;
|
||||
|
||||
fn parse_slotted(&self) -> bool {
|
||||
// NOTE(emilio): Slot assignment and such works per-document, but
|
||||
// getting a document around here is not trivial, and it's not worth
|
||||
// anyway to handle this in a per-doc basis.
|
||||
unsafe { structs::nsContentUtils_sIsWebComponentsEnabled }
|
||||
}
|
||||
|
||||
fn pseudo_element_allows_single_colon(name: &str) -> bool {
|
||||
// FIXME: -moz-tree check should probably be ascii-case-insensitive.
|
||||
::selectors::parser::is_css2_pseudo_element(name) ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue