mirror of
https://github.com/servo/servo.git
synced 2025-06-24 17:14:33 +01:00
Update web-platform-tests to revision 0d318188757a9c996e20b82db201fd04de5aa255
This commit is contained in:
parent
b2a5225831
commit
1a81b18b9f
12321 changed files with 544385 additions and 6 deletions
|
@ -0,0 +1,50 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: object - attributes</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<body onload="on_load()">
|
||||
<div id="log"></div>
|
||||
<form>
|
||||
<object id="obj1" data="blue.html" name="o" height="50" width="100"></object>
|
||||
<object id="obj2" name="p" type="image/png"></object>
|
||||
</form>
|
||||
<script>
|
||||
var obj1;
|
||||
var obj2;
|
||||
var t1 = async_test("object.contentWindow");
|
||||
var t3 = async_test("object.width");
|
||||
var t4 = async_test("object.height");
|
||||
|
||||
setup(function() {
|
||||
obj1 = document.getElementById("obj1");
|
||||
obj2 = document.getElementById("obj2");
|
||||
});
|
||||
|
||||
function on_load () {
|
||||
t1.step(function() {
|
||||
assert_equals(obj1.contentWindow.name, "o", "The contentWindow's name of the object element should be 'o'.");
|
||||
assert_equals(obj2.contentWindow, null, "The contentWindow of the object element should be null when it type attribute starts with 'image/'.");
|
||||
obj1.setAttribute("name", "o1");
|
||||
assert_equals(obj1.name, "o1", "The name of the object element should be 'o1'.");
|
||||
assert_equals(obj1.contentWindow.name, "o1", "The contentWindow's name of the object element should be 'o1'.");
|
||||
obj1.removeAttribute("name");
|
||||
assert_equals(obj1.name, "", "The name of the object element should be empty string.");
|
||||
assert_equals(obj1.contentWindow.name, "", "The contentWindow's name of the object element should be empty string.");
|
||||
});
|
||||
t1.done()
|
||||
|
||||
t3.step(function() {
|
||||
assert_equals(getComputedStyle(obj1, null)["width"], "100px", "The width should be 100px.");
|
||||
});
|
||||
t3.done();
|
||||
|
||||
t4.step(function() {
|
||||
assert_equals(getComputedStyle(obj1, null)["height"], "50px", "The height should be 50px.");
|
||||
});
|
||||
t4.done();
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
|
@ -0,0 +1,65 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: object-events</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
|
||||
async_test(function(t) {
|
||||
var obj = document.createElement("object");
|
||||
obj.onerror = t.step_func_done(function(e){
|
||||
assert_equals(Object.getPrototypeOf(e).constructor, Event, "The error event should use the Event interface.");
|
||||
assert_true(e.isTrusted, "The error event should be a trusted event.");
|
||||
assert_false(e.cancelable, "The error event should not be a cancelable event.");
|
||||
assert_false(e.bubbles, "The error event should not be a bubble event.");
|
||||
assert_equals(e.target, obj, "The error event target should be the corresponding object element.");
|
||||
});
|
||||
|
||||
obj.onload = t.step_func_done(function(e){
|
||||
assert_unreached("The load event should not be fired.");
|
||||
});
|
||||
|
||||
obj.data = "file:\\http://nonexistent.html";
|
||||
document.body.appendChild(obj);
|
||||
}, "error event");
|
||||
|
||||
async_test(function(t) {
|
||||
var obj = document.createElement("object");
|
||||
obj.onload = t.step_func_done(function(e){
|
||||
assert_equals(Object.getPrototypeOf(e).constructor, Event, "The load event should use the Event interface.");
|
||||
assert_true(e.isTrusted, "The load event should be a trusted event.");
|
||||
assert_false(e.cancelable, "The load event should not be a cancelable event.");
|
||||
assert_false(e.bubbles, "The load event should not be a bubble event.");
|
||||
assert_equals(e.target, obj, "The load event target should be the corresponding object element.");
|
||||
});
|
||||
|
||||
obj.onerror = t.step_func_done(function(e){
|
||||
assert_unreached("The error event should not be fired.");
|
||||
});
|
||||
|
||||
obj.data = "/images/blue.png";
|
||||
document.body.appendChild(obj);
|
||||
}, "load event");
|
||||
|
||||
async_test(function(t) {
|
||||
var obj = document.createElement("object");
|
||||
obj.onload = t.step_func_done(function(e){
|
||||
assert_true(obj.contentWindow instanceof Window, "The object element should represent a nested browsing context.")
|
||||
assert_equals(Object.getPrototypeOf(e).constructor, Event, "The load event should use the Event interface.");
|
||||
assert_true(e.isTrusted, "The load event should be a trusted event.");
|
||||
assert_false(e.cancelable, "The load event should not be a cancelable event.");
|
||||
assert_false(e.bubbles, "The load event should not be a bubble event.");
|
||||
assert_equals(e.target, obj, "The load event target should be the corresponding object element.");
|
||||
});
|
||||
|
||||
obj.onerror = t.step_func_done(function(e){
|
||||
assert_unreached("The error event should not be fired.");
|
||||
});
|
||||
|
||||
obj.data = "about:blank";
|
||||
document.body.appendChild(obj);
|
||||
}, "load event of about:blank");
|
||||
|
||||
</script>
|
|
@ -0,0 +1,41 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: display fallback content</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
|
||||
var t1 = async_test("the typemustmatch attribute is specified");
|
||||
var t2 = async_test("the typemustmatch attribute is not specified");
|
||||
|
||||
</script>
|
||||
<body onload="t1.done(); t2.done()">
|
||||
<object id="obj"></object>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
|
||||
t1.step(function() {
|
||||
var obj1 = document.createElement("object");
|
||||
obj1.setAttribute("data", "/images/blue.png");
|
||||
obj1.setAttribute("type", "text/plain");
|
||||
obj1.setAttribute("typemustmatch", "");
|
||||
obj1.onload = t1.step_func(function () {
|
||||
assert_true("typeMustMatch" in obj1, "typeMustMatch is not supported.");
|
||||
assert_unreached("The image of the first object should not be loaded.");
|
||||
});
|
||||
document.getElementById("obj").appendChild(obj1);
|
||||
});
|
||||
|
||||
t2.step(function () {
|
||||
var obj2 = document.createElement("object");
|
||||
obj2.setAttribute("data", "test2.html");
|
||||
obj2.setAttribute("type", "text/plain");
|
||||
obj2.onload = t2.step_func( function () {
|
||||
assert_not_equals(obj2.contentDocument, null, "The test2.html should be loaded.");
|
||||
});
|
||||
document.getElementById("obj").appendChild(obj2);
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,33 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: object - handler</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com" />
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<object id="test" name="obj" data="test0.html" type="text/html"></object>
|
||||
<script>
|
||||
|
||||
var t1 = async_test("The nested browsing context must be navigated to the resource specified by the data attribute.");
|
||||
var t2 = async_test("The object.data must not be updated if the browsing context gets further navigated.");
|
||||
|
||||
function callback(data) {
|
||||
if (data == "test0") {
|
||||
t1.step(function() {
|
||||
var testEle = document.getElementById("test");
|
||||
assert_true(testEle.contentDocument.location.href.indexOf("test0.html") != -1, "The nested browsing context should be navigated to test0.html.");
|
||||
window["obj"].history.replaceState({state:"ok"}, "mytitle ", "object-fallback.html");
|
||||
assert_not_equals(testEle.contentDocument.location.href.indexOf("object-fallback.html"), -1, "The nested browsing context should be replacement enabled.");
|
||||
});
|
||||
t1.done();
|
||||
} else if (data == "test1") {
|
||||
t2.step(function() {
|
||||
var testEle = document.getElementById("test");
|
||||
assert_true(testEle.contentDocument.location.href.indexOf("test1.html") != -1, "The browsing context should be navigated to test1.html.");
|
||||
assert_true(testEle.data.indexOf("test0.html") != -1, "The value of attribute data should not be updated.");
|
||||
});
|
||||
t2.done();
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<script>
|
||||
|
||||
parent.callback("test0");
|
||||
document.location.href = "test1.html";
|
||||
|
||||
</script>
|
|
@ -0,0 +1,9 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<script>
|
||||
|
||||
parent.callback("test1");
|
||||
|
||||
</script>
|
|
@ -0,0 +1,4 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: object - fallback</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
Loading…
Add table
Add a link
Reference in a new issue