From 7feb3ecad0ba1bd81bd8573c0a1a0e2c7ddf5f2c Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Tue, 4 May 1999 23:29:06 +0000 Subject: [PATCH] Changes to support window.open in AppRunner. git-svn-id: svn://10.0.0.236/trunk@30277 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsPresShell.cpp | 8 ++-- mozilla/layout/generic/nsFrameFrame.cpp | 40 +++++-------------- mozilla/layout/html/base/src/nsPresShell.cpp | 8 ++-- .../layout/html/document/src/nsFrameFrame.cpp | 40 +++++-------------- 4 files changed, 26 insertions(+), 70 deletions(-) diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index 058bdc5bd9c..0ddebc0ef9a 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -1385,16 +1385,16 @@ PresShell::CantRenderReplacedElement(nsIPresContext* aPresContext, kIEventQueueServiceIID, (nsISupports **)&eventService); if (NS_SUCCEEDED(rv)) { - PLEventQueue* eventQueue; + nsCOMPtr eventQueue; rv = eventService->GetThreadEventQueue(PR_GetCurrentThread(), - &eventQueue); + getter_AddRefs(eventQueue)); nsServiceManager::ReleaseService(kEventQueueServiceCID, eventService); - if (NS_SUCCEEDED(rv) && (nsnull != eventQueue)) { + if (NS_SUCCEEDED(rv) && eventQueue) { CantRenderReplacedElementEvent* ev; ev = new CantRenderReplacedElementEvent(this, aFrame); - PL_PostEvent(eventQueue, ev); + eventQueue->PostEvent(ev); } } return rv; diff --git a/mozilla/layout/generic/nsFrameFrame.cpp b/mozilla/layout/generic/nsFrameFrame.cpp index 808e24f6514..3088e3cb87a 100644 --- a/mozilla/layout/generic/nsFrameFrame.cpp +++ b/mozilla/layout/generic/nsFrameFrame.cpp @@ -671,37 +671,13 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext, nsIContent* content; GetParentContent(content); - mWebShell = nsnull; - -#ifdef INCLUDE_XUL - nsCOMPtr presContainer; - aPresContext.GetContainer(getter_AddRefs(presContainer)); - if (presContainer) { - nsCOMPtr parentShell; - parentShell = do_QueryInterface(presContainer); - if (parentShell) { - nsWebShellType shellType; - parentShell->GetWebShellType(shellType); - if (shellType == nsWebShellChrome) { - nsCOMPtr parentContainer; - parentContainer = do_QueryInterface(presContainer); - if (parentContainer) { - parentContainer->ChildShellAdded(&mWebShell, content); - } - } - } + rv = nsComponentManager::CreateInstance(kWebShellCID, nsnull, kIWebShellIID, + (void**)&mWebShell); + if (NS_OK != rv) { + NS_ASSERTION(0, "could not create web widget"); + return rv; } -#endif // INCLUDE_XUL - - if (mWebShell == nsnull) { - rv = nsComponentManager::CreateInstance(kWebShellCID, nsnull, kIWebShellIID, - (void**)&mWebShell); - if (NS_OK != rv) { - NS_ASSERTION(0, "could not create web widget"); - return rv; - } - } - + // pass along marginwidth, marginheight, scrolling so sub document can use it mWebShell->SetMarginWidth(GetMarginWidth(&aPresContext, content)); mWebShell->SetMarginHeight(GetMarginHeight(&aPresContext, content)); @@ -743,7 +719,9 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext, if (value.EqualsIgnoreCase("content")) { // The web shell's type is content. mWebShell->SetWebShellType(nsWebShellContent); - //mWebShell->SetName(value.GetUnicode()); + nsCOMPtr shellAsContainer; + shellAsContainer = do_QueryInterface(mWebShell); + shellAsContainer->ContentShellAdded(mWebShell, content); } else { // Inherit our type from our parent webshell. If it is diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index 058bdc5bd9c..0ddebc0ef9a 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -1385,16 +1385,16 @@ PresShell::CantRenderReplacedElement(nsIPresContext* aPresContext, kIEventQueueServiceIID, (nsISupports **)&eventService); if (NS_SUCCEEDED(rv)) { - PLEventQueue* eventQueue; + nsCOMPtr eventQueue; rv = eventService->GetThreadEventQueue(PR_GetCurrentThread(), - &eventQueue); + getter_AddRefs(eventQueue)); nsServiceManager::ReleaseService(kEventQueueServiceCID, eventService); - if (NS_SUCCEEDED(rv) && (nsnull != eventQueue)) { + if (NS_SUCCEEDED(rv) && eventQueue) { CantRenderReplacedElementEvent* ev; ev = new CantRenderReplacedElementEvent(this, aFrame); - PL_PostEvent(eventQueue, ev); + eventQueue->PostEvent(ev); } } return rv; diff --git a/mozilla/layout/html/document/src/nsFrameFrame.cpp b/mozilla/layout/html/document/src/nsFrameFrame.cpp index 808e24f6514..3088e3cb87a 100644 --- a/mozilla/layout/html/document/src/nsFrameFrame.cpp +++ b/mozilla/layout/html/document/src/nsFrameFrame.cpp @@ -671,37 +671,13 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext, nsIContent* content; GetParentContent(content); - mWebShell = nsnull; - -#ifdef INCLUDE_XUL - nsCOMPtr presContainer; - aPresContext.GetContainer(getter_AddRefs(presContainer)); - if (presContainer) { - nsCOMPtr parentShell; - parentShell = do_QueryInterface(presContainer); - if (parentShell) { - nsWebShellType shellType; - parentShell->GetWebShellType(shellType); - if (shellType == nsWebShellChrome) { - nsCOMPtr parentContainer; - parentContainer = do_QueryInterface(presContainer); - if (parentContainer) { - parentContainer->ChildShellAdded(&mWebShell, content); - } - } - } + rv = nsComponentManager::CreateInstance(kWebShellCID, nsnull, kIWebShellIID, + (void**)&mWebShell); + if (NS_OK != rv) { + NS_ASSERTION(0, "could not create web widget"); + return rv; } -#endif // INCLUDE_XUL - - if (mWebShell == nsnull) { - rv = nsComponentManager::CreateInstance(kWebShellCID, nsnull, kIWebShellIID, - (void**)&mWebShell); - if (NS_OK != rv) { - NS_ASSERTION(0, "could not create web widget"); - return rv; - } - } - + // pass along marginwidth, marginheight, scrolling so sub document can use it mWebShell->SetMarginWidth(GetMarginWidth(&aPresContext, content)); mWebShell->SetMarginHeight(GetMarginHeight(&aPresContext, content)); @@ -743,7 +719,9 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext, if (value.EqualsIgnoreCase("content")) { // The web shell's type is content. mWebShell->SetWebShellType(nsWebShellContent); - //mWebShell->SetName(value.GetUnicode()); + nsCOMPtr shellAsContainer; + shellAsContainer = do_QueryInterface(mWebShell); + shellAsContainer->ContentShellAdded(mWebShell, content); } else { // Inherit our type from our parent webshell. If it is