Provide the source window as part of postMessage events.

This commit is contained in:
Josh Matthews 2018-12-20 16:16:51 -05:00
parent 212ae3b94a
commit 45619db0ba
12 changed files with 128 additions and 26 deletions

View file

@ -203,11 +203,12 @@ impl DissimilarOriginWindow {
None => return warn!("postMessage called with no incumbent global"),
Some(incumbent) => incumbent,
};
let msg = ScriptMsg::PostMessage(
self.window_proxy.browsing_context_id(),
origin,
data.move_to_arraybuffer(),
);
let msg = ScriptMsg::PostMessage {
target: self.window_proxy.browsing_context_id(),
source: incumbent.pipeline_id(),
target_origin: origin,
data: data.move_to_arraybuffer(),
};
let _ = incumbent.script_to_constellation_chan().send(msg);
}
}