Auto merge of #15546 - eddiequan:15209_fix_quotes_serialization_transform_none, r=Wafflespeanut

fixes quote transform: none serialization

<!-- Please describe your changes on the following line: -->
Adds a unit test to reproduce faulty behaviour, and serializes "none" correctly when provided an empty list.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #15209 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15546)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-02-14 10:41:58 -08:00 committed by GitHub
commit 2ea55ae1ad
2 changed files with 28 additions and 0 deletions

View file

@ -54,6 +54,10 @@ ${helpers.predefined_type("list-style-image", "UrlOrNone", "Either::Second(None_
impl ToCss for SpecifiedValue {
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
if self.0.is_empty() {
return dest.write_str("none")
}
let mut first = true;
for pair in &self.0 {
if !first {