mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1196163 part 3 - Derive value of window.fullScreen for content process from the sizemode of puppet widget. r=smaug
This commit is contained in:
parent
753bfea20d
commit
41026f8b05
@ -6225,7 +6225,7 @@ nsGlobalWindow::GetMainWidget()
|
||||
}
|
||||
|
||||
nsIWidget*
|
||||
nsGlobalWindow::GetNearestWidget()
|
||||
nsGlobalWindow::GetNearestWidget() const
|
||||
{
|
||||
nsIDocShell* docShell = GetDocShell();
|
||||
NS_ENSURE_TRUE(docShell, nullptr);
|
||||
@ -6666,8 +6666,16 @@ nsGlobalWindow::FullScreen() const
|
||||
nsCOMPtr<nsIDocShellTreeItem> rootItem;
|
||||
mDocShell->GetRootTreeItem(getter_AddRefs(rootItem));
|
||||
if (rootItem == mDocShell) {
|
||||
// We are the root window. Return our internal value.
|
||||
return mFullScreen;
|
||||
if (!XRE_IsContentProcess()) {
|
||||
// We are the root window. Return our internal value.
|
||||
return mFullScreen;
|
||||
}
|
||||
if (nsCOMPtr<nsIWidget> widget = GetNearestWidget()) {
|
||||
// We are in content process, figure out the value from
|
||||
// the sizemode of the puppet widget.
|
||||
return widget->SizeMode() == nsSizeMode_Fullscreen;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> window = rootItem->GetWindow();
|
||||
|
@ -1509,7 +1509,7 @@ public:
|
||||
bool WindowExists(const nsAString& aName, bool aLookForCallerOnJSStack);
|
||||
|
||||
already_AddRefed<nsIWidget> GetMainWidget();
|
||||
nsIWidget* GetNearestWidget();
|
||||
nsIWidget* GetNearestWidget() const;
|
||||
|
||||
void Freeze()
|
||||
{
|
||||
|
@ -368,7 +368,7 @@ public:
|
||||
/**
|
||||
* Get the docshell in this window.
|
||||
*/
|
||||
nsIDocShell *GetDocShell()
|
||||
nsIDocShell *GetDocShell() const
|
||||
{
|
||||
if (mOuterWindow) {
|
||||
return mOuterWindow->mDocShell;
|
||||
|
Loading…
Reference in New Issue
Block a user