mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Avoid serializing the counter type in counter functions if it's decimal.
See https://github.com/w3c/web-platform-tests/pull/9862 and such.
This commit is contained in:
parent
daaee046b3
commit
839eda000a
2 changed files with 15 additions and 8 deletions
|
@ -76,9 +76,22 @@ fn parse_counters<'i, 't>(
|
||||||
|
|
||||||
#[cfg(feature = "servo")]
|
#[cfg(feature = "servo")]
|
||||||
type CounterStyleType = ListStyleType;
|
type CounterStyleType = ListStyleType;
|
||||||
|
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
type CounterStyleType = CounterStyleOrNone;
|
type CounterStyleType = CounterStyleOrNone;
|
||||||
|
|
||||||
|
#[cfg(feature = "servo")]
|
||||||
|
#[inline]
|
||||||
|
fn is_decimal(counter_type: &CounterStyleType) -> bool {
|
||||||
|
*counter_type == ListStyleType::Decimal
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "gecko")]
|
||||||
|
#[inline]
|
||||||
|
fn is_decimal(counter_type: &CounterStyleType) -> bool {
|
||||||
|
*counter_type == CounterStyleOrNone::decimal()
|
||||||
|
}
|
||||||
|
|
||||||
/// The specified value for the `content` property.
|
/// The specified value for the `content` property.
|
||||||
///
|
///
|
||||||
/// https://drafts.csswg.org/css-content/#propdef-content
|
/// https://drafts.csswg.org/css-content/#propdef-content
|
||||||
|
@ -102,10 +115,10 @@ pub enum ContentItem {
|
||||||
String(Box<str>),
|
String(Box<str>),
|
||||||
/// `counter(name, style)`.
|
/// `counter(name, style)`.
|
||||||
#[css(comma, function)]
|
#[css(comma, function)]
|
||||||
Counter(CustomIdent, CounterStyleType),
|
Counter(CustomIdent, #[css(skip_if = "is_decimal")] CounterStyleType),
|
||||||
/// `counters(name, separator, style)`.
|
/// `counters(name, separator, style)`.
|
||||||
#[css(comma, function)]
|
#[css(comma, function)]
|
||||||
Counters(CustomIdent, Box<str>, CounterStyleType),
|
Counters(CustomIdent, Box<str>, #[css(skip_if = "is_decimal")] CounterStyleType),
|
||||||
/// `open-quote`.
|
/// `open-quote`.
|
||||||
OpenQuote,
|
OpenQuote,
|
||||||
/// `close-quote`.
|
/// `close-quote`.
|
||||||
|
|
|
@ -98,9 +98,3 @@
|
||||||
[widows: inherit]
|
[widows: inherit]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[content: counter(par-num)]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[content: counter(par-num, decimal)]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue