Skip to content

Commit

Permalink
Referrer policy should be inherited from creator
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=178403
<rdar://problem/31546136>

Add missing file that I inadvertently forgot to commit in r223697. The tests depend on this file.

* http/tests/security/resources/nested-referrer-policy-postmessage.html: Added.

Canonical link: https://commits.webkit.org/194722@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223704 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
dydz committed Oct 19, 2017
1 parent 568212d commit f0ab08a
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
10 changes: 10 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
2017-10-19 Daniel Bates <dabates@apple.com>

Referrer policy should be inherited from creator
https://bugs.webkit.org/show_bug.cgi?id=178403
<rdar://problem/31546136>

Add missing file that I inadvertently forgot to commit in r223697. The tests depend on this file.

* http/tests/security/resources/nested-referrer-policy-postmessage.html: Added.

2017-10-19 Matt Lewis <jlewis3@apple.com>

Marked http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown.html as flaky.
Expand Down
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<script>
function ownerWindow()
{
var owner = window.parent;
if (owner === this)
owner = window.opener;
return owner;
}

function receiveMessage(messageEvent)
{
if (messageEvent.source !== ownerWindow())
ownerWindow().postMessage(messageEvent.data, "*"); // Forward to owner
else {
// From owner
if (messageEvent.data === "new-window")
window.open("referrer-policy-postmessage.php");
else if (messageEvent.data === "new-subframe") {
var subframe = document.createElement("iframe");
subframe.src = "referrer-policy-postmessage.php";
document.body.appendChild(subframe);
}
}
}

window.addEventListener("message", receiveMessage, false);
ownerWindow().postMessage("ready", "*");
</script>
</head>
</html>

0 comments on commit f0ab08a

Please sign in to comment.