bug 825419 - outparamdel nsIDocShell::GetPresShell() r=smaug
This commit is contained in:
@@ -117,9 +117,7 @@ public:
|
|||||||
static DocAccessible* GetDocAccessibleFor(nsIDocShellTreeItem* aContainer)
|
static DocAccessible* GetDocAccessibleFor(nsIDocShellTreeItem* aContainer)
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aContainer));
|
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aContainer));
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
return GetAccService()->GetDocAccessible(docShell->GetPresShell());
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
return GetAccService()->GetDocAccessible(presShell);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -196,9 +196,7 @@ nsAccessibilityService::GetRootDocumentAccessible(nsIPresShell* aPresShell,
|
|||||||
treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
|
treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
|
||||||
if (treeItem != rootTreeItem) {
|
if (treeItem != rootTreeItem) {
|
||||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(rootTreeItem));
|
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(rootTreeItem));
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
ps = docShell->GetPresShell();
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
ps = presShell;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return aCanCreate ? GetDocAccessible(ps) : ps->GetDocAccessible();
|
return aCanCreate ? GetDocAccessible(ps) : ps->GetDocAccessible();
|
||||||
|
|||||||
@@ -6392,8 +6392,7 @@ nsContentUtils::FindPresShellForDocument(nsIDocument* aDoc)
|
|||||||
// Walk the docshell tree to find the nearest container that has a presshell,
|
// Walk the docshell tree to find the nearest container that has a presshell,
|
||||||
// and return that.
|
// and return that.
|
||||||
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(docShellTreeItem);
|
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(docShellTreeItem);
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsIPresShell* presShell = docShell->GetPresShell();
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
if (presShell) {
|
if (presShell) {
|
||||||
return presShell;
|
return presShell;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -801,8 +801,7 @@ nsFrameLoader::Show(int32_t marginWidth, int32_t marginHeight,
|
|||||||
scrollbarPrefY);
|
scrollbarPrefY);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
|
||||||
mDocShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
if (presShell) {
|
if (presShell) {
|
||||||
// Ensure root scroll frame is reflowed in case scroll preferences or
|
// Ensure root scroll frame is reflowed in case scroll preferences or
|
||||||
// margins have changed
|
// margins have changed
|
||||||
@@ -847,8 +846,7 @@ nsFrameLoader::Show(int32_t marginWidth, int32_t marginHeight,
|
|||||||
// sub-document. This shouldn't be necessary, but given the way our
|
// sub-document. This shouldn't be necessary, but given the way our
|
||||||
// editor works, it is. See
|
// editor works, it is. See
|
||||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=284245
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=284245
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
|
||||||
mDocShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
if (presShell) {
|
if (presShell) {
|
||||||
nsCOMPtr<nsIDOMHTMLDocument> doc =
|
nsCOMPtr<nsIDOMHTMLDocument> doc =
|
||||||
do_QueryInterface(presShell->GetDocument());
|
do_QueryInterface(presShell->GetDocument());
|
||||||
|
|||||||
@@ -744,9 +744,7 @@ protected:
|
|||||||
return mCanvasElement->OwnerDoc()->GetShell();
|
return mCanvasElement->OwnerDoc()->GetShell();
|
||||||
}
|
}
|
||||||
if (mDocShell) {
|
if (mDocShell) {
|
||||||
nsCOMPtr<nsIPresShell> shell;
|
return mDocShell->GetPresShell();
|
||||||
mDocShell->GetPresShell(getter_AddRefs(shell));
|
|
||||||
return shell.get();
|
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,8 +175,7 @@ PrintDocTree(nsIDocShellTreeItem* aParentItem, int aLevel)
|
|||||||
nsCOMPtr<nsIDocShell> parentAsDocShell(do_QueryInterface(aParentItem));
|
nsCOMPtr<nsIDocShell> parentAsDocShell(do_QueryInterface(aParentItem));
|
||||||
int32_t type;
|
int32_t type;
|
||||||
aParentItem->GetItemType(&type);
|
aParentItem->GetItemType(&type);
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = parentAsDocShell->GetPresShell();
|
||||||
parentAsDocShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
nsRefPtr<nsPresContext> presContext;
|
nsRefPtr<nsPresContext> presContext;
|
||||||
parentAsDocShell->GetPresContext(getter_AddRefs(presContext));
|
parentAsDocShell->GetPresContext(getter_AddRefs(presContext));
|
||||||
nsCOMPtr<nsIContentViewer> cv;
|
nsCOMPtr<nsIContentViewer> cv;
|
||||||
@@ -1467,8 +1466,7 @@ nsEventStateManager::HandleAccessKey(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
nsCOMPtr<nsIDocShell> subDS = do_QueryInterface(subShellItem);
|
nsCOMPtr<nsIDocShell> subDS = do_QueryInterface(subShellItem);
|
||||||
if (subDS && IsShellVisible(subDS)) {
|
if (subDS && IsShellVisible(subDS)) {
|
||||||
nsCOMPtr<nsIPresShell> subPS;
|
nsCOMPtr<nsIPresShell> subPS = subDS->GetPresShell();
|
||||||
subDS->GetPresShell(getter_AddRefs(subPS));
|
|
||||||
|
|
||||||
// Docshells need not have a presshell (eg. display:none
|
// Docshells need not have a presshell (eg. display:none
|
||||||
// iframes, docshells in transition between documents, etc).
|
// iframes, docshells in transition between documents, etc).
|
||||||
@@ -1504,9 +1502,7 @@ nsEventStateManager::HandleAccessKey(nsPresContext* aPresContext,
|
|||||||
docShell->GetParent(getter_AddRefs(parentShellItem));
|
docShell->GetParent(getter_AddRefs(parentShellItem));
|
||||||
nsCOMPtr<nsIDocShell> parentDS = do_QueryInterface(parentShellItem);
|
nsCOMPtr<nsIDocShell> parentDS = do_QueryInterface(parentShellItem);
|
||||||
if (parentDS) {
|
if (parentDS) {
|
||||||
nsCOMPtr<nsIPresShell> parentPS;
|
nsCOMPtr<nsIPresShell> parentPS = parentDS->GetPresShell();
|
||||||
|
|
||||||
parentDS->GetPresShell(getter_AddRefs(parentPS));
|
|
||||||
NS_ASSERTION(parentPS, "Our PresShell exists but the parent's does not?");
|
NS_ASSERTION(parentPS, "Our PresShell exists but the parent's does not?");
|
||||||
|
|
||||||
nsPresContext *parentPC = parentPS->GetPresContext();
|
nsPresContext *parentPC = parentPS->GetPresContext();
|
||||||
|
|||||||
@@ -2760,9 +2760,7 @@ static bool HasPresShell(nsPIDOMWindow *aWindow)
|
|||||||
nsIDocShell *docShell = aWindow->GetDocShell();
|
nsIDocShell *docShell = aWindow->GetDocShell();
|
||||||
if (!docShell)
|
if (!docShell)
|
||||||
return false;
|
return false;
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
return docShell->GetPresShell() != nullptr;
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
return presShell != nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|||||||
@@ -426,7 +426,7 @@ nsXBLWindowKeyHandler::IsEditor()
|
|||||||
nsIDocShell *docShell = piwin->GetDocShell();
|
nsIDocShell *docShell = piwin->GetDocShell();
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell;
|
||||||
if (docShell)
|
if (docShell)
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
presShell = docShell->GetPresShell();
|
||||||
|
|
||||||
if (presShell) {
|
if (presShell) {
|
||||||
return presShell->GetSelectionFlags() == nsISelectionDisplay::DISPLAY_ALL;
|
return presShell->GetSelectionFlags() == nsISelectionDisplay::DISPLAY_ALL;
|
||||||
|
|||||||
@@ -1037,9 +1037,8 @@ NS_IMETHODIMP nsDocShell::GetInterface(const nsIID & aIID, void **aSink)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
else if (aIID.Equals(NS_GET_IID(nsISelectionDisplay))) {
|
else if (aIID.Equals(NS_GET_IID(nsISelectionDisplay))) {
|
||||||
nsCOMPtr<nsIPresShell> shell;
|
nsIPresShell* shell = GetPresShell();
|
||||||
nsresult rv = GetPresShell(getter_AddRefs(shell));
|
if (shell)
|
||||||
if (NS_SUCCEEDED(rv) && shell)
|
|
||||||
return shell->QueryInterface(aIID,aSink);
|
return shell->QueryInterface(aIID,aSink);
|
||||||
}
|
}
|
||||||
else if (aIID.Equals(NS_GET_IID(nsIDocShellTreeOwner))) {
|
else if (aIID.Equals(NS_GET_IID(nsIDocShellTreeOwner))) {
|
||||||
@@ -1733,22 +1732,12 @@ nsDocShell::GetPresContext(nsPresContext ** aPresContext)
|
|||||||
return mContentViewer->GetPresContext(aPresContext);
|
return mContentViewer->GetPresContext(aPresContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP_(nsIPresShell*)
|
||||||
nsDocShell::GetPresShell(nsIPresShell ** aPresShell)
|
nsDocShell::GetPresShell()
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
|
||||||
|
|
||||||
NS_ENSURE_ARG_POINTER(aPresShell);
|
|
||||||
*aPresShell = nullptr;
|
|
||||||
|
|
||||||
nsRefPtr<nsPresContext> presContext;
|
nsRefPtr<nsPresContext> presContext;
|
||||||
(void) GetPresContext(getter_AddRefs(presContext));
|
(void) GetPresContext(getter_AddRefs(presContext));
|
||||||
|
return presContext ? presContext->GetPresShell() : nullptr;
|
||||||
if (presContext) {
|
|
||||||
NS_IF_ADDREF(*aPresShell = presContext->GetPresShell());
|
|
||||||
}
|
|
||||||
|
|
||||||
return rv;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
@@ -1869,8 +1858,7 @@ nsDocShell::GetCharset(char** aCharset)
|
|||||||
NS_ENSURE_ARG_POINTER(aCharset);
|
NS_ENSURE_ARG_POINTER(aCharset);
|
||||||
*aCharset = nullptr;
|
*aCharset = nullptr;
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsIPresShell* presShell = GetPresShell();
|
||||||
GetPresShell(getter_AddRefs(presShell));
|
|
||||||
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
||||||
nsIDocument *doc = presShell->GetDocument();
|
nsIDocument *doc = presShell->GetDocument();
|
||||||
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
|
||||||
@@ -3246,8 +3234,7 @@ PrintDocTree(nsIDocShellTreeItem * aParentNode, int aLevel)
|
|||||||
nsCOMPtr<nsIDocShell> parentAsDocShell(do_QueryInterface(aParentNode));
|
nsCOMPtr<nsIDocShell> parentAsDocShell(do_QueryInterface(aParentNode));
|
||||||
int32_t type;
|
int32_t type;
|
||||||
aParentNode->GetItemType(&type);
|
aParentNode->GetItemType(&type);
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = parentAsDocShell->GetPresShell();
|
||||||
parentAsDocShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
nsRefPtr<nsPresContext> presContext;
|
nsRefPtr<nsPresContext> presContext;
|
||||||
parentAsDocShell->GetPresContext(getter_AddRefs(presContext));
|
parentAsDocShell->GetPresContext(getter_AddRefs(presContext));
|
||||||
nsIDocument *doc = presShell->GetDocument();
|
nsIDocument *doc = presShell->GetDocument();
|
||||||
@@ -5051,8 +5038,7 @@ nsDocShell::DoGetPositionAndSize(int32_t * x, int32_t * y, int32_t * cx,
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsDocShell::Repaint(bool aForce)
|
nsDocShell::Repaint(bool aForce)
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell =GetPresShell();
|
||||||
GetPresShell(getter_AddRefs(presShell));
|
|
||||||
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
nsIViewManager* viewManager = presShell->GetViewManager();
|
nsIViewManager* viewManager = presShell->GetViewManager();
|
||||||
@@ -5117,8 +5103,7 @@ nsDocShell::GetVisibility(bool * aVisibility)
|
|||||||
if (!mContentViewer)
|
if (!mContentViewer)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
|
||||||
GetPresShell(getter_AddRefs(presShell));
|
|
||||||
if (!presShell)
|
if (!presShell)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
||||||
@@ -5143,11 +5128,10 @@ nsDocShell::GetVisibility(bool * aVisibility)
|
|||||||
treeItem->GetParent(getter_AddRefs(parentItem));
|
treeItem->GetParent(getter_AddRefs(parentItem));
|
||||||
while (parentItem) {
|
while (parentItem) {
|
||||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(treeItem));
|
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(treeItem));
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
presShell = docShell->GetPresShell();
|
||||||
|
|
||||||
nsCOMPtr<nsIDocShell> parentDS = do_QueryInterface(parentItem);
|
nsCOMPtr<nsIDocShell> parentDS = do_QueryInterface(parentItem);
|
||||||
nsCOMPtr<nsIPresShell> pPresShell;
|
nsCOMPtr<nsIPresShell> pPresShell = parentDS->GetPresShell();
|
||||||
parentDS->GetPresShell(getter_AddRefs(pPresShell));
|
|
||||||
|
|
||||||
// Null-check for crash in bug 267804
|
// Null-check for crash in bug 267804
|
||||||
if (!pPresShell) {
|
if (!pPresShell) {
|
||||||
@@ -5208,8 +5192,7 @@ nsDocShell::SetIsActive(bool aIsActive)
|
|||||||
mIsActive = aIsActive;
|
mIsActive = aIsActive;
|
||||||
|
|
||||||
// Tell the PresShell about it.
|
// Tell the PresShell about it.
|
||||||
nsCOMPtr<nsIPresShell> pshell;
|
nsCOMPtr<nsIPresShell> pshell = GetPresShell();
|
||||||
GetPresShell(getter_AddRefs(pshell));
|
|
||||||
if (pshell)
|
if (pshell)
|
||||||
pshell->SetIsActive(aIsActive);
|
pshell->SetIsActive(aIsActive);
|
||||||
|
|
||||||
@@ -7396,8 +7379,7 @@ nsDocShell::RestoreFromHistory()
|
|||||||
nsView *rootViewSibling = nullptr, *rootViewParent = nullptr;
|
nsView *rootViewSibling = nullptr, *rootViewParent = nullptr;
|
||||||
nsIntRect newBounds(0, 0, 0, 0);
|
nsIntRect newBounds(0, 0, 0, 0);
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> oldPresShell;
|
nsCOMPtr<nsIPresShell> oldPresShell = GetPresShell();
|
||||||
nsDocShell::GetPresShell(getter_AddRefs(oldPresShell));
|
|
||||||
if (oldPresShell) {
|
if (oldPresShell) {
|
||||||
nsIViewManager *vm = oldPresShell->GetViewManager();
|
nsIViewManager *vm = oldPresShell->GetViewManager();
|
||||||
if (vm) {
|
if (vm) {
|
||||||
@@ -7618,8 +7600,7 @@ nsDocShell::RestoreFromHistory()
|
|||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> shell;
|
nsCOMPtr<nsIPresShell> shell = GetPresShell();
|
||||||
nsDocShell::GetPresShell(getter_AddRefs(shell));
|
|
||||||
|
|
||||||
nsIViewManager *newVM = shell ? shell->GetViewManager() : nullptr;
|
nsIViewManager *newVM = shell ? shell->GetViewManager() : nullptr;
|
||||||
nsView *newRootView = newVM ? newVM->GetRootView() : nullptr;
|
nsView *newRootView = newVM ? newVM->GetRootView() : nullptr;
|
||||||
@@ -7899,8 +7880,7 @@ nsDocShell::CreateContentViewer(const char *aContentType,
|
|||||||
// the ID can be used to distinguish it from the other parts.
|
// the ID can be used to distinguish it from the other parts.
|
||||||
nsCOMPtr<nsIMultiPartChannel> multiPartChannel(do_QueryInterface(request));
|
nsCOMPtr<nsIMultiPartChannel> multiPartChannel(do_QueryInterface(request));
|
||||||
if (multiPartChannel) {
|
if (multiPartChannel) {
|
||||||
nsCOMPtr<nsIPresShell> shell;
|
nsCOMPtr<nsIPresShell> shell = GetPresShell();
|
||||||
rv = GetPresShell(getter_AddRefs(shell));
|
|
||||||
if (NS_SUCCEEDED(rv) && shell) {
|
if (NS_SUCCEEDED(rv) && shell) {
|
||||||
nsIDocument *doc = shell->GetDocument();
|
nsIDocument *doc = shell->GetDocument();
|
||||||
if (doc) {
|
if (doc) {
|
||||||
@@ -9605,12 +9585,11 @@ nsDocShell::ScrollToAnchor(nsACString & aCurHash, nsACString & aNewHash,
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> shell;
|
nsCOMPtr<nsIPresShell> shell = GetPresShell();
|
||||||
nsresult rv = GetPresShell(getter_AddRefs(shell));
|
if (!shell) {
|
||||||
if (NS_FAILED(rv) || !shell) {
|
|
||||||
// If we failed to get the shell, or if there is no shell,
|
// If we failed to get the shell, or if there is no shell,
|
||||||
// nothing left to do here.
|
// nothing left to do here.
|
||||||
return rv;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have no new anchor, we do not want to scroll, unless there is a
|
// If we have no new anchor, we do not want to scroll, unless there is a
|
||||||
@@ -9652,7 +9631,7 @@ nsDocShell::ScrollToAnchor(nsACString & aCurHash, nsACString & aNewHash,
|
|||||||
// conversion will fail and give us an empty Unicode string.
|
// conversion will fail and give us an empty Unicode string.
|
||||||
// In that case, we should just fall through to using the
|
// In that case, we should just fall through to using the
|
||||||
// page's charset.
|
// page's charset.
|
||||||
rv = NS_ERROR_FAILURE;
|
nsresult rv = NS_ERROR_FAILURE;
|
||||||
NS_ConvertUTF8toUTF16 uStr(str);
|
NS_ConvertUTF8toUTF16 uStr(str);
|
||||||
if (!uStr.IsEmpty()) {
|
if (!uStr.IsEmpty()) {
|
||||||
rv = shell->GoToAnchor(NS_ConvertUTF8toUTF16(str), scroll);
|
rv = shell->GoToAnchor(NS_ConvertUTF8toUTF16(str), scroll);
|
||||||
@@ -10635,9 +10614,8 @@ NS_IMETHODIMP nsDocShell::PersistLayoutHistoryState()
|
|||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
if (mOSHE) {
|
if (mOSHE) {
|
||||||
nsCOMPtr<nsIPresShell> shell;
|
nsCOMPtr<nsIPresShell> shell = GetPresShell();
|
||||||
rv = GetPresShell(getter_AddRefs(shell));
|
if (shell) {
|
||||||
if (NS_SUCCEEDED(rv) && shell) {
|
|
||||||
nsCOMPtr<nsILayoutHistoryState> layoutState;
|
nsCOMPtr<nsILayoutHistoryState> layoutState;
|
||||||
rv = shell->CaptureHistoryState(getter_AddRefs(layoutState));
|
rv = shell->CaptureHistoryState(getter_AddRefs(layoutState));
|
||||||
}
|
}
|
||||||
@@ -11283,8 +11261,7 @@ nsDocShell::GetChildOffset(nsIDOMNode * aChild, nsIDOMNode * aParent,
|
|||||||
nsIScrollableFrame *
|
nsIScrollableFrame *
|
||||||
nsDocShell::GetRootScrollFrame()
|
nsDocShell::GetRootScrollFrame()
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIPresShell> shell;
|
nsCOMPtr<nsIPresShell> shell = GetPresShell();
|
||||||
NS_ENSURE_SUCCESS(GetPresShell(getter_AddRefs(shell)), nullptr);
|
|
||||||
NS_ENSURE_TRUE(shell, nullptr);
|
NS_ENSURE_TRUE(shell, nullptr);
|
||||||
|
|
||||||
return shell->GetRootScrollFrameAsScrollableExternal();
|
return shell->GetRootScrollFrameAsScrollableExternal();
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ interface nsIWebBrowserPrint;
|
|||||||
interface nsIVariant;
|
interface nsIVariant;
|
||||||
interface nsIPrivacyTransitionObserver;
|
interface nsIPrivacyTransitionObserver;
|
||||||
|
|
||||||
[scriptable, builtinclass, uuid(ed04b29f-ae9a-460a-858e-960b523bb3a5)]
|
[scriptable, builtinclass, uuid(008f5c86-b915-458c-aaf1-78de3b484e68)]
|
||||||
interface nsIDocShell : nsISupports
|
interface nsIDocShell : nsISupports
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -186,7 +186,7 @@ interface nsIDocShell : nsISupports
|
|||||||
/**
|
/**
|
||||||
* Presentation shell for the currently loaded document. This may be null.
|
* Presentation shell for the currently loaded document. This may be null.
|
||||||
*/
|
*/
|
||||||
[noscript] readonly attribute nsIPresShell presShell;
|
[noscript,notxpcom] nsIPresShell GetPresShell();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Presentation shell for the oldest document, if this docshell is
|
* Presentation shell for the oldest document, if this docshell is
|
||||||
|
|||||||
@@ -108,9 +108,7 @@ nsDOMWindowUtils::GetPresShell()
|
|||||||
if (!docShell)
|
if (!docShell)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
return docShell->GetPresShell();
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
return presShell;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsPresContext*
|
nsPresContext*
|
||||||
@@ -1055,8 +1053,7 @@ nsDOMWindowUtils::GetWidget(nsPoint* aOffset)
|
|||||||
if (window) {
|
if (window) {
|
||||||
nsIDocShell *docShell = window->GetDocShell();
|
nsIDocShell *docShell = window->GetDocShell();
|
||||||
if (docShell) {
|
if (docShell) {
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
if (presShell) {
|
if (presShell) {
|
||||||
nsIFrame* frame = presShell->GetRootFrame();
|
nsIFrame* frame = presShell->GetRootFrame();
|
||||||
if (frame)
|
if (frame)
|
||||||
@@ -1374,8 +1371,7 @@ nsDOMWindowUtils::DisableNonTestMouseEvents(bool aDisable)
|
|||||||
NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
|
||||||
nsIDocShell *docShell = window->GetDocShell();
|
nsIDocShell *docShell = window->GetDocShell();
|
||||||
NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
||||||
presShell->DisableNonTestMouseEvents(aDisable);
|
presShell->DisableNonTestMouseEvents(aDisable);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@@ -1765,8 +1761,7 @@ nsDOMWindowUtils::SendQueryContentEvent(uint32_t aType,
|
|||||||
nsIDocShell *docShell = window->GetDocShell();
|
nsIDocShell *docShell = window->GetDocShell();
|
||||||
NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
nsPresContext* presContext = presShell->GetPresContext();
|
nsPresContext* presContext = presShell->GetPresContext();
|
||||||
@@ -2814,8 +2809,7 @@ nsDOMWindowUtils::GetPaintingSuppressed(bool *aPaintingSuppressed)
|
|||||||
nsIDocShell *docShell = window->GetDocShell();
|
nsIDocShell *docShell = window->GetDocShell();
|
||||||
NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
*aPaintingSuppressed = presShell->IsPaintingSuppressed();
|
*aPaintingSuppressed = presShell->IsPaintingSuppressed();
|
||||||
|
|||||||
@@ -618,8 +618,7 @@ nsFocusManager::MoveCaretToFocus(nsIDOMWindow* aWindow)
|
|||||||
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(dsti);
|
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(dsti);
|
||||||
NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
nsCOMPtr<nsPIDOMWindow> window(do_QueryInterface(aWindow));
|
nsCOMPtr<nsPIDOMWindow> window(do_QueryInterface(aWindow));
|
||||||
@@ -716,8 +715,7 @@ nsFocusManager::WindowRaised(nsIDOMWindow* aWindow)
|
|||||||
|
|
||||||
nsCOMPtr<nsIDocShell> currentDocShell = currentWindow->GetDocShell();
|
nsCOMPtr<nsIDocShell> currentDocShell = currentWindow->GetDocShell();
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = currentDocShell->GetPresShell();
|
||||||
currentDocShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
if (presShell) {
|
if (presShell) {
|
||||||
// disable selection mousedown state on activation
|
// disable selection mousedown state on activation
|
||||||
// XXXndeakin P3 not sure if this is necessary, but it doesn't hurt
|
// XXXndeakin P3 not sure if this is necessary, but it doesn't hurt
|
||||||
@@ -927,8 +925,7 @@ nsFocusManager::WindowHidden(nsIDOMWindow* aWindow)
|
|||||||
nsCOMPtr<nsIContent> oldFocusedContent = mFocusedContent.forget();
|
nsCOMPtr<nsIContent> oldFocusedContent = mFocusedContent.forget();
|
||||||
|
|
||||||
nsCOMPtr<nsIDocShell> focusedDocShell = mFocusedWindow->GetDocShell();
|
nsCOMPtr<nsIDocShell> focusedDocShell = mFocusedWindow->GetDocShell();
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = focusedDocShell->GetPresShell();
|
||||||
focusedDocShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
|
|
||||||
if (oldFocusedContent && oldFocusedContent->IsInDoc()) {
|
if (oldFocusedContent && oldFocusedContent->IsInDoc()) {
|
||||||
NotifyFocusStateChange(oldFocusedContent,
|
NotifyFocusStateChange(oldFocusedContent,
|
||||||
@@ -1056,8 +1053,7 @@ nsFocusManager::EnsureCurrentWidgetFocused()
|
|||||||
// platform knows that this widget is focused.
|
// platform knows that this widget is focused.
|
||||||
nsCOMPtr<nsIDocShell> docShell = mFocusedWindow->GetDocShell();
|
nsCOMPtr<nsIDocShell> docShell = mFocusedWindow->GetDocShell();
|
||||||
if (docShell) {
|
if (docShell) {
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
if (presShell) {
|
if (presShell) {
|
||||||
nsIViewManager* vm = presShell->GetViewManager();
|
nsIViewManager* vm = presShell->GetViewManager();
|
||||||
if (vm) {
|
if (vm) {
|
||||||
@@ -1262,8 +1258,7 @@ nsFocusManager::SetFocusInner(nsIContent* aNewContent, int32_t aFlags,
|
|||||||
if (aFocusChanged) {
|
if (aFocusChanged) {
|
||||||
nsCOMPtr<nsIDocShell> docShell = newWindow->GetDocShell();
|
nsCOMPtr<nsIDocShell> docShell = newWindow->GetDocShell();
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
if (presShell)
|
if (presShell)
|
||||||
ScrollIntoView(presShell, contentToFocus, aFlags);
|
ScrollIntoView(presShell, contentToFocus, aFlags);
|
||||||
}
|
}
|
||||||
@@ -1513,8 +1508,7 @@ nsFocusManager::Blur(nsPIDOMWindow* aWindowToClear,
|
|||||||
|
|
||||||
// Keep a ref to presShell since dispatching the DOM event may cause
|
// Keep a ref to presShell since dispatching the DOM event may cause
|
||||||
// the document to be destroyed.
|
// the document to be destroyed.
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
if (!presShell) {
|
if (!presShell) {
|
||||||
mFocusedContent = nullptr;
|
mFocusedContent = nullptr;
|
||||||
return true;
|
return true;
|
||||||
@@ -1664,8 +1658,7 @@ nsFocusManager::Focus(nsPIDOMWindow* aWindow,
|
|||||||
if (!docShell)
|
if (!docShell)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
if (!presShell)
|
if (!presShell)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1977,8 +1970,7 @@ nsFocusManager::RaiseWindow(nsPIDOMWindow* aWindow)
|
|||||||
if (!docShell)
|
if (!docShell)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
if (!presShell)
|
if (!presShell)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -2026,8 +2018,7 @@ nsFocusManager::UpdateCaret(bool aMoveCaretToFocus,
|
|||||||
bool browseWithCaret =
|
bool browseWithCaret =
|
||||||
Preferences::GetBool("accessibility.browsewithcaret");
|
Preferences::GetBool("accessibility.browsewithcaret");
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = focusedDocShell->GetPresShell();
|
||||||
focusedDocShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
if (!presShell)
|
if (!presShell)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -1546,8 +1546,7 @@ nsGlobalWindow::SetInitialPrincipalToSubject()
|
|||||||
GetDocShell()->CreateAboutBlankContentViewer(newWindowPrincipal);
|
GetDocShell()->CreateAboutBlankContentViewer(newWindowPrincipal);
|
||||||
mDoc->SetIsInitialDocument(true);
|
mDoc->SetIsInitialDocument(true);
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> shell;
|
nsCOMPtr<nsIPresShell> shell = GetDocShell()->GetPresShell();
|
||||||
GetDocShell()->GetPresShell(getter_AddRefs(shell));
|
|
||||||
|
|
||||||
if (shell && !shell->DidInitialize()) {
|
if (shell && !shell->DidInitialize()) {
|
||||||
// Ensure that if someone plays with this document they will get
|
// Ensure that if someone plays with this document they will get
|
||||||
@@ -3670,8 +3669,7 @@ nsGlobalWindow::SetInnerWidth(int32_t aInnerWidth)
|
|||||||
NS_ERROR_FAILURE);
|
NS_ERROR_FAILURE);
|
||||||
|
|
||||||
|
|
||||||
nsRefPtr<nsIPresShell> presShell;
|
nsRefPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
|
||||||
mDocShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
|
|
||||||
if (presShell && presShell->GetIsViewportOverridden())
|
if (presShell && presShell->GetIsViewportOverridden())
|
||||||
{
|
{
|
||||||
@@ -3737,8 +3735,7 @@ nsGlobalWindow::SetInnerHeight(int32_t aInnerHeight)
|
|||||||
NS_ENSURE_SUCCESS(CheckSecurityWidthAndHeight(nullptr, &aInnerHeight),
|
NS_ENSURE_SUCCESS(CheckSecurityWidthAndHeight(nullptr, &aInnerHeight),
|
||||||
NS_ERROR_FAILURE);
|
NS_ERROR_FAILURE);
|
||||||
|
|
||||||
nsRefPtr<nsIPresShell> presShell;
|
nsRefPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
|
||||||
mDocShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
|
|
||||||
if (presShell && presShell->GetIsViewportOverridden())
|
if (presShell && presShell->GetIsViewportOverridden())
|
||||||
{
|
{
|
||||||
@@ -3892,8 +3889,7 @@ nsGlobalWindow::GetInnerScreenRect()
|
|||||||
rootWindow->FlushPendingNotifications(Flush_Layout);
|
rootWindow->FlushPendingNotifications(Flush_Layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
|
||||||
mDocShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
if (!presShell)
|
if (!presShell)
|
||||||
return nsRect();
|
return nsRect();
|
||||||
nsIFrame* rootFrame = presShell->GetRootFrame();
|
nsIFrame* rootFrame = presShell->GetRootFrame();
|
||||||
@@ -3953,8 +3949,7 @@ nsGlobalWindow::GetMozPaintCount(uint64_t* aResult)
|
|||||||
if (!mDocShell)
|
if (!mDocShell)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
|
||||||
mDocShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
if (!presShell)
|
if (!presShell)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
||||||
@@ -4493,8 +4488,7 @@ nsGlobalWindow::GetNearestWidget()
|
|||||||
{
|
{
|
||||||
nsIDocShell* docShell = GetDocShell();
|
nsIDocShell* docShell = GetDocShell();
|
||||||
NS_ENSURE_TRUE(docShell, nullptr);
|
NS_ENSURE_TRUE(docShell, nullptr);
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
NS_ENSURE_TRUE(presShell, nullptr);
|
NS_ENSURE_TRUE(presShell, nullptr);
|
||||||
nsIFrame* rootFrame = presShell->GetRootFrame();
|
nsIFrame* rootFrame = presShell->GetRootFrame();
|
||||||
NS_ENSURE_TRUE(rootFrame, nullptr);
|
NS_ENSURE_TRUE(rootFrame, nullptr);
|
||||||
@@ -4681,8 +4675,7 @@ nsGlobalWindow::EnsureReflowFlushAndPaint()
|
|||||||
if (!mDocShell)
|
if (!mDocShell)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
|
||||||
mDocShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
|
|
||||||
if (!presShell)
|
if (!presShell)
|
||||||
return;
|
return;
|
||||||
@@ -7427,8 +7420,7 @@ nsGlobalWindow::GetSelection(nsISelection** aSelection)
|
|||||||
if (!mDocShell)
|
if (!mDocShell)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
|
||||||
mDocShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
|
|
||||||
if (!presShell)
|
if (!presShell)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@@ -8257,8 +8249,7 @@ nsGlobalWindow::UpdateCanvasFocus(bool aFocusChanged, nsIContent* aNewContent)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
if (!presShell || !mDocument)
|
if (!presShell || !mDocument)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -8325,8 +8316,7 @@ nsGlobalWindow::GetComputedStyleHelper(nsIDOMElement* aElt,
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
|
||||||
mDocShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
|
|
||||||
if (!presShell) {
|
if (!presShell) {
|
||||||
// Try flushing frames on our parent in case there's a pending
|
// Try flushing frames on our parent in case there's a pending
|
||||||
@@ -8344,8 +8334,7 @@ nsGlobalWindow::GetComputedStyleHelper(nsIDOMElement* aElt,
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
mDocShell->GetPresShell(getter_AddRefs(presShell));
|
presShell = mDocShell->GetPresShell();
|
||||||
|
|
||||||
if (!presShell) {
|
if (!presShell) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@@ -10354,8 +10343,7 @@ nsGlobalWindow::GetScrollFrame()
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
|
||||||
mDocShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
if (presShell) {
|
if (presShell) {
|
||||||
return presShell->GetRootScrollFrameAsScrollable();
|
return presShell->GetRootScrollFrameAsScrollable();
|
||||||
}
|
}
|
||||||
@@ -11033,8 +11021,7 @@ nsGlobalChromeWindow::SetCursor(const nsAString& aCursor)
|
|||||||
|
|
||||||
if (presContext) {
|
if (presContext) {
|
||||||
// Need root widget.
|
// Need root widget.
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
|
||||||
mDocShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
nsIViewManager* vm = presShell->GetViewManager();
|
nsIViewManager* vm = presShell->GetViewManager();
|
||||||
|
|||||||
@@ -173,7 +173,8 @@ nsSelectionCommandsBase::GetPresShellFromWindow(nsPIDOMWindow *aWindow, nsIPresS
|
|||||||
nsIDocShell *docShell = aWindow->GetDocShell();
|
nsIDocShell *docShell = aWindow->GetDocShell();
|
||||||
NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
return docShell->GetPresShell(aPresShell);
|
NS_IF_ADDREF(*aPresShell = docShell->GetPresShell());
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
@@ -362,8 +363,7 @@ nsClipboardCommand::DoCommand(const char *aCommandName, nsISupports *aContext)
|
|||||||
nsIDocShell *docShell = window->GetDocShell();
|
nsIDocShell *docShell = window->GetDocShell();
|
||||||
NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
nsCopySupport::FireClipboardEvent(NS_COPY, presShell, nullptr);
|
nsCopySupport::FireClipboardEvent(NS_COPY, presShell, nullptr);
|
||||||
|
|||||||
@@ -1438,7 +1438,7 @@ ChromeTooltipListener::sTooltipCallback(nsITimer *aTimer,
|
|||||||
do_GetInterface(static_cast<nsIWebBrowser*>(self->mWebBrowser));
|
do_GetInterface(static_cast<nsIWebBrowser*>(self->mWebBrowser));
|
||||||
nsCOMPtr<nsIPresShell> shell;
|
nsCOMPtr<nsIPresShell> shell;
|
||||||
if (docShell) {
|
if (docShell) {
|
||||||
docShell->GetPresShell(getter_AddRefs(shell));
|
shell = docShell->GetPresShell();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIWidget* widget = nullptr;
|
nsIWidget* widget = nullptr;
|
||||||
|
|||||||
@@ -2369,7 +2369,7 @@ nsDocumentViewer::FindContainerView()
|
|||||||
docShellItem->GetParent(getter_AddRefs(parentDocShellItem));
|
docShellItem->GetParent(getter_AddRefs(parentDocShellItem));
|
||||||
if (parentDocShellItem) {
|
if (parentDocShellItem) {
|
||||||
nsCOMPtr<nsIDocShell> parentDocShell = do_QueryInterface(parentDocShellItem);
|
nsCOMPtr<nsIDocShell> parentDocShell = do_QueryInterface(parentDocShellItem);
|
||||||
parentDocShell->GetPresShell(getter_AddRefs(parentPresShell));
|
parentPresShell = parentDocShell->GetPresShell();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!parentPresShell) {
|
if (!parentPresShell) {
|
||||||
|
|||||||
@@ -5522,9 +5522,8 @@ PresShell::GetParentPresShell()
|
|||||||
nsCOMPtr<nsIDocShell> parentDocShell = do_QueryInterface(parentTreeItem);
|
nsCOMPtr<nsIDocShell> parentDocShell = do_QueryInterface(parentTreeItem);
|
||||||
NS_ENSURE_TRUE(parentDocShell && treeItem != parentTreeItem, nullptr);
|
NS_ENSURE_TRUE(parentDocShell && treeItem != parentTreeItem, nullptr);
|
||||||
|
|
||||||
nsIPresShell* parentPresShell = nullptr;
|
nsCOMPtr<nsIPresShell> parentPresShell = parentDocShell->GetPresShell();
|
||||||
parentDocShell->GetPresShell(&parentPresShell);
|
return parentPresShell.forget();
|
||||||
return parentPresShell;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||||||
mFrameLoader->GetDocShell(getter_AddRefs(docShell));
|
mFrameLoader->GetDocShell(getter_AddRefs(docShell));
|
||||||
if (!docShell)
|
if (!docShell)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
presShell = docShell->GetPresShell();
|
||||||
if (!presShell)
|
if (!presShell)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@@ -1117,8 +1117,7 @@ nsSubDocumentFrame::ObtainIntrinsicSizeFrame()
|
|||||||
nsCOMPtr<nsIDocShell> docShell;
|
nsCOMPtr<nsIDocShell> docShell;
|
||||||
GetDocShell(getter_AddRefs(docShell));
|
GetDocShell(getter_AddRefs(docShell));
|
||||||
if (docShell) {
|
if (docShell) {
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
if (presShell) {
|
if (presShell) {
|
||||||
nsIScrollableFrame* scrollable = presShell->GetRootScrollFrameAsScrollable();
|
nsIScrollableFrame* scrollable = presShell->GetRootScrollFrameAsScrollable();
|
||||||
if (scrollable) {
|
if (scrollable) {
|
||||||
|
|||||||
@@ -36,10 +36,7 @@ inLayoutUtils::GetPresShellFor(nsISupports* aThing)
|
|||||||
{
|
{
|
||||||
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aThing);
|
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aThing);
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
return window->GetDocShell()->GetPresShell();
|
||||||
window->GetDocShell()->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
|
|
||||||
return presShell;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*static*/
|
/*static*/
|
||||||
|
|||||||
@@ -1066,7 +1066,7 @@ nsPrintEngine::IsThereARangeSelection(nsIDOMWindow* aDOMWin)
|
|||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell;
|
||||||
if (aDOMWin) {
|
if (aDOMWin) {
|
||||||
nsCOMPtr<nsPIDOMWindow> window(do_QueryInterface(aDOMWin));
|
nsCOMPtr<nsPIDOMWindow> window(do_QueryInterface(aDOMWin));
|
||||||
window->GetDocShell()->GetPresShell(getter_AddRefs(presShell));
|
presShell = window->GetDocShell()->GetPresShell();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!presShell)
|
if (!presShell)
|
||||||
@@ -2022,8 +2022,7 @@ nsresult
|
|||||||
nsPrintEngine::UpdateSelectionAndShrinkPrintObject(nsPrintObject* aPO,
|
nsPrintEngine::UpdateSelectionAndShrinkPrintObject(nsPrintObject* aPO,
|
||||||
bool aDocumentIsTopLevel)
|
bool aDocumentIsTopLevel)
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIPresShell> displayShell;
|
nsCOMPtr<nsIPresShell> displayShell = aPO->mDocShell->GetPresShell();
|
||||||
aPO->mDocShell->GetPresShell(getter_AddRefs(displayShell));
|
|
||||||
// Transfer Selection Ranges to the new Print PresShell
|
// Transfer Selection Ranges to the new Print PresShell
|
||||||
nsCOMPtr<nsISelection> selection, selectionPS;
|
nsCOMPtr<nsISelection> selection, selectionPS;
|
||||||
// It's okay if there is no display shell, just skip copying the selection
|
// It's okay if there is no display shell, just skip copying the selection
|
||||||
|
|||||||
@@ -74,8 +74,7 @@ nsRegressionTester::DumpFrameModel(nsIDOMWindow *aWindowToDump,
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
|
|
||||||
nsIFrame* root = presShell->GetRootFrame();
|
nsIFrame* root = presShell->GetRootFrame();
|
||||||
|
|
||||||
|
|||||||
@@ -288,8 +288,7 @@ nsFormFillController::SetPopupOpen(bool aPopupOpen)
|
|||||||
NS_ENSURE_STATE(content);
|
NS_ENSURE_STATE(content);
|
||||||
nsCOMPtr<nsIDocShell> docShell = GetDocShellForInput(mFocusedInput);
|
nsCOMPtr<nsIDocShell> docShell = GetDocShellForInput(mFocusedInput);
|
||||||
NS_ENSURE_STATE(docShell);
|
NS_ENSURE_STATE(docShell);
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
NS_ENSURE_STATE(presShell);
|
NS_ENSURE_STATE(presShell);
|
||||||
presShell->ScrollContentIntoView(content,
|
presShell->ScrollContentIntoView(content,
|
||||||
nsIPresShell::ScrollAxis(
|
nsIPresShell::ScrollAxis(
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ nsTypeAheadFind::SetDocShell(nsIDocShell* aDocShell)
|
|||||||
NS_ENSURE_TRUE(mWebBrowserFind, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(mWebBrowserFind, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell;
|
||||||
aDocShell->GetPresShell(getter_AddRefs(presShell));
|
presShell = aDocShell->GetPresShell();
|
||||||
mPresShell = do_GetWeakReference(presShell);
|
mPresShell = do_GetWeakReference(presShell);
|
||||||
|
|
||||||
mStartFindRange = nullptr;
|
mStartFindRange = nullptr;
|
||||||
@@ -275,7 +275,7 @@ nsTypeAheadFind::FindItNow(nsIPresShell *aPresShell, bool aIsLinksOnly,
|
|||||||
nsCOMPtr<nsIDocShell> ds = do_QueryReferent(mDocShell);
|
nsCOMPtr<nsIDocShell> ds = do_QueryReferent(mDocShell);
|
||||||
NS_ENSURE_TRUE(ds, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(ds, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
ds->GetPresShell(getter_AddRefs(startingPresShell));
|
startingPresShell = ds->GetPresShell();
|
||||||
mPresShell = do_GetWeakReference(startingPresShell);
|
mPresShell = do_GetWeakReference(startingPresShell);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -683,8 +683,7 @@ nsTypeAheadFind::GetSearchContainers(nsISupports *aContainer,
|
|||||||
if (!docShell)
|
if (!docShell)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
|
|
||||||
nsRefPtr<nsPresContext> presContext;
|
nsRefPtr<nsPresContext> presContext;
|
||||||
docShell->GetPresContext(getter_AddRefs(presContext));
|
docShell->GetPresContext(getter_AddRefs(presContext));
|
||||||
@@ -898,7 +897,7 @@ nsTypeAheadFind::Find(const nsAString& aSearchString, bool aLinksOnly,
|
|||||||
nsCOMPtr<nsIDocShell> ds (do_QueryReferent(mDocShell));
|
nsCOMPtr<nsIDocShell> ds (do_QueryReferent(mDocShell));
|
||||||
NS_ENSURE_TRUE(ds, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(ds, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
ds->GetPresShell(getter_AddRefs(presShell));
|
presShell = ds->GetPresShell();
|
||||||
mPresShell = do_GetWeakReference(presShell);
|
mPresShell = do_GetWeakReference(presShell);
|
||||||
}
|
}
|
||||||
nsCOMPtr<nsISelection> selection;
|
nsCOMPtr<nsISelection> selection;
|
||||||
|
|||||||
@@ -249,9 +249,7 @@ nsWebShellWindow::GetPresShell()
|
|||||||
if (!mDocShell)
|
if (!mDocShell)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
return mDocShell->GetPresShell();
|
||||||
mDocShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
return presShell.get();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@@ -298,8 +296,7 @@ nsWebShellWindow::RequestWindowClose(nsIWidget* aWidget)
|
|||||||
nsCOMPtr<nsPIDOMWindow> window(do_GetInterface(mDocShell));
|
nsCOMPtr<nsPIDOMWindow> window(do_GetInterface(mDocShell));
|
||||||
nsCOMPtr<nsIDOMEventTarget> eventTarget = do_QueryInterface(window);
|
nsCOMPtr<nsIDOMEventTarget> eventTarget = do_QueryInterface(window);
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
nsCOMPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
|
||||||
mDocShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
|
|
||||||
if (eventTarget) {
|
if (eventTarget) {
|
||||||
nsRefPtr<nsPresContext> presContext = presShell->GetPresContext();
|
nsRefPtr<nsPresContext> presContext = presShell->GetPresContext();
|
||||||
|
|||||||
Reference in New Issue
Block a user