1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef dom_base_nsPIDOMWindowInlines_h___
8 #define dom_base_nsPIDOMWindowInlines_h___
10 inline bool nsPIDOMWindowOuter::IsLoading() const {
11 auto* win
= GetCurrentInnerWindow();
14 NS_ERROR("No current inner window available!");
19 return win
->IsLoading();
22 inline bool nsPIDOMWindowInner::IsLoading() const {
24 NS_ERROR("IsLoading() called on orphan inner window!");
29 return !mIsDocumentLoaded
;
32 inline bool nsPIDOMWindowOuter::IsHandlingResizeEvent() const {
33 auto* win
= GetCurrentInnerWindow();
36 NS_ERROR("No current inner window available!");
41 return win
->IsHandlingResizeEvent();
44 inline bool nsPIDOMWindowInner::IsHandlingResizeEvent() const {
46 NS_ERROR("IsHandlingResizeEvent() called on orphan inner window!");
51 return mIsHandlingResizeEvent
;
54 inline bool nsPIDOMWindowInner::HasActiveDocument() {
55 return IsCurrentInnerWindow();
58 inline bool nsPIDOMWindowInner::IsTopInnerWindow() const {
59 return mTopInnerWindow
== this;
62 inline nsIDocShell
* nsPIDOMWindowOuter::GetDocShell() const {
66 inline nsIDocShell
* nsPIDOMWindowInner::GetDocShell() const {
67 return mOuterWindow
? mOuterWindow
->GetDocShell() : nullptr;
70 inline mozilla::dom::BrowsingContext
* nsPIDOMWindowOuter::GetBrowsingContext()
72 return mBrowsingContext
;
75 inline mozilla::dom::BrowsingContext
* nsPIDOMWindowInner::GetBrowsingContext()
77 return mBrowsingContext
;
80 inline mozilla::dom::Element
* nsPIDOMWindowOuter::GetFocusedElement() const {
81 return mInnerWindow
? mInnerWindow
->GetFocusedElement() : nullptr;
84 inline bool nsPIDOMWindowOuter::UnknownFocusMethodShouldShowOutline() const {
85 return mInnerWindow
&& mInnerWindow
->UnknownFocusMethodShouldShowOutline();