Update web-platform-tests to revision 4b25d322ac6ed466f992669e5408b15d37d56436

This commit is contained in:
Ms2ger 2015-10-21 16:41:59 +02:00
parent 6a4ad433a2
commit 92e90e6633
32 changed files with 277 additions and 150 deletions

View file

@ -13705,6 +13705,10 @@
"path": "dom/nodes/Element-getElementsByClassName.html", "path": "dom/nodes/Element-getElementsByClassName.html",
"url": "/dom/nodes/Element-getElementsByClassName.html" "url": "/dom/nodes/Element-getElementsByClassName.html"
}, },
{
"path": "dom/nodes/Element-getElementsByTagName-change-document-HTMLNess.html",
"url": "/dom/nodes/Element-getElementsByTagName-change-document-HTMLNess.html"
},
{ {
"path": "dom/nodes/Element-getElementsByTagName.html", "path": "dom/nodes/Element-getElementsByTagName.html",
"url": "/dom/nodes/Element-getElementsByTagName.html" "url": "/dom/nodes/Element-getElementsByTagName.html"
@ -26129,10 +26133,6 @@
"path": "shadow-dom/untriaged/user-interaction/ranges-and-selections/test-002.html", "path": "shadow-dom/untriaged/user-interaction/ranges-and-selections/test-002.html",
"url": "/shadow-dom/untriaged/user-interaction/ranges-and-selections/test-002.html" "url": "/shadow-dom/untriaged/user-interaction/ranges-and-selections/test-002.html"
}, },
{
"path": "subresource-integrity/subresource-integrity.html",
"url": "/subresource-integrity/subresource-integrity.html"
},
{ {
"path": "touch-events/create-touch-touchlist.html", "path": "touch-events/create-touch-touchlist.html",
"url": "/touch-events/create-touch-touchlist.html" "url": "/touch-events/create-touch-touchlist.html"
@ -35315,7 +35315,7 @@
} }
] ]
}, },
"rev": "4bba821de44da9ed47c2562f995a0da6eecc177b", "rev": "4b25d322ac6ed466f992669e5408b15d37d56436",
"url_base": "/", "url_base": "/",
"version": 2 "version": 2
} }

View file

@ -1,5 +1,11 @@
[send-entity-body-document.htm] [send-entity-body-document.htm]
type: testharness type: testharness
disabled:
if os == "mac": https://github.com/servo/servo/issues/8157
[XMLHttpRequest: send() - Document] [XMLHttpRequest: send() - Document]
expected: FAIL expected: FAIL
[XML document, windows-1252]
expected: FAIL

View file

