Update web-platform-tests to revision d7afcb8708eac08a614d161d5622a48172daf7e3

This commit is contained in:
WPT Sync Bot 2019-05-15 10:40:54 -04:00 committed by Josh Matthews
parent 6f8bb4dd40
commit edff458e23
791 changed files with 17647 additions and 10322 deletions

View file

@ -50,6 +50,7 @@ test(function() {
assert_equals(serialize(root), '<root xmlns="urn:bar"><outer xmlns=""><inner>value1</inner></outer></root>');
}, 'Check if there is no redundant empty namespace declaration.');
// https://github.com/w3c/DOM-Parsing/issues/47
test(function() {
assert_equals(serialize(parse('<root><child xmlns=""/></root>')),
'<root><child/></root>');
@ -97,12 +98,12 @@ test(function() {
'Should choose the nearest prefix');
}, 'Check if an attribute with namespace and no prefix is serialized with the nearest-declared prefix');
// https://github.com/w3c/DOM-Parsing/issues/45
test(function() {
let root = parse('<el1 xmlns:p="u1" xmlns:q="u1"><el2 xmlns:q="u2"/></el1>');
root.firstChild.setAttributeNS('u1', 'name', 'v');
assert_equals(serialize(root),
'<el1 xmlns:p="u1" xmlns:q="u1"><el2 xmlns:q="u2" q:name="v"/></el1>');
// Maybe this is a specification error.
}, 'Check if an attribute with namespace and no prefix is serialized with the nearest-declared prefix even if the prefix is assigned to another namespace.');
test(function() {
@ -117,6 +118,7 @@ test(function() {
'<r xmlns:xx="uri"><b xx:name="value"/></r>');
}, 'Check if the prefix of an attribute is replaced with another existing prefix mapped to the same namespace URI.');
// https://github.com/w3c/DOM-Parsing/issues/29
test(function() {
let root = parse('<r xmlns:xx="uri"></r>');
root.setAttributeNS('uri2', 'p:name', 'value');
@ -183,6 +185,12 @@ test(function() {
assert_equals(serialize(root), '<root xmlns:p="uri2"><p:child xmlns:p="uri1"/></root>');
}, 'Check if start tag serialization applied the original prefix even if it is declared in an ancestor element.');
// https://github.com/w3c/DOM-Parsing/issues/52
test(function() {
assert_equals(serialize(parse('<root xmlns:x="uri1"><table xmlns="uri1"></table></root>')),
'<root xmlns:x="uri1"><x:table xmlns="uri1"/></root>');
}, 'Check if start tag serialization does NOT apply the default namespace if its namespace is declared in an ancestor.');
test(function() {
const root = parse('<root><child1/><child2/></root>');
root.firstChild.setAttributeNS('uri1', 'attr1', 'value1');
@ -191,11 +199,12 @@ test(function() {
assert_equals(serialize(root), '<root><child1 xmlns:ns1="uri1" ns1:attr1="value1" xmlns:ns2="uri2" ns2:attr2="value2"/><child2 xmlns:ns3="uri3" ns3:attr3="value3"/></root>');
}, 'Check if generated prefixes match to "ns${index}".');
// https://github.com/w3c/DOM-Parsing/issues/44
// According to 'DOM Parsing and Serialization' draft as of 2018-12-11,
// 'generate a prefix' result can conflict with an existing xmlns:ns* declaration.
test(function() {
const root = parse('<root xmlns:ns2="uri2"><child xmlns:ns1="uri1"/></root>');
root.firstChild.setAttributeNS('uri3', 'attr1', 'value1');
// According to 'DOM Parsing and Serialization' draft as of 2018-12-11,
// 'generate a prefix' result can conflict with an existing xmlns:ns* declaration.
assert_equals(serialize(root), '<root xmlns:ns2="uri2"><child xmlns:ns1="uri1" xmlns:ns1="uri3" ns1:attr1="value1"/></root>');
}, 'Check if "ns1" is generated even if the element already has xmlns:ns1.');