From b805addd63451b28e4b8088eaf4d76e6e5012ed2 Mon Sep 17 00:00:00 2001 From: "akkana%netscape.com" Date: Thu, 24 Oct 2002 19:58:36 +0000 Subject: [PATCH] 176505: Fix composer/mail compose regression, back out jag. a=blizzard & #mozilla --- content/base/src/nsFrameLoader.cpp | 17 ++++++++++++----- layout/generic/nsFrameFrame.cpp | 3 --- layout/html/document/src/nsFrameFrame.cpp | 3 --- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/content/base/src/nsFrameLoader.cpp b/content/base/src/nsFrameLoader.cpp index 15046d561890..8c3ddded2606 100644 --- a/content/base/src/nsFrameLoader.cpp +++ b/content/base/src/nsFrameLoader.cpp @@ -450,9 +450,17 @@ nsFrameLoader::EnsureDocShell() } } - // if it isn't content, set it to the parent's type - PRInt32 shellType = isContent ? nsIDocShellTreeItem::typeContent : parentType; - docShellAsItem->SetItemType(shellType); + if (isContent) { + // The web shell's type is content. + + docShellAsItem->SetItemType(nsIDocShellTreeItem::typeContent); + } else { + // Inherit our type from our parent webshell. If it is + // chrome, we'll be chrome. If it is content, we'll be + // content. + + docShellAsItem->SetItemType(parentType); + } parentAsNode->AddChild(docShellAsItem); @@ -461,8 +469,7 @@ nsFrameLoader::EnsureDocShell() parentAsItem->GetTreeOwner(getter_AddRefs(parentTreeOwner)); if(parentTreeOwner) { - PRBool is_primary = shellType == nsIDocShellTreeItem::typeChrome && - value.Equals(NS_LITERAL_STRING("content-primary")); + PRBool is_primary = value.Equals(NS_LITERAL_STRING("content-primary")); parentTreeOwner->ContentShellAdded(docShellAsItem, is_primary, value.get()); diff --git a/layout/generic/nsFrameFrame.cpp b/layout/generic/nsFrameFrame.cpp index 3a7f6ddcbd70..8bfcb5ee9b54 100644 --- a/layout/generic/nsFrameFrame.cpp +++ b/layout/generic/nsFrameFrame.cpp @@ -683,10 +683,7 @@ nsHTMLFrameOuterFrame::AttributeChanged(nsIPresContext* aPresContext, nsCOMPtr parentTreeOwner; parentAsItem->GetTreeOwner(getter_AddRefs(parentTreeOwner)); if (parentTreeOwner) { - PRInt32 shellType; - parentAsItem->GetItemType(&shellType); PRBool is_primary_content = - shellType == nsIDocShellTreeItem::typeChrome && value.EqualsIgnoreCase("content-primary"); parentTreeOwner->ContentShellAdded(docShellAsItem, is_primary_content, diff --git a/layout/html/document/src/nsFrameFrame.cpp b/layout/html/document/src/nsFrameFrame.cpp index 3a7f6ddcbd70..8bfcb5ee9b54 100644 --- a/layout/html/document/src/nsFrameFrame.cpp +++ b/layout/html/document/src/nsFrameFrame.cpp @@ -683,10 +683,7 @@ nsHTMLFrameOuterFrame::AttributeChanged(nsIPresContext* aPresContext, nsCOMPtr parentTreeOwner; parentAsItem->GetTreeOwner(getter_AddRefs(parentTreeOwner)); if (parentTreeOwner) { - PRInt32 shellType; - parentAsItem->GetItemType(&shellType); PRBool is_primary_content = - shellType == nsIDocShellTreeItem::typeChrome && value.EqualsIgnoreCase("content-primary"); parentTreeOwner->ContentShellAdded(docShellAsItem, is_primary_content,