Bug 919520 - Update web-platform-tests tests; r=jgraham

--HG--
rename : dom/imptests/failures/html/old-tests/submission/Opera/microdata/Makefile.in => dom/imptests/failures/html/microdata/microdata-dom-api/Makefile.in
rename : dom/imptests/failures/html/old-tests/submission/Opera/microdata/moz.build => dom/imptests/failures/html/microdata/microdata-dom-api/moz.build
rename : dom/imptests/failures/html/old-tests/submission/Opera/microdata/test_001.html.json => dom/imptests/failures/html/microdata/microdata-dom-api/test_001.html.json
rename : dom/imptests/html/html/dom/elements/global-attributes/test_dataset-instanceof.html => dom/imptests/html/html/dom/elements/global-attributes/test_dataset-prototype.html
rename : dom/imptests/html/old-tests/submission/Opera/microdata/Makefile.in => dom/imptests/html/microdata/microdata-dom-api/Makefile.in
rename : dom/imptests/html/old-tests/submission/Opera/microdata/moz.build => dom/imptests/html/microdata/microdata-dom-api/moz.build
rename : dom/imptests/html/old-tests/submission/Opera/microdata/test_001.html => dom/imptests/html/microdata/microdata-dom-api/test_001.html
This commit is contained in:
Ms2ger 2013-09-25 19:25:30 +02:00
parent e724d8a766
commit 374dceb3fb
20 changed files with 267 additions and 39 deletions

View File

@ -1,5 +0,0 @@
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
MOCHITEST_FILES := \
test_document-dir.html.json \
$(NULL)

View File

@ -1,3 +0,0 @@
{
"Setting the idl attribute to the empty sting": true
}

View File

@ -22,7 +22,7 @@ DIRS += [
'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',
]

View File

@ -18,6 +18,6 @@ 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

View File

@ -7,6 +7,7 @@
<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"
@ -24,4 +25,7 @@ test(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>

View File

@ -6,7 +6,7 @@ MOCHITEST_FILES := \
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 \

View File

@ -32,6 +32,8 @@
"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)
{

View File

@ -11,6 +11,16 @@
<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>

View File

@ -1,10 +1,9 @@
<!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>
@ -20,6 +19,8 @@ test(function() {
}, "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>

View File

@ -1,2 +1,3 @@
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT

View File

@ -5,4 +5,5 @@ MOCHITEST_FILES := \
test_form-elements-matches.html \
test_form-elements-nameditem-01.html \
test_form-elements-nameditem-02.html \
test_form-nameditem.html \
$(NULL)

View File

@ -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>

View File

@ -7,27 +7,6 @@ to Google. -->
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
// From WebIDL:
//
// * The value of the Function objects 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.
*/

View File

@ -11,7 +11,6 @@ DIRS += [
'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',
@ -20,7 +19,7 @@ DIRS += [
'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',