зеркало из https://github.com/mozilla/pjs.git
Changes to support window.open in AppRunner.
This commit is contained in:
Родитель
41a9f754f1
Коммит
42da7d31a2
|
@ -1385,16 +1385,16 @@ PresShell::CantRenderReplacedElement(nsIPresContext* aPresContext,
|
|||
kIEventQueueServiceIID,
|
||||
(nsISupports **)&eventService);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
PLEventQueue* eventQueue;
|
||||
nsCOMPtr<nsIEventQueue> 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;
|
||||
|
|
|
@ -671,37 +671,13 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext,
|
|||
nsIContent* content;
|
||||
GetParentContent(content);
|
||||
|
||||
mWebShell = nsnull;
|
||||
|
||||
#ifdef INCLUDE_XUL
|
||||
nsCOMPtr<nsISupports> presContainer;
|
||||
aPresContext.GetContainer(getter_AddRefs(presContainer));
|
||||
if (presContainer) {
|
||||
nsCOMPtr<nsIWebShell> parentShell;
|
||||
parentShell = do_QueryInterface(presContainer);
|
||||
if (parentShell) {
|
||||
nsWebShellType shellType;
|
||||
parentShell->GetWebShellType(shellType);
|
||||
if (shellType == nsWebShellChrome) {
|
||||
nsCOMPtr<nsIWebShellContainer> 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<nsIWebShellContainer> shellAsContainer;
|
||||
shellAsContainer = do_QueryInterface(mWebShell);
|
||||
shellAsContainer->ContentShellAdded(mWebShell, content);
|
||||
}
|
||||
else {
|
||||
// Inherit our type from our parent webshell. If it is
|
||||
|
|
|
@ -1385,16 +1385,16 @@ PresShell::CantRenderReplacedElement(nsIPresContext* aPresContext,
|
|||
kIEventQueueServiceIID,
|
||||
(nsISupports **)&eventService);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
PLEventQueue* eventQueue;
|
||||
nsCOMPtr<nsIEventQueue> 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;
|
||||
|
|
|
@ -671,37 +671,13 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext,
|
|||
nsIContent* content;
|
||||
GetParentContent(content);
|
||||
|
||||
mWebShell = nsnull;
|
||||
|
||||
#ifdef INCLUDE_XUL
|
||||
nsCOMPtr<nsISupports> presContainer;
|
||||
aPresContext.GetContainer(getter_AddRefs(presContainer));
|
||||
if (presContainer) {
|
||||
nsCOMPtr<nsIWebShell> parentShell;
|
||||
parentShell = do_QueryInterface(presContainer);
|
||||
if (parentShell) {
|
||||
nsWebShellType shellType;
|
||||
parentShell->GetWebShellType(shellType);
|
||||
if (shellType == nsWebShellChrome) {
|
||||
nsCOMPtr<nsIWebShellContainer> 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<nsIWebShellContainer> shellAsContainer;
|
||||
shellAsContainer = do_QueryInterface(mWebShell);
|
||||
shellAsContainer->ContentShellAdded(mWebShell, content);
|
||||
}
|
||||
else {
|
||||
// Inherit our type from our parent webshell. If it is
|
||||
|
|
Загрузка…
Ссылка в новой задаче