/work/obj-fuzz/dist/include/nsPIDOMWindowInlines.h
Line | Count | Source (jump to first uncovered line) |
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/. */ |
6 | | |
7 | | bool |
8 | | nsPIDOMWindowOuter::IsLoading() const |
9 | 0 | { |
10 | 0 | auto* win = GetCurrentInnerWindow(); |
11 | 0 |
|
12 | 0 | if (!win) { |
13 | 0 | NS_ERROR("No current inner window available!"); |
14 | 0 |
|
15 | 0 | return false; |
16 | 0 | } |
17 | 0 |
|
18 | 0 | return win->IsLoading(); |
19 | 0 | } |
20 | | |
21 | | bool |
22 | | nsPIDOMWindowInner::IsLoading() const |
23 | 0 | { |
24 | 0 | if (!mOuterWindow) { |
25 | 0 | NS_ERROR("IsLoading() called on orphan inner window!"); |
26 | 0 |
|
27 | 0 | return false; |
28 | 0 | } |
29 | 0 |
|
30 | 0 | return !mIsDocumentLoaded; |
31 | 0 | } |
32 | | |
33 | | bool |
34 | | nsPIDOMWindowOuter::IsHandlingResizeEvent() const |
35 | | { |
36 | | auto* win = GetCurrentInnerWindow(); |
37 | | |
38 | | if (!win) { |
39 | | NS_ERROR("No current inner window available!"); |
40 | | |
41 | | return false; |
42 | | } |
43 | | |
44 | | return win->IsHandlingResizeEvent(); |
45 | | } |
46 | | |
47 | | bool |
48 | | nsPIDOMWindowInner::IsHandlingResizeEvent() const |
49 | | { |
50 | | if (!mOuterWindow) { |
51 | | NS_ERROR("IsHandlingResizeEvent() called on orphan inner window!"); |
52 | | |
53 | | return false; |
54 | | } |
55 | | |
56 | | return mIsHandlingResizeEvent; |
57 | | } |
58 | | |
59 | | bool |
60 | | nsPIDOMWindowInner::IsCurrentInnerWindow() const |
61 | | { |
62 | | return mOuterWindow && mOuterWindow->GetCurrentInnerWindow() == AsInner(); |
63 | | } |
64 | | |
65 | | bool |
66 | | nsPIDOMWindowInner::HasActiveDocument() |
67 | | { |
68 | | return IsCurrentInnerWindow() || |
69 | | (mOuterWindow && |
70 | | mOuterWindow->GetCurrentInnerWindow() && |
71 | | mOuterWindow->GetCurrentInnerWindow()->GetDoc() == mDoc); |
72 | | } |
73 | | |
74 | | bool |
75 | | nsPIDOMWindowInner::IsTopInnerWindow() const |
76 | | { |
77 | | return mTopInnerWindow == this; |
78 | | } |
79 | | |
80 | | nsIDocShell* |
81 | | nsPIDOMWindowOuter::GetDocShell() const |
82 | 0 | { |
83 | 0 | return mDocShell; |
84 | 0 | } |
85 | | |
86 | | nsIDocShell* |
87 | | nsPIDOMWindowInner::GetDocShell() const |
88 | 0 | { |
89 | 0 | return mOuterWindow ? mOuterWindow->GetDocShell() : nullptr; |
90 | 0 | } |
91 | | |
92 | | mozilla::dom::Element* |
93 | | nsPIDOMWindowOuter::GetFocusedElement() const |
94 | | { |
95 | | return mInnerWindow ? mInnerWindow->GetFocusedElement() : nullptr; |
96 | | } |
97 | | |
98 | | mozilla::dom::Element* |
99 | | nsPIDOMWindowInner::GetFocusedElement() const |
100 | | { |
101 | | return mFocusedElement; |
102 | | } |