diff --git a/mozilla/accessible/src/base/nsAccessNode.cpp b/mozilla/accessible/src/base/nsAccessNode.cpp index 6a0cc3d664c..34655238262 100755 --- a/mozilla/accessible/src/base/nsAccessNode.cpp +++ b/mozilla/accessible/src/base/nsAccessNode.cpp @@ -629,7 +629,7 @@ nsAccessNode::GetPresShellFor(nsIDOMNode *aNode) } nsIPresShell *presShell = nsnull; if (doc) { - presShell = doc->GetShellAt(0); + presShell = doc->GetPrimaryShell(); NS_IF_ADDREF(presShell); } return presShell; diff --git a/mozilla/accessible/src/base/nsAccessibilityService.cpp b/mozilla/accessible/src/base/nsAccessibilityService.cpp index e1712a0e1d3..3159a9065d3 100644 --- a/mozilla/accessible/src/base/nsAccessibilityService.cpp +++ b/mozilla/accessible/src/base/nsAccessibilityService.cpp @@ -295,7 +295,7 @@ nsAccessibilityService::GetInfo(nsISupports* aFrame, nsIFrame** aRealFrame, nsIW // do_GetWR only works into a |nsCOMPtr| :-( nsCOMPtr weakShell = - do_GetWeakReference(document->GetShellAt(0)); + do_GetWeakReference(document->GetPrimaryShell()); NS_IF_ADDREF(*aShell = weakShell); return NS_OK; @@ -311,7 +311,7 @@ nsAccessibilityService::GetShellFromNode(nsIDOMNode *aNode, nsIWeakReference **a return NS_ERROR_INVALID_ARG; // ---- Get the pres shell ---- - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (!shell) return NS_ERROR_FAILURE; @@ -360,7 +360,7 @@ nsAccessibilityService::CreateRootAccessible(nsIPresShell *aShell, nsIPresShell *presShell = aShell; if (!presShell) { - presShell = aDocument->GetShellAt(0); + presShell = aDocument->GetPrimaryShell(); } nsCOMPtr weakShell(do_GetWeakReference(presShell)); @@ -939,7 +939,7 @@ nsAccessibilityService::GetAccessibleFor(nsIDOMNode *aNode, if (!doc) return NS_ERROR_FAILURE; - nsIPresShell *presShell = doc->GetShellAt(0); + nsIPresShell *presShell = doc->GetPrimaryShell(); return GetAccessibleInShell(aNode, presShell, aAccessible); } diff --git a/mozilla/accessible/src/base/nsAccessible.cpp b/mozilla/accessible/src/base/nsAccessible.cpp index ca09e4b3fa0..2c46a6393b6 100644 --- a/mozilla/accessible/src/base/nsAccessible.cpp +++ b/mozilla/accessible/src/base/nsAccessible.cpp @@ -2862,7 +2862,7 @@ void nsAccessible::DoCommandCallback(nsITimer *aTimer, void *aClosure) if (!doc) { return; } - nsCOMPtr presShell = doc->GetShellAt(0); + nsCOMPtr presShell = doc->GetPrimaryShell(); nsPIDOMWindow *outerWindow = doc->GetWindow(); if (presShell && outerWindow) { nsAutoPopupStatePusher popupStatePusher(outerWindow, openAllowed); @@ -3241,7 +3241,7 @@ PRBool nsAccessible::CheckVisibilityInParentChain(nsIDocument* aDocument, nsIVie if (parentDoc != nsnull) { nsIContent* content = parentDoc->FindContentForSubDocument(document); if (content != nsnull) { - nsIPresShell* shell = parentDoc->GetShellAt(0); + nsIPresShell* shell = parentDoc->GetPrimaryShell(); nsIFrame* frame = shell->GetPrimaryFrameFor(content); while (frame != nsnull && !frame->HasView()) { frame = frame->GetParent(); diff --git a/mozilla/accessible/src/base/nsDocAccessible.cpp b/mozilla/accessible/src/base/nsDocAccessible.cpp index 31089d01c95..833381002bd 100644 --- a/mozilla/accessible/src/base/nsDocAccessible.cpp +++ b/mozilla/accessible/src/base/nsDocAccessible.cpp @@ -593,7 +593,7 @@ void nsDocAccessible::GetBoundsRect(nsRect& aBounds, nsIFrame** aRelativeFrame) nsIDocument *parentDoc = nsnull; while (document) { - nsIPresShell *presShell = document->GetShellAt(0); + nsIPresShell *presShell = document->GetPrimaryShell(); if (!presShell) { return; } diff --git a/mozilla/accessible/src/html/nsHTMLSelectAccessible.cpp b/mozilla/accessible/src/html/nsHTMLSelectAccessible.cpp index 21642815e70..18e5b256b83 100644 --- a/mozilla/accessible/src/html/nsHTMLSelectAccessible.cpp +++ b/mozilla/accessible/src/html/nsHTMLSelectAccessible.cpp @@ -727,7 +727,7 @@ nsresult nsHTMLSelectOptionAccessible::GetFocusedOptionNode(nsIDOMNode *aListNod nsCOMPtr document = content->GetDocument(); nsIPresShell *shell = nsnull; if (document) - shell = document->GetShellAt(0); + shell = document->GetPrimaryShell(); if (!shell) return NS_ERROR_FAILURE; diff --git a/mozilla/accessible/src/html/nsHTMLTableAccessible.cpp b/mozilla/accessible/src/html/nsHTMLTableAccessible.cpp index 0f1ee36f85c..63f32fdade9 100644 --- a/mozilla/accessible/src/html/nsHTMLTableAccessible.cpp +++ b/mozilla/accessible/src/html/nsHTMLTableAccessible.cpp @@ -666,7 +666,7 @@ nsHTMLTableAccessible::GetTableLayout(nsITableLayout **aLayoutObject) nsCOMPtr content(do_QueryInterface(tableNode)); NS_ENSURE_TRUE(content, NS_ERROR_FAILURE); - nsIPresShell *presShell = content->GetDocument()->GetShellAt(0); + nsIPresShell *presShell = content->GetDocument()->GetPrimaryShell(); nsCOMPtr layoutObject; rv = presShell->GetLayoutObjectFor(content, getter_AddRefs(layoutObject)); diff --git a/mozilla/accessible/src/msaa/nsDocAccessibleWrap.cpp b/mozilla/accessible/src/msaa/nsDocAccessibleWrap.cpp index 2a2c9167a75..ffa79a109de 100644 --- a/mozilla/accessible/src/msaa/nsDocAccessibleWrap.cpp +++ b/mozilla/accessible/src/msaa/nsDocAccessibleWrap.cpp @@ -136,7 +136,7 @@ STDMETHODIMP nsDocAccessibleWrap::get_accChild( // has focus, but the system thinks the content window has focus. nsIDocument* parentDoc = mDocument->GetParentDocument(); if (parentDoc) { - nsIPresShell *parentShell = parentDoc->GetShellAt(0); + nsIPresShell *parentShell = parentDoc->GetPrimaryShell(); nsCOMPtr weakParentShell(do_GetWeakReference(parentShell)); if (weakParentShell) { nsCOMPtr parentDocAccessible = diff --git a/mozilla/content/base/public/nsIDocument.h b/mozilla/content/base/public/nsIDocument.h index 869852abcb1..0a7894a04fb 100644 --- a/mozilla/content/base/public/nsIDocument.h +++ b/mozilla/content/base/public/nsIDocument.h @@ -94,8 +94,8 @@ class mozAutoSubtreeModified; // IID for the nsIDocument interface #define NS_IDOCUMENT_IID \ -{ 0x1b8ed19c, 0xb87d, 0x4058, \ - { 0x92, 0x2a, 0xff, 0xbc, 0x36, 0x29, 0x3b, 0xd7 } } +{ 0xb7f930df, 0x1c61, 0x410f, \ + { 0xab, 0x3c, 0xe2, 0x53, 0xca, 0x8d, 0x85, 0x49 } } // Flag for AddStyleSheet(). #define NS_STYLESHEET_FROM_CATALOG (1 << 0) @@ -349,6 +349,7 @@ public: virtual PRBool DeleteShell(nsIPresShell* aShell) = 0; virtual PRUint32 GetNumberOfShells() const = 0; virtual nsIPresShell *GetShellAt(PRUint32 aIndex) const = 0; + virtual nsIPresShell *GetPrimaryShell() const = 0; virtual void SetShellsHidden(PRBool aHide) = 0; /** diff --git a/mozilla/content/base/src/nsContentAreaDragDrop.cpp b/mozilla/content/base/src/nsContentAreaDragDrop.cpp index 1100f29ade9..7fc1bce2991 100644 --- a/mozilla/content/base/src/nsContentAreaDragDrop.cpp +++ b/mozilla/content/base/src/nsContentAreaDragDrop.cpp @@ -805,7 +805,7 @@ nsContentAreaDragDrop::DragGesture(nsIDOMEvent* inMouseEvent) nsCOMPtr targetContent(do_QueryInterface(target)); nsIDocument* doc = targetContent->GetCurrentDoc(); if (doc) { - nsIPresShell* presShell = doc->GetShellAt(0); + nsIPresShell* presShell = doc->GetPrimaryShell(); if (presShell) { nsISelection* selection = presShell->GetCurrentSelection(nsISelectionController::SELECTION_NORMAL); diff --git a/mozilla/content/base/src/nsContentSink.cpp b/mozilla/content/base/src/nsContentSink.cpp index f99ecc8f826..ebfd046a126 100644 --- a/mozilla/content/base/src/nsContentSink.cpp +++ b/mozilla/content/base/src/nsContentSink.cpp @@ -448,7 +448,7 @@ nsContentSink::ProcessHeaderData(nsIAtom* aHeader, const nsAString& aValue, // XXXbz don't we want to support this as an HTTP header too? nsAutoString value(aValue); if (value.LowerCaseEqualsLiteral("no")) { - nsIPresShell* shell = mDocument->GetShellAt(0); + nsIPresShell* shell = mDocument->GetPrimaryShell(); if (shell) { shell->DisableThemeSupport(); } @@ -1174,7 +1174,7 @@ nsContentSink::DidProcessATokenImpl() // switches to low frequency interrupt mode. // Get the current user event time - nsIPresShell *shell = mDocument->GetShellAt(0); + nsIPresShell *shell = mDocument->GetPrimaryShell(); if (!shell) { // If there's no pres shell in the document, return early since diff --git a/mozilla/content/base/src/nsDocument.cpp b/mozilla/content/base/src/nsDocument.cpp index 0aefc6d3956..bd271cb88a2 100644 --- a/mozilla/content/base/src/nsDocument.cpp +++ b/mozilla/content/base/src/nsDocument.cpp @@ -1984,6 +1984,13 @@ nsDocument::GetShellAt(PRUint32 aIndex) const NS_STATIC_CAST(nsIPresShell*, mPresShells.SafeElementAt(aIndex)); } +nsIPresShell * +nsDocument::GetPrimaryShell() const +{ + return mShellsAreHidden ? nsnull : + NS_STATIC_CAST(nsIPresShell*, mPresShells.SafeElementAt(0)); +} + void nsDocument::SetShellsHidden(PRBool aHide) { @@ -2769,7 +2776,7 @@ nsDocument::DispatchContentLoadedEvents() if (innerEvent) { nsEventStatus status = nsEventStatus_eIgnore; - nsIPresShell *shell = ancestor_doc->GetShellAt(0); + nsIPresShell *shell = ancestor_doc->GetPrimaryShell(); if (shell) { nsCOMPtr context = shell->GetPresContext(); @@ -3798,7 +3805,7 @@ nsDocument::SetDir(const nsAString& aDirection) if (aDirection == NS_ConvertASCIItoUTF16(elt->mName)) { if (GET_BIDI_OPTION_DIRECTION(options) != elt->mValue) { SET_BIDI_OPTION_DIRECTION(options, elt->mValue); - nsIPresShell *shell = GetShellAt(0); + nsIPresShell *shell = GetPrimaryShell(); if (shell) { nsPresContext *context = shell->GetPresContext(); NS_ENSURE_TRUE(context, NS_ERROR_UNEXPECTED); @@ -4651,7 +4658,7 @@ NS_IMETHODIMP nsDocument::DispatchEvent(nsIDOMEvent* aEvent, PRBool *_retval) { // Obtain a presentation context - nsIPresShell *shell = GetShellAt(0); + nsIPresShell *shell = GetPrimaryShell(); nsCOMPtr context; if (shell) { context = shell->GetPresContext(); @@ -4740,7 +4747,7 @@ nsDocument::CreateEvent(const nsAString& aEventType, nsIDOMEvent** aReturn) // Obtain a presentation shell - nsIPresShell *shell = GetShellAt(0); + nsIPresShell *shell = GetPrimaryShell(); nsPresContext *presContext = nsnull; diff --git a/mozilla/content/base/src/nsDocument.h b/mozilla/content/base/src/nsDocument.h index a00f7c809c1..17d38c01380 100644 --- a/mozilla/content/base/src/nsDocument.h +++ b/mozilla/content/base/src/nsDocument.h @@ -377,6 +377,7 @@ public: virtual PRBool DeleteShell(nsIPresShell* aShell); virtual PRUint32 GetNumberOfShells() const; virtual nsIPresShell *GetShellAt(PRUint32 aIndex) const; + virtual nsIPresShell *GetPrimaryShell() const; virtual void SetShellsHidden(PRBool aHide); virtual nsresult SetSubDocumentFor(nsIContent *aContent, diff --git a/mozilla/content/base/src/nsGenericElement.cpp b/mozilla/content/base/src/nsGenericElement.cpp index dea8a89c5b5..1d10d65fb8d 100644 --- a/mozilla/content/base/src/nsGenericElement.cpp +++ b/mozilla/content/base/src/nsGenericElement.cpp @@ -2499,7 +2499,7 @@ nsGenericElement::GetPrimaryFrameFor(nsIContent* aContent, nsIDocument* aDocument) { // Get presentation shell 0 - nsIPresShell *presShell = aDocument->GetShellAt(0); + nsIPresShell *presShell = aDocument->GetPrimaryShell(); if (!presShell) { return nsnull; } diff --git a/mozilla/content/base/src/nsImageLoadingContent.cpp b/mozilla/content/base/src/nsImageLoadingContent.cpp index 1fdf440532e..94b0bbf56d4 100644 --- a/mozilla/content/base/src/nsImageLoadingContent.cpp +++ b/mozilla/content/base/src/nsImageLoadingContent.cpp @@ -822,7 +822,7 @@ nsImageLoadingContent::FireEvent(const nsAString& aEventType) // We should not be getting called from off the UI thread... NS_ASSERTION(NS_IsMainThread(), "should be on the main thread"); - nsIPresShell *shell = document->GetShellAt(0); + nsIPresShell *shell = document->GetPrimaryShell(); nsPresContext *presContext = shell ? shell->GetPresContext() : nsnull; nsCOMPtr evt = diff --git a/mozilla/content/base/src/nsObjectLoadingContent.cpp b/mozilla/content/base/src/nsObjectLoadingContent.cpp index a1b2e5a6bc5..07ddb04773d 100644 --- a/mozilla/content/base/src/nsObjectLoadingContent.cpp +++ b/mozilla/content/base/src/nsObjectLoadingContent.cpp @@ -1298,7 +1298,7 @@ nsObjectLoadingContent::GetFrame() return nsnull; // No current doc -> no frame } - nsIPresShell* shell = doc->GetShellAt(0); + nsIPresShell* shell = doc->GetPrimaryShell(); if (!shell) { return nsnull; // No presentation -> no frame } diff --git a/mozilla/content/base/src/nsScriptElement.cpp b/mozilla/content/base/src/nsScriptElement.cpp index bb1feb85ddd..cafe0c8118f 100755 --- a/mozilla/content/base/src/nsScriptElement.cpp +++ b/mozilla/content/base/src/nsScriptElement.cpp @@ -53,7 +53,7 @@ GetContextForContent(nsIContent* aContent) { nsIDocument* doc = aContent->GetCurrentDoc(); if (doc) { - nsIPresShell *presShell = doc->GetShellAt(0); + nsIPresShell *presShell = doc->GetPrimaryShell(); if (presShell) { return presShell->GetPresContext(); } diff --git a/mozilla/content/events/src/nsEventListenerManager.cpp b/mozilla/content/events/src/nsEventListenerManager.cpp index 47b2d437364..f59a1fdb335 100644 --- a/mozilla/content/events/src/nsEventListenerManager.cpp +++ b/mozilla/content/events/src/nsEventListenerManager.cpp @@ -1321,7 +1321,7 @@ nsEventListenerManager::DispatchEvent(nsIDOMEvent* aEvent, PRBool *_retval) } // Obtain a presentation shell - nsIPresShell *shell = document->GetShellAt(0); + nsIPresShell *shell = document->GetPrimaryShell(); nsCOMPtr context; if (shell) { context = shell->GetPresContext(); diff --git a/mozilla/content/events/src/nsEventStateManager.cpp b/mozilla/content/events/src/nsEventStateManager.cpp index e237404d139..2186df1263e 100644 --- a/mozilla/content/events/src/nsEventStateManager.cpp +++ b/mozilla/content/events/src/nsEventStateManager.cpp @@ -796,7 +796,7 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext, if (gLastFocusedContent) // could have changed in Dispatch doc = gLastFocusedContent->GetDocument(); if (doc) { - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (shell) { nsCOMPtr oldPresContext = shell->GetPresContext(); @@ -1017,7 +1017,7 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext, if (document) { // Use a strong ref to make sure that the shell is alive still // when calling FrameSelection(). - nsCOMPtr shell = document->GetShellAt(0); + nsCOMPtr shell = document->GetPrimaryShell(); NS_ASSERTION(shell, "Focus events should not be getting thru when this is null!"); if (shell) { nsPresContext* context = shell->GetPresContext(); @@ -1085,7 +1085,7 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext, nsEvent event(PR_TRUE, NS_BLUR_CONTENT); if (gLastFocusedContent) { - nsIPresShell *shell = gLastFocusedDocument->GetShellAt(0); + nsIPresShell *shell = gLastFocusedDocument->GetPrimaryShell(); if (shell) { nsCOMPtr oldPresContext = shell->GetPresContext(); @@ -1785,7 +1785,7 @@ nsEventStateManager::ChangeTextSize(PRInt32 change) nsIDocument *doc = GetDocumentFromWindow(contentWindow); if(!doc) return NS_ERROR_FAILURE; - nsIPresShell *presShell = doc->GetShellAt(0); + nsIPresShell *presShell = doc->GetPrimaryShell(); if(!presShell) return NS_ERROR_FAILURE; nsPresContext *presContext = presShell->GetPresContext(); if(!presContext) return NS_ERROR_FAILURE; @@ -2791,7 +2791,7 @@ nsEventStateManager::NotifyMouseOver(nsGUIEvent* aEvent, nsIContent* aContent) if (parentDoc) { nsIContent *docContent = parentDoc->FindContentForSubDocument(mDocument); if (docContent) { - nsIPresShell *parentShell = parentDoc->GetShellAt(0); + nsIPresShell *parentShell = parentDoc->GetPrimaryShell(); if (parentShell) { nsEventStateManager* parentESM = NS_STATIC_CAST(nsEventStateManager*, @@ -4178,7 +4178,7 @@ nsEventStateManager::SendFocusBlur(nsPresContext* aPresContext, // associated view manager on exit from this function. // See bug 53763. nsCOMPtr kungFuDeathGrip; - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (shell) { kungFuDeathGrip = shell->GetViewManager(); @@ -4455,7 +4455,7 @@ nsEventStateManager::GetFocusedFrame(nsIFrame** aFrame) if (!mCurrentFocusFrame && mCurrentFocus) { nsIDocument* doc = mCurrentFocus->GetDocument(); if (doc) { - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (shell) { mCurrentFocusFrame = shell->GetPrimaryFrameFor(mCurrentFocus); } diff --git a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp index 109caed0477..c6175f12cae 100644 --- a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp +++ b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp @@ -1060,7 +1060,7 @@ nsGenericHTMLElement::ScrollIntoView(PRBool aTop) } // Get the presentation shell - nsCOMPtr presShell = document->GetShellAt(0); + nsCOMPtr presShell = document->GetPrimaryShell(); if (!presShell) { return NS_OK; } @@ -1757,7 +1757,7 @@ nsGenericHTMLElement::GetPresContext() nsIDocument* doc = GetDocument(); if (doc) { // Get presentation shell 0 - nsIPresShell *presShell = doc->GetShellAt(0); + nsIPresShell *presShell = doc->GetPrimaryShell(); if (presShell) { return presShell->GetPresContext(); } diff --git a/mozilla/content/html/content/src/nsHTMLButtonElement.cpp b/mozilla/content/html/content/src/nsHTMLButtonElement.cpp index 0b0cf405322..0e0f782782a 100644 --- a/mozilla/content/html/content/src/nsHTMLButtonElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLButtonElement.cpp @@ -218,7 +218,7 @@ nsHTMLButtonElement::Click() nsCOMPtr doc = GetCurrentDoc(); if (doc) { - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (shell) { nsCOMPtr context = shell->GetPresContext(); if (context) { diff --git a/mozilla/content/html/content/src/nsHTMLInputElement.cpp b/mozilla/content/html/content/src/nsHTMLInputElement.cpp index 6a670530014..9f425bebac0 100644 --- a/mozilla/content/html/content/src/nsHTMLInputElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLInputElement.cpp @@ -1310,7 +1310,7 @@ nsHTMLInputElement::Click() return rv; } - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (shell) { nsCOMPtr context = shell->GetPresContext(); diff --git a/mozilla/content/html/content/src/nsHTMLTableRowElement.cpp b/mozilla/content/html/content/src/nsHTMLTableRowElement.cpp index 0aba51efede..c7ce9244ba5 100644 --- a/mozilla/content/html/content/src/nsHTMLTableRowElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTableRowElement.cpp @@ -106,7 +106,7 @@ void DebugList(nsIDOMHTMLTableElement* aTable) { if (root) { root->List(); } - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (shell) { nsIFrame* rootFrame = shell->FrameManager()->GetRootFrame(); if (rootFrame) { diff --git a/mozilla/content/html/document/src/nsHTMLDocument.cpp b/mozilla/content/html/document/src/nsHTMLDocument.cpp index d14a8e713d5..f96ce7f8759 100644 --- a/mozilla/content/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/content/html/document/src/nsHTMLDocument.cpp @@ -1239,7 +1239,7 @@ nsHTMLDocument::SetCompatibilityMode(nsCompatibility aMode) mCompatMode = aMode; CSSLoader()->SetCompatibilityMode(mCompatMode); - nsCOMPtr shell = GetShellAt(0); + nsCOMPtr shell = GetPrimaryShell(); if (shell) { nsPresContext *pc = shell->GetPresContext(); if (pc) { @@ -2732,7 +2732,7 @@ nsHTMLDocument::GetWidth(PRInt32* aWidth) // is the one for which we need information. // Since GetPixelDimensions flushes and flushing can destroy // our shell, hold a strong ref to it. - nsCOMPtr shell = GetShellAt(0); + nsCOMPtr shell = GetPrimaryShell(); if (!shell) { return NS_OK; } @@ -2754,7 +2754,7 @@ nsHTMLDocument::GetHeight(PRInt32* aHeight) // is the one for which we need information. // Since GetPixelDimensions flushes and flushing can destroy // our shell, hold a strong ref to it. - nsCOMPtr shell = GetShellAt(0); + nsCOMPtr shell = GetPrimaryShell(); if (!shell) { return NS_OK; } diff --git a/mozilla/content/html/document/src/nsImageDocument.cpp b/mozilla/content/html/document/src/nsImageDocument.cpp index a82223a7cab..9d578a53701 100644 --- a/mozilla/content/html/document/src/nsImageDocument.cpp +++ b/mozilla/content/html/document/src/nsImageDocument.cpp @@ -428,7 +428,7 @@ nsImageDocument::RestoreImageTo(PRInt32 aX, PRInt32 aY) RestoreImage(); FlushPendingNotifications(Flush_Layout); - nsIPresShell *shell = GetShellAt(0); + nsIPresShell *shell = GetPrimaryShell(); if (!shell) return NS_OK; @@ -600,7 +600,7 @@ nsImageDocument::CreateSyntheticDocument() nsresult nsImageDocument::CheckOverflowing(PRBool changeState) { - nsIPresShell *shell = GetShellAt(0); + nsIPresShell *shell = GetPrimaryShell(); if (!shell) { return NS_OK; } diff --git a/mozilla/content/html/document/src/nsPluginDocument.cpp b/mozilla/content/html/document/src/nsPluginDocument.cpp index 099fda668dd..61e548107d3 100644 --- a/mozilla/content/html/document/src/nsPluginDocument.cpp +++ b/mozilla/content/html/document/src/nsPluginDocument.cpp @@ -99,7 +99,7 @@ nsPluginStreamListener::OnStartRequest(nsIRequest* request, nsISupports *ctxt) nsIContent* embed = mPluginDoc->GetPluginContent(); // Now we have a frame for our , start the load - nsIPresShell* shell = mDocument->GetShellAt(0); + nsIPresShell* shell = mDocument->GetPrimaryShell(); if (!shell) { // Can't instantiate w/o a shell return NS_BINDING_ABORTED; @@ -291,7 +291,7 @@ nsPluginDocument::Print() { NS_ENSURE_TRUE(mPluginContent, NS_ERROR_FAILURE); - nsIPresShell *shell = GetShellAt(0); + nsIPresShell *shell = GetPrimaryShell(); if (!shell) { return NS_OK; } diff --git a/mozilla/content/svg/content/src/nsSVGSVGElement.cpp b/mozilla/content/svg/content/src/nsSVGSVGElement.cpp index 5ae2d1d8e70..5ce09c6b663 100644 --- a/mozilla/content/svg/content/src/nsSVGSVGElement.cpp +++ b/mozilla/content/svg/content/src/nsSVGSVGElement.cpp @@ -272,7 +272,7 @@ nsSVGSVGElement::GetPixelUnitToMillimeterX(float *aPixelUnitToMillimeterX) nsIDocument* doc = GetCurrentDoc(); if (!doc) return NS_OK; // Get Presentation shell 0 - nsIPresShell *presShell = doc->GetShellAt(0); + nsIPresShell *presShell = doc->GetPrimaryShell(); if (!presShell) return NS_OK; // Get the Presentation Context from the Shell @@ -302,7 +302,7 @@ nsSVGSVGElement::GetScreenPixelToMillimeterX(float *aScreenPixelToMillimeterX) nsIDocument* doc = GetCurrentDoc(); if (!doc) return NS_OK; // Get Presentation shell 0 - nsIPresShell *presShell = doc->GetShellAt(0); + nsIPresShell *presShell = doc->GetPrimaryShell(); if (!presShell) return NS_OK; // Get the Presentation Context from the Shell @@ -1011,7 +1011,7 @@ nsSVGSVGElement::SetCurrentScaleTranslate(float s, float x, float y) // now dispatch an SVGZoom event if we are the root element nsIDocument* doc = GetCurrentDoc(); if (doc) { - nsCOMPtr presShell = doc->GetShellAt(0); + nsCOMPtr presShell = doc->GetPrimaryShell(); NS_ASSERTION(presShell, "no presShell"); if (presShell && doc->GetRootContent() == NS_STATIC_CAST(nsIContent*, this)) { @@ -1036,7 +1036,7 @@ nsSVGSVGElement::SetCurrentTranslate(float x, float y) // now dispatch an SVGScroll event if we are the root element nsIDocument* doc = GetCurrentDoc(); if (doc) { - nsCOMPtr presShell = doc->GetShellAt(0); + nsCOMPtr presShell = doc->GetPrimaryShell(); NS_ASSERTION(presShell, "no presShell"); if (presShell && doc->GetRootContent() == NS_STATIC_CAST(nsIContent*, this)) { @@ -1167,7 +1167,7 @@ nsSVGSVGElement::DidModifySVGObservable (nsISVGValue* observable, { nsIDocument* doc = GetCurrentDoc(); if (!doc) return NS_ERROR_FAILURE; - nsCOMPtr presShell = doc->GetShellAt(0); + nsCOMPtr presShell = doc->GetPrimaryShell(); NS_ASSERTION(presShell, "no presShell"); if (!presShell) return NS_ERROR_FAILURE; @@ -1296,7 +1296,7 @@ void nsSVGSVGElement::GetOffsetToAncestor(nsIContent* ancestor, // presshells. document->FlushPendingNotifications(Flush_Layout); - nsIPresShell *presShell = document->GetShellAt(0); + nsIPresShell *presShell = document->GetPrimaryShell(); if (!presShell) { return; } @@ -1323,7 +1323,7 @@ nsSVGSVGElement::InvalidateTransformNotifyFrame() { nsIDocument* doc = GetCurrentDoc(); if (!doc) return; - nsIPresShell* presShell = doc->GetShellAt(0); + nsIPresShell* presShell = doc->GetPrimaryShell(); if (!presShell) return; nsIFrame* frame = presShell->GetPrimaryFrameFor(this); diff --git a/mozilla/content/svg/content/src/nsSVGUseElement.cpp b/mozilla/content/svg/content/src/nsSVGUseElement.cpp index 5df10957bdd..ed576e56eca 100644 --- a/mozilla/content/svg/content/src/nsSVGUseElement.cpp +++ b/mozilla/content/svg/content/src/nsSVGUseElement.cpp @@ -446,7 +446,7 @@ nsSVGUseElement::TriggerReclone() { nsIDocument *doc = GetCurrentDoc(); if (!doc) return; - nsIPresShell *presShell = doc->GetShellAt(0); + nsIPresShell *presShell = doc->GetPrimaryShell(); if (!presShell) return; presShell->RecreateFramesFor(this); } diff --git a/mozilla/content/xbl/src/nsBindingManager.cpp b/mozilla/content/xbl/src/nsBindingManager.cpp index 7bd765e89c1..4d423068328 100644 --- a/mozilla/content/xbl/src/nsBindingManager.cpp +++ b/mozilla/content/xbl/src/nsBindingManager.cpp @@ -726,7 +726,7 @@ nsBindingManager::RemoveLayeredBinding(nsIContent* aContent, nsIURI* aURL) // been removed and style may have changed due to the removal of the // anonymous children. // XXXbz this should be using the current doc (if any), not the owner doc. - nsIPresShell *presShell = doc->GetShellAt(0); + nsIPresShell *presShell = doc->GetPrimaryShell(); NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE); return presShell->RecreateFramesFor(aContent);; diff --git a/mozilla/content/xbl/src/nsXBLPrototypeHandler.cpp b/mozilla/content/xbl/src/nsXBLPrototypeHandler.cpp index 60143b48e34..aaa907fcca9 100644 --- a/mozilla/content/xbl/src/nsXBLPrototypeHandler.cpp +++ b/mozilla/content/xbl/src/nsXBLPrototypeHandler.cpp @@ -395,7 +395,7 @@ nsXBLPrototypeHandler::ExecuteHandler(nsIDOMEventReceiver* aReceiver, nsPresContext *pc = nsnull; nsIDocument *doc = handlerElement->GetCurrentDoc(); if (doc) { - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (shell) { pc = shell->GetPresContext(); } diff --git a/mozilla/content/xbl/src/nsXBLResourceLoader.cpp b/mozilla/content/xbl/src/nsXBLResourceLoader.cpp index 6f1e7d0f77a..3cdbb9418f2 100644 --- a/mozilla/content/xbl/src/nsXBLResourceLoader.cpp +++ b/mozilla/content/xbl/src/nsXBLResourceLoader.cpp @@ -251,7 +251,7 @@ nsXBLResourceLoader::NotifyBoundElements() // has a primary frame and whether it's in the undisplayed map // before sending a ContentInserted notification, or bad things // will happen. - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (shell) { nsIFrame* childFrame = shell->GetPrimaryFrameFor(content); if (!childFrame) { diff --git a/mozilla/content/xbl/src/nsXBLService.cpp b/mozilla/content/xbl/src/nsXBLService.cpp index 310b511168a..30b4806fa06 100644 --- a/mozilla/content/xbl/src/nsXBLService.cpp +++ b/mozilla/content/xbl/src/nsXBLService.cpp @@ -190,7 +190,7 @@ public: // has a primary frame and whether it's in the undisplayed map // before sending a ContentInserted notification, or bad things // will happen. - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (shell) { nsIFrame* childFrame = shell->GetPrimaryFrameFor(mBoundElement); if (!childFrame) { diff --git a/mozilla/content/xml/document/src/nsXMLContentSink.cpp b/mozilla/content/xml/document/src/nsXMLContentSink.cpp index c4ebbbd8102..a55bdd5d738 100644 --- a/mozilla/content/xml/document/src/nsXMLContentSink.cpp +++ b/mozilla/content/xml/document/src/nsXMLContentSink.cpp @@ -1096,7 +1096,7 @@ nsXMLContentSink::HandleEndElement(const PRUnichar *aName) nsEventStatus status = nsEventStatus_eIgnore; nsEvent event(PR_TRUE, NS_SVG_LOAD); event.eventStructType = NS_SVG_EVENT; - nsCOMPtr presShell = mDocument->GetShellAt(0); + nsCOMPtr presShell = mDocument->GetPrimaryShell(); if (presShell) { FlushTags(); presShell->HandleDOMEventWithTarget(content, &event, &status); diff --git a/mozilla/content/xtf/src/nsXTFElementWrapper.cpp b/mozilla/content/xtf/src/nsXTFElementWrapper.cpp index 81f3f7083a1..4349350b837 100644 --- a/mozilla/content/xtf/src/nsXTFElementWrapper.cpp +++ b/mozilla/content/xtf/src/nsXTFElementWrapper.cpp @@ -930,7 +930,7 @@ nsXTFElementWrapper::RegUnregAccessKey(PRBool aDoReg) return; // Get presentation shell 0 - nsIPresShell *presShell = doc->GetShellAt(0); + nsIPresShell *presShell = doc->GetPrimaryShell(); if (!presShell) return; diff --git a/mozilla/content/xul/content/src/nsXULElement.cpp b/mozilla/content/xul/content/src/nsXULElement.cpp index 67df5d60cb1..5b96ab3202d 100644 --- a/mozilla/content/xul/content/src/nsXULElement.cpp +++ b/mozilla/content/xul/content/src/nsXULElement.cpp @@ -605,7 +605,7 @@ nsXULElement::PerformAccesskey(PRBool aKeyCausesActivation, if (!doc) return; - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (!shell) return; @@ -1105,7 +1105,7 @@ nsXULElement::UnregisterAccessKey(const nsAString& aOldValue) // nsIDocument* doc = GetCurrentDoc(); if (doc && !aOldValue.IsEmpty()) { - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (shell) { nsIContent *content = this; @@ -2034,7 +2034,7 @@ nsXULElement::Focus() if (doc->GetNumberOfShells() == 0) return NS_OK; - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); // Set focus nsCOMPtr context = shell->GetPresContext(); @@ -2055,7 +2055,7 @@ nsXULElement::Blur() if (doc->GetNumberOfShells() == 0) return NS_OK; - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); // Set focus nsCOMPtr context = shell->GetPresContext(); @@ -2336,7 +2336,7 @@ nsXULElement::HideWindowChrome(PRBool aShouldHide) if (!doc || doc->GetRootContent() != this) return NS_ERROR_UNEXPECTED; - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (shell) { nsIContent* content = NS_STATIC_CAST(nsIContent*, this); diff --git a/mozilla/content/xul/content/src/nsXULPopupListener.cpp b/mozilla/content/xul/content/src/nsXULPopupListener.cpp index ff7390cbdf2..6ad17744e03 100644 --- a/mozilla/content/xul/content/src/nsXULPopupListener.cpp +++ b/mozilla/content/xul/content/src/nsXULPopupListener.cpp @@ -327,7 +327,7 @@ XULPopupListenerImpl::FireFocusOnTargetContent(nsIDOMNode* aTargetNode) nsCOMPtr doc = do_QueryInterface(domDoc); // Get nsIDOMElement for targetNode - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (!shell) return NS_ERROR_FAILURE; @@ -570,7 +570,7 @@ XULPopupListenerImpl::LaunchPopup(PRInt32 aClientX, PRInt32 aClientY) nsIContent* parent = popup->GetParent(); if (parent) { nsIDocument* doc = parent->GetCurrentDoc(); - nsIPresShell* presShell = doc ? doc->GetShellAt(0) : nsnull; + nsIPresShell* presShell = doc ? doc->GetPrimaryShell() : nsnull; nsIFrame* frame = presShell ? presShell->GetPrimaryFrameFor(parent) : nsnull; if (frame) { nsIMenuFrame* menu = nsnull; diff --git a/mozilla/content/xul/document/src/nsXULDocument.cpp b/mozilla/content/xul/document/src/nsXULDocument.cpp index 26d3360fab7..1890351f1ec 100644 --- a/mozilla/content/xul/document/src/nsXULDocument.cpp +++ b/mozilla/content/xul/document/src/nsXULDocument.cpp @@ -1422,7 +1422,7 @@ nsXULDocument::GetWidth(PRInt32* aWidth) // We make the assumption that the first presentation shell // is the one for which we need information. - nsIPresShell *shell = GetShellAt(0); + nsIPresShell *shell = GetPrimaryShell(); if (shell) { PRInt32 width, height; @@ -1443,7 +1443,7 @@ nsXULDocument::GetHeight(PRInt32* aHeight) // We make the assumption that the first presentation shell // is the one for which we need information. - nsIPresShell *shell = GetShellAt(0); + nsIPresShell *shell = GetPrimaryShell(); if (shell) { PRInt32 width, height; @@ -3798,7 +3798,7 @@ nsXULDocument::OverlayForwardReference::Resolve() nsCOMPtr target; PRBool notify = PR_FALSE; - nsIPresShell *shell = mDocument->GetShellAt(0); + nsIPresShell *shell = mDocument->GetPrimaryShell(); if (shell) shell->GetDidInitialReflow(¬ify); diff --git a/mozilla/dom/src/base/nsDOMClassInfo.cpp b/mozilla/dom/src/base/nsDOMClassInfo.cpp index 889345d6b6c..e699db6b265 100644 --- a/mozilla/dom/src/base/nsDOMClassInfo.cpp +++ b/mozilla/dom/src/base/nsDOMClassInfo.cpp @@ -6817,7 +6817,7 @@ nsElementSH::PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx, } // See if we have a frame. - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (!shell) { return NS_OK; diff --git a/mozilla/dom/src/base/nsFocusController.cpp b/mozilla/dom/src/base/nsFocusController.cpp index 40ac0154942..4764ddae151 100644 --- a/mozilla/dom/src/base/nsFocusController.cpp +++ b/mozilla/dom/src/base/nsFocusController.cpp @@ -287,7 +287,7 @@ nsFocusController::MoveFocus(PRBool aForward, nsIDOMElement* aElt) if (count == 0) return NS_OK; - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (!shell) return NS_OK; diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index 7943d966c8a..74234aa9da4 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/dom/src/base/nsGlobalWindow.cpp @@ -5471,7 +5471,7 @@ nsGlobalWindow::DispatchEvent(nsIDOMEvent* aEvent, PRBool* _retval) } // Obtain a presentation shell - nsIPresShell *shell = mDoc->GetShellAt(0); + nsIPresShell *shell = mDoc->GetPrimaryShell(); nsCOMPtr presContext; if (shell) { // Retrieve the context @@ -7445,7 +7445,7 @@ nsGlobalWindow::RestoreWindowState(nsISupports *aState) // focusable now. nsIDocument *doc = focusedContent->GetCurrentDoc(); if (doc) { - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (shell) { nsPresContext *pc = shell->GetPresContext(); if (pc) { diff --git a/mozilla/dom/src/base/nsHistory.cpp b/mozilla/dom/src/base/nsHistory.cpp index 24e24b41a6e..5f98bca7267 100644 --- a/mozilla/dom/src/base/nsHistory.cpp +++ b/mozilla/dom/src/base/nsHistory.cpp @@ -293,7 +293,7 @@ nsHistory::Go() nsIPresShell *shell; nsPresContext *pcx; - if (doc && (shell = doc->GetShellAt(0)) && + if (doc && (shell = doc->GetPrimaryShell()) && (pcx = shell->GetPresContext())) { pcx->ClearStyleDataAndReflow(); } diff --git a/mozilla/dom/src/base/nsLocation.cpp b/mozilla/dom/src/base/nsLocation.cpp index f20d7d87332..a3e7422a03d 100644 --- a/mozilla/dom/src/base/nsLocation.cpp +++ b/mozilla/dom/src/base/nsLocation.cpp @@ -893,7 +893,7 @@ nsLocation::Reload() nsIPresShell *shell; nsPresContext *pcx; - if (doc && (shell = doc->GetShellAt(0)) && + if (doc && (shell = doc->GetPrimaryShell()) && (pcx = shell->GetPresContext())) { pcx->ClearStyleDataAndReflow(); } diff --git a/mozilla/editor/libeditor/text/nsEditorEventListeners.cpp b/mozilla/editor/libeditor/text/nsEditorEventListeners.cpp index d76f5802b53..90f46a5ebbb 100644 --- a/mozilla/editor/libeditor/text/nsEditorEventListeners.cpp +++ b/mozilla/editor/libeditor/text/nsEditorEventListeners.cpp @@ -1014,7 +1014,7 @@ IsTargetFocused(nsIDOMEventTarget* aTarget) if (!doc) return PR_FALSE; - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (!shell) return PR_FALSE; diff --git a/mozilla/embedding/browser/gtk/src/EmbedContextMenuInfo.cpp b/mozilla/embedding/browser/gtk/src/EmbedContextMenuInfo.cpp index 3689d996947..c951e37766c 100644 --- a/mozilla/embedding/browser/gtk/src/EmbedContextMenuInfo.cpp +++ b/mozilla/embedding/browser/gtk/src/EmbedContextMenuInfo.cpp @@ -161,7 +161,7 @@ EmbedContextMenuInfo::GetFormControlType(nsIDOMEvent* aEvent) nsCOMPtr doc = do_QueryInterface(mCtxDocument); if (!doc) return NS_OK; - nsIPresShell *presShell = doc->GetShellAt(0); + nsIPresShell *presShell = doc->GetPrimaryShell(); if (!presShell) return NS_OK; nsCOMPtr tgContent = do_QueryInterface(mEventTarget); @@ -595,7 +595,7 @@ EmbedContextMenuInfo::UpdateContextData(nsIDOMEvent *aDOMEvent) nsCOMPtr doc = do_QueryInterface(mCtxDocument); if (!doc) return NS_OK; - nsIPresShell *presShell = doc->GetShellAt(0); + nsIPresShell *presShell = doc->GetPrimaryShell(); if (!presShell) return NS_OK; nsCOMPtr tgContent = do_QueryInterface(mEventTarget); diff --git a/mozilla/embedding/browser/gtk/src/EmbedEventListener.cpp b/mozilla/embedding/browser/gtk/src/EmbedEventListener.cpp index 36b59550cc6..731866f5eac 100644 --- a/mozilla/embedding/browser/gtk/src/EmbedEventListener.cpp +++ b/mozilla/embedding/browser/gtk/src/EmbedEventListener.cpp @@ -656,7 +656,7 @@ EmbedEventListener::HandleSelection(nsIDOMMouseEvent* aDOMMouseEvent) if (NS_FAILED(rv) || !doc) return NS_ERROR_FAILURE; - nsIPresShell *presShell = doc->GetShellAt(0); + nsIPresShell *presShell = doc->GetPrimaryShell(); /* Gets nsISelectionController interface for the current context */ mCurSelCon = do_QueryInterface(presShell); diff --git a/mozilla/embedding/components/find/src/nsFind.cpp b/mozilla/embedding/components/find/src/nsFind.cpp index d5dc9057fae..755b5cb7de7 100644 --- a/mozilla/embedding/components/find/src/nsFind.cpp +++ b/mozilla/embedding/components/find/src/nsFind.cpp @@ -372,7 +372,7 @@ nsFindContentIterator::SetupInnerIterator(nsIContent* aContent) NS_ASSERTION(aContent && !aContent->IsNativeAnonymous(), "invalid call"); nsIDocument* doc = aContent->GetDocument(); - nsIPresShell* shell = doc ? doc->GetShellAt(0) : nsnull; + nsIPresShell* shell = doc ? doc->GetPrimaryShell() : nsnull; if (!shell) return; @@ -830,7 +830,7 @@ PRBool nsFind::IsVisibleNode(nsIDOMNode *aDOMNode) if (!doc) return PR_FALSE; - nsIPresShell *presShell = doc->GetShellAt(0); + nsIPresShell *presShell = doc->GetPrimaryShell(); if (!presShell) return PR_FALSE; diff --git a/mozilla/embedding/components/find/src/nsWebBrowserFind.cpp b/mozilla/embedding/components/find/src/nsWebBrowserFind.cpp index 58ae2d4602e..8f62f1c985e 100644 --- a/mozilla/embedding/components/find/src/nsWebBrowserFind.cpp +++ b/mozilla/embedding/components/find/src/nsWebBrowserFind.cpp @@ -385,7 +385,7 @@ FocusElementButNotDocument(nsIDocument* aDocument, nsIContent* aContent) nsCOMPtr newFocusedElement(do_QueryInterface(aContent)); focusController->SetFocusedElement(newFocusedElement); - nsIPresShell* presShell = aDocument->GetShellAt(0); + nsIPresShell* presShell = aDocument->GetPrimaryShell(); nsIEventStateManager* esm = presShell->GetPresContext()->EventStateManager(); // Temporarily set esm::mCurrentFocus so that esm::GetContentState() tells @@ -410,7 +410,7 @@ void nsWebBrowserFind::SetSelectionAndScroll(nsIDOMWindow* aWindow, if (!domDoc) return; nsCOMPtr doc(do_QueryInterface(domDoc)); - nsIPresShell* presShell = doc->GetShellAt(0); + nsIPresShell* presShell = doc->GetPrimaryShell(); if (!presShell) return; // since the match could be an anonymous textnode inside a @@ -834,7 +834,7 @@ nsWebBrowserFind::GetFrameSelection(nsIDOMWindow* aWindow, if (!domDoc) return; nsCOMPtr doc(do_QueryInterface(domDoc)); - nsIPresShell* presShell = doc->GetShellAt(0); + nsIPresShell* presShell = doc->GetPrimaryShell(); if (!presShell) return; // text input controls have their independent selection controllers diff --git a/mozilla/extensions/access-builtin/accessproxy/nsAccessProxy.cpp b/mozilla/extensions/access-builtin/accessproxy/nsAccessProxy.cpp index 39dca677fe8..714f051fa7f 100644 --- a/mozilla/extensions/access-builtin/accessproxy/nsAccessProxy.cpp +++ b/mozilla/extensions/access-builtin/accessproxy/nsAccessProxy.cpp @@ -141,7 +141,7 @@ NS_IMETHODIMP nsAccessProxy::HandleEvent(nsIDOMEvent* aEvent) if (domDoc) { doc = do_QueryInterface(domDoc); if (doc && doc->GetNumberOfShells()>0) { - presShell = doc->GetShellAt(0); + presShell = doc->GetPrimaryShell(); } } //return NS_OK; diff --git a/mozilla/extensions/spatialnavigation/src/nsSpatialNavigation.cpp b/mozilla/extensions/spatialnavigation/src/nsSpatialNavigation.cpp index 0d493c90c75..7df7fa9c190 100755 --- a/mozilla/extensions/spatialnavigation/src/nsSpatialNavigation.cpp +++ b/mozilla/extensions/spatialnavigation/src/nsSpatialNavigation.cpp @@ -651,7 +651,7 @@ nsSpatialNavigation::handleMove(int direction) if (!doc) return NS_ERROR_FAILURE; -/* nsIPresShell *presShell = doc->GetShellAt(0); +/* nsIPresShell *presShell = doc->GetPrimaryShell(); nsIFrame* cframe = presShell->GetPrimaryFrameFor(c); @@ -679,7 +679,7 @@ nsSpatialNavigation::handleMove(int direction) contentWindow->GetDocument(getter_AddRefs(domDoc)); nsCOMPtr doc = do_QueryInterface(domDoc); - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (!shell) return NS_OK; presContext = shell->GetPresContext(); @@ -706,7 +706,7 @@ nsSpatialNavigation::handleMove(int direction) subdocWindow->GetDocument(getter_AddRefs(subdomdoc)); if (!subdoc) return NS_OK; - nsIPresShell *subdocShell = subdoc->GetShellAt(0); + nsIPresShell *subdocShell = subdoc->GetPrimaryShell(); if (!subdocShell) return NS_OK; nsPresContext *subdocPresContext = subdocShell->GetPresContext(); @@ -856,7 +856,7 @@ nsSpatialNavigation::getPresContext(nsIContent* content) if (!doc) return nsnull; // the only case where there could be more shells in printpreview - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (!shell) return nsnull; nsPresContext *presContext = shell->GetPresContext(); diff --git a/mozilla/extensions/spatialnavigation/src/nsSpatialNavigationUtils.cpp b/mozilla/extensions/spatialnavigation/src/nsSpatialNavigationUtils.cpp index 1ab6b5a3b1f..7f13070b96d 100755 --- a/mozilla/extensions/spatialnavigation/src/nsSpatialNavigationUtils.cpp +++ b/mozilla/extensions/spatialnavigation/src/nsSpatialNavigationUtils.cpp @@ -306,7 +306,7 @@ nsresult getFrameForContent(nsIContent* aContent, nsIFrame** aFrame) if (!doc) return NS_ERROR_FAILURE; - nsIPresShell *presShell = doc->GetShellAt(0); + nsIPresShell *presShell = doc->GetPrimaryShell(); nsIFrame* frame = presShell->GetPrimaryFrameFor(aContent); if (!frame) diff --git a/mozilla/extensions/typeaheadfind/src/nsTypeAheadFind.cpp b/mozilla/extensions/typeaheadfind/src/nsTypeAheadFind.cpp index 3751d508968..cdcb48d0ca9 100644 --- a/mozilla/extensions/typeaheadfind/src/nsTypeAheadFind.cpp +++ b/mozilla/extensions/typeaheadfind/src/nsTypeAheadFind.cpp @@ -487,7 +487,7 @@ nsTypeAheadFind::UseInWindow(nsIDOMWindow *aDOMWin) return NS_OK; } - nsIPresShell *presShell = doc->GetShellAt(0); + nsIPresShell *presShell = doc->GetPrimaryShell(); if (!presShell) { return NS_OK; @@ -823,7 +823,7 @@ nsTypeAheadFind::BackOneChar(PRBool *aIsBackspaceUsed) startNode->GetOwnerDocument(getter_AddRefs(domDoc)); nsCOMPtr doc(do_QueryInterface(domDoc)); if (doc) { - presShell = doc->GetShellAt(0); + presShell = doc->GetPrimaryShell(); } } if (!presShell) { @@ -2471,7 +2471,7 @@ nsTypeAheadFind::GetTargetIfTypeAheadOkay(nsIDOMEvent *aEvent, // ---------- Get presshell ----------- - nsIPresShell *presShell = doc->GetShellAt(0); + nsIPresShell *presShell = doc->GetPrimaryShell(); if (!presShell) { return NS_OK; } diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index 52ec42c2733..05a34695052 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -5876,7 +5876,7 @@ StopPluginInstance(PresShell *aShell, nsIContent *aContent) PR_STATIC_CALLBACK(PRBool) FreezeSubDocument(nsIDocument *aDocument, void *aData) { - nsIPresShell *shell = aDocument->GetShellAt(0); + nsIPresShell *shell = aDocument->GetPrimaryShell(); if (shell) shell->Freeze(); @@ -5916,7 +5916,7 @@ StartPluginInstance(PresShell *aShell, nsIContent *aContent) PR_STATIC_CALLBACK(PRBool) ThawSubDocument(nsIDocument *aDocument, void *aData) { - nsIPresShell *shell = aDocument->GetShellAt(0); + nsIPresShell *shell = aDocument->GetPrimaryShell(); if (shell) shell->Thaw(); diff --git a/mozilla/layout/forms/nsTextControlFrame.cpp b/mozilla/layout/forms/nsTextControlFrame.cpp index d995aad43a2..4dbf9a8dc60 100644 --- a/mozilla/layout/forms/nsTextControlFrame.cpp +++ b/mozilla/layout/forms/nsTextControlFrame.cpp @@ -305,7 +305,7 @@ nsTextInputListener::NotifySelectionChanged(nsIDOMDocument* aDoc, nsISelection* nsCOMPtr doc = content->GetDocument(); if (doc) { - nsCOMPtr presShell = doc->GetShellAt(0); + nsCOMPtr presShell = doc->GetPrimaryShell(); if (presShell) { nsEventStatus status = nsEventStatus_eIgnore; diff --git a/mozilla/layout/generic/nsImageMap.cpp b/mozilla/layout/generic/nsImageMap.cpp index 243d1b1eec8..269235b5b6d 100644 --- a/mozilla/layout/generic/nsImageMap.cpp +++ b/mozilla/layout/generic/nsImageMap.cpp @@ -1007,7 +1007,7 @@ nsImageMap::ChangeFocus(nsIDOMEvent* aEvent, PRBool aFocus) { nsCOMPtr doc = targetContent->GetDocument(); //This check is necessary to see if we're still attached to the doc if (doc) { - nsIPresShell *presShell = doc->GetShellAt(0); + nsIPresShell *presShell = doc->GetPrimaryShell(); if (presShell) { nsIFrame* imgFrame = presShell->GetPrimaryFrameFor(targetContent); if (imgFrame) { diff --git a/mozilla/layout/generic/nsObjectFrame.cpp b/mozilla/layout/generic/nsObjectFrame.cpp index 553a391b512..8b080446f2d 100644 --- a/mozilla/layout/generic/nsObjectFrame.cpp +++ b/mozilla/layout/generic/nsObjectFrame.cpp @@ -981,7 +981,7 @@ nsObjectFrame::PrintPlugin(nsIRenderingContext& aRenderingContext, // now we need to get the shell for the screen // XXX assuming that the shell at zero will always be the screen one - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); if (!shell) return; diff --git a/mozilla/layout/inspector/src/inLayoutUtils.cpp b/mozilla/layout/inspector/src/inLayoutUtils.cpp index 557b17f517c..84b139fa37a 100644 --- a/mozilla/layout/inspector/src/inLayoutUtils.cpp +++ b/mozilla/layout/inspector/src/inLayoutUtils.cpp @@ -108,7 +108,7 @@ inLayoutUtils::GetEventStateManagerFor(nsIDOMElement *aElement) return nsnull; } - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); NS_ASSERTION(shell, "No pres shell"); return shell->GetPresContext()->EventStateManager(); diff --git a/mozilla/layout/printing/nsPrintPreviewListener.cpp b/mozilla/layout/printing/nsPrintPreviewListener.cpp index 16643e34c0b..9ee525a4099 100644 --- a/mozilla/layout/printing/nsPrintPreviewListener.cpp +++ b/mozilla/layout/printing/nsPrintPreviewListener.cpp @@ -188,7 +188,7 @@ nsPrintPreviewListener::HandleEvent(nsIDOMEvent* aEvent) nsIDocument* parentDoc = doc->GetParentDocument(); NS_ASSERTION(parentDoc, "no parent document"); nsIEventStateManager* esm = - parentDoc->GetShellAt(0)->GetPresContext()->EventStateManager(); + parentDoc->GetPrimaryShell()->GetPresContext()->EventStateManager(); if (esm) { esm->SetContentState(nsnull, NS_EVENT_STATE_FOCUS); PRBool forward = (action == eEventAction_Tab); diff --git a/mozilla/layout/style/nsComputedDOMStyle.cpp b/mozilla/layout/style/nsComputedDOMStyle.cpp index 8d482a66cfc..6ab0b0796d6 100644 --- a/mozilla/layout/style/nsComputedDOMStyle.cpp +++ b/mozilla/layout/style/nsComputedDOMStyle.cpp @@ -308,7 +308,7 @@ nsComputedDOMStyle::GetPropertyCSSValue(const nsAString& aPropertyName, // may be different. document->FlushPendingNotifications(Flush_Style); - nsIPresShell* presShell = document->GetShellAt(0); + nsIPresShell* presShell = document->GetPrimaryShell(); NS_ENSURE_TRUE(presShell, NS_ERROR_NOT_AVAILABLE); mFrame = presShell->GetPrimaryFrameFor(mContent); @@ -680,7 +680,7 @@ nsComputedDOMStyle::GetFontFamily(nsIDOMCSSValue** aValue) nsCOMPtr doc = do_QueryReferent(mDocumentWeak); NS_ASSERTION(doc, "document is required"); - nsIPresShell* presShell = doc->GetShellAt(0); + nsIPresShell* presShell = doc->GetPrimaryShell(); NS_ASSERTION(presShell, "pres shell is required"); nsPresContext *presContext = presShell->GetPresContext(); NS_ASSERTION(presContext, "pres context is required"); diff --git a/mozilla/layout/style/nsInspectorCSSUtils.cpp b/mozilla/layout/style/nsInspectorCSSUtils.cpp index 892815b0c14..3da04911907 100644 --- a/mozilla/layout/style/nsInspectorCSSUtils.cpp +++ b/mozilla/layout/style/nsInspectorCSSUtils.cpp @@ -167,7 +167,7 @@ nsInspectorCSSUtils::GetRuleNodeForContent(nsIContent* aContent, nsIDocument* doc = aContent->GetDocument(); NS_ENSURE_TRUE(doc, NS_ERROR_UNEXPECTED); - nsIPresShell *presShell = doc->GetShellAt(0); + nsIPresShell *presShell = doc->GetPrimaryShell(); NS_ENSURE_TRUE(presShell, NS_ERROR_UNEXPECTED); nsRefPtr sContext = diff --git a/mozilla/layout/xul/base/src/nsBoxObject.cpp b/mozilla/layout/xul/base/src/nsBoxObject.cpp index f18d69f80c0..340a619a9e3 100644 --- a/mozilla/layout/xul/base/src/nsBoxObject.cpp +++ b/mozilla/layout/xul/base/src/nsBoxObject.cpp @@ -157,7 +157,7 @@ nsBoxObject::GetPresShell(PRBool aFlushLayout) doc->FlushPendingNotifications(Flush_Layout); } - return doc->GetShellAt(0); + return doc->GetPrimaryShell(); } nsresult diff --git a/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp b/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp index 38c3c772440..58c28d1fb30 100644 --- a/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp @@ -114,7 +114,7 @@ nsImageBoxFrameEvent::Run() return NS_OK; } - nsIPresShell *pres_shell = doc->GetShellAt(0); + nsIPresShell *pres_shell = doc->GetPrimaryShell(); if (!pres_shell) { return NS_OK; } diff --git a/mozilla/layout/xul/base/src/nsMenuBarFrame.cpp b/mozilla/layout/xul/base/src/nsMenuBarFrame.cpp index cb84c7c86e2..7836f8179ab 100644 --- a/mozilla/layout/xul/base/src/nsMenuBarFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuBarFrame.cpp @@ -218,7 +218,7 @@ nsMenuBarFrame::SetActive(PRBool aActiveFlag) if (!focusedDoc) break; - presShell = focusedDoc->GetShellAt(0); + presShell = focusedDoc->GetPrimaryShell(); nsCOMPtr selCon(do_QueryInterface(presShell)); // there is no selection controller for full page plugins if (!selCon) diff --git a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp index 71a0fd00a64..1d52b05ffb5 100644 --- a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp @@ -378,7 +378,7 @@ nsMenuPopupFrame::AdjustClientXYForNestedDocuments ( nsIDOMXULDocument* inPopupD if ( targetAsContent ) { nsCOMPtr targetDocument = targetAsContent->GetDocument(); if (targetDocument) { - nsIPresShell *shell = targetDocument->GetShellAt(0); + nsIPresShell *shell = targetDocument->GetPrimaryShell(); if ( shell ) { // We might be inside a popup widget. If so, we need to use that widget and // not the root view's widget. diff --git a/mozilla/layout/xul/base/src/nsXULTooltipListener.cpp b/mozilla/layout/xul/base/src/nsXULTooltipListener.cpp index 2cf6bedb0b6..b553012de8e 100644 --- a/mozilla/layout/xul/base/src/nsXULTooltipListener.cpp +++ b/mozilla/layout/xul/base/src/nsXULTooltipListener.cpp @@ -589,7 +589,7 @@ nsXULTooltipListener::FindTooltip(nsIContent* aTarget, nsIContent** aTooltip) aTarget->GetAttr(kNameSpaceID_None, nsGkAtoms::tooltiptext, tooltipText); if (!tooltipText.IsEmpty()) { // specifying tooltiptext means we will always use the default tooltip - nsIRootBox* rootBox = nsIRootBox::GetRootBox(document->GetShellAt(0)); + nsIRootBox* rootBox = nsIRootBox::GetRootBox(document->GetPrimaryShell()); NS_ENSURE_STATE(rootBox); *aTooltip = rootBox->GetDefaultTooltip(); if (*aTooltip) { @@ -631,7 +631,7 @@ nsXULTooltipListener::FindTooltip(nsIContent* aTarget, nsIContent** aTooltip) #ifdef MOZ_XUL // titletips should just use the default tooltip if (mIsSourceTree && mNeedTitletip) { - nsIRootBox* rootBox = nsIRootBox::GetRootBox(document->GetShellAt(0)); + nsIRootBox* rootBox = nsIRootBox::GetRootBox(document->GetPrimaryShell()); NS_ENSURE_STATE(rootBox); NS_IF_ADDREF(*aTooltip = rootBox->GetDefaultTooltip()); } @@ -655,7 +655,7 @@ nsXULTooltipListener::GetTooltipFor(nsIContent* aTarget, nsIContent** aTooltip) nsIContent* parent = tooltip->GetParent(); if (parent) { nsIDocument* doc = parent->GetCurrentDoc(); - nsIPresShell* presShell = doc ? doc->GetShellAt(0) : nsnull; + nsIPresShell* presShell = doc ? doc->GetPrimaryShell() : nsnull; nsIFrame* frame = presShell ? presShell->GetPrimaryFrameFor(parent) : nsnull; if (frame) { nsIMenuFrame* menu = nsnull; diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeColumns.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeColumns.cpp index bb49e8ada55..7679d8ecb94 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeColumns.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeColumns.cpp @@ -106,7 +106,7 @@ nsTreeColumn::GetFrame() if (!document) return nsnull; - nsIPresShell *shell = document->GetShellAt(0); + nsIPresShell *shell = document->GetPrimaryShell(); if (!shell) return nsnull; @@ -589,7 +589,7 @@ nsTreeColumns::EnsureColumns() return; nsCOMPtr document = treeContent->GetDocument(); - nsIPresShell *shell = document->GetShellAt(0); + nsIPresShell *shell = document->GetPrimaryShell(); if (!shell) return; diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeSelection.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeSelection.cpp index 1712b769e0c..f5b4bf98bac 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeSelection.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeSelection.cpp @@ -828,7 +828,7 @@ nsTreeSelection::FireOnSelectHandler() if (!document) return NS_OK; - nsIPresShell *shell = document->GetShellAt(0); + nsIPresShell *shell = document->GetPrimaryShell(); if (shell) { // Retrieve the context in which our DOM event will fire. nsCOMPtr aPresContext = shell->GetPresContext(); diff --git a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp index 7ffb05fecf1..809301f0ada 100644 --- a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp +++ b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp @@ -315,7 +315,7 @@ NS_IMETHODIMP nsPluginDocReframeEvent::Run() { for (PRUint32 i = 0; i < c; i++) { nsCOMPtr doc (do_QueryElementAt(mDocs, i)); if (doc) { - nsIPresShell *shell = doc->GetShellAt(0); + nsIPresShell *shell = doc->GetPrimaryShell(); // if this document has a presentation shell, then it has frames and can be reframed if (shell) { diff --git a/mozilla/toolkit/components/autocomplete/src/nsAutoCompleteController.cpp b/mozilla/toolkit/components/autocomplete/src/nsAutoCompleteController.cpp index f6ee3f4fbc4..821f18d4db1 100644 --- a/mozilla/toolkit/components/autocomplete/src/nsAutoCompleteController.cpp +++ b/mozilla/toolkit/components/autocomplete/src/nsAutoCompleteController.cpp @@ -1423,7 +1423,7 @@ nsAutoCompleteController::GetPopupWidget() nsCOMPtr doc = do_QueryInterface(domDoc); NS_ENSURE_TRUE(doc, nsnull); - nsIPresShell* presShell = doc->GetShellAt(0); + nsIPresShell* presShell = doc->GetPrimaryShell(); NS_ENSURE_TRUE(presShell, nsnull); nsCOMPtr content = do_QueryInterface(popup); diff --git a/mozilla/toolkit/components/satchel/src/nsFormFillController.cpp b/mozilla/toolkit/components/satchel/src/nsFormFillController.cpp index 5e60d8a31c8..6a4c99e0489 100644 --- a/mozilla/toolkit/components/satchel/src/nsFormFillController.cpp +++ b/mozilla/toolkit/components/satchel/src/nsFormFillController.cpp @@ -135,7 +135,7 @@ GetScreenOrigin(nsIDOMElement* aElement) if (doc) { // Get Presentation shell 0 - nsIPresShell* presShell = doc->GetShellAt(0); + nsIPresShell* presShell = doc->GetPrimaryShell(); if (presShell) { nsIFrame* frame = presShell->GetPrimaryFrameFor(content); diff --git a/mozilla/widget/src/beos/nsDragService.cpp b/mozilla/widget/src/beos/nsDragService.cpp index bbb343bf4c1..f9e0da50a4c 100644 --- a/mozilla/widget/src/beos/nsDragService.cpp +++ b/mozilla/widget/src/beos/nsDragService.cpp @@ -91,7 +91,7 @@ GetPrimaryFrameFor(nsIDOMNode *aDOMNode) nsIDocument* doc = aContent->GetCurrentDoc(); if (nsnull == doc) return nsnull; - nsIPresShell* presShell = doc->GetShellAt(0); + nsIPresShell* presShell = doc->GetPrimaryShell(); if ( nsnull == presShell) return nsnull; return presShell->GetPrimaryFrameFor(aContent); diff --git a/mozilla/widget/src/mac/nsDragService.cpp b/mozilla/widget/src/mac/nsDragService.cpp index 6699e6c606d..d35921f8f29 100644 --- a/mozilla/widget/src/mac/nsDragService.cpp +++ b/mozilla/widget/src/mac/nsDragService.cpp @@ -97,7 +97,7 @@ GetPrimaryFrameFor(nsIContent* aContent) nsIFrame* result = nsnull; nsIDocument* doc = aContent->GetCurrentDoc(); if (doc) { - nsIPresShell* presShell = doc->GetShellAt(0); + nsIPresShell* presShell = doc->GetPrimaryShell(); if (presShell) { result = presShell->GetPrimaryFrameFor(aContent); } diff --git a/mozilla/widget/src/xpwidgets/nsBaseDragService.cpp b/mozilla/widget/src/xpwidgets/nsBaseDragService.cpp index e8f1cc658a0..e1180b790db 100644 --- a/mozilla/widget/src/xpwidgets/nsBaseDragService.cpp +++ b/mozilla/widget/src/xpwidgets/nsBaseDragService.cpp @@ -231,7 +231,7 @@ nsBaseDragService::InvokeDragSession(nsIDOMNode *aDOMNode, if (contentNode) { nsIDocument* doc = contentNode->GetCurrentDoc(); if (doc) { - nsIPresShell* presShell = doc->GetShellAt(0); + nsIPresShell* presShell = doc->GetPrimaryShell(); if (presShell) { nsIViewManager* vm = presShell->GetViewManager(); if (vm) { @@ -356,7 +356,7 @@ nsBaseDragService::FireDragEventAtSource(PRUint32 aMsg) if (mSourceNode) { nsCOMPtr doc = do_QueryInterface(mSourceDocument); if (doc) { - nsCOMPtr presShell = doc->GetShellAt(0); + nsCOMPtr presShell = doc->GetPrimaryShell(); if (presShell) { nsEventStatus status = nsEventStatus_eIgnore; nsMouseEvent event(PR_TRUE, aMsg, nsnull, nsMouseEvent::eReal); @@ -380,7 +380,7 @@ GetPresShellForContent(nsIDOMNode* aDOMNode) if (document) { document->FlushPendingNotifications(Flush_Display); - return document->GetShellAt(0); + return document->GetPrimaryShell(); } return nsnull;