зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1576787 - Handle RemoteObjectProxies in instanceof r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D43559 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
6772173be2
Коммит
ead45f248b
|
@ -2461,6 +2461,11 @@ bool InterfaceHasInstance(JSContext* cx, unsigned argc, JS::Value* vp) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IsRemoteObjectProxy(instance, clasp->mPrototypeID)) {
|
||||||
|
args.rval().setBoolean(true);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return CallOrdinaryHasInstance(cx, args);
|
return CallOrdinaryHasInstance(cx, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,6 @@ fail-if = fission # Bug 1573621: window.location access after cross-origin navig
|
||||||
[test_bug862380.html]
|
[test_bug862380.html]
|
||||||
[test_bug865260.html]
|
[test_bug865260.html]
|
||||||
[test_bug870423.html]
|
[test_bug870423.html]
|
||||||
fail-if = fission # isinstance hooks for remote object proxies.
|
|
||||||
[test_bug871887.html]
|
[test_bug871887.html]
|
||||||
[test_bug912322.html]
|
[test_bug912322.html]
|
||||||
[test_bug916945.html]
|
[test_bug916945.html]
|
||||||
|
|
|
@ -16,6 +16,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=870423
|
||||||
function go() {
|
function go() {
|
||||||
var sowin = $('soifr').contentWindow;
|
var sowin = $('soifr').contentWindow;
|
||||||
var xowin = $('xoifr').contentWindow;
|
var xowin = $('xoifr').contentWindow;
|
||||||
|
var xosswin = $('xossifr').contentWindow;
|
||||||
|
|
||||||
check(window, sowin, 'HTMLBodyElement', function(win) { return win.document.body; });
|
check(window, sowin, 'HTMLBodyElement', function(win) { return win.document.body; });
|
||||||
check(window, sowin, 'HTMLDocument', function(win) { return win.document; });
|
check(window, sowin, 'HTMLDocument', function(win) { return win.document; });
|
||||||
|
@ -25,6 +26,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=870423
|
||||||
ok(xowin instanceof Window, "Cross-origin instanceof should work");
|
ok(xowin instanceof Window, "Cross-origin instanceof should work");
|
||||||
ok(xowin.location instanceof Location, "Cross-origin instanceof should work");
|
ok(xowin.location instanceof Location, "Cross-origin instanceof should work");
|
||||||
|
|
||||||
|
// cross-origin same-site.
|
||||||
|
ok(xosswin instanceof Window, "Cross-origin instanceof should work");
|
||||||
|
ok(xosswin.location instanceof Location, "Cross-origin instanceof should work");
|
||||||
|
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,6 +50,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=870423
|
||||||
</div>
|
</div>
|
||||||
<iframe id="soifr" src="file_empty.html"></iframe>
|
<iframe id="soifr" src="file_empty.html"></iframe>
|
||||||
<iframe id="xoifr" src="http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html"></iframe>
|
<iframe id="xoifr" src="http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html"></iframe>
|
||||||
|
<!-- cross origin, same site -->
|
||||||
|
<iframe id="xossifr" src="//test1.mochi.test:8888/tests/js/xpconnect/tests/mochitest/file_empty.html"></iframe>
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
</pre>
|
</pre>
|
||||||
</body>
|
</body>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче