mirror of
https://github.com/servo/servo.git
synced 2025-08-02 04:00:32 +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::ascii::AsciiExt;
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
use std::cell::Ref;
|
use std::cell::Ref;
|
||||||
|
use std::slice::SliceConcatExt;
|
||||||
|
|
||||||
// http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface
|
// http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
|
@ -50,9 +51,8 @@ macro_rules! css_properties(
|
||||||
);
|
);
|
||||||
|
|
||||||
fn serialize_list(list: &[Ref<PropertyDeclaration>]) -> DOMString {
|
fn serialize_list(list: &[Ref<PropertyDeclaration>]) -> DOMString {
|
||||||
list.iter().fold(String::new(), |accum, ref declaration| {
|
let strings: Vec<_> = list.iter().map(|d| d.value()).collect();
|
||||||
accum + &declaration.value() + " "
|
strings.join(" ")
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CSSStyleDeclaration {
|
impl CSSStyleDeclaration {
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#![feature(str_utf16)]
|
#![feature(str_utf16)]
|
||||||
#![feature(unicode)]
|
#![feature(unicode)]
|
||||||
#![feature(vec_push_all)]
|
#![feature(vec_push_all)]
|
||||||
|
#![feature(slice_concat_ext)]
|
||||||
|
|
||||||
#![deny(unsafe_code)]
|
#![deny(unsafe_code)]
|
||||||
#![allow(non_snake_case)]
|
#![allow(non_snake_case)]
|
||||||
|
|
|
@ -29055,6 +29055,27 @@
|
||||||
},
|
},
|
||||||
"local_changes": {
|
"local_changes": {
|
||||||
"deleted": [],
|
"deleted": [],
|
||||||
|
"items": {},
|
||||||
|
"deleted": [
|
||||||
|
"shadow-dom/shadow-trees/hosting-multiple-shadow-trees-002.html",
|
||||||
|
"shadow-dom/shadow-trees/hosting-multiple-shadow-trees-006.html",
|
||||||
|
"shadow-dom/shadow-trees/hosting-multiple-shadow-trees-004.html",
|
||||||
|
"shadow-dom/shadow-trees/hosting-multiple-shadow-trees-003.html",
|
||||||
|
"2dcontext/transformations/canvas_transformations_reset_001.htm",
|
||||||
|
"shadow-dom/shadow-trees/hosting-multiple-shadow-trees-005.html"
|
||||||
|
],
|
||||||
|
|
||||||
|
"items": {
|
||||||
|
"testharness": {
|
||||||
|
"dom/nodes/CharacterData-surrogates.html": [
|
||||||
|
{
|
||||||
|
"path": "dom/nodes/CharacterData-surrogates.html",
|
||||||
|
"url": "/dom/nodes/CharacterData-surrogates.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
"items": {},
|
"items": {},
|
||||||
"reftest_nodes": {}
|
"reftest_nodes": {}
|
||||||
},
|
},
|
||||||
|
|
|
@ -737,6 +737,12 @@
|
||||||
"url": "/_mozilla/mozilla/storage.html"
|
"url": "/_mozilla/mozilla/storage.html"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"mozilla/style_no_trailing_space.html": [
|
||||||
|
{
|
||||||
|
"path": "mozilla/style_no_trailing_space.html",
|
||||||
|
"url": "/_mozilla/mozilla/style_no_trailing_space.html"
|
||||||
|
}
|
||||||
|
],
|
||||||
"mozilla/textcontent.html": [
|
"mozilla/textcontent.html": [
|
||||||
{
|
{
|
||||||
"path": "mozilla/textcontent.html",
|
"path": "mozilla/textcontent.html",
|
||||||
|
|
16
tests/wpt/mozilla/tests/mozilla/style_no_trailing_space.html
Normal file
16
tests/wpt/mozilla/tests/mozilla/style_no_trailing_space.html
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title></title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="foo" style="border-width: 1px"></div>
|
||||||
|
<script>
|
||||||
|
test(function() {
|
||||||
|
var border_width = document.getElementById("foo").style["borderWidth"];
|
||||||
|
assert_equals(border_width, "1px 1px 1px 1px");
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Add table
Add a link
Reference in a new issue