mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision dc5cbf088edcdb266541d4e5a76149a2c6e716a0
This commit is contained in:
parent
1d40075f03
commit
079092dfea
2381 changed files with 90360 additions and 17722 deletions
|
@ -5,7 +5,8 @@
|
|||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-base-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<base id="base" href="http://{{domains[www]}}:{{ports[http][0]}}">
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<base id="base">
|
||||
<div id="log"></div>
|
||||
<img id="test" src="test.ico" style="display:none">
|
||||
|
||||
|
@ -13,16 +14,20 @@
|
|||
var testElement;
|
||||
var baseElement;
|
||||
|
||||
var otherOrigin = get_host_info().HTTP_REMOTE_ORIGIN;
|
||||
|
||||
setup(function() {
|
||||
testElement = document.getElementById("test");
|
||||
baseElement = document.getElementById("base");
|
||||
|
||||
baseElement.setAttribute("href", otherOrigin);
|
||||
});
|
||||
|
||||
test(function() {
|
||||
assert_equals(baseElement.href, "http://{{domains[www]}}:{{ports[http][0]}}/", "The href attribute of the base element is incorrect.");
|
||||
assert_equals(baseElement.href, otherOrigin + "/", "The href attribute of the base element is incorrect.");
|
||||
}, "The href attribute of the base element is specified");
|
||||
|
||||
test(function() {
|
||||
assert_equals(testElement.src, "http://{{domains[www]}}:{{ports[http][0]}}/test.ico", "The src attribute of the img element is incorrect.");
|
||||
assert_equals(testElement.src, otherOrigin + "/test.ico", "The src attribute of the img element is incorrect.");
|
||||
}, "The src attribute of the img element must relative to the href attribute of the base element");
|
||||
</script>
|
||||
|
|
|
@ -11,18 +11,12 @@ test(function() {
|
|||
valueOf: function() { throw Error() }
|
||||
};
|
||||
var tests = [
|
||||
[function() { return Audio() }, null, "No arguments, without new"],
|
||||
[function() { return new Audio() }, null, "No arguments, with new"],
|
||||
[function() { return Audio("") }, "", "Empty string argument, without new"],
|
||||
[function() { return new Audio("") }, "", "Empty string argument, with new"],
|
||||
[function() { return Audio("src") }, "src", "Non-empty string argument, without new"],
|
||||
[function() { return new Audio("src") }, "src", "Non-empty string argument, with new"],
|
||||
[function() { return Audio(null) }, "null", "Null argument, without new"],
|
||||
[function() { return new Audio(null) }, "null", "Null argument, with new"],
|
||||
[function() { return Audio(undefined) }, null, "Undefined argument, without new"],
|
||||
[function() { return new Audio(undefined) }, null, "Undefined argument, with new"],
|
||||
[function() { return Audio("", throwingObject) }, "", "Extra argument, without new"],
|
||||
[function() { return new Audio("", throwingObject) }, "", "Extra argument, with new"],
|
||||
[function() { return new Audio() }, null, "No arguments"],
|
||||
[function() { return new Audio("") }, "", "Empty string argument"],
|
||||
[function() { return new Audio("src") }, "src", "Non-empty string argument"],
|
||||
[function() { return new Audio(null) }, "null", "Null argument"],
|
||||
[function() { return new Audio(undefined) }, null, "Undefined argument"],
|
||||
[function() { return new Audio("", throwingObject) }, "", "Extra argument"],
|
||||
];
|
||||
tests.forEach(function(t) {
|
||||
var fn = t[0], expectedSrc = t[1], description = t[2];
|
||||
|
@ -38,6 +32,11 @@ test(function() {
|
|||
}, description);
|
||||
});
|
||||
});
|
||||
test(function() {
|
||||
assert_throws(new TypeError(), function() {
|
||||
Audio();
|
||||
});
|
||||
}, "Calling Audio should throw");
|
||||
test(function() {
|
||||
assert_throws(new TypeError(), function() {
|
||||
HTMLAudioElement();
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: security.drawImage.canvas.sub</title>
|
||||
<title>Canvas test: security.drawImage.canvas</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>security.drawImage.canvas.sub</h1>
|
||||
<h1>security.drawImage.canvas</h1>
|
||||
<p class="desc">drawImage of unclean canvas makes the canvas origin-unclean</p>
|
||||
|
||||
|
||||
|
@ -31,5 +31,6 @@ assert_throws("SECURITY_ERR", function() { ctx.getImageData(0, 0, 1, 1); });
|
|||
|
||||
});
|
||||
</script>
|
||||
<img src="http://{{domains[www2]}}:{{ports[http][0]}}/images/yellow.png" id="yellow.png" class="resource">
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="data:text/javascript,addCrossOriginYellowImage()"></script>
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: security.drawImage.image.sub</title>
|
||||
<title>Canvas test: security.drawImage.image</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>security.drawImage.image.sub</h1>
|
||||
<h1>security.drawImage.image</h1>
|
||||
<p class="desc">drawImage of different-origin image makes the canvas origin-unclean</p>
|
||||
|
||||
|
||||
|
@ -26,5 +26,6 @@ assert_throws("SECURITY_ERR", function() { ctx.getImageData(0, 0, 1, 1); });
|
|||
|
||||
});
|
||||
</script>
|
||||
<img src="http://{{domains[www2]}}:{{ports[http][0]}}/images/yellow.png" id="yellow.png" class="resource">
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="data:text/javascript,addCrossOriginYellowImage()"></script>
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: security.pattern.canvas.fillStyle.sub</title>
|
||||
<title>Canvas test: security.pattern.canvas.fillStyle</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>security.pattern.canvas.fillStyle.sub</h1>
|
||||
<h1>security.pattern.canvas.fillStyle</h1>
|
||||
<p class="desc">Setting fillStyle to a pattern of an unclean canvas makes the canvas origin-unclean</p>
|
||||
|
||||
|
||||
|
@ -33,5 +33,6 @@ assert_throws("SECURITY_ERR", function() { ctx.getImageData(0, 0, 1, 1); });
|
|||
|
||||
});
|
||||
</script>
|
||||
<img src="http://{{domains[www2]}}:{{ports[http][0]}}/images/yellow.png" id="yellow.png" class="resource">
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="data:text/javascript,addCrossOriginYellowImage()"></script>
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: security.pattern.canvas.strokeStyle.sub</title>
|
||||
<title>Canvas test: security.pattern.canvas.strokeStyle</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>security.pattern.canvas.strokeStyle.sub</h1>
|
||||
<h1>security.pattern.canvas.strokeStyle</h1>
|
||||
<p class="desc">Setting strokeStyle to a pattern of an unclean canvas makes the canvas origin-unclean</p>
|
||||
|
||||
|
||||
|
@ -33,5 +33,6 @@ assert_throws("SECURITY_ERR", function() { ctx.getImageData(0, 0, 1, 1); });
|
|||
|
||||
});
|
||||
</script>
|
||||
<img src="http://{{domains[www2]}}:{{ports[http][0]}}/images/yellow.png" id="yellow.png" class="resource">
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="data:text/javascript,addCrossOriginYellowImage()"></script>
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: security.pattern.canvas.timing.sub</title>
|
||||
<title>Canvas test: security.pattern.canvas.timing</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>security.pattern.canvas.timing.sub</h1>
|
||||
<h1>security.pattern.canvas.timing</h1>
|
||||
<p class="desc">Pattern safety depends on whether the source was origin-clean, not on whether it still is clean</p>
|
||||
|
||||
<p class="notes">Disagrees with spec on "is" vs "was"
|
||||
|
@ -36,5 +36,6 @@ _assert(true, "true"); // okay if there was no exception
|
|||
|
||||
});
|
||||
</script>
|
||||
<img src="http://{{domains[www2]}}:{{ports[http][0]}}/images/yellow.png" id="yellow.png" class="resource">
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="data:text/javascript,addCrossOriginYellowImage()"></script>
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: security.pattern.create.sub</title>
|
||||
<title>Canvas test: security.pattern.create</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>security.pattern.create.sub</h1>
|
||||
<h1>security.pattern.create</h1>
|
||||
<p class="desc">Creating an unclean pattern does not make the canvas origin-unclean</p>
|
||||
|
||||
|
||||
|
@ -27,5 +27,6 @@ _assert(true, "true"); // okay if there was no exception
|
|||
|
||||
});
|
||||
</script>
|
||||
<img src="http://{{domains[www]}}:{{ports[http][0]}}/images/yellow.png" id="yellow.png" class="resource">
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="data:text/javascript,addCrossOriginYellowImage()"></script>
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: security.pattern.cross.sub</title>
|
||||
<title>Canvas test: security.pattern.cross</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>security.pattern.cross.sub</h1>
|
||||
<h1>security.pattern.cross</h1>
|
||||
<p class="desc">Using an unclean pattern makes the target canvas origin-unclean, not the pattern canvas</p>
|
||||
|
||||
|
||||
|
@ -34,5 +34,6 @@ ctx2.getImageData(0, 0, 1, 1);
|
|||
|
||||
});
|
||||
</script>
|
||||
<img src="http://{{domains[www2]}}:{{ports[http][0]}}/images/yellow.png" id="yellow.png" class="resource">
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="data:text/javascript,addCrossOriginYellowImage()"></script>
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: security.pattern.image.fillStyle.sub</title>
|
||||
<title>Canvas test: security.pattern.image.fillStyle</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>security.pattern.image.fillStyle.sub</h1>
|
||||
<h1>security.pattern.image.fillStyle</h1>
|
||||
<p class="desc">Setting fillStyle to a pattern of a different-origin image makes the canvas origin-unclean</p>
|
||||
|
||||
|
||||
|
@ -28,5 +28,6 @@ assert_throws("SECURITY_ERR", function() { ctx.getImageData(0, 0, 1, 1); });
|
|||
|
||||
});
|
||||
</script>
|
||||
<img src="http://{{domains[www2]}}:{{ports[http][0]}}/images/yellow.png" id="yellow.png" class="resource">
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="data:text/javascript,addCrossOriginYellowImage()"></script>
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: security.pattern.image.strokeStyle.sub</title>
|
||||
<title>Canvas test: security.pattern.image.strokeStyle</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>security.pattern.image.strokeStyle.sub</h1>
|
||||
<h1>security.pattern.image.strokeStyle</h1>
|
||||
<p class="desc">Setting strokeStyle to a pattern of a different-origin image makes the canvas origin-unclean</p>
|
||||
|
||||
|
||||
|
@ -28,5 +28,6 @@ assert_throws("SECURITY_ERR", function() { ctx.getImageData(0, 0, 1, 1); });
|
|||
|
||||
});
|
||||
</script>
|
||||
<img src="http://{{domains[www2]}}:{{ports[http][0]}}/images/yellow.png" id="yellow.png" class="resource">
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="data:text/javascript,addCrossOriginYellowImage()"></script>
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: security.reset.sub</title>
|
||||
<title>Canvas test: security.reset</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>security.reset.sub</h1>
|
||||
<h1>security.reset</h1>
|
||||
<p class="desc">Resetting the canvas state does not reset the origin-clean flag</p>
|
||||
|
||||
|
||||
|
@ -28,5 +28,6 @@ assert_throws("SECURITY_ERR", function() { canvas.toDataURL(); });
|
|||
|
||||
});
|
||||
</script>
|
||||
<img src="http://{{domains[www2]}}:{{ports[http][0]}}/images/yellow.png" id="yellow.png" class="resource">
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="data:text/javascript,addCrossOriginYellowImage()"></script>
|
||||
|
|
@ -10,9 +10,8 @@
|
|||
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
function test_allowfullscreen(t, setup_iframe) {
|
||||
async_test(function(t) {
|
||||
var iframe = document.createElement("iframe");
|
||||
setup_iframe(iframe);
|
||||
iframe.src = "support/blank.htm";
|
||||
var eventWatcher = new EventWatcher(t, iframe, "load");
|
||||
document.body.appendChild(iframe);
|
||||
|
@ -21,74 +20,15 @@
|
|||
});
|
||||
|
||||
assert_true(document.fullscreenEnabled, "Top level document has fullscreen enabled flag set");
|
||||
eventWatcher.wait_for("load").then(t.step_func(function() {
|
||||
eventWatcher.wait_for("load").then(t.step_func_done(function() {
|
||||
assert_false(iframe.contentDocument.fullscreenEnabled, "Document inside iframe without allowfullscreen attribute should not have fullscreen enabled flag set");
|
||||
iframe.setAttribute("allowfullscreen", true);
|
||||
assert_false(iframe.contentDocument.fullscreenEnabled, "Setting allowfullscreen attribute after document load should not affect fullscreen enabled flag");
|
||||
iframe.contentWindow.location.reload();
|
||||
return eventWatcher.wait_for("load");
|
||||
})).then(t.step_func(function() {
|
||||
assert_true(iframe.contentDocument.fullscreenEnabled, "Fullscreen enabled flag should be set when a new document is loaded with allowfullscreen attribute present");
|
||||
assert_true(iframe.contentDocument.fullscreenEnabled, "Fullscreen should be allowed when allowfullscreen attribute is set");
|
||||
iframe.removeAttribute("allowfullscreen");
|
||||
assert_true(iframe.contentDocument.fullscreenEnabled, "Removing allowfullscreen attribute should not affect fullscreen enabled flag");
|
||||
iframe.contentWindow.location.reload();
|
||||
return eventWatcher.wait_for("load");
|
||||
})).then(t.step_func_done(function() {
|
||||
assert_false(iframe.contentDocument.fullscreenEnabled, "Fullscreen enabled flag should be reset when a new document is loaded with allowfullscreen attribute absent");
|
||||
assert_false(iframe.contentDocument.fullscreenEnabled, "Fullscreen should be denied when allowfullscreen attribute is removed");
|
||||
}));
|
||||
}
|
||||
|
||||
async_test(function(t) {
|
||||
test_allowfullscreen(t, function(iframe) {});
|
||||
}, "iframe-allowfullscreen");
|
||||
|
||||
async_test(function(t) {
|
||||
test_allowfullscreen(t, function(iframe) {
|
||||
iframe.setAttribute("sandbox", "allow-same-origin");
|
||||
});
|
||||
}, "iframe-sandbox-allowfullscreen");
|
||||
|
||||
/* Fullscreen enabled flag with dialog */
|
||||
|
||||
function test_allowfullscreen_dialog(t, setup_iframe, check) {
|
||||
var iframe = document.createElement("iframe");
|
||||
setup_iframe(iframe);
|
||||
iframe.src = "support/blank.htm";
|
||||
var eventWatcher = new EventWatcher(t, iframe, "load");
|
||||
document.body.appendChild(iframe);
|
||||
t.add_cleanup(function() {
|
||||
document.body.removeChild(iframe);
|
||||
});
|
||||
|
||||
var newWin;
|
||||
assert_true(document.fullscreenEnabled, "Top level document has fullscreen enabled flag set");
|
||||
eventWatcher.wait_for("load").then(t.step_func(function() {
|
||||
assert_false(iframe.contentDocument.fullscreenEnabled, "Document inside iframe without allowfullscreen attribute should not have fullscreen enabled flag set");
|
||||
newWin = iframe.contentWindow.open("support/blank.htm");
|
||||
t.add_cleanup(function() {
|
||||
newWin.close();
|
||||
});
|
||||
var newWinEventWatcher = new EventWatcher(t, newWin, "load");
|
||||
return newWinEventWatcher.wait_for("load");
|
||||
})).then(t.step_func_done(function() {
|
||||
check(newWin);
|
||||
}));
|
||||
}
|
||||
|
||||
async_test(function(t) {
|
||||
test_allowfullscreen_dialog(t, function() {}, function(newWin) {
|
||||
assert_true(newWin.document.fullscreenEnabled, "Document in the new window is a top level document, thus should has fullscreen enabled flag set");
|
||||
});
|
||||
}, "iframe-allowfullscreen-dialog");
|
||||
|
||||
async_test(function(t) {
|
||||
test_allowfullscreen_dialog(t, function(iframe) {
|
||||
iframe.setAttribute("sandbox", "allow-same-origin allow-popups");
|
||||
}, function(newWin) {
|
||||
assert_false(newWin.document.fullscreenEnabled, "Document in the new window should inherit the sandboxed fullscreen flag and should not have fullscreen enabled flag set");
|
||||
});
|
||||
}, "iframe-sandbox-allowfullscreen-dialog");
|
||||
|
||||
/* Fullscreen enabled flag with about:blank */
|
||||
|
||||
function test_allowfullscreen_noload(setup_iframe, check) {
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
{conditions: {minLength: "4", value: "abcde"}, expected: false, name: "[target] Dirty value - value is greater than minLength", dirty: true},
|
||||
{conditions: {minLength: "4", value: "\u0041\u0041\u0041\u0041\u0041"}, expected: false, name: "[target] Dirty value - length of value(AAAAA) in unicode is greater than minLength", dirty: true},
|
||||
{conditions: {minLength: "4", value: "abcd"}, expected: false, name: "[target] Dirty value - value equals to minLength", dirty: true},
|
||||
{conditions: {minLength: "4", value: "abc"}, expected: true, name: "[target] Dirty value - length of value is less than minLength", dirty: true}
|
||||
// False due to lack of required interactive editing by the user
|
||||
{conditions: {minLength: "4", value: "abc"}, expected: false, name: "[target] Dirty value - length of value is less than minLength", dirty: true}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -41,7 +42,8 @@
|
|||
{conditions: {minLength: "4", value: "abcde"}, expected: false, name: "[target] Dirty value - value is less than minLength", dirty: true},
|
||||
{conditions: {minLength: "4", value: "\u000D\u000A\u000D\u000A\u000D\u000A"}, expected: false, name: "[target] Dirty value - length of value(LF, CRLF) in unicode is less than minLength", dirty: true},
|
||||
{conditions: {minLength: "4", value: "abcd"}, expected: false, name: "[target] Dirty value - length of value equals to minLength", dirty: true},
|
||||
{conditions: {minLength: "4", value: "abc"}, expected: true, name: "[target] Dirty value - length of value is greater than minLength", dirty: true}
|
||||
// False due to lack of required interactive editing by the user
|
||||
{conditions: {minLength: "4", value: "abc"}, expected: false, name: "[target] Dirty value - length of value is greater than minLength", dirty: true}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<title>li element</title>
|
||||
<link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-li-element">
|
||||
<link rel="match" href="grouping-li-reftest-001.html" />
|
||||
<meta name="assert" content="The value attribute has no effect when applied to a li element whose parent is a non-ol element." />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<title>li element</title>
|
||||
<link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-li-element">
|
||||
<link rel="match" href="grouping-li-reftest-002-ref.html" />
|
||||
<meta name="assert" content="li elements with ol parents have ordinal values." />
|
||||
<style type="text/css">
|
||||
span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
<p>Unordered List</p>
|
||||
<ul id="unordered">
|
||||
<li id="test_li">list item</li>
|
||||
<li>list item</li>
|
||||
<li>list item</li>
|
||||
<li>list item</li>
|
||||
</ul>
|
||||
|
@ -116,23 +116,11 @@
|
|||
<script>
|
||||
"use strict";
|
||||
|
||||
var testLI = document.getElementById("test_li"), testList = [], i = 0;
|
||||
|
||||
// check that prototype matches spec's DOM interface
|
||||
test(function() {
|
||||
assert_equals(Object.getPrototypeOf(testLI), HTMLLIElement.prototype, "HTMLLIElement.prototype should be used for li");
|
||||
}, "The prototype for li is HTMLLIElement.prototype");
|
||||
|
||||
// check that "own" property "value" is present
|
||||
test(function() {
|
||||
assert_own_property(testLI,"value", "li should have a 'value' attribute");
|
||||
}, "li should have a 'value' attribute");
|
||||
|
||||
// "The [value] attribute has no default value" so, per https://html.spec.whatwg.org/multipage/#reflect,
|
||||
// the default when unspecified is 0
|
||||
testList = document.querySelectorAll("#unordered li, #basic li");
|
||||
test(function() {
|
||||
for(i = 0; i < testList.length; i++) {
|
||||
var testList = document.querySelectorAll("#unordered li, #basic li");
|
||||
for (var i = 0; i < testList.length; i++) {
|
||||
assert_equals(testList[i].value, 0, "Default (unspecified) value of value is 0.");
|
||||
}
|
||||
}, "Default (unspecified) value of value is 0.");
|
||||
|
@ -146,55 +134,55 @@
|
|||
|
||||
// start2's first element has value of 2
|
||||
test(function() {
|
||||
testLI = document.getElementById("start2").children[0];
|
||||
var testLI = document.getElementById("start2").children[0];
|
||||
assert_equals(testLI.value, 2, "value of 2 -> value of 2");
|
||||
}, ".value property reflects content attribute - and both parse value of '2' correctly.");
|
||||
|
||||
// negative's first element has value of -10
|
||||
test(function() {
|
||||
testLI = document.getElementById("negative").children[0];
|
||||
var testLI = document.getElementById("negative").children[0];
|
||||
assert_equals(testLI.value, -10, "value of -10 -> value of -10");
|
||||
}, "IDL and content attribute parse value of '-10' correctly.");
|
||||
|
||||
// posFloatDown's first element has value of 4.03 which should return 4
|
||||
test(function() {
|
||||
testLI = document.getElementById("posFloatDown").children[0];
|
||||
var testLI = document.getElementById("posFloatDown").children[0];
|
||||
assert_equals(testLI.value, 4, "value of 4.03 -> 4");
|
||||
}, "IDL and content attribute parse value of '4.03' correctly.");
|
||||
|
||||
// negFloatDown's first element has value of -4.03 which should return -4
|
||||
test(function() {
|
||||
testLI = document.getElementById("negFloatDown").children[0];
|
||||
var testLI = document.getElementById("negFloatDown").children[0];
|
||||
assert_equals(testLI.value, -4, "value of -4.03 -> -4");
|
||||
}, "IDL and content attribute parse value of '-4.03' correctly.");
|
||||
|
||||
// posFloatUp's first element has value of 4.9 which should return 4
|
||||
test(function() {
|
||||
testLI = document.getElementById("posFloatUp").children[0];
|
||||
var testLI = document.getElementById("posFloatUp").children[0];
|
||||
assert_equals(testLI.value, 4, "value of 4.9 -> 4");
|
||||
}, "IDL and content attribute parse value of '4.9' correctly.");
|
||||
|
||||
// negFloatUp's first element has value of -4.9 which should return -4
|
||||
test(function() {
|
||||
testLI = document.getElementById("negFloatUp").children[0];
|
||||
var testLI = document.getElementById("negFloatUp").children[0];
|
||||
assert_equals(testLI.value, -4, "value of -4.9 -> -4");
|
||||
}, "IDL and content attribute parse value of '-4.9' correctly.");
|
||||
|
||||
// exponent's first element has value of 7e2 which should return 7
|
||||
test(function() {
|
||||
testLI = document.getElementById("exponent").children[0];
|
||||
var testLI = document.getElementById("exponent").children[0];
|
||||
assert_equals(testLI.value, 7, "value of 7e2 -> 7");
|
||||
}, "IDL and content attribute parse value of '7e2' correctly.");
|
||||
|
||||
// decimal's first element has value of .5 which should return 0
|
||||
test(function() {
|
||||
testLI = document.getElementById("decimal").children[0];
|
||||
var testLI = document.getElementById("decimal").children[0];
|
||||
assert_equals(testLI.value, 0, "value of .5 -> 0 (default)");
|
||||
}, "IDL and content attribute parse value of '.5' correctly.");
|
||||
|
||||
// letter's first element has value of A which should return 0
|
||||
test(function() {
|
||||
testLI = document.getElementById("letter").children[0];
|
||||
var testLI = document.getElementById("letter").children[0];
|
||||
assert_equals(testLI.value, 0, "value of A -> 0 (default)");
|
||||
}, "IDL and content attribute parse value of 'A' correctly.");
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<title>ol element</title>
|
||||
<link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
|
||||
<link rel="match" href="grouping-ol-rev-reftest-001.html" />
|
||||
<meta name="assert" content="OL's reversed attribute creates a descending list." />
|
||||
<style type="text/css">
|
||||
span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<title>ol element</title>
|
||||
<link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
|
||||
<link rel="match" href="grouping-ol-start-reftest-001.html" />
|
||||
<meta name="assert" content="Sequences produced by calculated values for LI elements within OL match spec's expectations. (part one)" />
|
||||
<style type="text/css">
|
||||
span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<title>ol element</title>
|
||||
<link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
|
||||
<link rel="match" href="grouping-ol-start-reftest-002.html" />
|
||||
<meta name="assert" content="Sequences produced by calculated values for LI elements within OL match spec's expectations. (part two)" />
|
||||
<style type="text/css">
|
||||
span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<title>ol element</title>
|
||||
<link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
|
||||
<link rel="match" href="grouping-ol-type-reftest-001.html" />
|
||||
<meta name="assert" content="OL's type attribute defaults to decimal state." />
|
||||
<style type="text/css">
|
||||
span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<title>ol element</title>
|
||||
<link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
|
||||
<link rel="match" href="grouping-ol-type-reftest-002.html" />
|
||||
<meta name="assert" content="List items are rendered consistently with the state of the type attribute." />
|
||||
<style type="text/css">
|
||||
span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<title>ol element</title>
|
||||
<link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-element">
|
||||
<link rel="match" href="grouping-ol-type-reftest-003.html" />
|
||||
<meta name="assert" content="OL's type attribute defaults to decimal state." />
|
||||
<style type="text/css">
|
||||
span p {display:list-item; margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-top: 0; padding-bottom: 0;}
|
||||
|
|
|
@ -169,17 +169,17 @@
|
|||
// check that "own" properties reversed, start, and type are present
|
||||
test(function () {
|
||||
testList = document.getElementById("basic");
|
||||
assert_own_property(testList, "reversed");
|
||||
assert_idl_attribute(testList, "reversed");
|
||||
}, "'reversed' property should be defined on OL.");
|
||||
|
||||
test(function () {
|
||||
testList = document.getElementById("basic");
|
||||
assert_own_property(testList, "start");
|
||||
assert_idl_attribute(testList, "start");
|
||||
}, "'start' property should be defined on OL.");
|
||||
|
||||
test(function () {
|
||||
testList = document.getElementById("basic");
|
||||
assert_own_property(testList, "type");
|
||||
assert_idl_attribute(testList, "type");
|
||||
}, "'type' property should be defined on OL.");
|
||||
|
||||
// "The reversed, start, and type IDL attributes must reflect the respective content attributes of the same name."
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<title>pre element</title>
|
||||
<link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-pre-element">
|
||||
<link rel="match" href="grouping-pre-reftest-001.html" />
|
||||
<meta name="assert" content="Newlines within pre elements separate paragraphs for the purposes of BIDI." />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>Test of interfaces</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:Ms2ger@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/">
|
||||
|
|
|
@ -146,5 +146,5 @@ var elements = [
|
|||
["video", "Video"],
|
||||
["wbr", ""],
|
||||
["xmp", "Pre"],
|
||||
["å-bar", "Unknown"], // not a valid custom element name
|
||||
["\u00E5-bar", "Unknown"], // not a valid custom element name
|
||||
];
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>Reference of Alternate css</title>
|
||||
<link rel="match" href="alternate-css-ref.html">
|
||||
<link rel="stylesheet" href="preferred.css" title="preferred">
|
||||
<div>foobar</div>
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset=utf-8>
|
||||
<title>Selector: pseudo-classes (:valid, :invalid)</title>
|
||||
<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org" id=link1>
|
||||
|
@ -6,6 +8,13 @@
|
|||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="utils.js"></script>
|
||||
<style>
|
||||
#styleTests form, #styleTests fieldset, #failExample { background-color:red; }
|
||||
#styleTests > :valid, #validExample { background-color:green; }
|
||||
#styleTests > :invalid, #invalidExample { background-color:lime; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<div id='simpleConstraints'>
|
||||
<input type=text id=text1 value="foobar" required>
|
||||
|
@ -35,7 +44,27 @@
|
|||
<input type=number id=number1 value=0 min=1>
|
||||
<input type=number id=number2 value=1 min=1>
|
||||
</div>
|
||||
|
||||
<div id='styleTests'>
|
||||
<form>
|
||||
</form>
|
||||
<form>
|
||||
<input type=text min=8 value=4>
|
||||
</form>
|
||||
<form>
|
||||
<input type=number min=8 value=4>
|
||||
</form>
|
||||
<fieldset>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<input type=text min=8 value=4>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<input type=number min=8 value=4>
|
||||
</fieldset>
|
||||
<div id='validExample'></div>
|
||||
<div id='invalidExample'></div>
|
||||
<div id='failExample'></div>
|
||||
</div>
|
||||
<script>
|
||||
testSelectorIdsMatch("#simpleConstraints :valid", ["text1"], "':valid' matches elements that satisfy their constraints");
|
||||
|
||||
|
@ -65,4 +94,53 @@
|
|||
document.getElementById("text8").value="BBB";
|
||||
testSelectorIdsMatch("#patternConstraints :valid", ["text7"], "':valid' doesn't match new elements that do not satisfy their constraints");
|
||||
testSelectorIdsMatch("#patternConstraints :invalid", ["text8"], "':invalid' matches new elements that do not satisfy their constraints");
|
||||
|
||||
function getBGColor(elem) {
|
||||
return getComputedStyle(elem).backgroundColor;
|
||||
}
|
||||
|
||||
function testStyles(type) {
|
||||
var elems = document.querySelectorAll("#styleTests " + type),
|
||||
empty = elems[0],
|
||||
valid = elems[1],
|
||||
invalid = elems[2],
|
||||
validInput = valid.querySelector("input"),
|
||||
invalidInput = invalid.querySelector("input"),
|
||||
expectedValidBGColor = getBGColor(document.getElementById("validExample")),
|
||||
expectedInvalidBGColor = getBGColor(document.getElementById("invalidExample")),
|
||||
expectedFailBGColor = getBGColor(document.getElementById("failExample"));
|
||||
|
||||
test(function() {
|
||||
assert_equals(getBGColor(empty), expectedValidBGColor, "wrong background-color");
|
||||
}, 'empty ' + type + ' correctly styled on page-load');
|
||||
|
||||
test(function() {
|
||||
assert_equals(getBGColor(valid), expectedValidBGColor, "wrong background-color");
|
||||
}, 'valid ' + type + ' correctly styled on page-load');
|
||||
test(function() {
|
||||
assert_equals(getBGColor(invalid), expectedInvalidBGColor, "wrong background-color");
|
||||
}, 'invalid ' + type + ' correctly styled on page-load');
|
||||
|
||||
test(function() {
|
||||
empty.appendChild(validInput.cloneNode());
|
||||
assert_equals(getBGColor(empty), expectedValidBGColor, "wrong background-color");
|
||||
}, 'programmatically adding valid to empty ' + type + ' results in correct style');
|
||||
test(function() {
|
||||
empty.appendChild(invalidInput.cloneNode());
|
||||
assert_equals(getBGColor(empty), expectedInvalidBGColor, "wrong background-color");
|
||||
}, 'programmatically adding invalid to empty ' + type + ' results in correct style');
|
||||
|
||||
validInput.type = "number";
|
||||
invalidInput.type = "text";
|
||||
test(function() {
|
||||
assert_equals(getBGColor(valid), expectedInvalidBGColor, "wrong background-color");
|
||||
}, 'programmatically-invalidated ' + type + ' correctly styled');
|
||||
test(function() {
|
||||
assert_equals(getBGColor(invalid), expectedValidBGColor, "wrong background-color");
|
||||
}, 'programmatically-validated ' + type + ' correctly styled');
|
||||
}
|
||||
test(testStyles.bind(undefined, "form"), ":valid/:invalid styling for <form>");
|
||||
test(testStyles.bind(undefined, "fieldset"), ":valid/:invalid styling for <fieldset>");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
</table>
|
||||
<table id="table4" style="display:none">
|
||||
</table>
|
||||
<table id="table5" style="display:none">
|
||||
</table>
|
||||
<script>
|
||||
test(function () {
|
||||
var table0 = document.getElementById('table0');
|
||||
|
@ -81,6 +83,18 @@
|
|||
table4.deleteCaption();
|
||||
assert_equals(caption.parentNode, table4);
|
||||
}, "deleteCaption method not remove caption that is not in html namespace")
|
||||
test(function() {
|
||||
var table5 = document.getElementById('table5');
|
||||
var caption = document.createElement('caption');
|
||||
caption.appendChild(table5)
|
||||
|
||||
// Node cannot be inserted at the specified point in the hierarchy
|
||||
assert_throws("HierarchyRequestError", function() {
|
||||
table5.caption = caption;
|
||||
});
|
||||
|
||||
assert_not_equals(table5.caption, caption);
|
||||
}, "Setting caption rethrows exception");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -37,6 +37,15 @@ test(function() {
|
|||
assert_equals(t.tFoot.previousSibling, tbody2);
|
||||
assert_equals(t.tFoot.nextSibling, null);
|
||||
|
||||
t.deleteTFoot();
|
||||
assert_equals(t.tFoot, null);
|
||||
|
||||
t.tFoot = tfoot;
|
||||
assert_equals(t.tFoot, tfoot);
|
||||
|
||||
assert_equals(t.tFoot.previousSibling, tbody2);
|
||||
assert_equals(t.tFoot.nextSibling, null);
|
||||
|
||||
assert_throws(new TypeError(), function(){
|
||||
t.tFoot = document.createElement("div");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue