mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 545314 - Force an inner window here so that we return a working location object. r=peterv
This commit is contained in:
parent
b57a6ad5d3
commit
54ca1d9bd6
@ -6590,6 +6590,12 @@ nsWindowSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
||||
// here) since we must define window.location to prevent the
|
||||
// getter from being overriden (for security reasons).
|
||||
|
||||
// Note: Because we explicitly don't forward to the inner window
|
||||
// above, we have to ensure here that our window has a current
|
||||
// inner window so that the location object we return will work.
|
||||
|
||||
win->EnsureInnerWindow();
|
||||
|
||||
nsCOMPtr<nsIDOMLocation> location;
|
||||
rv = win->GetLocation(getter_AddRefs(location));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -114,6 +114,7 @@ _TEST_FILES = \
|
||||
test_bug534149.html \
|
||||
test_bug558973.html \
|
||||
test_bug563487.html \
|
||||
test_bug545314.html \
|
||||
test_bug548828.html \
|
||||
$(NULL)
|
||||
|
||||
|
30
dom/tests/mochitest/bugs/test_bug545314.html
Normal file
30
dom/tests/mochitest/bugs/test_bug545314.html
Normal file
@ -0,0 +1,30 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=545314
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 545314</title>
|
||||
<script type="application/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=545314">Mozilla Bug 545314</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<iframe id="ifr"></iframe>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Bug 545314 **/
|
||||
var frame = window.frames[0];
|
||||
frame.location.assign("http://localhost:8888/");
|
||||
ok(true, "location.assign didn't throw");
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user