fixed bug 27161 by adding interfacs onto nsIPresShell to get/set the "subshell" for an nsIContent

this part of the fix is temporary, but sufficient for beta.  it calls the pres shell to do the initial association.
after beta, this will be done by the frame construction code.
r=travis
a=jar
This commit is contained in:
buster%netscape.com 2000-03-03 23:16:43 +00:00
Родитель f119fe3159
Коммит 8076fee6b0
2 изменённых файлов: 22 добавлений и 4 удалений

Просмотреть файл

@ -694,9 +694,20 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext* aPresContext,
GetParentContent(content);
mWebShell = do_CreateInstance(kWebShellCID);
NS_ENSURE_TRUE(mWebShell, NS_ERROR_FAILURE);
nsCOMPtr<nsIDocShellTreeItem> docShellAsItem(do_QueryInterface(mWebShell));
NS_ENSURE_TRUE(docShellAsItem, NS_ERROR_FAILURE);
// notify the pres shell that a docshell has been created
nsCOMPtr<nsIPresShell> presShell;
aPresContext->GetShell(getter_AddRefs(presShell));
if (presShell)
{
nsCOMPtr<nsISupports> webShellAsSupports(do_QueryInterface(mWebShell));
NS_ENSURE_TRUE(webShellAsSupports, NS_ERROR_FAILURE);
presShell->SetSubShellFor(mContent, webShellAsSupports);
}
// pass along marginwidth, marginheight, scrolling so sub document can use it
mWebShell->SetMarginWidth(GetMarginWidth(aPresContext, content));
mWebShell->SetMarginHeight(GetMarginHeight(aPresContext, content));
@ -793,8 +804,6 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext* aPresContext,
float t2p;
aPresContext->GetTwipsToPixels(&t2p);
nsCOMPtr<nsIPresShell> presShell;
aPresContext->GetShell(getter_AddRefs(presShell));
// create, init, set the parent of the view
nsIView* view;

Просмотреть файл

@ -694,9 +694,20 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext* aPresContext,
GetParentContent(content);
mWebShell = do_CreateInstance(kWebShellCID);
NS_ENSURE_TRUE(mWebShell, NS_ERROR_FAILURE);
nsCOMPtr<nsIDocShellTreeItem> docShellAsItem(do_QueryInterface(mWebShell));
NS_ENSURE_TRUE(docShellAsItem, NS_ERROR_FAILURE);
// notify the pres shell that a docshell has been created
nsCOMPtr<nsIPresShell> presShell;
aPresContext->GetShell(getter_AddRefs(presShell));
if (presShell)
{
nsCOMPtr<nsISupports> webShellAsSupports(do_QueryInterface(mWebShell));
NS_ENSURE_TRUE(webShellAsSupports, NS_ERROR_FAILURE);
presShell->SetSubShellFor(mContent, webShellAsSupports);
}
// pass along marginwidth, marginheight, scrolling so sub document can use it
mWebShell->SetMarginWidth(GetMarginWidth(aPresContext, content));
mWebShell->SetMarginHeight(GetMarginHeight(aPresContext, content));
@ -793,8 +804,6 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext* aPresContext,
float t2p;
aPresContext->GetTwipsToPixels(&t2p);
nsCOMPtr<nsIPresShell> presShell;
aPresContext->GetShell(getter_AddRefs(presShell));
// create, init, set the parent of the view
nsIView* view;