Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse at-rule without block in two stages #18336

Merged
merged 1 commit into from Sep 2, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Parse at-rule without block in two stages

  • Loading branch information
upsuper committed Sep 1, 2017
commit 2bca62045fbda9d2e6e26724c8d303a3ed03df54

Some generated files are not rendered by default. Learn more.

@@ -13,7 +13,7 @@ path = "lib.rs"
azure = {git = "https://github.com/servo/rust-azure"}
canvas_traits = {path = "../canvas_traits"}
compositing = {path = "../compositing"}
cssparser = "0.19"
cssparser = "0.20"
euclid = "0.15"
fnv = "1.0"
gleam = "0.4"
@@ -10,7 +10,7 @@ name = "canvas_traits"
path = "lib.rs"

[dependencies]
cssparser = "0.19"
cssparser = "0.20"
euclid = "0.15"
heapsize = "0.4"
heapsize_derive = "0.1"
@@ -33,7 +33,7 @@ byteorder = "1.0"
canvas_traits = {path = "../canvas_traits"}
caseless = "0.1.0"
cookie = "0.6"
cssparser = "0.19"
cssparser = "0.20"
deny_public_fields = {path = "../deny_public_fields"}
devtools_traits = {path = "../devtools_traits"}
dom_struct = {path = "../dom_struct"}
@@ -13,7 +13,7 @@ path = "lib.rs"
app_units = "0.5"
atomic_refcell = "0.1"
canvas_traits = {path = "../canvas_traits"}
cssparser = "0.19"
cssparser = "0.20"
euclid = "0.15"
gfx_traits = {path = "../gfx_traits"}
heapsize = "0.4"
@@ -25,7 +25,7 @@ unstable = []
[dependencies]
bitflags = "0.7"
matches = "0.1"
cssparser = "0.19.3"
cssparser = "0.20"
log = "0.3"
fnv = "1.0"
phf = "0.7.18"
@@ -37,7 +37,7 @@ bitflags = "0.7"
bit-vec = "0.4.3"
byteorder = "1.0"
cfg-if = "0.1.0"
cssparser = "0.19.5"
cssparser = "0.20"
encoding = {version = "0.2", optional = true}
euclid = "0.15"
fnv = "1.0"
@@ -114,7 +114,8 @@ struct CounterStyleRuleParser<'a, 'b: 'a> {

/// Default methods reject all at rules.
impl<'a, 'b, 'i> AtRuleParser<'i> for CounterStyleRuleParser<'a, 'b> {
type Prelude = ();
type PreludeNoBlock = ();
type PreludeBlock = ();
type AtRule = ();
type Error = SelectorParseError<'i, StyleParseError<'i>>;
}
@@ -179,7 +179,8 @@ struct FontFaceRuleParser<'a, 'b: 'a> {

/// Default methods reject all at rules.
impl<'a, 'b, 'i> AtRuleParser<'i> for FontFaceRuleParser<'a, 'b> {
type Prelude = ();
type PreludeNoBlock = ();
type PreludeBlock = ();
type AtRule = ();
type Error = SelectorParseError<'i, StyleParseError<'i>>;
}
@@ -953,7 +953,8 @@ struct PropertyDeclarationParser<'a, 'b: 'a> {

/// Default methods reject all at rules.
impl<'a, 'b, 'i> AtRuleParser<'i> for PropertyDeclarationParser<'a, 'b> {
type Prelude = ();
type PreludeNoBlock = ();
type PreludeBlock = ();
type AtRule = Importance;
type Error = SelectorParseError<'i, StyleParseError<'i>>;
}
@@ -193,7 +193,8 @@ struct FFVDeclarationsParser<'a, 'b: 'a, T: 'a> {

/// Default methods reject all at rules.
impl<'a, 'b, 'i, T> AtRuleParser<'i> for FFVDeclarationsParser<'a, 'b, T> {
type Prelude = ();
type PreludeNoBlock = ();
type PreludeBlock = ();
type AtRule = ();
type Error = SelectorParseError<'i, StyleParseError<'i>>;
}
@@ -389,14 +390,15 @@ macro_rules! font_feature_values_blocks {
}

impl<'a, 'i, R: ParseErrorReporter> AtRuleParser<'i> for FontFeatureValuesRuleParser<'a, R> {
type Prelude = BlockType;
type PreludeNoBlock = ();
type PreludeBlock = BlockType;
type AtRule = ();
type Error = SelectorParseError<'i, StyleParseError<'i>>;

fn parse_prelude<'t>(&mut self,
name: CowRcStr<'i>,
_input: &mut Parser<'i, 't>)
-> Result<AtRuleType<Self::Prelude, Self::AtRule>, ParseError<'i>> {
-> Result<AtRuleType<(), BlockType>, ParseError<'i>> {
match_ignore_ascii_case! { &*name,
$(
$name => Ok(AtRuleType::WithBlock(BlockType::$ident_camel)),
@@ -407,7 +409,7 @@ macro_rules! font_feature_values_blocks {

fn parse_block<'t>(
&mut self,
prelude: Self::Prelude,
prelude: BlockType,
input: &mut Parser<'i, 't>
) -> Result<Self::AtRule, ParseError<'i>> {
debug_assert_eq!(self.context.rule_type(), CssRuleType::FontFeatureValues);
@@ -476,9 +476,9 @@ pub fn parse_keyframe_list<R>(
}).filter_map(Result::ok).collect()
}

enum Void {}
impl<'a, 'i, R> AtRuleParser<'i> for KeyframeListParser<'a, R> {
type Prelude = Void;
type PreludeNoBlock = ();
type PreludeBlock = ();
type AtRule = Arc<Locked<Keyframe>>;
type Error = SelectorParseError<'i, StyleParseError<'i>>;
}
@@ -543,7 +543,8 @@ struct KeyframeDeclarationParser<'a, 'b: 'a> {

/// Default methods reject all at rules.
impl<'a, 'b, 'i> AtRuleParser<'i> for KeyframeDeclarationParser<'a, 'b> {
type Prelude = ();
type PreludeNoBlock = ();
type PreludeBlock = ();
type AtRule = ();
type Error = SelectorParseError<'i, StyleParseError<'i>>;
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.