Struct style::selector_parser::SelectorParser
[−]
[src]
pub struct SelectorParser<'a> { pub stylesheet_origin: Origin, pub namespaces: &'a Namespaces, pub url_data: Option<&'a UrlExtraData>, }
Servo's selector parser.
Fields
stylesheet_origin: Origin
The origin of the stylesheet we're parsing.
namespaces: &'a Namespaces
The namespace set of the stylesheet.
url_data: Option<&'a UrlExtraData>
The extra URL data of the stylesheet, which is used to look up whether we are parsing a chrome:// URL style sheet.
Methods
impl<'a> SelectorParser<'a>
[src]
[src]
Parse a selector list with an author origin and without taking into account namespaces.
This is used for some DOM APIs like querySelector
.
pub fn in_user_agent_stylesheet(&self) -> bool
[src]
Whether we're parsing selectors in a user-agent stylesheet.
pub fn chrome_rules_enabled(&self) -> bool
[src]
Whether we're parsing selectors in a stylesheet that has chrome privilege.
Trait Implementations
impl<'a> MallocSizeOf for SelectorParser<'a>
[src]
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
[src]
Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more
impl<'a, 'i> Parser<'i> for SelectorParser<'a>
[src]
type Impl = SelectorImpl
type Error = StyleParseErrorKind<'i>
fn parse_non_ts_pseudo_class(
&self,
location: SourceLocation,
name: CowRcStr<'i>
) -> Result<NonTSPseudoClass, ParseError<'i>>
[src]
&self,
location: SourceLocation,
name: CowRcStr<'i>
) -> Result<NonTSPseudoClass, ParseError<'i>>
This function can return an "Err" pseudo-element in order to support CSS2.1 pseudo-elements. Read more
fn parse_non_ts_functional_pseudo_class<'t>(
&self,
name: CowRcStr<'i>,
parser: &mut CssParser<'i, 't>
) -> Result<NonTSPseudoClass, ParseError<'i>>
[src]
&self,
name: CowRcStr<'i>,
parser: &mut CssParser<'i, 't>
) -> Result<NonTSPseudoClass, ParseError<'i>>
fn parse_pseudo_element(
&self,
location: SourceLocation,
name: CowRcStr<'i>
) -> Result<PseudoElement, ParseError<'i>>
[src]
&self,
location: SourceLocation,
name: CowRcStr<'i>
) -> Result<PseudoElement, ParseError<'i>>
fn default_namespace(&self) -> Option<Namespace>
[src]
fn namespace_for_prefix(&self, prefix: &Prefix) -> Option<Namespace>
[src]
fn pseudo_element_allows_single_colon(name: &str) -> bool
[src]
Whether the name is a pseudo-element that can be specified with the single colon syntax in addition to the double-colon syntax. Read more
fn parse_slotted(&self) -> bool
[src]
Whether to parse the ::slotted()
pseudo-element.
fn parse_functional_pseudo_element(
&self,
name: CowRcStr<'i>,
arguments: &mut Parser<'i, 't>
) -> Result<<Self::Impl as SelectorImpl>::PseudoElement, ParseError<'i, Self::Error>>
[src]
&self,
name: CowRcStr<'i>,
arguments: &mut Parser<'i, 't>
) -> Result<<Self::Impl as SelectorImpl>::PseudoElement, ParseError<'i, Self::Error>>