mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
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:
commit
e1ede2074d
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": {}
|
||||||
},
|
},
|
||||||
|
@ -34463,4 +34484,4 @@
|
||||||
"rev": "cf8340b5fae7b820788ffc31f8cc6b6b04978002",
|
"rev": "cf8340b5fae7b820788ffc31f8cc6b6b04978002",
|
||||||
"url_base": "/",
|
"url_base": "/",
|
||||||
"version": 2
|
"version": 2
|
||||||
}
|
}
|
||||||
|
|
|
@ -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",
|
||||||
|
@ -1064,4 +1070,4 @@
|
||||||
"rev": null,
|
"rev": null,
|
||||||
"url_base": "/_mozilla/",
|
"url_base": "/_mozilla/",
|
||||||
"version": 2
|
"version": 2
|
||||||
}
|
}
|
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