зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1438833: fix web platform tests for XMLSerializer r=bz
This was a regression introduced by the fix for bug 169521. MozReview-Commit-ID: CaUayY0bnqu --HG-- extra : rebase_source : 71389463ccfe99626d758d4303e61d47bffe3774
This commit is contained in:
Родитель
9e616d15ed
Коммит
a9009a94da
|
@ -42,10 +42,17 @@ test(function() {
|
|||
|
||||
test(function() {
|
||||
var serializer = new XMLSerializer();
|
||||
var root = createXmlDoc().documentElement;
|
||||
root.firstChild.setAttribute('attr1', 'value1\tvalue2\r\n');
|
||||
var xmlString = serializer.serializeToString(root);
|
||||
assert_equals(xmlString, '<root><child1 attr1="value1	value2
">value1</child1></root>');
|
||||
var parser = new DOMParser();
|
||||
var root = parser.parseFromString('<root />', 'text/xml').documentElement;
|
||||
root.setAttribute('attr', '\t');
|
||||
assert_in_array(serializer.serializeToString(root), [
|
||||
'<root attr="	"/>', '<root attr="	"/>']);
|
||||
root.setAttribute('attr', '\n');
|
||||
assert_in_array(serializer.serializeToString(root), [
|
||||
'<root attr="
"/>', '<root attr=" "/>']);
|
||||
root.setAttribute('attr', '\r');
|
||||
assert_in_array(serializer.serializeToString(root), [
|
||||
'<root attr="
"/>', '<root attr=" "/>']);
|
||||
}, 'check XMLSerializer.serializeToString escapes attribute values for roundtripping');
|
||||
|
||||
</script>
|
||||
|
|
Загрузка…
Ссылка в новой задаче