servo: Merge #7429 - Fixed serialize_list to no longer append an additional space at the e… (from GyrosOfWar:serialize_list_space_fix); r=jdm

…nd of the string.

Fixes #7404

Source-Repo: https://github.com/servo/servo
Source-Revision: e1ede2074d2ceb74c0d9f38b23697f17dc3a8fc9
This commit is contained in:
Martin Tomasi
2015-09-02 09:15:16 -06:00
parent c118b053c9
commit 6bbcb60bf6
2 changed files with 4 additions and 3 deletions

View File

@@ -20,6 +20,7 @@ use util::str::DOMString;
use std::ascii::AsciiExt;
use std::borrow::ToOwned;
use std::cell::Ref;
use std::slice::SliceConcatExt;
// http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface
#[dom_struct]
@@ -50,9 +51,8 @@ macro_rules! css_properties(
);
fn serialize_list(list: &[Ref<PropertyDeclaration>]) -> DOMString {
list.iter().fold(String::new(), |accum, ref declaration| {
accum + &declaration.value() + " "
})
let strings: Vec<_> = list.iter().map(|d| d.value()).collect();
strings.join(" ")
}
impl CSSStyleDeclaration {

View File

@@ -30,6 +30,7 @@
#![feature(str_utf16)]
#![feature(unicode)]
#![feature(vec_push_all)]
#![feature(slice_concat_ext)]
#![deny(unsafe_code)]
#![allow(non_snake_case)]