Coverage Report

Created: 2018-09-25 14:53

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