Bug 1528029 [wpt PR 15376] - Remove a special handling for XLink namespace in XMLSerializer, a=testonly
authorKent Tamura <tkent@chromium.org>
Tue, 05 Mar 2019 12:13:23 +0000
changeset 464535 9af6b8db40bd
parent 464534 c673e6572713
child 464536 b172a1750aec
push id35717
push useraciure@mozilla.com
push dateSun, 17 Mar 2019 09:45:26 +0000
treeherdermozilla-central@e0861be8d6c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1528029, 15376, 927626, 1469843, 631984
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1528029 [wpt PR 15376] - Remove a special handling for XLink namespace in XMLSerializer, a=testonly Automatic update from web-platform-tests Remove a special handling for XLink namespace in XMLSerializer The new behavior matches to the standard, Firefox, and Safari. Bug: 927626 Change-Id: Ifc6687992c10fbca13faaaeb4a56e59f5469f594 Reviewed-on: https://chromium-review.googlesource.com/c/1469843 Reviewed-by: Yoshifumi Inoue <yosin@chromium.org> Commit-Queue: Kent Tamura <tkent@chromium.org> Cr-Commit-Position: refs/heads/master@{#631984} -- wpt-commits: 6fb30bc55bf721c87d2ff32640deefc1b01061ab wpt-pr: 15376
testing/web-platform/tests/domparsing/XMLSerializer-serializeToString.html
--- a/testing/web-platform/tests/domparsing/XMLSerializer-serializeToString.html
+++ b/testing/web-platform/tests/domparsing/XMLSerializer-serializeToString.html
@@ -147,11 +147,21 @@ test(function() {
   const root = (new DOMParser()).parseFromString(input, 'text/xml').documentElement;
   root.firstChild.setAttributeNS('uri3', 'attr1', 'value1');
   const xmlString = (new XMLSerializer()).serializeToString(root);
   // 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(xmlString, '<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.');
 
+test(function() {
+  const root = (new Document()).createElement('root');
+  root.setAttributeNS('http://www.w3.org/1999/xlink', 'href', 'v');
+  assert_equals(serialize(root), '<root xmlns:ns1="http://www.w3.org/1999/xlink" ns1:href="v"/>');
+
+  const root2 = (new Document()).createElement('root');
+  root2.setAttributeNS('http://www.w3.org/1999/xlink', 'xl:type', 'v');
+  assert_equals(serialize(root2), '<root xmlns:xl="http://www.w3.org/1999/xlink" xl:type="v"/>');
+}, 'Check if no special handling for XLink namespace unlike HTML serializer.');
+
 </script>
  </body>
 </html>