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:
@@ -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 {
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#![feature(str_utf16)]
|
||||
#![feature(unicode)]
|
||||
#![feature(vec_push_all)]
|
||||
#![feature(slice_concat_ext)]
|
||||
|
||||
#![deny(unsafe_code)]
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
Reference in New Issue
Block a user