Bug 1526595 [wpt PR 15260] - XMLSerializer: Fix prefix generation algorithm, a=testonly
☠☠ backed out by 749b314d6c28 ☠ ☠
authorKent Tamura <tkent@chromium.org>
Mon, 18 Feb 2019 19:25:00 +0000
changeset 460266 4cb5caf1eefa17e7ddf2fbe7614e3ed224d730f5
parent 460265 21f3cd50bec56d819a5c0f47de7d4db8cf7ca0dc
child 460267 9bc8a95c51a5ed0cd7fd2a319e5b877176488e5f
push id112074
push userwptsync@mozilla.com
push dateThu, 21 Feb 2019 19:59:15 +0000
treeherdermozilla-inbound@a15983fcecca [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1526595, 15260, 928639, 1454070, 629490
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 1526595 [wpt PR 15260] - XMLSerializer: Fix prefix generation algorithm, a=testonly Automatic update from web-platform-tests XMLSerializer: Fix prefix generation algorithm Fix it in order to match to DOM Parsing and Serialization specification. We should not expose hash values of strings. Bug: 928639 Change-Id: I589572d87715805961f2931c6808c1bd38acade6 Reviewed-on: https://chromium-review.googlesource.com/c/1454070 Reviewed-by: Yoshifumi Inoue <yosin@chromium.org> Commit-Queue: Yoshifumi Inoue <yosin@chromium.org> Auto-Submit: Kent Tamura <tkent@chromium.org> Cr-Commit-Position: refs/heads/master@{#629490} -- wpt-commits: d2c49d8610185244a31e04ef32aae70da0dd35f7 wpt-pr: 15260
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
@@ -50,11 +50,21 @@ test(function() {
   root.setAttribute('attr', '\n');
   assert_in_array(serializer.serializeToString(root), [
     '<root attr="&#xA;"/>', '<root attr="&#10;"/>']);
   root.setAttribute('attr', '\r');
   assert_in_array(serializer.serializeToString(root), [
     '<root attr="&#xD;"/>', '<root attr="&#13;"/>']);
 }, 'check XMLSerializer.serializeToString escapes attribute values for roundtripping');
 
+test(function() {
+  const input = '<root><child1/><child2/></root>';
+  const root = (new DOMParser()).parseFromString(input, 'text/xml').documentElement;
+  root.firstChild.setAttributeNS('uri1', 'attr1', 'value1');
+  root.firstChild.setAttributeNS('uri2', 'attr2', 'value2');
+  root.lastChild.setAttributeNS('uri3', 'attr3', 'value3');
+  const xmlString = (new XMLSerializer()).serializeToString(root);
+  assert_equals(xmlString, '<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}".');
+
 </script>
  </body>
 </html>