Permalink
Browse files

Bug 534226 - Remove support for multiple presshells, r=bz, sr=roc

  • Loading branch information...
Olli Pettay Olli Pettay
Olli Pettay authored and Olli Pettay committed Jan 7, 2010
1 parent ffa7884 commit c0f0d7e3a56833cb348299f5aed8dfd07f04bfb3
@@ -113,7 +113,6 @@
#include "nsIXPConnect.h"
#include "nsIXULAppInfo.h"
#include "nsIXULRuntime.h"
#include "nsPresShellIterator.h"
#define UILOCALE_CMD_LINE_ARG "UILocale"
@@ -956,9 +955,8 @@ nsresult nsChromeRegistry::RefreshWindow(nsIDOMWindowInternal* aWindow,
return NS_OK;
// Deal with the agent sheets first. Have to do all the style sets by hand.
nsPresShellIterator iter(document);
nsCOMPtr<nsIPresShell> shell;
while ((shell = iter.GetNextShell())) {
nsCOMPtr<nsIPresShell> shell = document->GetPrimaryShell();
if (shell) {
// Reload only the chrome URL agent style sheets.
nsCOMArray<nsIStyleSheet> agentSheets;
rv = shell->GetAgentStyleSheets(agentSheets);
@@ -75,7 +75,6 @@ nsCopySupport.h \
nsContentCreatorFunctions.h \
nsDOMFile.h \
nsLineBreaker.h \
nsPresShellIterator.h \
nsReferencedElement.h \
nsXMLNameSpaceMap.h \
$(NULL)
@@ -105,8 +105,8 @@ class nsIBoxObject;
// IID for the nsIDocument interface
#define NS_IDOCUMENT_IID \
{ 0xd16d73c1, 0xe0f7, 0x415c, \
{ 0xbd, 0x68, 0x9c, 0x1f, 0x93, 0xb8, 0x73, 0x7a } }
{ 0x1539ada4, 0x753f, 0x48a9, \
{ 0x83, 0x11, 0x71, 0xb9, 0xbd, 0xa6, 0x41, 0xc6 } }
// Flag for AddStyleSheet().
#define NS_STYLESHEET_FROM_CATALOG (1 << 0)
@@ -409,10 +409,15 @@ class nsIDocument : public nsINode
nsIViewManager* aViewManager,
nsStyleSet* aStyleSet,
nsIPresShell** aInstancePtrResult) = 0;
virtual PRBool DeleteShell(nsIPresShell* aShell) = 0;
virtual nsIPresShell *GetPrimaryShell() const = 0;
void SetShellsHidden(PRBool aHide) { mShellsAreHidden = aHide; }
PRBool ShellsAreHidden() const { return mShellsAreHidden; }
void DeleteShell() { mPresShell = nsnull; }
nsIPresShell* GetPrimaryShell() const
{
return mShellIsHidden ? nsnull : mPresShell;
}
void SetShellHidden(PRBool aHide) { mShellIsHidden = aHide; }
PRBool ShellIsHidden() const { return mShellIsHidden; }
/**
* Return the parent document of this document. Will return null
@@ -1247,7 +1252,6 @@ class nsIDocument : public nsINode
virtual void WillDispatchMutationEvent(nsINode* aTarget) = 0;
virtual void MutationEventDispatched(nsINode* aTarget) = 0;
friend class mozAutoSubtreeModified;
friend class nsPresShellIterator;
nsCOMPtr<nsIURI> mDocumentURI;
nsCOMPtr<nsIURI> mDocumentBaseURI;
@@ -1296,7 +1300,7 @@ class nsIDocument : public nsINode
// document in it.
PRPackedBool mIsInitialDocumentInWindow;
PRPackedBool mShellsAreHidden;
PRPackedBool mShellIsHidden;
PRPackedBool mIsRegularHTML;
@@ -1355,7 +1359,7 @@ class nsIDocument : public nsINode
// won't be collected
PRUint32 mMarkedCCGeneration;
nsTObserverArray<nsIPresShell*> mPresShells;
nsIPresShell* mPresShell;
nsCOMArray<nsINode> mSubtreeModifiedTargets;
PRUint32 mSubtreeModifiedDepth;

This file was deleted.

Oops, something went wrong.
@@ -95,7 +95,6 @@
#include "nsNodeUtils.h"
#include "nsIDOMNode.h"
#include "nsThreadUtils.h"
#include "nsPresShellIterator.h"
#include "nsPIDOMWindow.h"
#include "mozAutoDocUpdate.h"
#include "nsIWebNavigation.h"
@@ -1229,9 +1228,8 @@ nsContentSink::ScrollToRef()
// http://www.w3.org/TR/html4/appendix/notes.html#h-B.2.1
NS_ConvertUTF8toUTF16 ref(unescapedRef);
nsPresShellIterator iter(mDocument);
nsCOMPtr<nsIPresShell> shell;
while ((shell = iter.GetNextShell())) {
nsCOMPtr<nsIPresShell> shell = mDocument->GetPrimaryShell();
if (shell) {
// Check an empty string which might be caused by the UTF-8 conversion
if (!ref.IsEmpty()) {
// Note that GoToAnchor will handle flushing layout as needed.
@@ -1309,24 +1307,13 @@ nsContentSink::StartLayout(PRBool aIgnorePendingSheets)
mLastNotificationTime = PR_Now();
mDocument->SetMayStartLayout(PR_TRUE);
nsPresShellIterator iter(mDocument);
nsCOMPtr<nsIPresShell> shell;
while ((shell = iter.GetNextShell())) {
// Make sure we don't call InitialReflow() for a shell that has
// already called it. This can happen when the layout frame for
// an iframe is constructed *between* the Embed() call for the
// docshell in the iframe, and the content sink's call to OpenBody().
// (Bug 153815)
if (shell->DidInitialReflow()) {
// XXX: The assumption here is that if something already
// called InitialReflow() on this shell, it also did some of
// the setup below, so we do nothing and just move on to the
// next shell in the list.
continue;
}
nsCOMPtr<nsIPresShell> shell = mDocument->GetPrimaryShell();
// Make sure we don't call InitialReflow() for a shell that has
// already called it. This can happen when the layout frame for
// an iframe is constructed *between* the Embed() call for the
// docshell in the iframe, and the content sink's call to OpenBody().
// (Bug 153815)
if (shell && !shell->DidInitialReflow()) {
nsRect r = shell->GetPresContext()->GetVisibleArea();
nsCOMPtr<nsIPresShell> shellGrip = shell;
nsresult rv = shell->InitialReflow(r.width, r.height);
Oops, something went wrong.

0 comments on commit c0f0d7e

Please sign in to comment.