@ -1,17 +1,5 @@
[Document-createElement-namespace.html] [Document-createElement-namespace.html]
type: testharness type: testharness
[Created element's namespace in created XML document]
expected: FAIL
[Created element's namespace in created XHTML document]
expected: FAIL
[Created element's namespace in created SVG document]
expected: FAIL
[Created element's namespace in created MathML document]
expected: FAIL
[Created element's namespace in empty.xhtml] [Created element's namespace in empty.xhtml]
expected: FAIL expected: FAIL

View file

@ -0,0 +1,6 @@
[Element-getElementsByTagName-change-document-HTMLNess.html]
type: testharness
expected: TIMEOUT
[Untitled]
expected: NOTRUN

View file

@ -0,0 +1,8 @@
[document.title-09.html]
type: testharness
[No title element in SVG document]
expected: FAIL
[Title element not child of SVG root]
expected: FAIL

View file

@ -24,3 +24,9 @@
[Test lookup IMG in collection using [\]] [Test lookup IMG in collection using [\]]
expected: FAIL expected: FAIL
[Test lookup IMG in collection using .]
expected: FAIL
[Test lookup tags in collection using .]
expected: FAIL

View file

@ -1 +1 @@
0008a0d00ae1a58ba888ba9bec181cd6e16d8b94 7574a8ec72e121613cb56f2af746f858c02b7181

View file

@ -0,0 +1,5 @@
def main(request, response):
headers = [("Content-type", "text/html;charset=utf-8")]
content = "<!DOCTYPE html><div></div>"
return headers, content

View file

@ -0,0 +1,5 @@
def main(request, response):
headers = [("Content-type", "text/html;charset=utf-8")]
content = "<img>foo"
return headers, content

View file

@ -20,7 +20,7 @@
request("TEST", "text/plain;charset=UTF-8") request("TEST", "text/plain;charset=UTF-8")
function init(fr) { request(fr.contentDocument, fr.getAttribute("data-t")) } function init(fr) { request(fr.contentDocument, fr.getAttribute("data-t")) }
</script> </script>
<iframe src='data:text/xml;charset=windows-1252,<%FF/>' onload="init(this)" data-t="application/xml;charset=windows-1252"></iframe> <iframe src='data:text/xml;charset=windows-1252,<%FF/>' onload="init(this)" data-t="application/xml;charset=UTF-8"></iframe>
<iframe src='data:text/html;charset=windows-1252,%FF' onload="init(this)" data-t="text/html;charset=windows-1252"></iframe> <iframe src='data:text/html;charset=windows-1252,%FF' onload="init(this)" data-t="text/html;charset=UTF-8"></iframe>
</body> </body>
</html> </html>

View file

@ -16,11 +16,13 @@
{ contentType: 'text/html;charset=UTF-8', responseText : '<body>\uFFFD<\/body>' }, /*invalid character code in document turns into FFFD*/ { contentType: 'text/html;charset=UTF-8', responseText : '<body>\uFFFD<\/body>' }, /*invalid character code in document turns into FFFD*/
{ contentType: 'text/html;charset=UTF-8', responseText : '<body>\u30C6\u30b9\u30c8<\/body>' } /* correctly serialized Shift-JIS */, { contentType: 'text/html;charset=UTF-8', responseText : '<body>\u30C6\u30b9\u30c8<\/body>' } /* correctly serialized Shift-JIS */,
{ contentType: 'text/html;charset=UTF-8', responseText: 'top' }, /* There's some markup included, but it's not really relevant for this test suite, so we do an indexOf() test */ { contentType: 'text/html;charset=UTF-8', responseText: 'top' }, /* There's some markup included, but it's not really relevant for this test suite, so we do an indexOf() test */
{ contentType: 'text/html;charset=UTF-8' } { contentType: 'text/html;charset=UTF-8' },
{ contentType: 'text/html;charset=UTF-8', responseText: '<img>foo' },
{ contentType: 'text/html;charset=UTF-8', responseText: '<!DOCTYPE html><html><head></head><body><div></div></body></html>' }
] ]
function request(input, isHTML, title) { function request(input, number, title) {
test(function() { test(function() {
var client = new XMLHttpRequest() var client = new XMLHttpRequest()
client.open("POST", "resources/content.py?response_charset_label=UTF-8", false) client.open("POST", "resources/content.py?response_charset_label=UTF-8", false)
@ -30,12 +32,14 @@
// The indexOf() assertation will overlook some stuff, i.e. XML prologues that shouldn't be there (looking at you, Presto). // The indexOf() assertation will overlook some stuff, i.e. XML prologues that shouldn't be there (looking at you, Presto).
// However, arguably these things have little to do with the XHR functionality we're testing. // However, arguably these things have little to do with the XHR functionality we're testing.
if(exp.responseText){ // This test does not want to assert anything about what markup a standalone IMG should be wrapped in. Hence the GIF test lacks a responseText expectation. if(exp.responseText){ // This test does not want to assert anything about what markup a standalone IMG should be wrapped in. Hence the GIF test lacks a responseText expectation.
assert_true(client.responseText.indexOf(exp.responseText) != -1); assert_true(client.responseText.indexOf(exp.responseText) != -1,
JSON.stringify(exp.responseText) + " not in " +
JSON.stringify(client.responseText));
} }
assert_equals(client.responseXML, null) assert_equals(client.responseXML, null)
}, title) }, title)
} }
function init(fr, number, title) { request(fr.contentDocument, number) } function init(fr, number, title) { request(fr.contentDocument, number, title) }
</script> </script>
<!-- <!--
This test also tests how documents in various encodings are serialized. This test also tests how documents in various encodings are serialized.
@ -50,6 +54,8 @@
<iframe src='resources/shift-jis-html.py' onload="init(this, 2, 'HTML document, shift-jis')"></iframe> <iframe src='resources/shift-jis-html.py' onload="init(this, 2, 'HTML document, shift-jis')"></iframe>
<iframe src='folder.txt' onload="init(this, 3, 'plain text file')"></iframe> <iframe src='folder.txt' onload="init(this, 3, 'plain text file')"></iframe>
<iframe src='resources/image.gif' onload="init(this, 4, 'image file')"></iframe> <iframe src='resources/image.gif' onload="init(this, 4, 'image file')"></iframe>
<iframe src='resources/img-utf8-html.py' onload="init(this, 5, 'img tag')"></iframe>
<iframe src='resources/empty-div-utf8-html.py' onload="init(this, 6, 'empty div')"></iframe>
</body> </body>
</html> </html>

View file

@ -18,7 +18,13 @@ connect-src 'self'; script-src 'self' 'unsafe-inline';
try { try {
var xhr = new XMLHttpRequest; var xhr = new XMLHttpRequest;
xhr.open("GET", "http://www1.{{host}}:{{ports[http][0]}}/content-security-policy/support/fail.png", true); xhr.open("GET", "http://www1.{{host}}:{{ports[http][0]}}/content-security-policy/support/fail.png", true);
xhr.send();
xhr.onload = function() {
log("Fail"); log("Fail");
}
xhr.onerror = function() {
log("Pass");
}
} catch (e) { } catch (e) {
log("Pass"); log("Pass");
} }

View file

@ -13,22 +13,17 @@
*/ */
/** /**
* Test that an element created using the Document object doc has the namespace * Test that an element created using the Document object doc has the HTML
* that would be expected for the given contentType. * namespace.
*/ */
function testDoc(doc, contentType) { function testDoc(doc, contentType) {
// WebKit doesn't support document.contentType, so they don't get this sanity
// check :(
if (doc.contentType !== undefined) { if (doc.contentType !== undefined) {
// Sanity check
assert_equals(doc.contentType, contentType, assert_equals(doc.contentType, contentType,
"Wrong MIME type -- incorrect server config?"); "Wrong MIME type -- incorrect server config?");
} }
var expectedNamespace = contentType == "text/html" || assert_equals(doc.createElement("x").namespaceURI, "http://www.w3.org/1999/xhtml");
contentType == "application/xhtml+xml"
? "http://www.w3.org/1999/xhtml" : null;
assert_equals(doc.createElement("x").namespaceURI, expectedNamespace);
} }
// First test various objects we create in JS // First test various objects we create in JS

View file

@ -0,0 +1,50 @@
<!doctype html>
<meta charset=utf-8>
<title></title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<iframe src="Element-getElementsByTagName-change-document-HTMLNess-iframe.xml"></iframe>
<script>
onload = function() {
var parent = document.createElement("div");
var child1 = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
child1.textContent = "xhtml:a";
var child2 = document.createElementNS("http://www.w3.org/1999/xhtml", "A");
child2.textContent = "xhtml:A";
var child3 = document.createElementNS("", "a");
child3.textContent = "a";
var child4 = document.createElementNS("", "A");
child4.textContent = "A";
parent.appendChild(child1);
parent.appendChild(child2);
parent.appendChild(child3);
parent.appendChild(child4);
var list = parent.getElementsByTagName("A");
assert_array_equals(list, [child1, child4],
"In an HTML document, should lowercase the tagname passed in for HTML " +
"elements only");
frames[0].document.documentElement.appendChild(parent);
assert_array_equals(list, [child1, child4],
"After changing document, should still be lowercasing for HTML");
assert_array_equals(parent.getElementsByTagName("A"),
[child2, child4],
"New list with same root and argument should not be lowercasing now");
// Now reinsert all those nodes into the parent, to blow away caches.
parent.appendChild(child1);
parent.appendChild(child2);
parent.appendChild(child3);
parent.appendChild(child4);
assert_array_equals(list, [child1, child4],
"After blowing away caches, should still have the same list");
assert_array_equals(parent.getElementsByTagName("A"),
[child2, child4],
"New list with same root and argument should still not be lowercasing");
done();
}
</script>

View file

@ -23,43 +23,40 @@ function isDefaultNamespace(node, namespace, expected, name) {
var frag = document.createDocumentFragment(); var frag = document.createDocumentFragment();
lookupNamespaceURI(frag, null, null, 'DocumentFragment should have null namespace'); lookupNamespaceURI(frag, null, null, 'DocumentFragment should have null namespace, prefix null');
lookupNamespaceURI(frag, '', null, 'DocumentFragment should have null namespace'); lookupNamespaceURI(frag, '', null, 'DocumentFragment should have null namespace, prefix ""');
lookupNamespaceURI(frag, 'foo', null, 'DocumentFragment should have null namespace'); lookupNamespaceURI(frag, 'foo', null, 'DocumentFragment should have null namespace, prefix "foo"');
lookupNamespaceURI(frag, 'xmlns', null, 'DocumentFragment should have null namespace'); lookupNamespaceURI(frag, 'xmlns', null, 'DocumentFragment should have null namespace, prefix "xmlns"');
isDefaultNamespace(frag, null, true, 'DocumentFragment is in default namespace'); isDefaultNamespace(frag, null, true, 'DocumentFragment is in default namespace, prefix null');
isDefaultNamespace(frag, '', true, 'DocumentFragment is in default namespace'); isDefaultNamespace(frag, '', true, 'DocumentFragment is in default namespace, prefix ""');
isDefaultNamespace(frag, 'foo', false, 'DocumentFragment is in default namespace'); isDefaultNamespace(frag, 'foo', false, 'DocumentFragment is in default namespace, prefix "foo"');
isDefaultNamespace(frag, 'xmlns', false, 'DocumentFragment is in default namespace'); isDefaultNamespace(frag, 'xmlns', false, 'DocumentFragment is in default namespace, prefix "xmlns"');
var fooElem = document.createElementNS('fooNamespace', 'prefix:elem'); var fooElem = document.createElementNS('fooNamespace', 'prefix:elem');
fooElem.setAttribute('bar', 'value'); fooElem.setAttribute('bar', 'value');
lookupNamespaceURI(fooElem, null, null, 'Element should have null namespace'); lookupNamespaceURI(fooElem, null, null, 'Element should have null namespace, prefix null');
lookupNamespaceURI(fooElem, '', null, 'Element should have null namespace'); lookupNamespaceURI(fooElem, '', null, 'Element should have null namespace, prefix ""');
lookupNamespaceURI(fooElem, 'fooNamespace', null, 'Element should not have namespace matching prefix with namespaceURI value'); lookupNamespaceURI(fooElem, 'fooNamespace', null, 'Element should not have namespace matching prefix with namespaceURI value');
lookupNamespaceURI(fooElem, 'xmlns', null, 'Element should not have XMLNS namespace'); lookupNamespaceURI(fooElem, 'xmlns', null, 'Element should not have XMLNS namespace');
lookupNamespaceURI(fooElem, 'prefix', 'fooNamespace', 'Element has namespace URI matching prefix'); lookupNamespaceURI(fooElem, 'prefix', 'fooNamespace', 'Element has namespace URI matching prefix');
isDefaultNamespace(fooElem, null, true, 'Empty namespace is not default'); isDefaultNamespace(fooElem, null, true, 'Empty namespace is not default, prefix null');
isDefaultNamespace(fooElem, '', true, 'Empty namespace is not default'); isDefaultNamespace(fooElem, '', true, 'Empty namespace is not default, prefix ""');
isDefaultNamespace(fooElem, 'fooNamespace', false, 'fooNamespace is not default'); isDefaultNamespace(fooElem, 'fooNamespace', false, 'fooNamespace is not default');
isDefaultNamespace(fooElem, 'http://www.w3.org/2000/xmlns/', false, 'xmlns namespace is not default'); isDefaultNamespace(fooElem, 'http://www.w3.org/2000/xmlns/', false, 'xmlns namespace is not default');
fooElem.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:bar', 'barURI'); fooElem.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:bar', 'barURI');
fooElem.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns', 'bazURI'); fooElem.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns', 'bazURI');
lookupNamespaceURI(fooElem, null, 'bazURI', 'Element should have baz namespace'); lookupNamespaceURI(fooElem, null, 'bazURI', 'Element should have baz namespace, prefix null');
lookupNamespaceURI(fooElem, '', 'bazURI', 'Element should have baz namespace'); lookupNamespaceURI(fooElem, '', 'bazURI', 'Element should have baz namespace, prefix ""');
lookupNamespaceURI(fooElem, 'prefix', 'fooNamespace', 'Element has namespace URI matching prefix');
lookupNamespaceURI(fooElem, 'xmlns', null, 'Element does not has namespace with xlmns prefix'); lookupNamespaceURI(fooElem, 'xmlns', null, 'Element does not has namespace with xlmns prefix');
lookupNamespaceURI(fooElem, 'bar', 'barURI', 'Element has bar namespace'); lookupNamespaceURI(fooElem, 'bar', 'barURI', 'Element has bar namespace');
isDefaultNamespace(fooElem, null, false, 'Empty namespace is not default'); isDefaultNamespace(fooElem, null, false, 'Empty namespace is not default on fooElem, prefix null');
isDefaultNamespace(fooElem, '', false, 'Empty namespace is not default'); isDefaultNamespace(fooElem, '', false, 'Empty namespace is not default on fooElem, prefix ""');
isDefaultNamespace(fooElem, 'fooNamespace', false, 'fooNamespace is not default');
isDefaultNamespace(fooElem, 'http://www.w3.org/2000/xmlns/', false, 'xmlns namespace is not default');
isDefaultNamespace(fooElem, 'barURI', false, 'bar namespace is not default'); isDefaultNamespace(fooElem, 'barURI', false, 'bar namespace is not default');
isDefaultNamespace(fooElem, 'bazURI', true, 'baz namespace is default'); isDefaultNamespace(fooElem, 'bazURI', true, 'baz namespace is default');
@ -71,8 +68,8 @@ lookupNamespaceURI(comment, '', 'bazURI', 'Comment should inherit baz namespace
lookupNamespaceURI(comment, 'prefix', 'fooNamespace', 'Comment should inherit namespace URI matching prefix'); lookupNamespaceURI(comment, 'prefix', 'fooNamespace', 'Comment should inherit namespace URI matching prefix');
lookupNamespaceURI(comment, 'bar', 'barURI', 'Comment should inherit bar namespace'); lookupNamespaceURI(comment, 'bar', 'barURI', 'Comment should inherit bar namespace');
isDefaultNamespace(comment, null, false, 'For comment, empty namespace is not default'); isDefaultNamespace(comment, null, false, 'For comment, empty namespace is not default, prefix null');
isDefaultNamespace(comment, '', false, 'For comment, empty namespace is not default'); isDefaultNamespace(comment, '', false, 'For comment, empty namespace is not default, prefix ""');
isDefaultNamespace(comment, 'fooNamespace', false, 'For comment, fooNamespace is not default'); isDefaultNamespace(comment, 'fooNamespace', false, 'For comment, fooNamespace is not default');
isDefaultNamespace(comment, 'http://www.w3.org/2000/xmlns/', false, 'For comment, xmlns namespace is not default'); isDefaultNamespace(comment, 'http://www.w3.org/2000/xmlns/', false, 'For comment, xmlns namespace is not default');
isDefaultNamespace(comment, 'barURI', false, 'For comment, inherited bar namespace is not default'); isDefaultNamespace(comment, 'barURI', false, 'For comment, inherited bar namespace is not default');
@ -86,8 +83,8 @@ lookupNamespaceURI(fooChild, '', 'childNamespace', 'Child element should have nu
lookupNamespaceURI(fooChild, 'xmlns', null, 'Child element should not have XMLNS namespace'); lookupNamespaceURI(fooChild, 'xmlns', null, 'Child element should not have XMLNS namespace');
lookupNamespaceURI(fooChild, 'prefix', 'fooNamespace', 'Child element has namespace URI matching prefix'); lookupNamespaceURI(fooChild, 'prefix', 'fooNamespace', 'Child element has namespace URI matching prefix');
isDefaultNamespace(fooChild, null, false, 'Empty namespace is not default for child'); isDefaultNamespace(fooChild, null, false, 'Empty namespace is not default for child, prefix null');
isDefaultNamespace(fooChild, '', false, 'Empty namespace is not default for child'); isDefaultNamespace(fooChild, '', false, 'Empty namespace is not default for child, prefix ""');
isDefaultNamespace(fooChild, 'fooNamespace', false, 'fooNamespace is not default for child'); isDefaultNamespace(fooChild, 'fooNamespace', false, 'fooNamespace is not default for child');
isDefaultNamespace(fooChild, 'http://www.w3.org/2000/xmlns/', false, 'xmlns namespace is not default for child'); isDefaultNamespace(fooChild, 'http://www.w3.org/2000/xmlns/', false, 'xmlns namespace is not default for child');
isDefaultNamespace(fooChild, 'barURI', false, 'bar namespace is not default for child'); isDefaultNamespace(fooChild, 'barURI', false, 'bar namespace is not default for child');
@ -97,13 +94,13 @@ isDefaultNamespace(fooChild, 'childNamespace', true, 'childNamespace is default
document.documentElement.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:bar', 'barURI'); document.documentElement.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:bar', 'barURI');
document.documentElement.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns', 'bazURI'); document.documentElement.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns', 'bazURI');
lookupNamespaceURI(document, null, 'http://www.w3.org/1999/xhtml', 'Document should have xhtml namespace'); lookupNamespaceURI(document, null, 'http://www.w3.org/1999/xhtml', 'Document should have xhtml namespace, prefix null');
lookupNamespaceURI(document, '', 'http://www.w3.org/1999/xhtml', 'Document should have xhtml namespace'); lookupNamespaceURI(document, '', 'http://www.w3.org/1999/xhtml', 'Document should have xhtml namespace, prefix ""');
lookupNamespaceURI(document, 'prefix', null, 'Document has no namespace URI matching prefix'); lookupNamespaceURI(document, 'prefix', null, 'Document has no namespace URI matching prefix');
lookupNamespaceURI(document, 'bar', 'barURI', 'Document has bar namespace'); lookupNamespaceURI(document, 'bar', 'barURI', 'Document has bar namespace');
isDefaultNamespace(document, null, false, 'For document, Empty namespace is not default'); isDefaultNamespace(document, null, false, 'For document, empty namespace is not default, prefix null');
isDefaultNamespace(document, '', false, 'For document, Empty namespace is not default'); isDefaultNamespace(document, '', false, 'For document, empty namespace is not default, prefix ""');
isDefaultNamespace(document, 'fooNamespace', false, 'For document, fooNamespace is not default'); isDefaultNamespace(document, 'fooNamespace', false, 'For document, fooNamespace is not default');
isDefaultNamespace(document, 'http://www.w3.org/2000/xmlns/', false, 'For document, xmlns namespace is not default'); isDefaultNamespace(document, 'http://www.w3.org/2000/xmlns/', false, 'For document, xmlns namespace is not default');
isDefaultNamespace(document, 'barURI', false, 'For document, bar namespace is not default'); isDefaultNamespace(document, 'barURI', false, 'For document, bar namespace is not default');

View file

@ -6,11 +6,13 @@
</head> </head>
<body> <body>
<div id="log"/> <div id="log"/>
<div id="tests">
<x class="a"/> <x class="a"/>
<g:x class="a"/> <g:x class="a"/>
</div>
<script>test(function() { <script>test(function() {
assert_array_equals(document.getElementsByClassName("a"), assert_array_equals(document.getElementsByClassName("a"),
document.getElementsByTagName("x")); document.getElementById("tests").children);
}) })
</script> </script>
</body> </body>

View file

@ -6,16 +6,18 @@
</head> </head>
<body> <body>
<div id="log" /> <div id="log" />
<div id="tests">
<x class="a"/> <x class="a"/>
<g:x class="a"/> <g:x class="a"/>
<x t:class="a" h:class="a" g:class="a"/> <x t:class="a" h:class="a" g:class="a"/>
<g:x t:class="a" h:class="a" g:class="a"/> <g:x t:class="a" h:class="a" g:class="a"/>
<t:x class="a" t:class="a" h:class="a" g:class="a"/> <t:x class="a" t:class="a" h:class="a" g:class="a"/>
</div>
<script> <script>
test(function() { test(function() {
var collection = document.getElementsByClassName("a"); var collection = document.getElementsByClassName("a");
var test = document.getElementsByTagName("x"); var test = document.getElementById("tests").children;
assert_array_equals(collection, [test[0], test[1]]); assert_array_equals(collection, [test[0], test[1], test[4]]);
}) })
</script> </script>
</body> </body>

View file

@ -266,10 +266,9 @@ var validSelectors = [
{name: "Class selector, matching element with specified class", selector: ".class-p", expect: ["class-p1","class-p2", "class-p3"], level: 1, testType: TEST_QSA | TEST_MATCH}, {name: "Class selector, matching element with specified class", selector: ".class-p", expect: ["class-p1","class-p2", "class-p3"], level: 1, testType: TEST_QSA | TEST_MATCH},
{name: "Class selector, chained, matching only elements with all specified classes", selector: "#class .apple.orange.banana", expect: ["class-div1", "class-div2", "class-p4", "class-div3", "class-p6", "class-div4"], level: 1, testType: TEST_QSA | TEST_MATCH}, {name: "Class selector, chained, matching only elements with all specified classes", selector: "#class .apple.orange.banana", expect: ["class-div1", "class-div2", "class-p4", "class-div3", "class-p6", "class-div4"], level: 1, testType: TEST_QSA | TEST_MATCH},
{name: "Class Selector, chained, with type selector", selector: "div.apple.banana.orange", expect: ["class-div1", "class-div2", "class-div3", "class-div4"], level: 1, testType: TEST_QSA | TEST_MATCH}, {name: "Class Selector, chained, with type selector", selector: "div.apple.banana.orange", expect: ["class-div1", "class-div2", "class-div3", "class-div4"], level: 1, testType: TEST_QSA | TEST_MATCH},
// Caution: If copying and pasting the folowing non-ASCII classes, ensure unicode normalisation is not performed in the process. {name: "Class selector, matching element with class value using non-ASCII characters (1)", selector: ".\u53F0\u5317Ta\u0301ibe\u030Ci", expect: ["class-span1"], level: 1, testType: TEST_QSA | TEST_MATCH},
{name: "Class selector, matching element with class value using non-ASCII characters", selector: ".台北Táiběi", expect: ["class-span1"], level: 1, testType: TEST_QSA | TEST_MATCH}, {name: "Class selector, matching multiple elements with class value using non-ASCII characters", selector: ".\u53F0\u5317", expect: ["class-span1","class-span2"], level: 1, testType: TEST_QSA | TEST_MATCH},
{name: "Class selector, matching multiple elements with class value using non-ASCII characters", selector: ".台北", expect: ["class-span1","class-span2"], level: 1, testType: TEST_QSA | TEST_MATCH}, {name: "Class selector, chained, matching element with multiple class values using non-ASCII characters (1)", selector: ".\u53F0\u5317Ta\u0301ibe\u030Ci.\u53F0\u5317", expect: ["class-span1"], level: 1, testType: TEST_QSA | TEST_MATCH},
{name: "Class selector, chained, matching element with multiple class values using non-ASCII characters", selector: ".台北Táiběi.台北", expect: ["class-span1"], level: 1, testType: TEST_QSA | TEST_MATCH},
{name: "Class selector, matching element with class with escaped character", selector: ".foo\\:bar", expect: ["class-span3"], level: 1, testType: TEST_QSA | TEST_MATCH}, {name: "Class selector, matching element with class with escaped character", selector: ".foo\\:bar", expect: ["class-span3"], level: 1, testType: TEST_QSA | TEST_MATCH},
{name: "Class selector, matching element with class with escaped character", selector: ".test\\.foo\\[5\\]bar", expect: ["class-span4"], level: 1, testType: TEST_QSA | TEST_MATCH}, {name: "Class selector, matching element with class with escaped character", selector: ".test\\.foo\\[5\\]bar", expect: ["class-span4"], level: 1, testType: TEST_QSA | TEST_MATCH},
@ -282,10 +281,9 @@ var validSelectors = [
{name: "ID selector, not matching non-existent ancestor", selector: "#none #id-div1", expect: [] /*no matches*/, level: 1, testType: TEST_QSA}, {name: "ID selector, not matching non-existent ancestor", selector: "#none #id-div1", expect: [] /*no matches*/, level: 1, testType: TEST_QSA},
{name: "ID selector, matching multiple elements with duplicate id", selector: "#id-li-duplicate", expect: ["id-li-duplicate", "id-li-duplicate", "id-li-duplicate", "id-li-duplicate"], level: 1, testType: TEST_QSA | TEST_MATCH}, {name: "ID selector, matching multiple elements with duplicate id", selector: "#id-li-duplicate", expect: ["id-li-duplicate", "id-li-duplicate", "id-li-duplicate", "id-li-duplicate"], level: 1, testType: TEST_QSA | TEST_MATCH},
// Caution: If copying and pasting the folowing non-ASCII IDs, ensure unicode normalisation is not performed in the process. {name: "ID selector, matching id value using non-ASCII characters (1)", selector: "#\u53F0\u5317Ta\u0301ibe\u030Ci", expect: ["\u53F0\u5317Ta\u0301ibe\u030Ci"], level: 1, testType: TEST_QSA | TEST_MATCH},
{name: "ID selector, matching id value using non-ASCII characters", selector: "#台北Táiběi", expect: ["台北Táiběi"], level: 1, testType: TEST_QSA | TEST_MATCH}, {name: "ID selector, matching id value using non-ASCII characters (2)", selector: "#\u53F0\u5317", expect: ["\u53F0\u5317"], level: 1, testType: TEST_QSA | TEST_MATCH},
{name: "ID selector, matching id value using non-ASCII characters", selector: "#台北", expect: ["台北"], level: 1, testType: TEST_QSA | TEST_MATCH}, {name: "ID selector, matching id values using non-ASCII characters (1)", selector: "#\u53F0\u5317Ta\u0301ibe\u030Ci, #\u53F0\u5317", expect: ["\u53F0\u5317Ta\u0301ibe\u030Ci", "\u53F0\u5317"], level: 1, testType: TEST_QSA | TEST_MATCH},
{name: "ID selector, matching id values using non-ASCII characters", selector: "#台北Táiběi, #台北", expect: ["台北Táiběi", "台北"], level: 1, testType: TEST_QSA | TEST_MATCH},
// XXX runMatchesTest() in level2-lib.js can't handle this because obtaining the expected nodes requires escaping characters when generating the selector from 'expect' values // XXX runMatchesTest() in level2-lib.js can't handle this because obtaining the expected nodes requires escaping characters when generating the selector from 'expect' values
{name: "ID selector, matching element with id with escaped character", selector: "#\\#foo\\:bar", expect: ["#foo:bar"], level: 1, testType: TEST_QSA}, {name: "ID selector, matching element with id with escaped character", selector: "#\\#foo\\:bar", expect: ["#foo:bar"], level: 1, testType: TEST_QSA},
@ -631,10 +629,9 @@ var scopedSelectors = [
{name: "Class selector, matching element with specified class (1)", selector: ".class-p", ctx: "", expect: ["class-p1","class-p2", "class-p3"], level: 1, testType: TEST_FIND | TEST_MATCH}, {name: "Class selector, matching element with specified class (1)", selector: ".class-p", ctx: "", expect: ["class-p1","class-p2", "class-p3"], level: 1, testType: TEST_FIND | TEST_MATCH},
{name: "Class selector, chained, matching only elements with all specified classes (1)", selector: "#class .apple.orange.banana", ctx: "", expect: ["class-div1", "class-div2", "class-p4", "class-div3", "class-p6", "class-div4"], level: 1, testType: TEST_FIND | TEST_MATCH}, {name: "Class selector, chained, matching only elements with all specified classes (1)", selector: "#class .apple.orange.banana", ctx: "", expect: ["class-div1", "class-div2", "class-p4", "class-div3", "class-p6", "class-div4"], level: 1, testType: TEST_FIND | TEST_MATCH},
{name: "Class Selector, chained, with type selector (1)", selector: "div.apple.banana.orange", ctx: "", expect: ["class-div1", "class-div2", "class-div3", "class-div4"], level: 1, testType: TEST_FIND | TEST_MATCH}, {name: "Class Selector, chained, with type selector (1)", selector: "div.apple.banana.orange", ctx: "", expect: ["class-div1", "class-div2", "class-div3", "class-div4"], level: 1, testType: TEST_FIND | TEST_MATCH},
// Caution: If copying and pasting the folowing non-ASCII classes, ensure unicode normalisation is not performed in the process. {name: "Class selector, matching element with class value using non-ASCII characters (2)", selector: ".\u53F0\u5317Ta\u0301ibe\u030Ci", ctx: "", expect: ["class-span1"], level: 1, testType: TEST_FIND | TEST_MATCH},
{name: "Class selector, matching element with class value using non-ASCII characters", selector: ".台北Táiběi", ctx: "", expect: ["class-span1"], level: 1, testType: TEST_FIND | TEST_MATCH}, {name: "Class selector, matching multiple elements with class value using non-ASCII characters (1)", selector: ".\u53F0\u5317", ctx: "", expect: ["class-span1","class-span2"], level: 1, testType: TEST_FIND | TEST_MATCH},
{name: "Class selector, matching multiple elements with class value using non-ASCII characters (1)", selector: ".台北", ctx: "", expect: ["class-span1","class-span2"], level: 1, testType: TEST_FIND | TEST_MATCH}, {name: "Class selector, chained, matching element with multiple class values using non-ASCII characters (2)", selector: ".\u53F0\u5317Ta\u0301ibe\u030Ci.\u53F0\u5317", ctx: "", expect: ["class-span1"], level: 1, testType: TEST_FIND | TEST_MATCH},
{name: "Class selector, chained, matching element with multiple class values using non-ASCII characters", selector: ".台北Táiběi.台北", ctx: "", expect: ["class-span1"], level: 1, testType: TEST_FIND | TEST_MATCH},
{name: "Class selector, matching element with class with escaped character (1)", selector: ".foo\\:bar", ctx: "", expect: ["class-span3"], level: 1, testType: TEST_FIND | TEST_MATCH}, {name: "Class selector, matching element with class with escaped character (1)", selector: ".foo\\:bar", ctx: "", expect: ["class-span3"], level: 1, testType: TEST_FIND | TEST_MATCH},
{name: "Class selector, matching element with class with escaped character (1)", selector: ".test\\.foo\\[5\\]bar", ctx: "", expect: ["class-span4"], level: 1, testType: TEST_FIND | TEST_MATCH}, {name: "Class selector, matching element with class with escaped character (1)", selector: ".test\\.foo\\[5\\]bar", ctx: "", expect: ["class-span4"], level: 1, testType: TEST_FIND | TEST_MATCH},
@ -647,10 +644,9 @@ var scopedSelectors = [
{name: "ID selector, not matching non-existent ancestor", selector: "#none #id-div1", ctx: "", expect: [] /*no matches*/, level: 1, testType: TEST_FIND}, {name: "ID selector, not matching non-existent ancestor", selector: "#none #id-div1", ctx: "", expect: [] /*no matches*/, level: 1, testType: TEST_FIND},
{name: "ID selector, matching multiple elements with duplicate id (1)", selector: "#id-li-duplicate", ctx: "", expect: ["id-li-duplicate", "id-li-duplicate", "id-li-duplicate", "id-li-duplicate"], level: 1, testType: TEST_FIND | TEST_MATCH}, {name: "ID selector, matching multiple elements with duplicate id (1)", selector: "#id-li-duplicate", ctx: "", expect: ["id-li-duplicate", "id-li-duplicate", "id-li-duplicate", "id-li-duplicate"], level: 1, testType: TEST_FIND | TEST_MATCH},
// Caution: If copying and pasting the folowing non-ASCII IDs, ensure unicode normalisation is not performed in the process. {name: "ID selector, matching id value using non-ASCII characters (3)", selector: "#\u53F0\u5317Ta\u0301ibe\u030Ci", ctx: "", expect: ["\u53F0\u5317Ta\u0301ibe\u030Ci"], level: 1, testType: TEST_FIND | TEST_MATCH},
{name: "ID selector, matching id value using non-ASCII characters", selector: "#台北Táiběi", ctx: "", expect: ["台北Táiběi"], level: 1, testType: TEST_FIND | TEST_MATCH}, {name: "ID selector, matching id value using non-ASCII characters (4)", selector: "#\u53F0\u5317", ctx: "", expect: ["\u53F0\u5317"], level: 1, testType: TEST_FIND | TEST_MATCH},
{name: "ID selector, matching id value using non-ASCII characters (1)", selector: "#台北", ctx: "", expect: ["台北"], level: 1, testType: TEST_FIND | TEST_MATCH}, {name: "ID selector, matching id values using non-ASCII characters (2)", selector: "#\u53F0\u5317Ta\u0301ibe\u030Ci, #\u53F0\u5317", ctx: "", expect: ["\u53F0\u5317Ta\u0301ibe\u030Ci", "\u53F0\u5317"], level: 1, testType: TEST_FIND | TEST_MATCH},
{name: "ID selector, matching id values using non-ASCII characters", selector: "#台北Táiběi, #台北", ctx: "", expect: ["台北Táiběi", "台北"], level: 1, testType: TEST_FIND | TEST_MATCH},
// XXX runMatchesTest() in level2-lib.js can't handle this because obtaining the expected nodes requires escaping characters when generating the selector from 'expect' values // XXX runMatchesTest() in level2-lib.js can't handle this because obtaining the expected nodes requires escaping characters when generating the selector from 'expect' values
{name: "ID selector, matching element with id with escaped character", selector: "#\\#foo\\:bar", ctx: "", expect: ["#foo:bar"], level: 1, testType: TEST_FIND}, {name: "ID selector, matching element with id with escaped character", selector: "#\\#foo\\:bar", ctx: "", expect: ["#foo:bar"], level: 1, testType: TEST_FIND},

View file

@ -6,10 +6,11 @@
<script> <script>
var iframe; var iframe;
var t = async_test(); var t = async_test();
onload = setTimeout(function() { onload = function() {
setTimeout(function() {
var iframe = document.getElementsByTagName("iframe")[0]; var iframe = document.getElementsByTagName("iframe")[0];
iframe.src="about:blank"; iframe.src="about:blank";
setTimeout(t.step_func(function() {assert_unreached();}), 1000)
}, 100) }, 100)
};
</script> </script>
<iframe src="008-1.html"></iframe> <iframe src="008-1.html"></iframe>

View file

@ -6,10 +6,11 @@
<script> <script>
var iframe; var iframe;
var t = async_test(); var t = async_test();
onload = setTimeout(function() { onload = function() {
setTimeout(function() {
var iframe = document.getElementsByTagName("iframe")[0]; var iframe = document.getElementsByTagName("iframe")[0];
iframe.src="about:blank"; iframe.src="about:blank";
setTimeout(t.step_func(function() {assert_unreached();}), 1000)
}, 100) }, 100)
}
</script> </script>
<iframe src="009-1.html"></iframe> <iframe src="009-1.html"></iframe>

View file

@ -7,23 +7,24 @@
var t = async_test(); var t = async_test();
started = false; started = false;
pages = [] pages = []
timer = null;
start_test_wait = t.step_func( start_test_wait = t.step_func(
function() { function() {
clearTimeout(timer); check_result = t.step_func(
timer = setTimeout(t.step_func(
function() { function() {
try { if (pages.length < 4) {
setTimeout(check_result, 500);
return
}
//The pass condition here is based on the idea that the spec is wrong and browsers are right //The pass condition here is based on the idea that the spec is wrong and browsers are right
assert_array_equals(pages, [2, 3, 2, 3], "Pages opened durning history navigation"); assert_array_equals(pages, [2, 3, 2, 3], "Pages opened during history navigation");
t.done(); t.done();
} finally {
// win.close();
} }
} )
), 500); setTimeout(check_result, 500);
} }
); );
t.step(function() {win = window.open("history_entry.html?urls=traverse_the_history_write_after_load_1-1.html"); t.step(function() {
win = window.open("history_entry.html?urls=traverse_the_history_write_after_load_1-1.html");
t.add_cleanup(function() {win.close()});
}); });
</script> </script>

View file

@ -7,23 +7,22 @@
var t = async_test(); var t = async_test();
started = false; started = false;
pages = [] pages = []
timer = null;
start_test_wait = t.step_func( start_test_wait = t.step_func(
function() { function() {
clearTimeout(timer); var check_result = t.step_func(function() {
timer = setTimeout(t.step_func( if (pages.length < 5) {
function() { setTimeout(check_result, 500);
try { return
}
//The pass condition here is based on the idea that the spec is wrong and browsers are right //The pass condition here is based on the idea that the spec is wrong and browsers are right
assert_array_equals(pages, [3, 4, 2, 3, 4], "Pages opened durning history navigation"); assert_array_equals(pages, [3, 4, 2, 3, 4], "Pages opened during history navigation");
t.done(); t.done();
} finally { });
win.close(); setTimeout(check_result, 500);
}
}
), 500);
} }
); );
t.step(function() {win = window.open("history_entry.html?urls=history_forward-1.html,traverse_the_history_write_onload_2-1.html"); t.step(function() {
}); win = window.open("history_entry.html?urls=history_forward-1.html,traverse_the_history_write_onload_2-1.html");
t.add_cleanup(function() {win.close()});
});
</script> </script>

View file

@ -5,21 +5,25 @@
<div id="log"></div> <div id="log"></div>
<script> <script>
var SVG_NAMESPACE = "http://www.w3.org/2000/svg"; var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
function newSVGDocument() { function newSVGDocument() {
return document.implementation.createDocument(SVG_NAMESPACE, "svg", null); return document.implementation.createDocument(SVG_NAMESPACE, "svg", null);
} }
function assertIsSVGTitle(element, expectedText) {
assert_equals(element.namespaceURI, SVG_NAMESPACE);
assert_equals(element.localName, "title");
assert_equals(element.textContent, expectedText);
}
test(function() { test(function() {
var doc = newSVGDocument(); var doc = newSVGDocument();
assert_equals(doc.title, ""); assert_equals(doc.title, "");
var child = doc.createElementNS(SVG_NAMESPACE, "x-child"); var child = doc.createElementNS(SVG_NAMESPACE, "x-child");
doc.documentElement.appendChild(child); doc.documentElement.appendChild(child);
doc.title = "foo"; doc.title = "foo";
var lastChild = doc.documentElement.lastChild; assertIsSVGTitle(doc.documentElement.firstChild, "foo");
assert_equals(lastChild.namespaceURI, SVG_NAMESPACE);
assert_equals(lastChild.localName, "title");
assert_equals(lastChild.textContent, "foo");
assert_equals(doc.title, "foo"); assert_equals(doc.title, "foo");
}, "No title element in SVG document"); }, "No title element in SVG document");
@ -48,13 +52,46 @@ test(function() {
child.appendChild(title); child.appendChild(title);
doc.documentElement.appendChild(child); doc.documentElement.appendChild(child);
assert_equals(doc.title, ""); assert_equals(doc.title, "");
// Now test that on setting, we create a new element and don't change the
// existing one
doc.title = "bar";
assert_equals(title.textContent, "foo");
assertIsSVGTitle(doc.documentElement.firstChild, "bar");
assert_equals(doc.title, "bar");
}, "Title element not child of SVG root"); }, "Title element not child of SVG root");
test(function() { test(function() {
var doc = newSVGDocument(); var doc = newSVGDocument();
var title = doc.createElement("title"); var title = doc.createElementNS(HTML_NAMESPACE, "title");
title.textContent = "foo"; title.textContent = "foo";
doc.documentElement.appendChild(title); doc.documentElement.appendChild(title);
assert_equals(doc.title, ""); assert_equals(doc.title, "");
}, "Title element not in SVG namespace"); }, "Title element not in SVG namespace");
test(function() {
// "SVG" != "svg"
var doc = document.implementation.createDocument(SVG_NAMESPACE, "SVG", null);
// Per spec, this does nothing
doc.title = "foo";
assert_equals(doc.documentElement.childNodes.length, 0);
assert_equals(doc.title, "");
// An SVG title is ignored by .title
doc.documentElement.appendChild(doc.createElementNS(SVG_NAMESPACE, "title"));
doc.documentElement.lastChild.textContent = "foo";
assert_equals(doc.title, "");
// But an HTML title is respected
doc.documentElement.appendChild(doc.createElementNS(HTML_NAMESPACE, "title"));
doc.documentElement.lastChild.textContent = "bar";
assert_equals(doc.title, "bar");
// Even if it's not a child of the root
var div = doc.createElementNS(HTML_NAMESPACE, "div");
div.appendChild(doc.documentElement.lastChild);
doc.documentElement.appendChild(div);
assert_equals(doc.title, "bar");
}, 'Root element not named "svg"');
</script> </script>

View file

@ -9,7 +9,7 @@
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
</head> </head>
<body> <body id="tags">
<img src="../../../../images/green.png" name="picture"> <img src="../../../../images/green.png" name="picture">
<script> <script>
test(function(){ assert_equals(document.all.length,12)}, "Test for HTMLAllCollection size"); test(function(){ assert_equals(document.all.length,12)}, "Test for HTMLAllCollection size");
@ -18,8 +18,6 @@ test(function(){ assert_equals(document.all.item(0).tagName,"HTML")}, "Test look
test(function(){ assert_equals(document.all[0].tagName,"HTML")}, "Test lookup by index using []"); test(function(){ assert_equals(document.all[0].tagName,"HTML")}, "Test lookup by index using []");
test(function(){ assert_equals(document.all.tags("script").length,3)}, "Test for multiple occurence 3 <script> found");
test(function(){ assert_equals(document.all.item("picture").nodeName,"IMG")}, "Test lookup IMG by name"); test(function(){ assert_equals(document.all.item("picture").nodeName,"IMG")}, "Test lookup IMG by name");
test(function(){ assert_equals(document.all.namedItem("picture").nodeName,"IMG")}, "Test lookup IMG by namedItem "); test(function(){ assert_equals(document.all.namedItem("picture").nodeName,"IMG")}, "Test lookup IMG by namedItem ");
@ -27,6 +25,10 @@ test(function(){ assert_equals(document.all.namedItem("picture").nodeName,"IMG")
test(function(){ assert_equals(document.all("picture").nodeName,"IMG")}, "Test lookup IMG in collection using ()"); test(function(){ assert_equals(document.all("picture").nodeName,"IMG")}, "Test lookup IMG in collection using ()");
test(function(){ assert_equals(document.all["picture"].nodeName,"IMG")}, "Test lookup IMG in collection using []"); test(function(){ assert_equals(document.all["picture"].nodeName,"IMG")}, "Test lookup IMG in collection using []");
test(function(){ assert_equals(document.all.picture.nodeName,"IMG")}, "Test lookup IMG in collection using .");
test(function(){ assert_equals(document.all.tags.id,"tags")}, "Test lookup tags in collection using .");
</script> </script>
<div id="log"></div> <div id="log"></div>
</body> </body>

View file

@ -18,8 +18,12 @@
<input type="checkbox" name="cb"> <input type="checkbox" name="cb">
</td> </td>
</tr> </tr>
<tr>
<td>
<button id="btn"></button> <button id="btn"></button>
<button name="btn"></button> <button name="btn"></button>
</td>
</tr>
</table> </table>
</form> </form>
@ -50,8 +54,8 @@ test(function () {
//getter - name //getter - name
test(function () { test(function () {
assert_equals(coll1("r1"), rdo, "HTMLFormControlsCollection(name) should return the 'input' element in radio status."); assert_throws(TypeError(), function() { coll1("r1") });
}, "HTMLFormControlsCollection(name) must return the named item"); }, "HTMLFormControlsCollection is not callable");
test(function () { test(function () {
assert_equals(coll1["r1"], rdo, "HTMLFormControlsCollection[name] should return the 'input' element in radio status."); assert_equals(coll1["r1"], rdo, "HTMLFormControlsCollection[name] should return the 'input' element in radio status.");

View file

@ -108,3 +108,6 @@ W3C-TEST.ORG:subresource-integrity/refresh-header.js.headers
# Lint doesn't know about sub.svg I guess # Lint doesn't know about sub.svg I guess
PARSE-FAILED:content-security-policy/svg/including.sub.svg PARSE-FAILED:content-security-policy/svg/including.sub.svg
#Helper files that aren't valid XML
PARSE-FAILED:dom/nodes/Document-createElement-namespace-tests/empty.xml
PARSE-FAILED:dom/nodes/Document-createElement-namespace-tests/minimal_html.xml

View file

@ -1,2 +1,2 @@
Access-Control-Allow-Origin: {{location[scheme]}}://{{domains[]}}:{{location[port]}} Access-Control-Allow-Origin: {{location[scheme]}}://{{location[hostname]}}:{{ports[http][0]}}
Access-Control-Allow-Credentials: true Access-Control-Allow-Credentials: true

View file

@ -1,2 +1,2 @@
Access-Control-Allow-Origin: {{location[scheme]}}://{{domains[]}}:{{location[port]}} Access-Control-Allow-Origin: {{location[scheme]}}://{{location[hostname]}}:{{ports[http][0]}}
Access-Control-Allow-Credentials: true Access-Control-Allow-Credentials: true

View file

@ -1,8 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<meta charset=utf-8> <meta charset=utf-8>
<title>Subresource Integrity</title> <title>Subresource Integrity</title>
<script src="/resources/testharness.js"></script> <script src="../../../resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="../../../resources/testharnessreport.js"></script>
<div id="log"></div> <div id="log"></div>
@ -10,15 +10,15 @@
<script> <script>
// <script> tests // <script> tests
var xorigin_anon_script = location.protocol var xorigin_anon_script = location.protocol
+ '//www1.' + location.hostname + ':' + location.port + '//' + location.hostname + ':' + {{ports[http][1]}}
+ '/subresource-integrity/crossorigin-anon-script.js'; + '/subresource-integrity/crossorigin-anon-script.js';
var xorigin_creds_script = location.protocol var xorigin_creds_script = location.protocol
+ '//www1.' + location.hostname + ':' + location.port + '//' + location.hostname + ':' + {{ports[http][1]}}
+ '/subresource-integrity/crossorigin-creds-script.js'; + '/subresource-integrity/crossorigin-creds-script.js';
var xorigin_ineligible_script = location.protocol var xorigin_ineligible_script = location.protocol
+ '//www1.' + location.hostname + ':' + location.port + '//' + location.hostname + ':' + {{ports[http][1]}}
+ '/subresource-integrity/crossorigin-ineligible-script.js'; + '/subresource-integrity/crossorigin-ineligible-script.js';
var SRIScriptTest = function(pass, name, src, integrityValue, crossoriginValue) { var SRIScriptTest = function(pass, name, src, integrityValue, crossoriginValue) {
@ -52,15 +52,15 @@
}; };
var xorigin_anon_style = location.protocol var xorigin_anon_style = location.protocol
+ '//www1.' + location.hostname + ':' + location.port + '//' + location.hostname + ':' + {{ports[http][1]}}
+ '/subresource-integrity/crossorigin-anon-style.css'; + '/subresource-integrity/crossorigin-anon-style.css';
var xorigin_creds_style = location.protocol var xorigin_creds_style = location.protocol
+ '//www1.' + location.hostname + ':' + location.port + '//' + location.hostname + ':' + {{ports[http][1]}}
+ '/subresource-integrity/crossorigin-creds-style.css'; + '/subresource-integrity/crossorigin-creds-style.css';
var xorigin_ineligible_style = location.protocol var xorigin_ineligible_style = location.protocol
+ '//www1.' + location.hostname + ':' + location.port + '//' + location.hostname + ':' + {{ports[http][1]}}
+ '/subresource-integrity/crossorigin-ineligible-style.css'; + '/subresource-integrity/crossorigin-ineligible-style.css';
// <link> tests // <link> tests
@ -540,6 +540,6 @@
style_tests.execute(); style_tests.execute();
</script> </script>
<!--TODO check cache-poisoned resources, transfer-encoding, 3xx redirect <!-- TODO check cache-poisoned resources, transfer-encoding, 3xx redirect
to resource with matching hash, and cross-origin leakage test as in sec5.3. to resource with matching hash, and cross-origin leakage test as in sec5.3.
--> -->

View file

@ -134,7 +134,7 @@ class SourceFile(object):
ext = ext[1:] ext = ext[1:]
if ext in ["html", "htm"]: if ext in ["html", "htm"]:
return "html" return "html"
if ext in ["xhtml", "xht"]: if ext in ["xhtml", "xht", "xml"]:
return "xhtml" return "xhtml"
if ext == "svg": if ext == "svg":
return "svg" return "svg"

View file

@ -31,7 +31,7 @@ interface Storage {
readonly attribute unsigned long length; readonly attribute unsigned long length;
DOMString? key(unsigned long index); DOMString? key(unsigned long index);
getter DOMString? getItem(DOMString key); getter DOMString? getItem(DOMString key);
setter creator void setItem(DOMString key, DOMString value); setter void setItem(DOMString key, DOMString value);
deleter void removeItem(DOMString key); deleter void removeItem(DOMString key);
void clear(); void clear();
}; };