mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +01:00
Update web-platform-tests to revision a46616a5b18e83587ddbbed756c7b96cbb4b015d
This commit is contained in:
parent
3f07cfec7c
commit
578498ba24
4001 changed files with 159517 additions and 30260 deletions
|
@ -0,0 +1,31 @@
|
|||
def main(request, response):
|
||||
origin = request.GET.first("origin");
|
||||
value = request.GET.first("value");
|
||||
return ([("Content-Type", "text/html")],
|
||||
"""<!DOCTYPE html>
|
||||
<title>XFO.</title>
|
||||
<body>
|
||||
<script>
|
||||
var gotMessage = false;
|
||||
window.addEventListener("message", e => {
|
||||
gotMessage = true;
|
||||
window.parent.postMessage(e.data, "*");
|
||||
});
|
||||
|
||||
var i = document.createElement("iframe");
|
||||
i.src = "%s/x-frame-options/support/xfo.py?value=%s";
|
||||
i.onload = _ => {
|
||||
// Why two rAFs? Because that seems to be enough to stop the
|
||||
// load event from racing with the onmessage event.
|
||||
requestAnimationFrame(_ => {
|
||||
requestAnimationFrame(_ => {
|
||||
if (!gotMessage) {
|
||||
window.parent.postMessage("Failed", "*");
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
document.body.appendChild(i);
|
||||
</script>
|
||||
""" % (origin, value))
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue