Use incumbent global for postmessage origin check.

This commit is contained in:
Josh Matthews 2018-12-20 16:18:34 -05:00
parent 51ab14086c
commit ec6a936f5c

View file

@ -865,11 +865,7 @@ impl WindowMethods for Window {
// Step 3-5.
let origin = match &origin[..] {
"*" => None,
"/" => {
// TODO(#12715): Should be the origin of the incumbent settings
// object, not self's.
Some(self.Document().origin().immutable().clone())
},
"/" => Some(source.Document().origin().immutable().clone()),
url => match ServoUrl::parse(&url) {
Ok(url) => Some(url.origin().clone()),
Err(_) => return Err(Error::Syntax),