mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Update web-platform-tests to revision 5e3ea8f49fee68c327388bfd1dd1375a8ce12a0e.
This commit is contained in:
parent
12195a5c4a
commit
bfb96b9448
1166 changed files with 35123 additions and 900 deletions
|
@ -10,6 +10,14 @@
|
|||
<body onload="on_load()">
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
function assert_resolve_url(doc, base) {
|
||||
var img = doc.createElement("img");
|
||||
img.src = "foo";
|
||||
var actual = img.src;
|
||||
var expected = base + "/foo";
|
||||
assert_equals(actual, expected, "img src should resolve correctly");
|
||||
}
|
||||
|
||||
var t1 = async_test("The document base URL of a document containing one or more base elements with href attributes is the frozen base URL of the first base element in the document that has an href attribute, in tree order.");
|
||||
|
||||
function on_load() {
|
||||
|
@ -17,6 +25,7 @@
|
|||
var base = document.createElement("base");
|
||||
base.setAttribute("href", "/foo/bar");
|
||||
document.head.appendChild(base);
|
||||
assert_resolve_url(document, location.href.replace(location.pathname, "/foo"));
|
||||
assert_equals(document.baseURI, base.href, "The document base URL should be URL of the first base element that has an href attribute.");
|
||||
});
|
||||
t1.done();
|
||||
|
@ -25,6 +34,7 @@
|
|||
async_test(function() {
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.onload = this.step_func_done(function () {
|
||||
assert_resolve_url(iframe.contentDocument, location.href.replace(location.pathname, "/common"));
|
||||
assert_equals(iframe.contentDocument.baseURI, iframe.contentDocument.location.href, "The document base URL should be the document's address.");
|
||||
});
|
||||
iframe.setAttribute("src", "/common/blank.html");
|
||||
|
@ -34,6 +44,7 @@
|
|||
async_test(function () {
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.onload = this.step_func_done(function () {
|
||||
assert_resolve_url(iframe.contentDocument, location.href.replace("/document-base-url.html", ""));
|
||||
assert_equals(iframe.contentDocument.baseURI, document.baseURI, "The document base URL should be the creator document's base URL.");
|
||||
});
|
||||
iframe.setAttribute("src", "about:blank");
|
||||
|
@ -43,6 +54,20 @@
|
|||
async_test(function () {
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.onload = this.step_func_done(function () {
|
||||
var doc = iframe.contentDocument;
|
||||
var base = doc.body.appendChild(document.createElement("base"));
|
||||
base.href = "sub/";
|
||||
assert_resolve_url(doc, location.href.replace("/document-base-url.html", "/sub"));
|
||||
assert_equals(doc.baseURI, document.baseURI);
|
||||
});
|
||||
iframe.setAttribute("src", "about:blank");
|
||||
document.body.appendChild(iframe);
|
||||
}, "about:blank with a base element.");
|
||||
|
||||
async_test(function () {
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.onload = this.step_func_done(function () {
|
||||
assert_resolve_url(iframe.contentDocument, location.href.replace("/document-base-url.html", ""));
|
||||
assert_equals(iframe.contentDocument.baseURI, document.baseURI, "The document base URL should be the containing document's base URL.");
|
||||
});
|
||||
iframe.setAttribute("srcdoc", "<p>foobar</p>");
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: toBlob.jpeg</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
<link rel="stylesheet" href="/common/canvas-tests.css">
|
||||
<body class="show_output">
|
||||
|
||||
<h1>toBlob.jpeg</h1>
|
||||
<p class="desc">toBlob with image/jpeg returns a JPEG Blob</p>
|
||||
|
||||
|
||||
<p class="output">Actual output:</p>
|
||||
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
|
||||
<ul id="d"></ul>
|
||||
<script>
|
||||
var t = async_test("toBlob with image/jpeg returns a JPEG Blob");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
canvas.toBlob(function(data){
|
||||
_assertSame(data.type, "image/jpeg", "data.type", "\"image/jpeg\"");
|
||||
}, 'image/jpeg');
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: toBlob.png</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
<link rel="stylesheet" href="/common/canvas-tests.css">
|
||||
<body class="show_output">
|
||||
|
||||
<h1>toBlob.png</h1>
|
||||
<p class="desc">toBlob with image/png returns a PNG Blob</p>
|
||||
|
||||
|
||||
<p class="output">Actual output:</p>
|
||||
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
|
||||
<ul id="d"></ul>
|
||||
<script>
|
||||
var t = async_test("toBlob with image/png returns a PNG Blob");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
canvas.toBlob(function(data){
|
||||
_assertSame(data.type, "image/png", "data.type", "\"image/png\"");
|
||||
}, 'image/png');
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#parsing-xhtml-documents">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../testcommon.js'></script>
|
||||
<script src='/html/resources/common.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#parsing-xhtml-documents">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../testcommon.js'></script>
|
||||
<script src='/html/resources/common.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#serializing-xhtml-documents">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../testcommon.js'></script>
|
||||
<script src='/html/resources/common.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#node-clone-additions">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../testcommon.js'></script>
|
||||
<script src='/html/resources/common.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#node-clone-additions">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../testcommon.js'></script>
|
||||
<script src='/html/resources/common.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#definitions">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../testcommon.js'></script>
|
||||
<script src='/html/resources/common.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#definitions">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../testcommon.js'></script>
|
||||
<script src='/html/resources/common.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#definitions">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../testcommon.js'></script>
|
||||
<script src='/html/resources/common.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -21,7 +21,6 @@ testInIFrame(null, function(context) {
|
|||
|
||||
var div = doc.createElement('div');
|
||||
div.setAttribute('id', 'div1');
|
||||
div.innerText = 'Some text';
|
||||
|
||||
template.appendChild(div);
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#definitions">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../testcommon.js'></script>
|
||||
<script src='/html/resources/common.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#innerhtml-on-templates">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../testcommon.js'></script>
|
||||
<script src='/html/resources/common.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#serializing-html-templates">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../testcommon.js'></script>
|
||||
<script src='/html/resources/common.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../testcommon.js'></script>
|
||||
<script src='/html/resources/common.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../testcommon.js'></script>
|
||||
<script src='/html/resources/common.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../testcommon.js'></script>
|
||||
<script src='/html/resources/common.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../testcommon.js'></script>
|
||||
<script src='/html/resources/common.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../testcommon.js'></script>
|
||||
<script src='/html/resources/common.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../testcommon.js'></script>
|
||||
<script src='/html/resources/common.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../testcommon.js'></script>
|
||||
<script src='/html/resources/common.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../testcommon.js'></script>
|
||||
<script src='/html/resources/common.js'></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -0,0 +1,94 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>deleteCaption()</title>
|
||||
<link rel="author" title="Ben Boyle" href="mailto:benjamins.boyle@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-table-deletecaption" />
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<table id="one-caption">
|
||||
<caption>Fixture table caption</caption>
|
||||
</table>
|
||||
|
||||
<table id="two-captions">
|
||||
<caption>Fixture table caption</caption>
|
||||
<caption>A second caption element</caption>
|
||||
</table>
|
||||
|
||||
<table id="zero-captions"></table>
|
||||
|
||||
<table id="descendent-caption">
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<caption>Nested caption</caption>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
// The deleteCaption() method must remove the first caption element child of the table element, if any.
|
||||
// https://html.spec.whatwgorg/multipage/tables.html#dom-table-deletecaption
|
||||
test(function() {
|
||||
var table = document.getElementById('one-caption');
|
||||
|
||||
table.deleteCaption();
|
||||
assert_equals(table.getElementsByTagName('caption').length, 0, 'caption was removed');
|
||||
|
||||
}, 'deleteCaption() delete only caption on table');
|
||||
|
||||
test(function() {
|
||||
var table = document.getElementById('one-caption');
|
||||
var result;
|
||||
|
||||
result = table.deleteCaption();
|
||||
// does .deleteCaption() have a return value?
|
||||
assert_equals(result, undefined, '.deleteCaption() returns undefined');
|
||||
}, 'deleteCaption() returns undefined');
|
||||
|
||||
test(function() {
|
||||
var table = document.getElementById('two-captions');
|
||||
|
||||
table.deleteCaption();
|
||||
assert_equals(table.getElementsByTagName('caption').length, 1, '1 caption (of 2) was removed');
|
||||
assert_equals(table.getElementsByTagName('caption')[0].textContent, 'A second caption element', 'The first caption was removed');
|
||||
|
||||
// removing the only caption
|
||||
table.deleteCaption();
|
||||
assert_equals(table.getElementsByTagName('caption').length, 0, 'last caption was removed');
|
||||
}, 'deleteCaption()');
|
||||
|
||||
test(function() {
|
||||
var table = document.getElementById('zero-captions');
|
||||
// removing a caption when none exists
|
||||
table.deleteCaption();
|
||||
|
||||
assert_equals(table.getElementsByTagName('caption').length, 0, 'no exceptions using .deleteCaption() on a table without any captions');
|
||||
|
||||
}, 'deleteCaption() does not throw any exceptions when called on a table without a caption');
|
||||
|
||||
test(function() {
|
||||
var table = document.getElementById( 'descendent-caption' );
|
||||
table.deleteCaption();
|
||||
|
||||
assert_equals(table.getElementsByTagName('caption').length, 1, 'descendent caption was not deleted');
|
||||
}, 'deleteCaption() does not delete captions in descendent tables');
|
||||
|
||||
test(function() {
|
||||
var table = document.getElementById('zero-captions');
|
||||
var caption;
|
||||
|
||||
caption = document.createElementNS('http://www.w3.org/2000/svg', 'caption');
|
||||
table.insertBefore(caption, table.firstChild);
|
||||
assert_equals(table.getElementsByTagName('caption').length, 1, 'SVG:caption is created');
|
||||
|
||||
table.deleteCaption();
|
||||
assert_equals(table.getElementsByTagName('caption').length, 1, 'SVG:caption is not deleted');
|
||||
|
||||
}, 'deleteCaption() handles captions from different namespaces');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#foster-parent-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<script src="/html/resources/common.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#foster-parent-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<script src="/html/resources/common.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<script src="/html/resources/common.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -75,7 +75,7 @@ test(function () {
|
|||
var div = template.content.querySelector('#dv');
|
||||
|
||||
assert_not_equals( div, null, 'Template should contain DIV element');
|
||||
assert_equals(div.innerText, 'Div content', 'Wrong template content inner text');
|
||||
assert_equals(div.textContent, 'Div content', 'Wrong template content inner text');
|
||||
|
||||
}, 'Generating of implied end tags. Test some text and DIV element');
|
||||
|
||||
|
@ -97,13 +97,13 @@ test(function () {
|
|||
|
||||
assert_not_equals(template.content.querySelector('#dv'), null,
|
||||
'Template should contain DIV element');
|
||||
assert_equals(template.content.querySelector('#dv').innerText,
|
||||
assert_equals(template.content.querySelector('#dv').textContent,
|
||||
'Div content', 'Wrong template content inner text');
|
||||
|
||||
}, 'Generating of implied end tags. Test wrong end tag');
|
||||
|
||||
|
||||
testInIFrame('../../resources/template-contents-table-no-end-tag.html', function(context) {
|
||||
testInIFrame('/html/semantics/scripting-1/the-template-element/resources/template-contents-table-no-end-tag.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.body.querySelector('template');
|
||||
|
@ -120,7 +120,7 @@ testInIFrame('../../resources/template-contents-table-no-end-tag.html', function
|
|||
}, 'Generating of implied end tags. Test table elements. Loading of HTML document from a file');
|
||||
|
||||
|
||||
testInIFrame('../../resources/template-contents-div-no-end-tag.html', function(context) {
|
||||
testInIFrame('/html/semantics/scripting-1/the-template-element/resources/template-contents-div-no-end-tag.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.body.querySelector('template');
|
||||
|
@ -129,7 +129,7 @@ testInIFrame('../../resources/template-contents-div-no-end-tag.html', function(c
|
|||
|
||||
var div = template.content.querySelector('div');
|
||||
assert_not_equals(div, null, 'Template should contain div element');
|
||||
assert_equals(div.innerText, 'Hello, template\n ', 'Invalid div contents');
|
||||
assert_equals(div.textContent, 'Hello, template\n ', 'Invalid div contents');
|
||||
|
||||
}, 'Generating of implied end tags. Test div element. Loading of HTML document from a file');
|
||||
</script>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<script src="/html/resources/common.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -117,7 +117,7 @@ test(function() {
|
|||
+ 'template\'s innerHTML');
|
||||
|
||||
|
||||
testInIFrame('../../resources/template-contents-body.html', function(context) {
|
||||
testInIFrame('/html/semantics/scripting-1/the-template-element/resources/template-contents-body.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.body.querySelector('template');
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<script src="/html/resources/common.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -112,7 +112,7 @@ test(function() {
|
|||
+ 'Test FRAMESET tag inside template tag assigned to another template\'s innerHTML');
|
||||
|
||||
|
||||
testInIFrame('../../resources/template-contents-frameset.html', function(context) {
|
||||
testInIFrame('/html/semantics/scripting-1/the-template-element/resources/template-contents-frameset.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.body.querySelector('template');
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<script src="/html/resources/common.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -115,7 +115,7 @@ test(function() {
|
|||
+ 'Test HEAD tag inside template tag assigned to another template\'s innerHTML');
|
||||
|
||||
|
||||
testInIFrame('../../resources/template-contents-head.html', function(context) {
|
||||
testInIFrame('/html/semantics/scripting-1/the-template-element/resources/template-contents-head.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.body.querySelector('template');
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<script src="/html/resources/common.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -144,7 +144,7 @@ test(function() {
|
|||
}, 'Ignore HTML token. Test valid element inside and between HTML and BODY elements');
|
||||
|
||||
|
||||
testInIFrame('../../resources/template-contents-html.html', function(context) {
|
||||
testInIFrame('/html/semantics/scripting-1/the-template-element/resources/template-contents-html.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.body.querySelector('template');
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<script src="/html/resources/common.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<script src="/html/resources/common.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -18,7 +18,7 @@
|
|||
// id attribute should be added to root <html> element
|
||||
// tabindex attribute should not be modified
|
||||
//class attribute should be ignored
|
||||
testInIFrame('../../resources/html-start-tag.html', function(context) {
|
||||
testInIFrame('/html/semantics/scripting-1/the-template-element/resources/html-start-tag.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.body.querySelector('template');
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-body-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<script src="/html/resources/common.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -86,7 +86,7 @@ test(function () {
|
|||
+ 'Test valid <template> element, <title> element and </template> tag after them');
|
||||
|
||||
|
||||
testInIFrame('../../resources/end-template-tag-in-body.html', function(context) {
|
||||
testInIFrame('/html/semantics/scripting-1/the-template-element/resources/end-template-tag-in-body.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
assert_equals(doc.body.querySelector('template'), null,
|
||||
|
|
|
@ -7,14 +7,14 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-head-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<script src="/html/resources/common.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
testInIFrame('../../resources/frameset-end-tag.html', function(context) {
|
||||
testInIFrame('/html/semantics/scripting-1/the-template-element/resources/frameset-end-tag.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var frameset = doc.querySelector('frameset');
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-head-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<script src="/html/resources/common.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -75,7 +75,7 @@ test(function () {
|
|||
var div = template.content.querySelector('#dv');
|
||||
|
||||
assert_not_equals( div, null, 'Template should contain DIV element');
|
||||
assert_equals(div.innerText, 'Div content', 'Wrong template content inner text');
|
||||
assert_equals(div.textContent, 'Div content', 'Wrong template content inner text');
|
||||
|
||||
}, 'Generating of implied end tags. Test some text and DIV element');
|
||||
|
||||
|
@ -97,13 +97,13 @@ test(function () {
|
|||
|
||||
assert_not_equals(template.content.querySelector('#dv'), null,
|
||||
'Template should contain DIV element');
|
||||
assert_equals(template.content.querySelector('#dv').innerText,
|
||||
assert_equals(template.content.querySelector('#dv').textContent,
|
||||
'Div content', 'Wrong template content inner text');
|
||||
|
||||
}, 'Generating of implied end tags. Test wrong end tag');
|
||||
|
||||
|
||||
testInIFrame('../../resources/head-template-contents-table-no-end-tag.html', function(context) {
|
||||
testInIFrame('/html/semantics/scripting-1/the-template-element/resources/head-template-contents-table-no-end-tag.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.head.querySelector('template');
|
||||
|
@ -121,7 +121,7 @@ testInIFrame('../../resources/head-template-contents-table-no-end-tag.html', fun
|
|||
}, 'Generating of implied end tags. Test table elements. Load HTML document from file');
|
||||
|
||||
|
||||
testInIFrame('../../resources/head-template-contents-div-no-end-tag.html', function(context) {
|
||||
testInIFrame('/html/semantics/scripting-1/the-template-element/resources/head-template-contents-div-no-end-tag.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.head.querySelector('template');
|
||||
|
@ -130,7 +130,7 @@ testInIFrame('../../resources/head-template-contents-div-no-end-tag.html', funct
|
|||
|
||||
var div = template.content.querySelector('div');
|
||||
assert_not_equals(div, null, 'Template should contain div element');
|
||||
assert_equals(div.innerText, 'Hello, template\n ', 'Invalid div contents');
|
||||
assert_equals(div.textContent, 'Hello, template\n ', 'Invalid div contents');
|
||||
|
||||
}, 'Generating of implied end tags. Test div element. Load HTML document from file');
|
||||
</script>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-head-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<script src="/html/resources/common.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -86,7 +86,7 @@ test(function () {
|
|||
+ 'Test valid <template> element, <title> element and </template> tag after them');
|
||||
|
||||
|
||||
testInIFrame('../../resources/end-template-tag-in-head.html', function(context) {
|
||||
testInIFrame('/html/semantics/scripting-1/the-template-element/resources/end-template-tag-in-head.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
assert_equals(doc.head.querySelector('template'), null, '</template> must be ignored');
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#in-table-addition">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<script src="/html/resources/common.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#appending-to-a-template">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<script src="/html/resources/common.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -77,7 +77,7 @@ test(function () {
|
|||
|
||||
|
||||
|
||||
testInIFrame('../../resources/template-contents.html', function(context) {
|
||||
testInIFrame('/html/semantics/scripting-1/the-template-element/resources/template-contents.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.querySelector('template');
|
||||
|
@ -91,7 +91,7 @@ testInIFrame('../../resources/template-contents.html', function(context) {
|
|||
+ 'Load HTML document from a file');
|
||||
|
||||
|
||||
testInIFrame('../../resources/template-contents-nested.html', function(context) {
|
||||
testInIFrame('/html/semantics/scripting-1/the-template-element/resources/template-contents-nested.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.querySelector('template');
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#clearing-the-stack">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<script src="/html/resources/common.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#clearing-the-stack">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<script src="/html/resources/common.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#clearing-the-stack">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<script src="/html/resources/common.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#creating-an-element-for-a-token">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../../testcommon.js'></script>
|
||||
<script src="/html/resources/common.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -107,7 +107,7 @@ test(function () {
|
|||
|
||||
|
||||
|
||||
testInIFrame('../../resources/template-contents.html', function(context) {
|
||||
testInIFrame('/html/semantics/scripting-1/the-template-element/resources/template-contents.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.querySelector('template');
|
||||
|
@ -122,7 +122,7 @@ testInIFrame('../../resources/template-contents.html', function(context) {
|
|||
|
||||
|
||||
|
||||
testInIFrame('../../resources/template-contents-nested.html', function(context) {
|
||||
testInIFrame('/html/semantics/scripting-1/the-template-element/resources/template-contents-nested.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template = doc.querySelector('template');
|
||||
|
@ -142,7 +142,7 @@ testInIFrame('../../resources/template-contents-nested.html', function(context)
|
|||
|
||||
|
||||
|
||||
testInIFrame('../../resources/two-templates.html', function(context) {
|
||||
testInIFrame('/html/semantics/scripting-1/the-template-element/resources/two-templates.html', function(context) {
|
||||
var doc = context.iframes[0].contentDocument;
|
||||
|
||||
var template1 = doc.querySelector('#template1');
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>NavigatorLanguage: navigator.language returns the user's preferred language</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/webappapis.html#navigatorlanguage">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<h2>Precondition</h2>
|
||||
<p>The user agent's preferred language is set as English (en).</p>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(navigator.language, "en");
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>NavigatorLanguage: the most preferred language is the one returned by navigator.language</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/webappapis.html#navigatorlanguage">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_true("language" in navigator);
|
||||
assert_true("languages" in navigator);
|
||||
|
||||
assert_equals(navigator.languages[0], navigator.language,
|
||||
"navigator.languages is the most preferred language first");
|
||||
|
||||
});
|
||||
</script>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue