mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update web-platform-tests to revision 4bba821de44da9ed47c2562f995a0da6eecc177b
This commit is contained in:
parent
af637640ae
commit
c8c377df9f
48 changed files with 697 additions and 8688 deletions
File diff suppressed because it is too large
Load diff
|
@ -1,5 +0,0 @@
|
|||
[XMLHttpRequest-withCredentials.html]
|
||||
type: testharness
|
||||
[setting withCredentials when in DONE state (synchronous)]
|
||||
expected: FAIL
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
[XMLHttpRequest-withCredentials.worker]
|
||||
type: testharness
|
||||
[setting withCredentials when in DONE state (synchronous)]
|
||||
expected: FAIL
|
||||
|
|
@ -48,15 +48,9 @@
|
|||
[Resulting cursor position for range 35 [detachedXmlComment, 2, detachedXmlComment, 6\]]
|
||||
expected: FAIL
|
||||
|
||||
[Resulting DOM for range 37 [processingInstruction, 0, processingInstruction, 4\]]
|
||||
expected: FAIL
|
||||
|
||||
[Resulting cursor position for range 37 [processingInstruction, 0, processingInstruction, 4\]]
|
||||
expected: FAIL
|
||||
|
||||
[Returned fragment for range 37 [processingInstruction, 0, processingInstruction, 4\]]
|
||||
expected: FAIL
|
||||
|
||||
[Resulting cursor position for range 38 [paras[1\].firstChild, 0, paras[1\].firstChild, 1\]]
|
||||
expected: FAIL
|
||||
|
||||
|
|
80
tests/wpt/metadata/dom/ranges/Range-insertNode.html.ini
Normal file
80
tests/wpt/metadata/dom/ranges/Range-insertNode.html.ini
Normal file
|
@ -0,0 +1,80 @@
|
|||
[Range-insertNode.html]
|
||||
type: testharness
|
||||
[0,1: resulting DOM for range [paras[0\].firstChild, 0, paras[0\].firstChild, 0\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[0,1: resulting range position for range [paras[0\].firstChild, 0, paras[0\].firstChild, 0\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[1,1: resulting DOM for range [paras[0\].firstChild, 0, paras[0\].firstChild, 1\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[1,1: resulting range position for range [paras[0\].firstChild, 0, paras[0\].firstChild, 1\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[2,1: resulting DOM for range [paras[0\].firstChild, 2, paras[0\].firstChild, 8\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[2,1: resulting range position for range [paras[0\].firstChild, 2, paras[0\].firstChild, 8\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[3,1: resulting DOM for range [paras[0\].firstChild, 2, paras[0\].firstChild, 9\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[3,1: resulting range position for range [paras[0\].firstChild, 2, paras[0\].firstChild, 9\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[4,2: resulting DOM for range [paras[1\].firstChild, 0, paras[1\].firstChild, 0\], node paras[1\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[4,2: resulting range position for range [paras[1\].firstChild, 0, paras[1\].firstChild, 0\], node paras[1\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[5,2: resulting DOM for range [paras[1\].firstChild, 2, paras[1\].firstChild, 9\], node paras[1\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[5,2: resulting range position for range [paras[1\].firstChild, 2, paras[1\].firstChild, 9\], node paras[1\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[6,6: resulting DOM for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0\], node detachedPara1.firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[6,6: resulting range position for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0\], node detachedPara1.firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[7,6: resulting DOM for range [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8\], node detachedPara1.firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[7,6: resulting range position for range [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8\], node detachedPara1.firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[8,4: resulting DOM for range [foreignPara1.firstChild, 0, foreignPara1.firstChild, 0\], node foreignPara1.firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[8,4: resulting range position for range [foreignPara1.firstChild, 0, foreignPara1.firstChild, 0\], node foreignPara1.firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[9,4: resulting DOM for range [foreignPara1.firstChild, 2, foreignPara1.firstChild, 8\], node foreignPara1.firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[9,4: resulting range position for range [foreignPara1.firstChild, 2, foreignPara1.firstChild, 8\], node foreignPara1.firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[18,1: resulting DOM for range [paras[0\].firstChild, 0, paras[1\].firstChild, 0\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[18,1: resulting range position for range [paras[0\].firstChild, 0, paras[1\].firstChild, 0\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[19,1: resulting DOM for range [paras[0\].firstChild, 0, paras[1\].firstChild, 8\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[19,1: resulting range position for range [paras[0\].firstChild, 0, paras[1\].firstChild, 8\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[20,1: resulting DOM for range [paras[0\].firstChild, 3, paras[3\], 1\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[20,1: resulting range position for range [paras[0\].firstChild, 3, paras[3\], 1\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
|
@ -1,98 +1,62 @@
|
|||
[Range-surroundContents.html]
|
||||
type: testharness
|
||||
[37,0: resulting DOM for range [processingInstruction, 0, processingInstruction, 4\], node paras[0\]]
|
||||
[0,1: resulting DOM for range [paras[0\].firstChild, 0, paras[0\].firstChild, 0\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[37,0: resulting range position for range [processingInstruction, 0, processingInstruction, 4\], node paras[0\]]
|
||||
[0,1: resulting range position for range [paras[0\].firstChild, 0, paras[0\].firstChild, 0\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[37,1: resulting DOM for range [processingInstruction, 0, processingInstruction, 4\], node paras[0\].firstChild]
|
||||
[1,1: resulting DOM for range [paras[0\].firstChild, 0, paras[0\].firstChild, 1\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[37,1: resulting range position for range [processingInstruction, 0, processingInstruction, 4\], node paras[0\].firstChild]
|
||||
[1,1: resulting range position for range [paras[0\].firstChild, 0, paras[0\].firstChild, 1\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[37,2: resulting DOM for range [processingInstruction, 0, processingInstruction, 4\], node paras[1\].firstChild]
|
||||
[2,1: resulting DOM for range [paras[0\].firstChild, 2, paras[0\].firstChild, 8\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[37,2: resulting range position for range [processingInstruction, 0, processingInstruction, 4\], node paras[1\].firstChild]
|
||||
[2,1: resulting range position for range [paras[0\].firstChild, 2, paras[0\].firstChild, 8\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[37,3: resulting DOM for range [processingInstruction, 0, processingInstruction, 4\], node foreignPara1]
|
||||
[3,1: resulting DOM for range [paras[0\].firstChild, 2, paras[0\].firstChild, 9\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[37,3: resulting range position for range [processingInstruction, 0, processingInstruction, 4\], node foreignPara1]
|
||||
[3,1: resulting range position for range [paras[0\].firstChild, 2, paras[0\].firstChild, 9\], node paras[0\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[37,4: resulting DOM for range [processingInstruction, 0, processingInstruction, 4\], node foreignPara1.firstChild]
|
||||
[4,2: resulting DOM for range [paras[1\].firstChild, 0, paras[1\].firstChild, 0\], node paras[1\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[37,4: resulting range position for range [processingInstruction, 0, processingInstruction, 4\], node foreignPara1.firstChild]
|
||||
[4,2: resulting range position for range [paras[1\].firstChild, 0, paras[1\].firstChild, 0\], node paras[1\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[37,5: resulting DOM for range [processingInstruction, 0, processingInstruction, 4\], node detachedPara1]
|
||||
[5,2: resulting DOM for range [paras[1\].firstChild, 2, paras[1\].firstChild, 9\], node paras[1\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[37,5: resulting range position for range [processingInstruction, 0, processingInstruction, 4\], node detachedPara1]
|
||||
[5,2: resulting range position for range [paras[1\].firstChild, 2, paras[1\].firstChild, 9\], node paras[1\].firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[37,6: resulting DOM for range [processingInstruction, 0, processingInstruction, 4\], node detachedPara1.firstChild]
|
||||
[6,6: resulting DOM for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0\], node detachedPara1.firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[37,6: resulting range position for range [processingInstruction, 0, processingInstruction, 4\], node detachedPara1.firstChild]
|
||||
[6,6: resulting range position for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0\], node detachedPara1.firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[37,8: resulting DOM for range [processingInstruction, 0, processingInstruction, 4\], node detachedDiv]
|
||||
[7,6: resulting DOM for range [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8\], node detachedPara1.firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[37,8: resulting range position for range [processingInstruction, 0, processingInstruction, 4\], node detachedDiv]
|
||||
[7,6: resulting range position for range [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8\], node detachedPara1.firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[37,10: resulting DOM for range [processingInstruction, 0, processingInstruction, 4\], node foreignPara2]
|
||||
[8,4: resulting DOM for range [foreignPara1.firstChild, 0, foreignPara1.firstChild, 0\], node foreignPara1.firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[37,10: resulting range position for range [processingInstruction, 0, processingInstruction, 4\], node foreignPara2]
|
||||
[8,4: resulting range position for range [foreignPara1.firstChild, 0, foreignPara1.firstChild, 0\], node foreignPara1.firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[37,12: resulting DOM for range [processingInstruction, 0, processingInstruction, 4\], node xmlElement]
|
||||
[9,4: resulting DOM for range [foreignPara1.firstChild, 2, foreignPara1.firstChild, 8\], node foreignPara1.firstChild]
|
||||
expected: FAIL
|
||||
|
||||
[37,12: resulting range position for range [processingInstruction, 0, processingInstruction, 4\], node xmlElement]
|
||||
expected: FAIL
|
||||
|
||||
[37,13: resulting DOM for range [processingInstruction, 0, processingInstruction, 4\], node detachedTextNode]
|
||||
expected: FAIL
|
||||
|
||||
[37,13: resulting range position for range [processingInstruction, 0, processingInstruction, 4\], node detachedTextNode]
|
||||
expected: FAIL
|
||||
|
||||
[37,14: resulting DOM for range [processingInstruction, 0, processingInstruction, 4\], node foreignTextNode]
|
||||
expected: FAIL
|
||||
|
||||
[37,14: resulting range position for range [processingInstruction, 0, processingInstruction, 4\], node foreignTextNode]
|
||||
expected: FAIL
|
||||
|
||||
[37,15: resulting DOM for range [processingInstruction, 0, processingInstruction, 4\], node processingInstruction]
|
||||
expected: FAIL
|
||||
|
||||
[37,15: resulting range position for range [processingInstruction, 0, processingInstruction, 4\], node processingInstruction]
|
||||
expected: FAIL
|
||||
|
||||
[37,16: resulting DOM for range [processingInstruction, 0, processingInstruction, 4\], node detachedProcessingInstruction]
|
||||
expected: FAIL
|
||||
|
||||
[37,16: resulting range position for range [processingInstruction, 0, processingInstruction, 4\], node detachedProcessingInstruction]
|
||||
expected: FAIL
|
||||
|
||||
[37,17: resulting DOM for range [processingInstruction, 0, processingInstruction, 4\], node comment]
|
||||
expected: FAIL
|
||||
|
||||
[37,17: resulting range position for range [processingInstruction, 0, processingInstruction, 4\], node comment]
|
||||
expected: FAIL
|
||||
|
||||
[37,18: resulting DOM for range [processingInstruction, 0, processingInstruction, 4\], node detachedComment]
|
||||
expected: FAIL
|
||||
|
||||
[37,18: resulting range position for range [processingInstruction, 0, processingInstruction, 4\], node detachedComment]
|
||||
[9,4: resulting range position for range [foreignPara1.firstChild, 2, foreignPara1.firstChild, 8\], node foreignPara1.firstChild]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
a350b215cc3e943985a66f1485c7eac7f4b9832e
|
||||
0008a0d00ae1a58ba888ba9bec181cd6e16d8b94
|
|
@ -43,6 +43,7 @@ function test_withCredentials(worker) {
|
|||
test(function() {
|
||||
var client = new XMLHttpRequest()
|
||||
client.open("GET", "resources/delay.py?ms=1000", false)
|
||||
client.send();
|
||||
assert_throws("InvalidStateError", function() { client.withCredentials = true })
|
||||
}, "setting withCredentials when in DONE state (synchronous)")
|
||||
}
|
||||
|
|
|
@ -58,9 +58,9 @@
|
|||
"text/x-thepiano;charset=UTF-8",
|
||||
"charset given but wrong, fix it (unknown MIME, bogus charset)"
|
||||
)
|
||||
request( /**/
|
||||
request(
|
||||
"text/plain;charset=utf-8;charset=waddup",
|
||||
"text/plain;charset=UTF-8;charset=UTF-8",
|
||||
"text/plain;charset=utf-8;charset=UTF-8",
|
||||
"charset given but wrong, fix it (known MIME, bogus charset)"
|
||||
)
|
||||
request(
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
|
||||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="assert" content="The custom element type identifies a custom element interface and is a sequence of characters that must match the NCName production">
|
||||
<meta name="timeout" content="long">
|
||||
<link rel="help" href="https://dvcs.w3.org/hg/webcomponents/raw-file/default/spec/custom/index.html#concepts">
|
||||
<link rel="help" href="http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
|
||||
<meta name="assert" content="The custom element type identifies a custom element interface and is a sequence of characters that must match the NCName production">
|
||||
<meta name="timeout" content="long">
|
||||
<link rel="help" href="https://dvcs.w3.org/hg/webcomponents/raw-file/default/spec/custom/index.html#concepts">
|
||||
<link rel="help" href="http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
|
|
|
@ -571,14 +571,6 @@ function indexOf(node) {
|
|||
* a spec bug.
|
||||
*/
|
||||
function myExtractContents(range) {
|
||||
// "If the context object's detached flag is set, raise an
|
||||
// INVALID_STATE_ERR exception and abort these steps."
|
||||
try {
|
||||
range.collapsed;
|
||||
} catch (e) {
|
||||
return "INVALID_STATE_ERR";
|
||||
}
|
||||
|
||||
// "Let frag be a new DocumentFragment whose ownerDocument is the same as
|
||||
// the ownerDocument of the context object's start node."
|
||||
var ownerDoc = range.startContainer.nodeType == Node.DOCUMENT_NODE
|
||||
|
@ -601,10 +593,11 @@ function myExtractContents(range) {
|
|||
var originalEndNode = range.endContainer;
|
||||
var originalEndOffset = range.endOffset;
|
||||
|
||||
// "If original start node and original end node are the same, and they are
|
||||
// a Text or Comment node:"
|
||||
// "If original start node is original end node, and they are a Text,
|
||||
// ProcessingInstruction, or Comment node:"
|
||||
if (range.startContainer == range.endContainer
|
||||
&& (range.startContainer.nodeType == Node.TEXT_NODE
|
||||
|| range.startContainer.nodeType == Node.PROCESSING_INSTRUCTION_NODE
|
||||
|| range.startContainer.nodeType == Node.COMMENT_NODE)) {
|
||||
// "Let clone be the result of calling cloneNode(false) on original
|
||||
// start node."
|
||||
|
@ -716,9 +709,11 @@ function myExtractContents(range) {
|
|||
newOffset = 1 + indexOf(referenceNode);
|
||||
}
|
||||
|
||||
// "If first partially contained child is a Text or Comment node:"
|
||||
// "If first partially contained child is a Text, ProcessingInstruction, or
|
||||
// Comment node:"
|
||||
if (firstPartiallyContainedChild
|
||||
&& (firstPartiallyContainedChild.nodeType == Node.TEXT_NODE
|
||||
|| firstPartiallyContainedChild.nodeType == Node.PROCESSING_INSTRUCTION_NODE
|
||||
|| firstPartiallyContainedChild.nodeType == Node.COMMENT_NODE)) {
|
||||
// "Let clone be the result of calling cloneNode(false) on original
|
||||
// start node."
|
||||
|
@ -773,9 +768,11 @@ function myExtractContents(range) {
|
|||
frag.appendChild(containedChildren[i]);
|
||||
}
|
||||
|
||||
// "If last partially contained child is a Text or Comment node:"
|
||||
// "If last partially contained child is a Text, ProcessingInstruction, or
|
||||
// Comment node:"
|
||||
if (lastPartiallyContainedChild
|
||||
&& (lastPartiallyContainedChild.nodeType == Node.TEXT_NODE
|
||||
|| lastPartiallyContainedChild.nodeType == Node.PROCESSING_INSTRUCTION_NODE
|
||||
|| lastPartiallyContainedChild.nodeType == Node.COMMENT_NODE)) {
|
||||
// "Let clone be the result of calling cloneNode(false) on original
|
||||
// end node."
|
||||
|
@ -831,13 +828,14 @@ function myExtractContents(range) {
|
|||
* instance "HIERARCHY_REQUEST_ERR".
|
||||
*/
|
||||
function myInsertNode(range, node) {
|
||||
// "If range's start node is either a ProcessingInstruction or Comment
|
||||
// node, or a Text node whose parent is null, throw an
|
||||
// "If range's start node is a ProcessingInstruction or Comment node, or is
|
||||
// a Text node whose parent is null, or is node, throw an
|
||||
// "HierarchyRequestError" exception and terminate these steps."
|
||||
if (range.startContainer.nodeType == Node.PROCESSING_INSTRUCTION_NODE
|
||||
|| range.startContainer.nodeType == Node.COMMENT_NODE
|
||||
|| (range.startContainer.nodeType == Node.TEXT_NODE
|
||||
&& !range.startContainer.parentNode)) {
|
||||
&& !range.startContainer.parentNode)
|
||||
|| range.startContainer == node) {
|
||||
return "HIERARCHY_REQUEST_ERR";
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<!DOCTYPE foo [ <!ELEMENT foo (#PCDATA)> ]><foo/>
|
|
@ -0,0 +1 @@
|
|||
<!DOCTYPE foo [ <!ELEMENT foo EMPTY> ]><foo/>
|
|
@ -78,7 +78,7 @@ function iframeLoaded() {
|
|||
}
|
||||
}
|
||||
</script>
|
||||
<iframe id="subset1" onload="iframeLoaded()" src="data:application/xml,<!DOCTYPE foo [ <!ELEMENT foo (%23PCDATA)> ]><foo/>" />
|
||||
<iframe id="subset2" onload="iframeLoaded()" src="data:application/xml,<!DOCTYPE foo [ <!ELEMENT foo EMPTY> ]><foo/>" />
|
||||
<iframe id="subset1" onload="iframeLoaded()" src="Node-isEqualNode-iframe1.xml" />
|
||||
<iframe id="subset2" onload="iframeLoaded()" src="Node-isEqualNode-iframe2.xml" />
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
<!doctype html>
|
||||
<title>Range constructor test</title>
|
||||
<link rel="author" title="Aryeh Gregor" href=ayg@aryeh.name>
|
||||
<div id=log></div>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script>
|
||||
"use strict";
|
||||
|
||||
test(function() {
|
||||
var range = new Range();
|
||||
assert_equals(range.startContainer, document, "startContainer");
|
||||
assert_equals(range.endContainer, document, "endContainer");
|
||||
assert_equals(range.startOffset, 0, "startOffset");
|
||||
assert_equals(range.endOffset, 0, "endOffset");
|
||||
assert_true(range.collapsed, "collapsed");
|
||||
assert_equals(range.commonAncestorContainer, document,
|
||||
"commonAncestorContainer");
|
||||
});
|
||||
</script>
|
|
@ -67,11 +67,13 @@ function myDeleteContents(range) {
|
|||
var originalEndOffset = range.endOffset;
|
||||
|
||||
// "If original start node and original end node are the same, and they are
|
||||
// a Text or Comment node, call deleteData(original start offset, original
|
||||
// end offset − original start offset) on that node, and abort these
|
||||
// steps."
|
||||
// a Text, ProcessingInstruction, or Comment node, replace data with node
|
||||
// original start node, offset original start offset, count original end
|
||||
// offset minus original start offset, and data the empty string, and then
|
||||
// terminate these steps"
|
||||
if (originalStartNode == originalEndNode
|
||||
&& (range.startContainer.nodeType == Node.TEXT_NODE
|
||||
|| range.startContainer.nodeType == Node.PROCESSING_INSTRUCTION_NODE
|
||||
|| range.startContainer.nodeType == Node.COMMENT_NODE)) {
|
||||
originalStartNode.deleteData(originalStartOffset, originalEndOffset - originalStartOffset);
|
||||
return;
|
||||
|
@ -120,10 +122,12 @@ function myDeleteContents(range) {
|
|||
newOffset = 1 + indexOf(referenceNode);
|
||||
}
|
||||
|
||||
// "If original start node is a Text or Comment node, run deleteData() on
|
||||
// it, with original start offset as the first argument and (length of
|
||||
// original start node − original start offset) as the second."
|
||||
// "If original start node is a Text, ProcessingInstruction, or Comment node,
|
||||
// replace data with node original start node, offset original start offset,
|
||||
// count original start node's length minus original start offset, data the
|
||||
// empty start"
|
||||
if (originalStartNode.nodeType == Node.TEXT_NODE
|
||||
|| originalStartNode.nodeType == Node.PROCESSING_INSTRUCTION_NODE
|
||||
|| originalStartNode.nodeType == Node.COMMENT_NODE) {
|
||||
originalStartNode.deleteData(originalStartOffset, nodeLength(originalStartNode) - originalStartOffset);
|
||||
}
|
||||
|
@ -134,9 +138,11 @@ function myDeleteContents(range) {
|
|||
nodesToRemove[i].parentNode.removeChild(nodesToRemove[i]);
|
||||
}
|
||||
|
||||
// "If original end node is a Text or Comment node, run deleteData(0,
|
||||
// original end offset) on it."
|
||||
// "If original end node is a Text, ProcessingInstruction, or Comment node,
|
||||
// replace data with node original end node, offset 0, count original end
|
||||
// offset, and data the empty string."
|
||||
if (originalEndNode.nodeType == Node.TEXT_NODE
|
||||
|| originalEndNode.nodeType == Node.PROCESSING_INSTRUCTION_NODE
|
||||
|| originalEndNode.nodeType == Node.COMMENT_NODE) {
|
||||
originalEndNode.deleteData(0, originalEndOffset);
|
||||
}
|
||||
|
|
|
@ -15,14 +15,6 @@ var testRangesCached = [];
|
|||
for (var i = 0; i < testNodes.length; i++) {
|
||||
var node = eval(testNodes[i]);
|
||||
|
||||
// "If the detached flag is set, throw an "InvalidStateError" exception and
|
||||
// terminate these steps."
|
||||
test(function() {
|
||||
var range = document.createRange();
|
||||
range.detach();
|
||||
assert_equals(range.intersectsNode(node), node === document);
|
||||
}, "Node " + i + " " + testNodes[i] + ", detached range");
|
||||
|
||||
for (var j = 0; j < testRanges.length; j++) {
|
||||
test(function() {
|
||||
if (testRangesCached[j] === undefined) {
|
||||
|
|
|
@ -17,14 +17,6 @@ testDiv.parentNode.removeChild(testDiv);
|
|||
|
||||
function mySurroundContents(range, newParent) {
|
||||
try {
|
||||
// "If the detached flag is set, throw an "InvalidStateError" exception
|
||||
// and terminate these steps."
|
||||
try {
|
||||
range.collapsed;
|
||||
} catch (e) {
|
||||
return "INVALID_STATE_ERR";
|
||||
}
|
||||
|
||||
// "If a non-Text node is partially contained in the context object,
|
||||
// throw a "InvalidStateError" exception and terminate these steps."
|
||||
var node = range.commonAncestorContainer;
|
||||
|
@ -118,8 +110,6 @@ function testSurroundContents(i, j) {
|
|||
var actualRoots = [];
|
||||
var expectedRoots = [];
|
||||
|
||||
var detached = false;
|
||||
|
||||
domTests[i][j].step(function() {
|
||||
restoreIframe(actualIframe, i, j);
|
||||
restoreIframe(expectedIframe, i, j);
|
||||
|
@ -129,12 +119,6 @@ function testSurroundContents(i, j) {
|
|||
actualNode = actualIframe.contentWindow.testNode;
|
||||
expectedNode = expectedIframe.contentWindow.testNode;
|
||||
|
||||
try {
|
||||
actualRange.collapsed;
|
||||
} catch (e) {
|
||||
detached = true;
|
||||
}
|
||||
|
||||
assert_equals(actualIframe.contentWindow.unexpectedException, null,
|
||||
"Unexpected exception thrown when setting up Range for actual surroundContents()");
|
||||
assert_equals(expectedIframe.contentWindow.unexpectedException, null,
|
||||
|
@ -160,15 +144,8 @@ function testSurroundContents(i, j) {
|
|||
// also the trees containing the moved nodes. These might not be the
|
||||
// same, if we're inserting a node from a detached tree or a different
|
||||
// document.
|
||||
//
|
||||
// Detached ranges are always in the contentDocument.
|
||||
if (detached) {
|
||||
actualRoots.push(actualIframe.contentDocument);
|
||||
expectedRoots.push(expectedIframe.contentDocument);
|
||||
} else {
|
||||
actualRoots.push(furthestAncestor(actualRange.startContainer));
|
||||
expectedRoots.push(furthestAncestor(expectedRange.startContainer));
|
||||
}
|
||||
actualRoots.push(furthestAncestor(actualRange.startContainer));
|
||||
expectedRoots.push(furthestAncestor(expectedRange.startContainer));
|
||||
|
||||
if (furthestAncestor(actualNode) != actualRoots[0]) {
|
||||
actualRoots.push(furthestAncestor(actualNode));
|
||||
|
@ -264,11 +241,6 @@ function testSurroundContents(i, j) {
|
|||
assertNodesEqual(actualRoots[k], expectedRoots[k], k ? "moved node's tree root" : "range's tree root");
|
||||
}
|
||||
|
||||
if (detached) {
|
||||
// No further tests we can do
|
||||
return;
|
||||
}
|
||||
|
||||
assert_equals(actualRange.startOffset, expectedRange.startOffset,
|
||||
"Unexpected startOffset after surroundContents()");
|
||||
assert_equals(actualRange.endOffset, expectedRange.endOffset,
|
||||
|
@ -300,8 +272,6 @@ function testSurroundContents(i, j) {
|
|||
positionTests[i][j].done();
|
||||
}
|
||||
|
||||
testRanges.unshift('"detached"');
|
||||
|
||||
var iStart = 0;
|
||||
var iStop = testRangesShort.length;
|
||||
var jStart = 0;
|
||||
|
|
|
@ -36,87 +36,13 @@
|
|||
<source name="source">
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.getElementsByName("section").length, 1);
|
||||
assert_equals(document.getElementsByName("section")[0],
|
||||
document.getElementsByTagName("section")[0]);
|
||||
assert_equals(document.getElementsByName("article").length, 1);
|
||||
assert_equals(document.getElementsByName("article")[0],
|
||||
document.getElementsByTagName("article")[0]);
|
||||
assert_equals(document.getElementsByName("aside").length, 1);
|
||||
assert_equals(document.getElementsByName("aside")[0],
|
||||
document.getElementsByTagName("aside")[0]);
|
||||
assert_equals(document.getElementsByName("hgroup").length, 1);
|
||||
assert_equals(document.getElementsByName("hgroup")[0],
|
||||
document.getElementsByTagName("hgroup")[0]);
|
||||
assert_equals(document.getElementsByName("header").length, 1);
|
||||
assert_equals(document.getElementsByName("header")[0],
|
||||
document.getElementsByTagName("header")[0]);
|
||||
assert_equals(document.getElementsByName("footer").length, 1);
|
||||
assert_equals(document.getElementsByName("footer")[0],
|
||||
document.getElementsByTagName("footer")[0]);
|
||||
assert_equals(document.getElementsByName("nav").length, 1);
|
||||
assert_equals(document.getElementsByName("nav")[0],
|
||||
document.getElementsByTagName("nav")[0]);
|
||||
assert_equals(document.getElementsByName("dialog").length, 1);
|
||||
assert_equals(document.getElementsByName("dialog")[0],
|
||||
document.getElementsByTagName("dialog")[0]);
|
||||
assert_equals(document.getElementsByName("figure").length, 1);
|
||||
assert_equals(document.getElementsByName("figure")[0],
|
||||
document.getElementsByTagName("figure")[0]);
|
||||
assert_equals(document.getElementsByName("audio").length, 1);
|
||||
assert_equals(document.getElementsByName("audio")[0],
|
||||
document.getElementsByTagName("audio")[0]);
|
||||
assert_equals(document.getElementsByName("video").length, 1);
|
||||
assert_equals(document.getElementsByName("video")[0],
|
||||
document.getElementsByTagName("video")[0]);
|
||||
assert_equals(document.getElementsByName("embed").length, 1);
|
||||
assert_equals(document.getElementsByName("embed")[0],
|
||||
document.getElementsByTagName("embed")[0]);
|
||||
assert_equals(document.getElementsByName("mark").length, 1);
|
||||
assert_equals(document.getElementsByName("mark")[0],
|
||||
document.getElementsByTagName("mark")[0]);
|
||||
assert_equals(document.getElementsByName("meter").length, 1);
|
||||
assert_equals(document.getElementsByName("meter")[0],
|
||||
document.getElementsByTagName("meter")[0]);
|
||||
assert_equals(document.getElementsByName("progress").length, 1);
|
||||
assert_equals(document.getElementsByName("progress")[0],
|
||||
document.getElementsByTagName("progress")[0]);
|
||||
assert_equals(document.getElementsByName("time").length, 1);
|
||||
assert_equals(document.getElementsByName("time")[0],
|
||||
document.getElementsByTagName("time")[0]);
|
||||
assert_equals(document.getElementsByName("canvas").length, 1);
|
||||
assert_equals(document.getElementsByName("canvas")[0],
|
||||
document.getElementsByTagName("canvas")[0]);
|
||||
assert_equals(document.getElementsByName("command").length, 1);
|
||||
assert_equals(document.getElementsByName("command")[0],
|
||||
document.getElementsByTagName("command")[0]);
|
||||
assert_equals(document.getElementsByName("menu").length, 1);
|
||||
assert_equals(document.getElementsByName("menu")[0],
|
||||
document.getElementsByTagName("menu")[0]);
|
||||
assert_equals(document.getElementsByName("details").length, 1);
|
||||
assert_equals(document.getElementsByName("details")[0],
|
||||
document.getElementsByTagName("details")[0]);
|
||||
assert_equals(document.getElementsByName("datalist").length, 1);
|
||||
assert_equals(document.getElementsByName("datalist")[0],
|
||||
document.getElementsByTagName("datalist")[0]);
|
||||
assert_equals(document.getElementsByName("keygen").length, 1);
|
||||
assert_equals(document.getElementsByName("keygen")[0],
|
||||
document.getElementsByTagName("keygen")[0]);
|
||||
assert_equals(document.getElementsByName("output").length, 1);
|
||||
assert_equals(document.getElementsByName("output")[0],
|
||||
document.getElementsByTagName("output")[0]);
|
||||
assert_equals(document.getElementsByName("ruby").length, 1);
|
||||
assert_equals(document.getElementsByName("ruby")[0],
|
||||
document.getElementsByTagName("ruby")[0]);
|
||||
assert_equals(document.getElementsByName("rt").length, 1);
|
||||
assert_equals(document.getElementsByName("rt")[0],
|
||||
document.getElementsByTagName("rt")[0]);
|
||||
assert_equals(document.getElementsByName("rp").length, 1);
|
||||
assert_equals(document.getElementsByName("rp")[0],
|
||||
document.getElementsByTagName("rp")[0]);
|
||||
assert_equals(document.getElementsByName("source").length, 1);
|
||||
assert_equals(document.getElementsByName("source")[0],
|
||||
document.getElementsByTagName("source")[0]);
|
||||
});
|
||||
var testDiv = document.getElementById("test");
|
||||
for (var i = 0; i < testDiv.children.length; i++) {
|
||||
var name = testDiv.children[i].getAttribute("name");
|
||||
test(function() {
|
||||
assert_equals(document.getElementsByName(name).length, 1);
|
||||
assert_equals(document.getElementsByName(name)[0],
|
||||
document.getElementsByTagName(name)[0]);
|
||||
}, 'getElementsByName("' + name + '")');
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -7,38 +7,26 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
function test_title(set, expected) {
|
||||
test(function() {
|
||||
document.title = set;
|
||||
assert_equals(document.title, expected);
|
||||
}, "document.title after setting to " + format_value(set));
|
||||
}
|
||||
|
||||
test(function() {
|
||||
// Single space characters must be normalized. (WHATWG r4353)
|
||||
assert_equals(document.title, "document.title and space normalization");
|
||||
}, "document.title initial value");
|
||||
|
||||
document.title = "one space";
|
||||
assert_equals(document.title, "one space");
|
||||
|
||||
document.title = "two spaces";
|
||||
assert_equals(document.title, "two spaces");
|
||||
|
||||
document.title = "one\ttab";
|
||||
assert_equals(document.title, "one tab");
|
||||
|
||||
document.title = "two\t\ttabs";
|
||||
assert_equals(document.title, "two tabs");
|
||||
|
||||
document.title = "one\nnewline";
|
||||
assert_equals(document.title, "one newline");
|
||||
|
||||
document.title = "two\n\nnewlines";
|
||||
assert_equals(document.title, "two newlines");
|
||||
|
||||
document.title = "one\fform feed";
|
||||
assert_equals(document.title, "one form feed");
|
||||
|
||||
document.title = "two\f\fform feeds";
|
||||
assert_equals(document.title, "two form feeds");
|
||||
|
||||
document.title = "one\rcarriage return";
|
||||
assert_equals(document.title, "one carriage return");
|
||||
|
||||
document.title = "two\r\rcarriage returns";
|
||||
assert_equals(document.title, "two carriage returns");
|
||||
});
|
||||
test_title("one space", "one space");
|
||||
test_title("two spaces", "two spaces");
|
||||
test_title("one\ttab", "one tab");
|
||||
test_title("two\t\ttabs", "two tabs");
|
||||
test_title("one\nnewline", "one newline");
|
||||
test_title("two\n\nnewlines", "two newlines");
|
||||
test_title("one\fform feed", "one form feed");
|
||||
test_title("two\f\fform feeds", "two form feeds");
|
||||
test_title("one\rcarriage return", "one carriage return");
|
||||
test_title("two\r\rcarriage returns", "two carriage returns");
|
||||
</script>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
||||
|
||||
function newSVGDocument() {
|
||||
return document.implementation.createDocument(SVG_NAMESPACE, "svg");
|
||||
return document.implementation.createDocument(SVG_NAMESPACE, "svg", null);
|
||||
}
|
||||
|
||||
test(function() {
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>ol@type: supported types</title>
|
||||
<style>
|
||||
.decimal {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
.lower-alpha {
|
||||
list-style-type: lower-alpha;
|
||||
}
|
||||
.upper-alpha {
|
||||
list-style-type: upper-alpha;
|
||||
}
|
||||
.lower-roman {
|
||||
list-style-type: lower-roman;
|
||||
}
|
||||
.upper-roman {
|
||||
list-style-type: upper-roman;
|
||||
}
|
||||
</style>
|
||||
<ol class=decimal><li>1<li>2</ol>
|
||||
<ol class=lower-alpha><li>a<li>b</ol>
|
||||
<ol class=upper-alpha><li>A<li>B</ol>
|
||||
<ol class=lower-roman><li>i<li>ii</ol>
|
||||
<ol class=upper-roman><li>I<li>II</ol>
|
|
@ -0,0 +1,9 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>ol@type: supported types</title>
|
||||
<link rel=match href=ol-type-supported-ref.html>
|
||||
<ol type=1><li>1<li>2</ol>
|
||||
<ol type=a><li>a<li>b</ol>
|
||||
<ol type=A><li>A<li>B</ol>
|
||||
<ol type=i><li>i<li>ii</ol>
|
||||
<ol type=I><li>I<li>II</ol>
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>ol@type: supported types</title>
|
||||
<link rel="match" href="ol-type-supported-ref.html"/>
|
||||
</head>
|
||||
<body>
|
||||
<ol type="1"><li>1</li><li>2</li></ol>
|
||||
<ol type="a"><li>a</li><li>b</li></ol>
|
||||
<ol type="A"><li>A</li><li>B</li></ol>
|
||||
<ol type="i"><li>i</li><li>ii</li></ol>
|
||||
<ol type="I"><li>I</li><li>II</li></ol>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,6 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>ol@type: unsupported type: circle</title>
|
||||
<link rel=match href=ol-type-unsupported-ref.html>
|
||||
<ol type=circle><li>1<li>2</ol>
|
||||
<ol type=CIRCLE><li>1<li>2</ol>
|
|
@ -0,0 +1,6 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>ol@type: unsupported type: disc</title>
|
||||
<link rel=match href=ol-type-unsupported-ref.html>
|
||||
<ol type=disc><li>1<li>2</ol>
|
||||
<ol type=DISC><li>1<li>2</ol>
|
|
@ -0,0 +1,6 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>ol@type: unsupported type: lower-alpha</title>
|
||||
<link rel=match href=ol-type-unsupported-ref.html>
|
||||
<ol type=lower-alpha><li>1<li>2</ol>
|
||||
<ol type=LOWER-ALPHA><li>1<li>2</ol>
|
|
@ -0,0 +1,6 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>ol@type: unsupported type: lower-roman</title>
|
||||
<link rel=match href=ol-type-unsupported-ref.html>
|
||||
<ol type=lower-roman><li>1<li>2</ol>
|
||||
<ol type=LOWER-ROMAN><li>1<li>2</ol>
|
|
@ -0,0 +1,6 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>ol@type: unsupported type: none</title>
|
||||
<link rel=match href=ol-type-unsupported-ref.html>
|
||||
<ol type=none><li>1<li>2</ol>
|
||||
<ol type=NONE><li>1<li>2</ol>
|
|
@ -0,0 +1,5 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>ol@type: unsupported types</title>
|
||||
<ol><li>1<li>2</ol>
|
||||
<ol><li>1<li>2</ol>
|
|
@ -0,0 +1,6 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>ol@type: unsupported type: round</title>
|
||||
<link rel=match href=ol-type-unsupported-ref.html>
|
||||
<ol type=round><li>1<li>2</ol>
|
||||
<ol type=ROUND><li>1<li>2</ol>
|
|
@ -0,0 +1,6 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>ol@type: unsupported type: square</title>
|
||||
<link rel=match href=ol-type-unsupported-ref.html>
|
||||
<ol type=square><li>1<li>2</ol>
|
||||
<ol type=SQUARE><li>1<li>2</ol>
|
|
@ -0,0 +1,6 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>ol@type: unsupported type: upper-latin</title>
|
||||
<link rel=match href=ol-type-unsupported-ref.html>
|
||||
<ol type=upper-alpha><li>1<li>2</ol>
|
||||
<ol type=UPPER-ALPHA><li>1<li>2</ol>
|
|
@ -0,0 +1,6 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>ol@type: unsupported type: upper-roman</title>
|
||||
<link rel=match href=ol-type-unsupported-ref.html>
|
||||
<ol type=upper-roman><li>1<li>2</ol>
|
||||
<ol type=UPPER-ROMAN><li>1<li>2</ol>
|
|
@ -279,7 +279,7 @@ var validator = {
|
|||
ctl.removeAttribute(item);
|
||||
});
|
||||
for (var attr in obj) {
|
||||
if (obj[attr] || obj[attr] === "")
|
||||
if (attr === "checked" || obj[attr] || obj[attr] === "")
|
||||
ctl[attr] = obj[attr];
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>test if select() API returns correct attributes</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="timeout" content="long">
|
||||
<link rel="author" title="Koji Tashiro" href="mailto:koji.tashiro@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/multipage/association-of-controls-and-forms.html#textFieldSelection">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
#!/usr/bin/env python
|
||||
import sys
|
||||
|
||||
from tools.lint import lint
|
||||
try:
|
||||
from tools.lint import lint
|
||||
except ImportError:
|
||||
print("tools.lint not found. Did you forget to run "
|
||||
'"git submodule update --init --recursive"?')
|
||||
sys.exit(2)
|
||||
|
||||
sys.exit(0 if lint.main() == 0 else 1)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -354,20 +354,24 @@ class LocalChanges(object):
|
|||
|
||||
return self
|
||||
|
||||
def load(tests_root, manifest_path):
|
||||
def load(tests_root, manifest):
|
||||
logger = get_logger()
|
||||
|
||||
if os.path.exists(manifest_path):
|
||||
logger.debug("Opening manifest at %s" % manifest_path)
|
||||
else:
|
||||
logger.debug("Creating new manifest at %s" % manifest_path)
|
||||
try:
|
||||
with open(manifest_path) as f:
|
||||
manifest = Manifest.from_json(tests_root, json.load(f))
|
||||
except IOError:
|
||||
manifest = Manifest(None)
|
||||
# "manifest" is a path or file-like object.
|
||||
if isinstance(manifest, basestring):
|
||||
if os.path.exists(manifest):
|
||||
logger.debug("Opening manifest at %s" % manifest)
|
||||
else:
|
||||
logger.debug("Creating new manifest at %s" % manifest)
|
||||
try:
|
||||
with open(manifest) as f:
|
||||
rv = Manifest.from_json(tests_root, json.load(f))
|
||||
except IOError:
|
||||
rv = Manifest(None)
|
||||
return rv
|
||||
|
||||
return Manifest.from_json(tests_root, json.load(manifest))
|
||||
|
||||
return manifest
|
||||
|
||||
def write(manifest, manifest_path):
|
||||
with open(manifest_path, "w") as f:
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Test setValueAtTime with startTime in the past</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
function do_test(t, context) {
|
||||
var source = context.createBufferSource();
|
||||
source.buffer =
|
||||
function() {
|
||||
var buffer = context.createBuffer(1, 1, context.sampleRate);
|
||||
buffer.getChannelData(0)[0] = 1.0;
|
||||
return buffer;
|
||||
}();
|
||||
source.loop = true;
|
||||
source.start();
|
||||
|
||||
// Use a ramp of slope 1/sample to measure time.
|
||||
// The end value is the extent of exact precision in single precision float.
|
||||
const rampEnd = Math.pow(2, 24);
|
||||
const rampEndSeconds = rampEnd / context.sampleRate;
|
||||
var test = context.createGain();
|
||||
test.gain.setValueAtTime(0.0, 0.0);
|
||||
test.gain.linearRampToValueAtTime(rampEnd, rampEndSeconds);
|
||||
|
||||
// With a different starting point on the same line, the result should be
|
||||
// the same. |currentTime| may include double precision floating point
|
||||
// rounding errors, so round to nearest integer sample to ignore these.
|
||||
var scheduledSample = Math.round(context.currentTime * context.sampleRate);
|
||||
assert_equals(scheduledSample % 128, 0,
|
||||
"currentTime advances in blocks of 128 samples");
|
||||
var reference = context.createGain();
|
||||
reference.gain.setValueAtTime(scheduledSample, context.currentTime);
|
||||
reference.gain.linearRampToValueAtTime(rampEnd, rampEndSeconds);
|
||||
|
||||
source.connect(test);
|
||||
source.connect(reference);
|
||||
|
||||
var merger = context.createChannelMerger();
|
||||
test.connect(merger, 0, 0);
|
||||
reference.connect(merger, 0, 1);
|
||||
|
||||
var processor = context.createScriptProcessor(0, 2, 0);
|
||||
merger.connect(processor);
|
||||
processor.onaudioprocess =
|
||||
t.step_func_done((e) => {
|
||||
source.stop();
|
||||
processor.onaudioprocess = null;
|
||||
|
||||
var testValue = e.inputBuffer.getChannelData(0)[0];
|
||||
var referenceValue = e.inputBuffer.getChannelData(1)[0];
|
||||
|
||||
assert_equals(testValue, referenceValue,
|
||||
"ramp value matches expected");
|
||||
assert_greater_than_equal(testValue, scheduledSample,
|
||||
"time does not retreat");
|
||||
assert_equals(testValue % 128, 0,
|
||||
"ScriptProcessor blocks align on 128-sample blocks");
|
||||
});
|
||||
}
|
||||
|
||||
async_test(function(t) {
|
||||
var context = new AudioContext;
|
||||
(function waitForTimeAdvance() {
|
||||
if (context.currentTime == 0) {
|
||||
t.step_timeout(waitForTimeAdvance, 0);
|
||||
} else {
|
||||
do_test(t, context);
|
||||
}
|
||||
})();
|
||||
});
|
||||
</script>
|
|
@ -17,11 +17,6 @@ and ensures that an empty string sent by one is received by the second.
|
|||
<!-- These files are in place when executing on W3C. -->
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/vendor-prefix.js"
|
||||
data-prefixed-objects=
|
||||
'[{"ancestors":["window"], "name":"RTCPeerConnection"}]'
|
||||
>
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
var test = async_test('Can send empty strings across a WebRTC data channel.');
|
||||
|
||||
|
|
|
@ -17,12 +17,6 @@ This test uses the legacy callback API with no media, and thus does not require
|
|||
<!-- These files are in place when executing on W3C. -->
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/vendor-prefix.js"
|
||||
data-prefixed-objects=
|
||||
'[{"ancestors":["window"], "name":"RTCPeerConnection"},
|
||||
{"ancestors":["window"], "name":"RTCSessionDescription"}]'
|
||||
>
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
var test = async_test('Can set up a basic WebRTC call with no data.');
|
||||
|
||||
|
|
|
@ -17,11 +17,6 @@ This test uses data only, and thus does not require fake media devices.
|
|||
<!-- These files are in place when executing on W3C. -->
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/vendor-prefix.js"
|
||||
data-prefixed-objects=
|
||||
'[{"ancestors":["window"], "name":"RTCPeerConnection"}]'
|
||||
>
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
var test = async_test('Can set up a basic WebRTC call with only data using promises.');
|
||||
|
||||
|
|
|
@ -14,32 +14,33 @@
|
|||
<div id='log'></div>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src="/common/vendor-prefix.js"
|
||||
data-prefixed-objects=
|
||||
'[{"ancestors":["window"], "name":"RTCPeerConnection"},
|
||||
{"ancestors":["window"], "name":"RTCSessionDescription"},
|
||||
{"ancestors":["window"], "name":"RTCIceCandidate"}]'>
|
||||
</script>
|
||||
<script src=/resources/WebIDLParser.js></script>
|
||||
<script src=/resources/idlharness.js></script>
|
||||
|
||||
<!-- The IDL is copied from the 06 March 2015 editors' draft. -->
|
||||
<!-- The IDL is copied from the 22 September 2015 editors' draft. -->
|
||||
<script type="text/plain">
|
||||
[ Constructor (RTCConfiguration configuration)]
|
||||
interface EventTarget {
|
||||
// Only a dummy definition is needed here.
|
||||
};
|
||||
[ Constructor (optional RTCConfiguration configuration)]
|
||||
interface RTCPeerConnection : EventTarget {
|
||||
Promise<RTCSessionDescription> createOffer (optional RTCOfferOptions options);
|
||||
Promise<RTCSessionDescription> createAnswer ();
|
||||
Promise<RTCSessionDescription> createAnswer (optional RTCAnswerOptions options);
|
||||
Promise<void> setLocalDescription (RTCSessionDescription description);
|
||||
readonly attribute RTCSessionDescription? localDescription;
|
||||
readonly attribute RTCSessionDescription? currentLocalDescription;
|
||||
readonly attribute RTCSessionDescription? pendingLocalDescription;
|
||||
Promise<void> setRemoteDescription (RTCSessionDescription description);
|
||||
readonly attribute RTCSessionDescription? remoteDescription;
|
||||
readonly attribute RTCSignalingState signalingState;
|
||||
void updateIce (RTCConfiguration configuration);
|
||||
readonly attribute RTCSessionDescription? currentRemoteDescription;
|
||||
readonly attribute RTCSessionDescription? pendingRemoteDescription;
|
||||
Promise<void> addIceCandidate (RTCIceCandidate candidate);
|
||||
readonly attribute RTCSignalingState signalingState;
|
||||
readonly attribute RTCIceGatheringState iceGatheringState;
|
||||
readonly attribute RTCIceConnectionState iceConnectionState;
|
||||
readonly attribute boolean? canTrickleIceCandidates;
|
||||
RTCConfiguration getConfiguration ();
|
||||
void setConfiguration (RTCConfiguration configuration);
|
||||
void close ();
|
||||
attribute EventHandler onnegotiationneeded;
|
||||
attribute EventHandler onicecandidate;
|
||||
|
@ -54,6 +55,11 @@ partial interface RTCPeerConnection {
|
|||
void createAnswer (RTCSessionDescriptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback);
|
||||
void setRemoteDescription (RTCSessionDescription description, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback);
|
||||
void addIceCandidate (RTCIceCandidate candidate, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback);
|
||||
void getStats (MediaStreamTrack? selector, RTCStatsCallback successCallback, RTCPeerConnectionErrorCallback failureCallback);
|
||||
};
|
||||
|
||||
partial interface RTCPeerConnection {
|
||||
static Promise<RTCCertificate> generateCertificate (AlgorithmIdentifier keygenAlgorithm);
|
||||
};
|
||||
|
||||
partial interface RTCPeerConnection {
|
||||
|
@ -70,21 +76,18 @@ partial interface RTCPeerConnection {
|
|||
};
|
||||
|
||||
partial interface RTCPeerConnection {
|
||||
RTCDTMFSender createDTMFSender (MediaStreamTrack track);
|
||||
readonly attribute RTCDTMFSender? dtmf;
|
||||
};
|
||||
|
||||
partial interface RTCPeerConnection {
|
||||
void getStats (MediaStreamTrack? selector, RTCStatsCallback successCallback, RTCPeerConnectionErrorCallback failureCallback);
|
||||
Promise<RTCStatsReport> getStats (optional MediaStreamTrack? selector);
|
||||
};
|
||||
|
||||
partial interface RTCPeerConnection {
|
||||
void setIdentityProvider (DOMString provider, optional DOMString protocol, optional DOMString username);
|
||||
void getIdentityAssertion ();
|
||||
readonly attribute RTCIdentityAssertion? peerIdentity;
|
||||
attribute EventHandler onidentityresult;
|
||||
attribute EventHandler onpeeridentity;
|
||||
attribute EventHandler onidpassertionerror;
|
||||
attribute EventHandler onidpvalidationerror;
|
||||
void setIdentityProvider (DOMString provider, optional DOMString protocol, optional DOMString usernameHint);
|
||||
Promise<DOMString> getIdentityAssertion ();
|
||||
readonly attribute Promise<RTCIdentityAssertion> peerIdentity;
|
||||
readonly attribute DOMString? idpLoginUrl;
|
||||
};
|
||||
|
||||
</script>
|
||||
|
|
|
@ -24,10 +24,7 @@ instance --use-fake-device-for-media-stream for Chrome.
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/vendor-prefix.js"
|
||||
data-prefixed-objects=
|
||||
'[{"ancestors":["navigator"], "name":"getUserMedia"},
|
||||
{"ancestors":["window"], "name":"RTCPeerConnection"},
|
||||
{"ancestors":["window"], "name":"RTCSessionDescription"},
|
||||
{"ancestors":["window"], "name":"RTCIceCandidate"}]'
|
||||
'[{"ancestors":["navigator"], "name":"getUserMedia"}]'
|
||||
data-prefixed-prototypes=
|
||||
'[{"ancestors":["HTMLMediaElement"],"name":"srcObject"}]'>
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue