Bug 938640 - Move GetTopImpl. r=bz.

This commit is contained in:
Peter Van der Beken 2013-12-14 18:52:12 +01:00
parent 7efc937c92
commit 3fc92d7b48

View File

@ -3624,29 +3624,6 @@ nsGlobalWindow::GetRealParent(nsIDOMWindow** aParent)
return NS_OK;
}
/**
* GetScriptableTop is called when script reads window.top.
*
* In contrast to GetRealTop, GetScriptableTop respects <iframe mozbrowser>
* boundaries. If we encounter a window owned by an <iframe mozbrowser> while
* walking up the window hierarchy, we'll stop and return that window.
*/
NS_IMETHODIMP
nsGlobalWindow::GetScriptableTop(nsIDOMWindow **aTop)
{
return GetTopImpl(aTop, /* aScriptable = */ true);
}
/**
* nsIDOMWindow::GetTop (when called from C++) is just a wrapper around
* GetRealTop.
*/
NS_IMETHODIMP
nsGlobalWindow::GetRealTop(nsIDOMWindow** aTop)
{
return GetTopImpl(aTop, /* aScriptable = */ false);
}
nsresult
nsGlobalWindow::GetTopImpl(nsIDOMWindow** aTop, bool aScriptable)
{
@ -3685,6 +3662,29 @@ nsGlobalWindow::GetTopImpl(nsIDOMWindow** aTop, bool aScriptable)
return NS_OK;
}
/**
* GetScriptableTop is called when script reads window.top.
*
* In contrast to GetRealTop, GetScriptableTop respects <iframe mozbrowser>
* boundaries. If we encounter a window owned by an <iframe mozbrowser> while
* walking up the window hierarchy, we'll stop and return that window.
*/
NS_IMETHODIMP
nsGlobalWindow::GetScriptableTop(nsIDOMWindow **aTop)
{
return GetTopImpl(aTop, /* aScriptable = */ true);
}
/**
* nsIDOMWindow::GetTop (when called from C++) is just a wrapper around
* GetRealTop.
*/
NS_IMETHODIMP
nsGlobalWindow::GetRealTop(nsIDOMWindow** aTop)
{
return GetTopImpl(aTop, /* aScriptable = */ false);
}
JSObject*
nsGlobalWindow::GetContent(JSContext* aCx, ErrorResult& aError)
{