2017-10-26 22:08:41 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2016-01-30 17:05:36 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2017-11-17 23:33:21 +00:00
|
|
|
bool nsPIDOMWindowOuter::IsLoading() const {
|
|
|
|
auto* win = GetCurrentInnerWindow();
|
2016-01-30 17:05:36 +00:00
|
|
|
|
2017-11-17 23:33:21 +00:00
|
|
|
if (!win) {
|
|
|
|
NS_ERROR("No current inner window available!");
|
2016-01-30 17:05:36 +00:00
|
|
|
|
2017-11-17 23:33:21 +00:00
|
|
|
return false;
|
|
|
|
}
|
2016-01-30 17:05:36 +00:00
|
|
|
|
2017-11-17 23:33:21 +00:00
|
|
|
return win->IsLoading();
|
2016-01-30 17:05:36 +00:00
|
|
|
}
|
|
|
|
|
2017-11-17 23:33:21 +00:00
|
|
|
bool nsPIDOMWindowInner::IsLoading() const {
|
2016-01-30 17:05:36 +00:00
|
|
|
if (!mOuterWindow) {
|
|
|
|
NS_ERROR("IsLoading() called on orphan inner window!");
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return !mIsDocumentLoaded;
|
|
|
|
}
|
|
|
|
|
2017-11-17 23:33:21 +00:00
|
|
|
bool nsPIDOMWindowOuter::IsHandlingResizeEvent() const {
|
|
|
|
auto* win = GetCurrentInnerWindow();
|
2016-01-30 17:05:36 +00:00
|
|
|
|
2017-11-17 23:33:21 +00:00
|
|
|
if (!win) {
|
|
|
|
NS_ERROR("No current inner window available!");
|
2016-01-30 17:05:36 +00:00
|
|
|
|
2017-11-17 23:33:21 +00:00
|
|
|
return false;
|
2016-01-30 17:05:36 +00:00
|
|
|
}
|
|
|
|
|
2017-11-17 23:33:21 +00:00
|
|
|
return win->IsHandlingResizeEvent();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool nsPIDOMWindowInner::IsHandlingResizeEvent() const {
|
2016-01-30 17:05:36 +00:00
|
|
|
if (!mOuterWindow) {
|
|
|
|
NS_ERROR("IsHandlingResizeEvent() called on orphan inner window!");
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return mIsHandlingResizeEvent;
|
|
|
|
}
|
|
|
|
|
2019-11-26 14:35:02 +00:00
|
|
|
bool nsPIDOMWindowInner::HasActiveDocument() { return IsCurrentInnerWindow(); }
|
2016-01-30 17:05:36 +00:00
|
|
|
|
2017-09-06 13:10:01 +00:00
|
|
|
bool nsPIDOMWindowInner::IsTopInnerWindow() const {
|
|
|
|
return mTopInnerWindow == this;
|
|
|
|
}
|
|
|
|
|
2017-11-21 18:25:27 +00:00
|
|
|
nsIDocShell* nsPIDOMWindowOuter::GetDocShell() const { return mDocShell; }
|
2016-01-30 17:05:36 +00:00
|
|
|
|
2017-11-21 18:25:27 +00:00
|
|
|
nsIDocShell* nsPIDOMWindowInner::GetDocShell() const {
|
|
|
|
return mOuterWindow ? mOuterWindow->GetDocShell() : nullptr;
|
|
|
|
}
|
|
|
|
|
2019-01-02 13:27:05 +00:00
|
|
|
mozilla::dom::BrowsingContext* nsPIDOMWindowOuter::GetBrowsingContext() const {
|
|
|
|
return mBrowsingContext;
|
|
|
|
}
|
|
|
|
|
2019-06-06 14:57:17 +00:00
|
|
|
mozilla::dom::BrowsingContext* nsPIDOMWindowInner::GetBrowsingContext() const {
|
|
|
|
return mBrowsingContext;
|
|
|
|
}
|
|
|
|
|
2018-04-26 19:28:30 +00:00
|
|
|
mozilla::dom::Element* nsPIDOMWindowOuter::GetFocusedElement() const {
|
|
|
|
return mInnerWindow ? mInnerWindow->GetFocusedElement() : nullptr;
|
2017-11-21 18:25:27 +00:00
|
|
|
}
|
2016-01-30 17:05:36 +00:00
|
|
|
|
2018-04-26 19:28:30 +00:00
|
|
|
mozilla::dom::Element* nsPIDOMWindowInner::GetFocusedElement() const {
|
|
|
|
return mFocusedElement;
|
2016-01-30 17:05:36 +00:00
|
|
|
}
|