mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Fixed serialize_list to no longer append an additional space at the end of the string
This commit is contained in:
parent
5478c7c24b
commit
ccddc3c13e
5 changed files with 49 additions and 5 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue