Bug 919520 - Update web-platform-tests tests; r=jgraham
authorMs2ger <ms2ger@gmail.com>
Wed, 25 Sep 2013 19:25:30 +0200
changeset 148684 0d367aa1e6c94c26d47e63dbd988402ae6d4cc9c
parent 148683 2ac30931b19b9caae6706947c6c515885cbd6302
child 148685 dca996cd431e4d27fae71123760744e290dcebdc
push id25352
push userkwierso@gmail.com
push dateThu, 26 Sep 2013 03:27:24 +0000
treeherdermozilla-central@94548c13fd47 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgraham
bugs919520
milestone27.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 919520 - Update web-platform-tests tests; r=jgraham
dom/imptests/failures/html/html/dom/elements/global-attributes/Makefile.in
dom/imptests/failures/html/html/dom/elements/global-attributes/test_document-dir.html.json
dom/imptests/failures/html/microdata/microdata-dom-api/Makefile.in
dom/imptests/failures/html/microdata/microdata-dom-api/moz.build
dom/imptests/failures/html/microdata/microdata-dom-api/test_001.html.json
dom/imptests/failures/html/old-tests/submission/Opera/microdata/Makefile.in
dom/imptests/failures/html/old-tests/submission/Opera/microdata/moz.build
dom/imptests/failures/html/old-tests/submission/Opera/microdata/test_001.html.json
dom/imptests/html.mozbuild
dom/imptests/html.txt
dom/imptests/html/html/dom/documents/dta/test_document.body-setter-01.html
dom/imptests/html/html/dom/elements/global-attributes/Makefile.in
dom/imptests/html/html/dom/elements/global-attributes/test_dataset-get.html
dom/imptests/html/html/dom/elements/global-attributes/test_dataset-instanceof.html
dom/imptests/html/html/dom/elements/global-attributes/test_dataset-prototype.html
dom/imptests/html/html/dom/elements/global-attributes/test_document-dir.html
dom/imptests/html/html/editing/the-hidden-attribute/Makefile.in
dom/imptests/html/html/semantics/forms/the-form-element/Makefile.in
dom/imptests/html/html/semantics/forms/the-form-element/test_form-nameditem.html
dom/imptests/html/html/webappapis/atob/test_base64.html
dom/imptests/html/microdata/microdata-dom-api/Makefile.in
dom/imptests/html/microdata/microdata-dom-api/moz.build
dom/imptests/html/microdata/microdata-dom-api/test_001.html
dom/imptests/html/old-tests/submission/Opera/microdata/Makefile.in
dom/imptests/html/old-tests/submission/Opera/microdata/moz.build
dom/imptests/html/old-tests/submission/Opera/microdata/test_001.html
dom/imptests/moz.build
deleted file mode 100644
--- a/dom/imptests/failures/html/html/dom/elements/global-attributes/Makefile.in
+++ /dev/null
@@ -1,5 +0,0 @@
-# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
-
-MOCHITEST_FILES := \
-  test_document-dir.html.json \
-  $(NULL)
deleted file mode 100644
--- a/dom/imptests/failures/html/html/dom/elements/global-attributes/test_document-dir.html.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-  "Setting the idl attribute to the empty sting": true
-}
rename from dom/imptests/failures/html/old-tests/submission/Opera/microdata/Makefile.in
rename to dom/imptests/failures/html/microdata/microdata-dom-api/Makefile.in
rename from dom/imptests/failures/html/old-tests/submission/Opera/microdata/moz.build
rename to dom/imptests/failures/html/microdata/microdata-dom-api/moz.build
rename from dom/imptests/failures/html/old-tests/submission/Opera/microdata/test_001.html.json
rename to dom/imptests/failures/html/microdata/microdata-dom-api/test_001.html.json
--- a/dom/imptests/html.mozbuild
+++ b/dom/imptests/html.mozbuild
@@ -17,12 +17,12 @@ DIRS += [
     'html/html/semantics/scripting-1/the-script-element',
     'html/html/semantics/tabular-data/the-table-element',
     'html/html/semantics/text-level-semantics/the-time-element',
     'html/html/webappapis/atob',
     'html/html/webappapis/scripting/events',
     'html/html/webappapis/scripting/processing-model-2',
     'html/html/webappapis/timers',
     'html/js/builtins',
-    'html/old-tests/submission/Opera/microdata',
+    'html/microdata/microdata-dom-api',
     'html/typedarrays',
     'html/webgl',
 ]
--- a/dom/imptests/html.txt
+++ b/dom/imptests/html.txt
@@ -13,11 +13,11 @@ html/semantics/forms/the-select-element
 html/semantics/scripting-1/the-script-element
 html/semantics/tabular-data/the-table-element
 html/semantics/text-level-semantics/the-time-element
 html/webappapis/atob
 html/webappapis/scripting/events
 html/webappapis/scripting/processing-model-2
 html/webappapis/timers
 js/builtins
-old-tests/submission/Opera/microdata
+microdata/microdata-dom-api
 typedarrays
 webgl
--- a/dom/imptests/html/html/dom/documents/dta/test_document.body-setter-01.html
+++ b/dom/imptests/html/html/dom/documents/dta/test_document.body-setter-01.html
@@ -2,16 +2,17 @@
 <title>Setting document.body to incorrect values</title>
 <link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
 <link rel="help" href="http://www.whatwg.org/html/#dom-document-body">
 <link rel="help" href="http://dev.w3.org/2006/webapi/WebIDL/#es-interface">
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <div id="log"></div>
 <script>
+var originalBody = document.body;
 test(function() {
   assert_throws(new TypeError(), function() {
     document.body = "text"
   })
 }, "Should throw a TypeError when trying to set document.body to a string.")
 test(function() {
   assert_throws("HierarchyRequestError", function() {
     document.body = document.createElement("div")
@@ -19,9 +20,12 @@ test(function() {
 }, "Should throw a HierarchyRequestError when trying to set document.body to a div element.")
 test(function() {
   var doc = document.implementation.createHTMLDocument("")
   doc.removeChild(doc.documentElement)
   assert_throws("HierarchyRequestError", function() {
     doc.body = document.createElement("body")
   })
 }, "Should throw a HierarchyRequestError when trying to set document.body when there's no root element.")
+test(function() {
+  assert_equals(document.body, originalBody);
+}, "document.body has not changed")
 </script>
--- a/dom/imptests/html/html/dom/elements/global-attributes/Makefile.in
+++ b/dom/imptests/html/html/dom/elements/global-attributes/Makefile.in
@@ -1,14 +1,14 @@
 # THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
 
 MOCHITEST_FILES := \
   test_classlist-nonstring.html \
   test_dataset-delete.html \
   test_dataset-enumeration.html \
   test_dataset-get.html \
   test_dataset.html \
-  test_dataset-instanceof.html \
+  test_dataset-prototype.html \
   test_dataset-set.html \
   test_document-dir.html \
   test_id-attribute.html \
   test_id-name.html \
   $(NULL)
--- a/dom/imptests/html/html/dom/elements/global-attributes/test_dataset-get.html
+++ b/dom/imptests/html/html/dom/elements/global-attributes/test_dataset-get.html
@@ -27,16 +27,18 @@
       test(function() { assert_true(testGet('data---foo', '-Foo')); },
         "Getting element.dataset['-Foo'] should return the value of element.getAttribute('data---foo')'");
       test(function() { assert_true(testGet('data-Foo', 'foo')); },
         "Getting element.dataset['foo'] should return the value of element.getAttribute('data-Foo')'");
       test(function() { assert_true(testGet('data-', '')); },
         "Getting element.dataset[''] should return the value of element.getAttribute('data-')'");
       test(function() { assert_true(testGet('data-\xE0', '\xE0')); },
         "Getting element.dataset['\xE0'] should return the value of element.getAttribute('data-\xE0')'");
+      test(function() { assert_true(testGet('data-to-string', 'toString')); },
+        "Getting element.dataset['toString'] should return the value of element.getAttribute('data-to-string')'");
 
       function matchesNothingInDataset(attr)
       {
         var d = document.createElement("div");
         d.setAttribute(attr, "value");
 
         if (!d.dataset)
           return false;
rename from dom/imptests/html/html/dom/elements/global-attributes/test_dataset-instanceof.html
rename to dom/imptests/html/html/dom/elements/global-attributes/test_dataset-prototype.html
--- a/dom/imptests/html/html/dom/elements/global-attributes/test_dataset-instanceof.html
+++ b/dom/imptests/html/html/dom/elements/global-attributes/test_dataset-prototype.html
@@ -6,11 +6,21 @@
     <script src="/resources/testharnessreport.js"></script>
   </head>
   <body>
     <h1>Dataset - element.dataset is an instance of DOMStringMap</h1>
     <div id="log"></div>
     <script>
       test(function() { assert_true(document.createElement("div").dataset instanceof window.DOMStringMap); },
         "An elements dataset property is an instance of a DOMStringMap");
+      test(function() {
+        var dataset = document.createElement("div").dataset;
+        assert_true("toString" in dataset, '"toString" in dataset');
+        assert_equals(dataset.toString, Object.prototype.toString);
+        assert_false("expando" in dataset, '"expando" in dataset');
+        assert_equals(dataset.expando, undefined);
+        Object.prototype.expando = 42;
+        assert_true("expando" in dataset, '"expando" in dataset');
+        assert_equals(dataset.expando, 42);
+      }, "Properties on Object.prototype should shine through.");
     </script>
   </body>
 </html>
--- a/dom/imptests/html/html/dom/elements/global-attributes/test_document-dir.html
+++ b/dom/imptests/html/html/dom/elements/global-attributes/test_document-dir.html
@@ -1,25 +1,26 @@
 <!DOCTYPE html>
 <html dir="LTR">
 <title>document.dir</title>
-<link rel="help" href="http://www.whatwg.org/html5/#dom-document-dir">
-<link rel="help" href="http://www.whatwg.org/html5/#reflect">
+<link rel="help" href="http://www.whatwg.org/html/#dom-document-dir">
+<link rel="help" href="http://www.whatwg.org/html/#reflect">
 <link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
-<link rel="stylesheet" href="/resources/testharness.css">
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <div id="log"></div>
 <script>
 test(function() {
   assert_equals(document.dir, "ltr");
   assert_equals(document.documentElement.getAttribute("dir"), "LTR");
 }, "Markup attribute")
 test(function() {
   document.dir = "x-garbage";
   assert_equals(document.dir, "");
   assert_equals(document.documentElement.getAttribute("dir"), "x-garbage");
 }, "Setting the idl attribute to a garbage value")
 test(function() {
   document.dir = "";
-  assert_equals(document.documentElement.hasAttribute("dir"), false, "Attribute should be gone");
-}, "Setting the idl attribute to the empty sting")
+  assert_true(document.documentElement.hasAttribute("dir"), "Attribute should still be around");
+  assert_equals(document.dir, "");
+  assert_equals(document.documentElement.getAttribute("dir"), "");
+}, "Setting the idl attribute to the empty string")
 </script>
--- a/dom/imptests/html/html/editing/the-hidden-attribute/Makefile.in
+++ b/dom/imptests/html/html/editing/the-hidden-attribute/Makefile.in
@@ -1,2 +1,3 @@
 # THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
 
+
--- a/dom/imptests/html/html/semantics/forms/the-form-element/Makefile.in
+++ b/dom/imptests/html/html/semantics/forms/the-form-element/Makefile.in
@@ -1,8 +1,9 @@
 # THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
 
 MOCHITEST_FILES := \
   test_form-elements-interfaces-01.html \
   test_form-elements-matches.html \
   test_form-elements-nameditem-01.html \
   test_form-elements-nameditem-02.html \
+  test_form-nameditem.html \
   $(NULL)
new file mode 100644
--- /dev/null
+++ b/dom/imptests/html/html/semantics/forms/the-form-element/test_form-nameditem.html
@@ -0,0 +1,239 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Form named getter</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<!-- XXX Nothing tests id attributes yet. -->
+<!-- XXX Keygen. -->
+<!-- XXX We also need tests for moving inputs and forms in the DOM. -->
+<form>
+<input type=button name=button>
+<input type=radio name=radio value=x>
+<input type=radio name=radio value=y>
+<input type=radio name=radio value=z>
+</form>
+
+<form>
+<button name=l1></button>
+<fieldset name=l2></fieldset>
+<input type=hidden name=l3>
+<input type=text name=l4>
+<input type=search name=l5>
+<input type=tel name=l6>
+<input type=url name=l7>
+<input type=email name=l8>
+<input type=password name=l9>
+<input type=datetime name=l10>
+<input type=date name=l11>
+<input type=month name=l12>
+<input type=week name=l13>
+<input type=time name=l14>
+<input type=datetime-local name=l15>
+<input type=number name=l16>
+<input type=range name=l17>
+<input type=color name=l18>
+<input type=checkbox name=l19>
+<input type=radio name=l20>
+<input type=file name=l21>
+<input type=submit name=l22>
+<input type=image name=l23>
+<input type=reset name=l24>
+<input type=button name=l25>
+<input type=foo name=l26>
+<input name=l27>
+<object name=l28></object>
+<output name=l29></output>
+<select name=l30></select>
+<textarea name=l31></textarea>
+</form>
+
+<form>
+<!-- EventTarget -->
+<input type=radio name=addEventListener>
+<input type=radio name=removeEventListener>
+<input type=radio name=dispatchEvent>
+
+<!-- Node -->
+<input type=radio name=nodeType>
+<input type=radio name=nodeName>
+<input type=radio name=ownerDocument>
+
+<!-- Element -->
+<input type=radio name=namespaceURI>
+<input type=radio name=prefix>
+<input type=radio name=localName>
+
+<!-- HTMLElement -->
+<input type=radio name=title>
+<input type=radio name=lang>
+<input type=radio name=dir>
+
+<!-- HTMLFormElement -->
+<input type=radio name=acceptCharset>
+<input type=radio name=action>
+<input type=radio name=autocomplete>
+<input type=radio name=enctype>
+<input type=radio name=encoding>
+<input type=radio name=method>
+<input type=radio name=name>
+<input type=radio name=noValidate>
+<input type=radio name=target>
+<input type=radio name=elements>
+<input type=radio name=length>
+<input type=radio name=submit>
+<input type=radio name=reset>
+<input type=radio name=checkValidity>
+</form>
+
+<img name=x>
+<form></form><!-- no child nodes -->
+<img name=y>
+<form><!-- a child node --></form>
+<img name=z>
+
+<input form=a name=b>
+<form id=a></form>
+<input form=c name=d>
+<input form=c name=d>
+<form id=c></form>
+<script>
+test(function() {
+  var form = document.getElementsByTagName("form")[0]
+  assert_equals(form.item, undefined)
+  assert_false("item" in form)
+}, "Forms should not have an item method")
+
+test(function() {
+  var form = document.getElementsByTagName("form")[0]
+  assert_equals(form.namedItem, undefined)
+  assert_false("namedItem" in form)
+}, "Forms should not have a namedItem method")
+
+test(function() {
+  var form = document.getElementsByTagName("form")[0]
+  var button = document.getElementsByTagName("input")[0]
+  assert_equals(button.type, "button")
+  assert_equals(form.button, button)
+  assert_equals(form.button.length, undefined)
+}, "Name for a single element should work")
+
+test(function() {
+  var form = document.getElementsByTagName("form")[0]
+  assert_equals(form.radio.item(-1), null)
+  assert_array_equals([0, 1, 2].map(function(i) {
+    return form.radio.item(i).value
+  }), ["x", "y", "z"])
+  assert_equals(form.radio.item(3), null)
+}, "Calling item() on the NodeList returned from the named getter should work")
+
+test(function() {
+  var form = document.getElementsByTagName("form")[0]
+  assert_equals(form.radio.length, 3)
+  assert_equals(form.radio[-1], undefined)
+  assert_array_equals([0, 1, 2].map(function(i) {
+    return form.radio[i].value
+  }), ["x", "y", "z"])
+  assert_equals(form.radio[3], undefined)
+}, "Indexed getter on the NodeList returned from the named getter should work")
+
+test(function() {
+  var form = document.getElementsByTagName("form")[0]
+  var indices = [-1, 0, 1, 2, 3]
+  indices.forEach(function(i) {
+    assert_throws(new TypeError(), function() {
+      form.radio(i)
+    })
+  })
+}, "Invoking a legacycaller on the NodeList returned from the named getter " +
+   "should not work")
+
+test(function() {
+  var form = document.getElementsByTagName("form")[1]
+  for (var i = 1; i <= 31; ++i) {
+    if (i == 23) {
+      // input type=image
+      assert_equals(form["l" + i], undefined)
+    } else {
+      assert_equals(form["l" + i], form.children[i - 1])
+    }
+  }
+}, "All listed elements except input type=image should be present in the form")
+
+test(function() {
+  var names = [
+    // EventTarget
+    "addEventListener", "removeEventListener", "dispatchEvent",
+    // Node
+    "nodeType", "nodeName", "ownerDocument",
+    // Element
+    "namespaceURI", "prefix", "localName",
+    // HTMLElement
+    "title", "lang", "dir",
+    // HTMLFormElement
+    "acceptCharset", "action", "autocomplete", "enctype", "encoding", "method",
+    "name", "noValidate", "target", "elements", "length", "submit", "reset",
+    "checkValidity"
+  ]
+  var form = document.getElementsByTagName("form")[2]
+  names.forEach(function(name, i) {
+    assert_equals(form[name], form.children[i])
+  })
+}, "Named elements should override builtins")
+
+test(function() {
+  var form = document.getElementsByTagName("form")[3]
+  assert_equals(form.x, undefined, "x should not be associated with the form")
+  assert_equals(form.y, undefined, "y should not be associated with the form")
+  assert_equals(form.z, undefined, "z should not be associated with the form")
+  assert_equals(form[0], undefined, "The form should not have supported property indices")
+  assert_equals(form.length, 0)
+}, "Named items outside the form should not be returned (no children)")
+
+test(function() {
+  var form = document.getElementsByTagName("form")[4]
+  assert_equals(form.x, undefined, "x should not be associated with the form")
+  assert_equals(form.y, undefined, "y should not be associated with the form")
+  assert_equals(form.z, undefined, "z should not be associated with the form")
+  assert_equals(form[0], undefined, "The form should not have supported property indices")
+  assert_equals(form.length, 0)
+}, "Named items outside the form should not be returned (one child)")
+
+test(function() {
+  var form = document.getElementsByTagName("form")[5]
+  assert_equals(form.id, "a")
+
+  var input = document.getElementsByName("b")[0]
+  assert_equals(input.localName, "input")
+  assert_equals(input.getAttribute("form"), "a")
+
+  assert_equals(form.b, input);
+}, "The form attribute should be taken into account for named getters (single element)")
+
+test(function() {
+  var form = document.getElementsByTagName("form")[6]
+  assert_equals(form.id, "c")
+
+  var input1 = document.getElementsByName("d")[0]
+  assert_equals(input1.localName, "input")
+  assert_equals(input1.getAttribute("form"), "c")
+
+  var input2 = document.getElementsByName("d")[1]
+  assert_equals(input2.localName, "input")
+  assert_equals(input2.getAttribute("form"), "c")
+
+  assert_true(form.d instanceof NodeList, "form.d should be a NodeList")
+  assert_array_equals(form.d, [input1, input2])
+}, "The form attribute should be taken into account for named getters (multiple elements)")
+
+test(function() {
+  var f = document.body.appendChild(document.createElement("form"))
+  f.id = "f"
+  var g = f.appendChild(document.createElement("form"))
+  g.id = "g"
+  var input = g.appendChild(document.createElement("input"))
+  input.name = "x"
+  assert_equals(f.x, undefined)
+  assert_equals(g.x, input)
+}, "Input should only be a named property on the innermost form that contains it")
+</script>
--- a/dom/imptests/html/html/webappapis/atob/test_base64.html
+++ b/dom/imptests/html/html/webappapis/atob/test_base64.html
@@ -2,37 +2,16 @@
 <!-- Originally developed by Aryeh Gregor, funded by Google.  Copyright belongs
 to Google. -->
 <title>atob()/btoa() tests</title>
 <meta charset=utf-8>
 <div id=log></div>
 <script src=/resources/testharness.js></script>
 <script src=/resources/testharnessreport.js></script>
 <script>
-// From WebIDL:
-//
-// * The value of the Function object’s length property is a Number determined
-//   as follows:
-//
-//   1. Let S be the effective overload set for regular operations (if the
-//      operation is a regular operation) or for static operations (if the
-//      operation is a static operation) with identifier id on interface I and
-//      with argument count 0 (for the ECMAScript language binding).
-//   2. Return the maximum argument list length of the functions in the entries
-//      of S.
-//
-// As far as I understand it, this means the length must be 1 here.
-test(function() {
-	assert_equals(btoa.length, 1);
-}, "btoa.length must equal the maximum number of arguments, namely 1");
-
-test(function() {
-	assert_equals(atob.length, 1);
-}, "atob.length must equal the maximum number of arguments, namely 1");
-
 /**
  * btoa() as defined by the HTML5 spec, which mostly just references RFC4648.
  */
 function mybtoa(s) {
 	// String conversion as required by WebIDL.
 	s = String(s);
 
 	// "The btoa() method must throw an INVALID_CHARACTER_ERR exception if the
rename from dom/imptests/html/old-tests/submission/Opera/microdata/Makefile.in
rename to dom/imptests/html/microdata/microdata-dom-api/Makefile.in
rename from dom/imptests/html/old-tests/submission/Opera/microdata/moz.build
rename to dom/imptests/html/microdata/microdata-dom-api/moz.build
rename from dom/imptests/html/old-tests/submission/Opera/microdata/test_001.html
rename to dom/imptests/html/microdata/microdata-dom-api/test_001.html
--- a/dom/imptests/moz.build
+++ b/dom/imptests/moz.build
@@ -6,26 +6,25 @@
 
 DIRS += [
     'failures/editing/conformancetest',
     'failures/editing/selecttest',
     'failures/html/html/browsers/the-window-object',
     'failures/html/html/browsers/the-window-object/named-access-on-the-window-object',
     'failures/html/html/dom/documents/dta',
     'failures/html/html/dom/documents/dta/doc.gEBN',
-    'failures/html/html/dom/elements/global-attributes',
     'failures/html/html/obsolete/implreq/oeaaa',
     'failures/html/html/semantics/forms/the-form-element',
     'failures/html/html/semantics/forms/the-option-element',
     'failures/html/html/semantics/forms/the-select-element',
     'failures/html/html/semantics/scripting-1/the-script-element',
     'failures/html/html/semantics/tabular-data/the-table-element',
     'failures/html/html/webappapis/atob',
     'failures/html/js/builtins',
-    'failures/html/old-tests/submission/Opera/microdata',
+    'failures/html/microdata/microdata-dom-api',
     'failures/html/typedarrays',
     'failures/webapps/DOMCore/tests/approved',
     'failures/webapps/DOMCore/tests/submissions/Ms2ger',
     'failures/webapps/DOMCore/tests/submissions/Opera',
     'failures/webapps/WebStorage/tests/submissions/Infraware',
     'failures/webapps/WebStorage/tests/submissions/Ms2ger',
     'failures/webapps/XMLHttpRequest/tests/submissions/Ms2ger'
 ]