mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 796938 - Use GetEntryGlobal in nsWindowWatcher::URIFromURL. r=smaug
This commit is contained in:
parent
7af3b3dc36
commit
14a072e068
@ -1346,18 +1346,8 @@ nsWindowWatcher::URIfromURL(const char *aURL,
|
||||
nsIDOMWindow *aParent,
|
||||
nsIURI **aURI)
|
||||
{
|
||||
nsCOMPtr<nsIDOMWindow> baseWindow;
|
||||
|
||||
/* build the URI relative to the calling JS Context, if any.
|
||||
(note this is the same context used to make the security check
|
||||
in nsGlobalWindow.cpp.) */
|
||||
JSContext *cx = nsContentUtils::GetCurrentJSContext();
|
||||
if (cx) {
|
||||
nsIScriptContext *scriptcx = nsJSUtils::GetDynamicScriptContext(cx);
|
||||
if (scriptcx) {
|
||||
baseWindow = do_QueryInterface(scriptcx->GetGlobalObject());
|
||||
}
|
||||
}
|
||||
// Build the URI relative to the entry global.
|
||||
nsCOMPtr<nsIDOMWindow> baseWindow = do_QueryInterface(GetEntryGlobal());
|
||||
|
||||
// failing that, build it relative to the parent window, if possible
|
||||
if (!baseWindow)
|
||||
|
Loading…
Reference in New Issue
Block a user