From 8b9d1cc2204af718100851725af108b8bf86d758 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Wed, 20 Jul 2016 09:41:29 -0400 Subject: [PATCH] Use only the incumbent global in postMessage Previously one of the origin checks was performed with the entry settings object, while the origin and source attributes of the resulting MessageEvent were derived from the incumbent settings object. At least WebKit and Blink appear to use the same global for both, and it makes sense to align the checks on the same global. The difference is only observable in test cases that fiddle with document.domain, as entry and incumbent are always same origin-domain (but, in document.domain cases, not always same origin). Fixes #1542. Helps #1431 but hurts #1430. --- source | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source b/source index 8f23e598262..8527cf522c3 100644 --- a/source +++ b/source @@ -94277,9 +94277,11 @@ function receiver(e) {
  • Let targetRealm be this Window object's Realm.

  • -
  • Let entrySettings be the entry settings object.

  • -
  • Let incumbentSettings be the incumbent settings object.

  • +
  • Let cloneRecord be StructuredCloneWithTransfer(message, transfer, targetRealm). Rethrow any exceptions.

  • @@ -94298,7 +94300,7 @@ function receiver(e) {

    If the targetOrigin argument is a single literal U+002F SOLIDUS character (/), and the Document of the Window object on which the method was invoked does not have the same origin as the responsible - document specified by entrySettings, then abort these steps silently.

    + document specified by incumbentSettings, then abort these steps silently.

    Otherwise, if the targetOrigin argument is an absolute URL, and the Document of the Window object on which the method was invoked