Exclude 'none' from <counter-style-name> after all.

https://github.com/w3c/csswg-drafts/issues/1295
This commit is contained in:
Simon Sapin 2017-04-26 05:39:36 +02:00
parent be38c9a5a7
commit 029150c770
2 changed files with 8 additions and 7 deletions

View file

@ -38,7 +38,8 @@ pub fn parse_counter_style_name(input: &mut Parser) -> Result<CustomIdent, ()> {
if let Some(&lower_cased) = predefined(&ident) {
Ok(CustomIdent(Atom::from(lower_cased)))
} else {
CustomIdent::from_ident(ident, &[])
// https://github.com/w3c/csswg-drafts/issues/1295 excludes "none"
CustomIdent::from_ident(ident, &["none"])
}
}
}

View file

@ -6,10 +6,10 @@
#![deny(missing_docs)]
use {Prefix, Namespace};
use {Atom, Prefix, Namespace};
use counter_style::{CounterStyleRule, parse_counter_style_name, parse_counter_style_body};
use cssparser::{AtRuleParser, Parser, QualifiedRuleParser};
use cssparser::{AtRuleType, RuleListParser, SourcePosition, parse_one_rule};
use cssparser::{AtRuleType, RuleListParser, parse_one_rule};
use cssparser::ToCss as ParserToCss;
use error_reporting::{ParseErrorReporter, NullReporter};
#[cfg(feature = "servo")]
@ -1117,10 +1117,10 @@ impl<'a, 'b> AtRuleParser for NestedRuleParser<'a, 'b> {
return Err(())
}
let name = parse_counter_style_name(input)?;
// FIXME: use static atoms and eq_ignore_ascii_case
// https://bugzilla.mozilla.org/show_bug.cgi?id=1359323
// "decimal" is already lower-cased by `parse_counter_style_name`.
if name.0 == "decimal" || name.0.eq_str_ignore_ascii_case("none") {
// ASCII-case-insensitive matches for "decimal" are already lower-cased
// by `parse_counter_style_name`, so we can use == here.
// FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1359323 use atom!("decimal")
if name.0 == Atom::from("decimal") {
return Err(())
}
Ok(AtRuleType::WithBlock(AtRulePrelude::CounterStyle(name)))