mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +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,55 @@
|
|||
<!DOCTYPE html><html><head><title>javascript: URL creating a document in an about:blank iframe</title>
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/embedded-content.html#the-iframe-element">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/embedded-content.html#process-the-iframe-attributes">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-iframe-element">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#process-the-iframe-attributes">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log">FAILED (test did not run)</div>
|
||||
|
||||
<iframe src="about:blank" name="ifr1"></iframe>
|
||||
<iframe src="" name="ifr2"></iframe>
|
||||
<iframe src="./" name="ifr3"></iframe>
|
||||
|
||||
<script>
|
||||
var test = async_test();
|
||||
var results = {};
|
||||
var expected = {
|
||||
ifr1:{url:"about:blank", sameDom: true},
|
||||
ifr2:{url:"about:blank", sameDom: true},
|
||||
ifr3:{url: location.href.replace(/\/[^\/]*$/, '/'), sameDom: true },
|
||||
ifr4:{url:"about:blank", sameDom: true}
|
||||
}
|
||||
|
||||
var js_url = 'javascript:"<html><script>var sameDom = false; try{var cn = top.document.body.className;sameDom = true;}catch(e){}; parent.postMessage( {url: document.URL, name: name, sameDom: sameDom}, \'*\')<\/script><body><p>JS-generated document</p></body></<html>";'
|
||||
window.addEventListener('message', function(e){
|
||||
var ifr = e.data.name;
|
||||
results[ifr] = e.data;
|
||||
test.step(function(){
|
||||
assert_equals(results[ifr].url, expected[ifr].url);
|
||||
assert_equals(results[ifr].sameDom, expected[ifr].sameDom);
|
||||
}, 'Testing URL and details of IFRAME ' + ifr);
|
||||
if(Object.keys(results).length === Object.keys(expected).length){
|
||||
test.done();
|
||||
}
|
||||
}, false);
|
||||
|
||||
var ifr = document.createElement('iframe');
|
||||
ifr.name = 'ifr4';
|
||||
document.body.appendChild(ifr);
|
||||
|
||||
window.onload = function () {
|
||||
for (var i = 0, frame, frames = document.getElementsByTagName('iframe'); frame = frames[i]; i++) {
|
||||
try{
|
||||
frame.src = js_url;
|
||||
}catch(e){
|
||||
results[frame.name] = 'Exception on setting!';
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,39 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="uft-8">
|
||||
<title>HTML Test: iframe_sandbox_allow_scripts</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-iframe-sandbox">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-iframe-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<iframe id="testIframe" src="support/sandbox_allow_script.html" sandbox="allow-same-origin" style="display:none"></iframe>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var step1 = false;
|
||||
var t = async_test("iframe_sandbox_allow_scripts");
|
||||
|
||||
setup({timeout:1000});
|
||||
window.addEventListener("message", callback1, false);
|
||||
|
||||
function run() {
|
||||
window.removeEventListener("message", callback1, false);
|
||||
document.getElementById("testIframe").sandbox = "allow-scripts";
|
||||
document.getElementById("testIframe").contentWindow.location.reload();
|
||||
window.addEventListener("message", callback2, false);
|
||||
}
|
||||
|
||||
function callback1(e) {
|
||||
step1= !step1;
|
||||
}
|
||||
|
||||
function callback2(e) {
|
||||
t.step(function () {
|
||||
assert_false(step1, "[allow-scripts] is not set.");
|
||||
assert_equals(e.data, "Script executed", "[allow-scripts] is set.");
|
||||
});
|
||||
t.done();
|
||||
}
|
||||
|
||||
setTimeout(run, 500);
|
||||
</script>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<title>moving modified IFRAME in document (original page about:blank, DOM modification)</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<link rel="help" href="https://html.spec.whatwg.org/#iframe-load-event-steps">
|
||||
<iframe src="about:blank"></iframe>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
onload = function() {
|
||||
var ifr = document.getElementsByTagName('iframe')[0];
|
||||
ifr.contentDocument.body.appendChild(ifr.contentDocument.createElement('p')).textContent = 'Modified document';
|
||||
setTimeout(function() {
|
||||
ifr.onload = function() {
|
||||
assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1);
|
||||
done();
|
||||
};
|
||||
document.getElementById('target').appendChild(ifr);
|
||||
}, 100);
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<title>moving modified IFRAME in document (original page about:blank, document.write modification)</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<link rel="help" href="https://html.spec.whatwg.org/#iframe-load-event-steps">
|
||||
<iframe src="about:blank"></iframe>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
onload = function() {
|
||||
var ifr = document.getElementsByTagName('iframe')[0];
|
||||
ifr.contentDocument.open();
|
||||
ifr.contentDocument.write('Modified document');
|
||||
ifr.contentDocument.close();
|
||||
setTimeout(function() {
|
||||
ifr.onload = function() {
|
||||
assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1);
|
||||
done();
|
||||
};
|
||||
document.getElementById('target').appendChild(ifr);
|
||||
}, 100);
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<title>moving modified IFRAME in document (original page from server, DOM modification)</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<link rel="help" href="https://html.spec.whatwg.org/#iframe-load-event-steps">
|
||||
<iframe src="support/blank.htm"></iframe>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
onload = function() {
|
||||
var ifr = document.getElementsByTagName('iframe')[0];
|
||||
ifr.contentDocument.body.appendChild(ifr.contentDocument.createElement('p')).textContent = 'Modified document';
|
||||
setTimeout(function() {
|
||||
ifr.onload = function() {
|
||||
assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1);
|
||||
done();
|
||||
};
|
||||
document.getElementById('target').appendChild(ifr);
|
||||
}, 100);
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<title>moving modified IFRAME in document (original page from server, document.write modification)</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<link rel="help" href="https://html.spec.whatwg.org/#iframe-load-event-steps">
|
||||
<iframe src="support/blank.htm"></iframe>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
onload = function(){
|
||||
var ifr = document.getElementsByTagName('iframe')[0];
|
||||
ifr.contentDocument.open();
|
||||
ifr.contentDocument.write('Modified document');
|
||||
ifr.contentDocument.close();
|
||||
setTimeout(function() {
|
||||
ifr.onload = function () {
|
||||
assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1);
|
||||
done();
|
||||
};
|
||||
document.getElementById('target').appendChild(ifr);
|
||||
}, 100);
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1 @@
|
|||
<html></html>
|
|
@ -0,0 +1,8 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="uft-8">
|
||||
<title>HTML Test: sandbox_allow_scripts</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<div id="test">Before change</div>
|
||||
<script>
|
||||
parent.window.postMessage("Script executed", "*");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue