Bug 1457744: Fix serialization order of list-style. r?xidorn
MozReview-Commit-ID: K5QtaNk4YJQ
--- a/servo/components/style/properties/shorthand/list.mako.rs
+++ b/servo/components/style/properties/shorthand/list.mako.rs
@@ -1,32 +1,32 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
<%namespace name="helpers" file="/helpers.mako.rs" />
<%helpers:shorthand name="list-style"
- sub_properties="list-style-position list-style-image list-style-type"
+ sub_properties="list-style-type list-style-position list-style-image"
derive_serialize="True"
spec="https://drafts.csswg.org/css-lists/#propdef-list-style">
use properties::longhands::{list_style_image, list_style_position, list_style_type};
use values::specified::url::ImageUrlOrNone;
pub fn parse_value<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Longhands, ParseError<'i>> {
// `none` is ambiguous until we've finished parsing the shorthands, so we count the number
// of times we see it.
let mut nones = 0u8;
let (mut image, mut position, mut list_style_type, mut any) = (None, None, None, false);
loop {
if input.try(|input| input.expect_ident_matching("none")).is_ok() {
- nones = nones + 1;
+ nones += 1;
if nones > 2 {
return Err(input.new_custom_error(SelectorParseErrorKind::UnexpectedIdent("none".into())))
}
any = true;
continue
}
if image.is_none() {
--- a/testing/web-platform/meta/css/cssom/shorthand-values.html.ini
+++ b/testing/web-platform/meta/css/cssom/shorthand-values.html.ini
@@ -21,14 +21,11 @@
expected: FAIL
[The serialization of border: 1px; border-top-color: red; should be canonical.]
expected: FAIL
[The serialization of border: solid; border-style: dotted should be canonical.]
expected: FAIL
- [The serialization of list-style-type: circle; list-style-position: inside; list-style-image: initial; should be canonical.]
- expected: FAIL
-
[The serialization of overflow-x: scroll; overflow-y: hidden; should be canonical.]
expected: FAIL