Struct style::stylesheets::TopLevelRuleParser [] [src]

pub struct TopLevelRuleParser<'a, R: 'a> {
    pub stylesheet_origin: Origin,
    pub shared_lock: &'a SharedRwLock,
    pub loader: Option<&'a StylesheetLoader>,
    pub context: ParserContext<'a>,
    pub error_context: ParserErrorContext<'a, R>,
    pub state: State,
    pub had_hierarchy_error: bool,
    pub namespaces: &'a mut Namespaces,
}

The parser for the top-level rules in a stylesheet.

Fields

The origin of the stylesheet we're parsing.

A reference to the lock we need to use to create rules.

A reference to a stylesheet loader if applicable, for @import rules.

The top-level parser context.

This won't contain any namespaces, and only nested parsers created with ParserContext::new_with_rule_type will.

The context required for reporting parse errors.

The current state of the parser.

Whether we have tried to parse was invalid due to being in the wrong place (e.g. an @import rule was found while in the Body state). Reset to false when take_had_hierarchy_error is called.

The namespace map we use for parsing. Needs to start as Some(), and will be taken out after parsing namespace rules, and that reference will be moved to ParserContext.

Methods

impl<'b, R> TopLevelRuleParser<'b, R>
[src]

[src]

Returns the current state of the parser.

[src]

Returns whether we previously tried to parse a rule that was invalid due to being in the wrong place (e.g. an @import rule was found after a regular style rule). The state of this flag is reset when this function is called.

Trait Implementations

impl<'a, 'i, R: ParseErrorReporter> AtRuleParser<'i> for TopLevelRuleParser<'a, R>
[src]

The intermediate representation of prelude of an at-rule without block;

The intermediate representation of prelude of an at-rule with block;

The finished representation of an at-rule.

The error type that is included in the ParseError value that can be returned.

[src]

Parse the prelude of an at-rule with the given name. Read more

[src]

Parse the content of a { /* ... */ } block for the body of the at-rule. Read more

[src]

End an at-rule which doesn't have block. Return the finished representation of the at-rule. Read more

impl<'a, 'i, R: ParseErrorReporter> QualifiedRuleParser<'i> for TopLevelRuleParser<'a, R>
[src]

The intermediate representation of a qualified rule prelude.

The finished representation of a qualified rule.

The error type that is included in the ParseError value that can be returned.

[src]

Parse the prelude of a qualified rule. For style rules, this is as Selector list. Read more

[src]

Parse the content of a { /* ... */ } block for the body of the qualified rule. Read more