Auto merge of #7429 - GyrosOfWar:serialize_list_space_fix, r=jdm

Fixed serialize_list to no longer append an additional space at the e…

…nd of the string.

Fixes #7404

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7429)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-09-02 09:15:16 -06:00
commit e1ede2074d
5 changed files with 49 additions and 5 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 {