1998-04-14 00:24:54 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Netscape Public License
|
|
|
|
* Version 1.0 (the "NPL"); you may not use this file except in
|
|
|
|
* compliance with the NPL. You may obtain a copy of the NPL at
|
|
|
|
* http://www.mozilla.org/NPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* NPL.
|
|
|
|
*
|
|
|
|
* The Initial Developer of this code under the NPL is Netscape
|
|
|
|
* Communications Corporation. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
|
|
|
* Reserved.
|
|
|
|
*/
|
|
|
|
#include "nsHTMLContainerFrame.h"
|
|
|
|
#include "nsIRenderingContext.h"
|
|
|
|
#include "nsIPresContext.h"
|
1998-05-03 07:51:48 +04:00
|
|
|
#include "nsIPresShell.h"
|
1998-04-14 00:24:54 +04:00
|
|
|
#include "nsIStyleContext.h"
|
|
|
|
#include "nsStyleConsts.h"
|
|
|
|
#include "nsCSSRendering.h"
|
|
|
|
#include "nsIContent.h"
|
|
|
|
#include "nsHTMLAtoms.h"
|
|
|
|
#include "nsIWidget.h"
|
|
|
|
#include "nsILinkHandler.h"
|
|
|
|
#include "nsHTMLValue.h"
|
|
|
|
#include "nsGUIEvent.h"
|
|
|
|
#include "nsIDocument.h"
|
|
|
|
#include "nsIURL.h"
|
1998-05-05 08:47:53 +04:00
|
|
|
#include "nsIPtr.h"
|
|
|
|
#include "nsAbsoluteFrame.h"
|
|
|
|
#include "nsPlaceholderFrame.h"
|
1998-05-29 06:13:25 +04:00
|
|
|
#include "nsIHTMLContent.h"
|
|
|
|
#include "nsHTMLParts.h"
|
1998-06-04 21:50:19 +04:00
|
|
|
#include "nsScrollFrame.h"
|
|
|
|
#include "nsIView.h"
|
1998-09-23 06:29:31 +04:00
|
|
|
#include "nsIViewManager.h"
|
|
|
|
#include "nsViewsCID.h"
|
1998-06-09 08:51:44 +04:00
|
|
|
#include "nsIReflowCommand.h"
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1998-05-05 08:47:53 +04:00
|
|
|
NS_DEF_PTR(nsIStyleContext);
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1998-05-06 03:56:50 +04:00
|
|
|
nsHTMLContainerFrame::nsHTMLContainerFrame(nsIContent* aContent, nsIFrame* aParent)
|
|
|
|
: nsContainerFrame(aContent, aParent)
|
1998-04-14 00:24:54 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
nsHTMLContainerFrame::~nsHTMLContainerFrame()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
1998-04-17 05:41:24 +04:00
|
|
|
NS_METHOD nsHTMLContainerFrame::Paint(nsIPresContext& aPresContext,
|
|
|
|
nsIRenderingContext& aRenderingContext,
|
|
|
|
const nsRect& aDirtyRect)
|
1998-04-14 00:24:54 +04:00
|
|
|
{
|
1998-05-28 08:38:28 +04:00
|
|
|
// Paint our background and border
|
1998-06-05 10:09:09 +04:00
|
|
|
const nsStyleDisplay* disp =
|
|
|
|
(const nsStyleDisplay*)mStyleContext->GetStyleData(eStyleStruct_Display);
|
1998-05-27 03:15:47 +04:00
|
|
|
|
1998-06-04 21:50:19 +04:00
|
|
|
if (disp->mVisible && mRect.width && mRect.height) {
|
1998-05-28 08:38:28 +04:00
|
|
|
PRIntn skipSides = GetSkipSides();
|
1998-06-05 10:09:09 +04:00
|
|
|
const nsStyleColor* color =
|
|
|
|
(const nsStyleColor*)mStyleContext->GetStyleData(eStyleStruct_Color);
|
|
|
|
const nsStyleSpacing* spacing =
|
|
|
|
(const nsStyleSpacing*)mStyleContext->GetStyleData(eStyleStruct_Spacing);
|
1998-07-22 09:02:07 +04:00
|
|
|
|
|
|
|
nsRect rect(0, 0, mRect.width, mRect.height);
|
1998-05-28 08:38:28 +04:00
|
|
|
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
|
1998-09-26 21:17:20 +04:00
|
|
|
aDirtyRect, rect, *color, 0, 0);
|
1998-05-28 08:38:28 +04:00
|
|
|
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,
|
1998-07-22 09:02:07 +04:00
|
|
|
aDirtyRect, rect, *spacing, skipSides);
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
PaintChildren(aPresContext, aRenderingContext, aDirtyRect);
|
|
|
|
|
|
|
|
if (nsIFrame::GetShowFrameBorders()) {
|
1998-06-04 21:50:19 +04:00
|
|
|
nsIView* view;
|
|
|
|
GetView(view);
|
|
|
|
if (nsnull != view) {
|
|
|
|
aRenderingContext.SetColor(NS_RGB(0,0,255));
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aRenderingContext.SetColor(NS_RGB(255,0,0));
|
|
|
|
}
|
1998-04-14 00:24:54 +04:00
|
|
|
aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height);
|
|
|
|
}
|
1998-04-17 05:41:24 +04:00
|
|
|
return NS_OK;
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
|
1998-04-17 05:41:24 +04:00
|
|
|
NS_METHOD nsHTMLContainerFrame::HandleEvent(nsIPresContext& aPresContext,
|
|
|
|
nsGUIEvent* aEvent,
|
|
|
|
nsEventStatus& aEventStatus)
|
1998-04-14 00:24:54 +04:00
|
|
|
{
|
1998-06-08 04:57:15 +04:00
|
|
|
return nsContainerFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
|
1998-07-17 08:52:12 +04:00
|
|
|
NS_METHOD nsHTMLContainerFrame::GetCursorAndContentAt(nsIPresContext& aPresContext,
|
1998-04-17 05:41:24 +04:00
|
|
|
const nsPoint& aPoint,
|
|
|
|
nsIFrame** aFrame,
|
1998-07-17 08:52:12 +04:00
|
|
|
nsIContent** aContent,
|
1998-04-17 05:41:24 +04:00
|
|
|
PRInt32& aCursor)
|
1998-04-14 00:24:54 +04:00
|
|
|
{
|
1998-07-17 08:52:12 +04:00
|
|
|
// Set content here, child will override if found.
|
|
|
|
*aContent = mContent;
|
|
|
|
|
1998-04-25 22:40:01 +04:00
|
|
|
// Get my cursor
|
1998-06-05 10:09:09 +04:00
|
|
|
const nsStyleColor* styleColor = (const nsStyleColor*)
|
|
|
|
mStyleContext->GetStyleData(eStyleStruct_Color);
|
1998-04-25 22:40:01 +04:00
|
|
|
PRInt32 myCursor = styleColor->mCursor;
|
|
|
|
|
|
|
|
// Get child's cursor, if any
|
1998-07-17 08:52:12 +04:00
|
|
|
nsContainerFrame::GetCursorAndContentAt(aPresContext, aPoint, aFrame, aContent, aCursor);
|
1998-04-25 22:40:01 +04:00
|
|
|
if (aCursor != NS_STYLE_CURSOR_INHERIT) {
|
1998-08-30 00:20:38 +04:00
|
|
|
nsIAtom* tag;
|
|
|
|
mContent->GetTag(tag);
|
1998-04-25 22:40:01 +04:00
|
|
|
if (nsHTMLAtoms::a == tag) {
|
|
|
|
// Anchor tags override their child cursors in some cases.
|
|
|
|
if ((NS_STYLE_CURSOR_IBEAM == aCursor) &&
|
|
|
|
(NS_STYLE_CURSOR_INHERIT != myCursor)) {
|
|
|
|
aCursor = myCursor;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
NS_RELEASE(tag);
|
1998-07-11 07:49:17 +04:00
|
|
|
return NS_OK;
|
1998-04-25 22:40:01 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (NS_STYLE_CURSOR_INHERIT != myCursor) {
|
1998-04-14 00:24:54 +04:00
|
|
|
// If this container has a particular cursor, use it, otherwise
|
|
|
|
// let the child decide.
|
|
|
|
*aFrame = this;
|
1998-04-25 22:40:01 +04:00
|
|
|
aCursor = myCursor;
|
1998-04-17 05:41:24 +04:00
|
|
|
return NS_OK;
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
1998-04-25 22:40:01 +04:00
|
|
|
|
|
|
|
// No specific cursor for us
|
|
|
|
aCursor = NS_STYLE_CURSOR_INHERIT;
|
|
|
|
return NS_OK;
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
|
1998-09-15 04:19:49 +04:00
|
|
|
nsPlaceholderFrame*
|
1998-09-23 06:29:31 +04:00
|
|
|
nsHTMLContainerFrame::CreatePlaceholderFrame(nsIPresContext& aPresContext,
|
1998-09-15 04:19:49 +04:00
|
|
|
nsIFrame* aFloatedFrame)
|
|
|
|
{
|
|
|
|
nsIContent* content;
|
|
|
|
aFloatedFrame->GetContent(content);
|
|
|
|
|
|
|
|
nsPlaceholderFrame* placeholder;
|
|
|
|
nsPlaceholderFrame::NewFrame((nsIFrame**)&placeholder, content, this, aFloatedFrame);
|
|
|
|
NS_IF_RELEASE(content);
|
|
|
|
|
|
|
|
// Let the placeholder share the same style context as the floated element
|
|
|
|
nsIStyleContext* kidSC;
|
1998-09-23 06:29:31 +04:00
|
|
|
aFloatedFrame->GetStyleContext(&aPresContext, kidSC);
|
|
|
|
placeholder->SetStyleContext(&aPresContext, kidSC);
|
1998-09-15 04:19:49 +04:00
|
|
|
NS_RELEASE(kidSC);
|
|
|
|
|
|
|
|
return placeholder;
|
|
|
|
}
|
1998-09-23 06:29:31 +04:00
|
|
|
|
1998-09-29 03:24:37 +04:00
|
|
|
nsAbsoluteFrame*
|
|
|
|
nsHTMLContainerFrame::CreateAbsolutePlaceholderFrame(nsIPresContext& aPresContext,
|
|
|
|
nsIFrame* aAbsoluteFrame)
|
|
|
|
{
|
|
|
|
nsIContent* content;
|
|
|
|
aAbsoluteFrame->GetContent(content);
|
|
|
|
|
|
|
|
nsAbsoluteFrame* placeholder;
|
|
|
|
nsAbsoluteFrame::NewFrame((nsIFrame**)&placeholder, content, this, aAbsoluteFrame);
|
|
|
|
NS_IF_RELEASE(content);
|
|
|
|
|
|
|
|
// Let the placeholder share the same style context as the floated element
|
|
|
|
nsIStyleContext* kidSC;
|
|
|
|
aAbsoluteFrame->GetStyleContext(&aPresContext, kidSC);
|
|
|
|
placeholder->SetStyleContext(&aPresContext, kidSC);
|
|
|
|
NS_RELEASE(kidSC);
|
|
|
|
|
|
|
|
return placeholder;
|
|
|
|
}
|
|
|
|
|
|
|
|
PRBool
|
|
|
|
nsHTMLContainerFrame::CreateWrapperFrame(nsIPresContext& aPresContext,
|
|
|
|
nsIFrame* aFrame,
|
|
|
|
nsIFrame*& aWrapperFrame)
|
|
|
|
{
|
|
|
|
// If the floated element can contain children then wrap it in a
|
|
|
|
// BODY frame before floating it
|
|
|
|
nsIContent* content;
|
|
|
|
PRBool isContainer;
|
|
|
|
|
|
|
|
aFrame->GetContent(content);
|
|
|
|
content->CanContainChildren(isContainer);
|
|
|
|
if (isContainer) {
|
|
|
|
// Wrap the floated element in a BODY frame.
|
1998-09-29 07:44:25 +04:00
|
|
|
NS_NewBodyFrame(content, this, aWrapperFrame, PR_FALSE);
|
1998-09-29 03:24:37 +04:00
|
|
|
|
|
|
|
// The body wrapper frame gets the original style context, and the floated
|
|
|
|
// frame gets a pseudo style context
|
|
|
|
nsIStyleContext* kidStyle;
|
|
|
|
aFrame->GetStyleContext(&aPresContext, kidStyle);
|
|
|
|
aWrapperFrame->SetStyleContext(&aPresContext, kidStyle);
|
|
|
|
NS_RELEASE(kidStyle);
|
|
|
|
|
|
|
|
nsIStyleContext* pseudoStyle;
|
|
|
|
pseudoStyle = aPresContext.ResolvePseudoStyleContextFor(nsHTMLAtoms::columnPseudo,
|
|
|
|
aWrapperFrame);
|
|
|
|
aFrame->SetStyleContext(&aPresContext, pseudoStyle);
|
|
|
|
NS_RELEASE(pseudoStyle);
|
|
|
|
|
|
|
|
// Init the body frame
|
|
|
|
aWrapperFrame->Init(aPresContext, aFrame);
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_RELEASE(content);
|
|
|
|
return isContainer;
|
|
|
|
}
|
|
|
|
|
|
|
|
PRBool
|
|
|
|
nsHTMLContainerFrame::MoveFrameOutOfFlow(nsIPresContext& aPresContext,
|
|
|
|
nsIFrame* aFrame,
|
|
|
|
const nsStyleDisplay* aDisplay,
|
|
|
|
const nsStylePosition* aPosition,
|
|
|
|
nsIFrame*& aPlaceholderFrame)
|
|
|
|
{
|
1998-09-29 08:47:59 +04:00
|
|
|
// Initialize OUT parameter
|
1998-09-29 03:24:37 +04:00
|
|
|
aPlaceholderFrame = nsnull;
|
|
|
|
|
|
|
|
// See if the element wants to be floated or absolutely positioned
|
1998-09-29 08:47:59 +04:00
|
|
|
PRBool isFloated = NS_STYLE_FLOAT_NONE != aDisplay->mFloats;
|
|
|
|
PRBool isAbsolute = NS_STYLE_POSITION_ABSOLUTE == aPosition->mPosition;
|
1998-09-29 03:24:37 +04:00
|
|
|
|
1998-09-29 08:47:59 +04:00
|
|
|
if (isFloated || isAbsolute) {
|
|
|
|
nsIFrame* nextSibling;
|
1998-09-29 03:24:37 +04:00
|
|
|
|
1998-09-29 08:47:59 +04:00
|
|
|
// Set aFrame's next sibling to nsnull, and remember the current next
|
|
|
|
// sibling pointer
|
1998-09-29 06:18:09 +04:00
|
|
|
aFrame->GetNextSibling(nextSibling);
|
|
|
|
aFrame->SetNextSibling(nsnull);
|
|
|
|
|
1998-09-29 08:47:59 +04:00
|
|
|
if (isFloated) {
|
|
|
|
// Create a placeholder frame that will serve as the anchor point.
|
|
|
|
nsPlaceholderFrame* placeholder =
|
|
|
|
CreatePlaceholderFrame(aPresContext, aFrame);
|
|
|
|
|
|
|
|
// See if we need to wrap the frame in a BODY frame
|
|
|
|
nsIFrame* wrapperFrame;
|
|
|
|
if (CreateWrapperFrame(aPresContext, aFrame, wrapperFrame)) {
|
|
|
|
// Bind the wrapper frame to the placeholder
|
|
|
|
placeholder->SetAnchoredItem(wrapperFrame);
|
|
|
|
}
|
|
|
|
|
|
|
|
aPlaceholderFrame = placeholder;
|
1998-09-29 03:24:37 +04:00
|
|
|
|
1998-09-29 08:47:59 +04:00
|
|
|
} else {
|
|
|
|
// Create a placeholder frame that will serve as the anchor point.
|
|
|
|
nsAbsoluteFrame* placeholder =
|
|
|
|
CreateAbsolutePlaceholderFrame(aPresContext, aFrame);
|
|
|
|
|
|
|
|
// See if we need to wrap the frame in a BODY frame
|
|
|
|
nsIFrame* wrapperFrame;
|
|
|
|
if (CreateWrapperFrame(aPresContext, aFrame, wrapperFrame)) {
|
|
|
|
// Bind the wrapper frame to the placeholder
|
|
|
|
placeholder->SetAbsoluteFrame(wrapperFrame);
|
|
|
|
}
|
|
|
|
|
|
|
|
aPlaceholderFrame = placeholder;
|
1998-09-29 03:24:37 +04:00
|
|
|
}
|
|
|
|
|
1998-09-29 08:47:59 +04:00
|
|
|
// Set the placeholder's next sibling to what aFrame's next sibling was
|
1998-09-29 06:18:09 +04:00
|
|
|
aPlaceholderFrame->SetNextSibling(nextSibling);
|
|
|
|
return PR_TRUE;
|
|
|
|
}
|
1998-09-29 08:47:59 +04:00
|
|
|
|
|
|
|
return PR_FALSE;
|
1998-09-29 03:24:37 +04:00
|
|
|
}
|
|
|
|
|
1998-09-23 06:29:31 +04:00
|
|
|
/**
|
|
|
|
* Create a next-in-flow for aFrame. Will return the newly created
|
|
|
|
* frame in aNextInFlowResult <b>if and only if</b> a new frame is
|
|
|
|
* created; otherwise nsnull is returned in aNextInFlowResult.
|
|
|
|
*/
|
|
|
|
nsresult
|
|
|
|
nsHTMLContainerFrame::CreateNextInFlow(nsIPresContext& aPresContext,
|
|
|
|
nsIFrame* aOuterFrame,
|
|
|
|
nsIFrame* aFrame,
|
|
|
|
nsIFrame*& aNextInFlowResult)
|
|
|
|
{
|
|
|
|
aNextInFlowResult = nsnull;
|
|
|
|
|
|
|
|
nsIFrame* nextInFlow;
|
|
|
|
aFrame->GetNextInFlow(nextInFlow);
|
|
|
|
if (nsnull == nextInFlow) {
|
|
|
|
// Create a continuation frame for the child frame and insert it
|
|
|
|
// into our lines child list.
|
|
|
|
nsIFrame* nextFrame;
|
|
|
|
aFrame->GetNextSibling(nextFrame);
|
|
|
|
nsIStyleContext* kidSC;
|
|
|
|
aFrame->GetStyleContext(&aPresContext, kidSC);
|
|
|
|
aFrame->CreateContinuingFrame(aPresContext, aOuterFrame,
|
|
|
|
kidSC, nextInFlow);
|
|
|
|
NS_RELEASE(kidSC);
|
|
|
|
if (nsnull == nextInFlow) {
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
|
|
|
aFrame->SetNextSibling(nextInFlow);
|
|
|
|
nextInFlow->SetNextSibling(nextFrame);
|
|
|
|
|
|
|
|
NS_FRAME_LOG(NS_FRAME_TRACE_NEW_FRAMES,
|
|
|
|
("nsInlineReflow::MaybeCreateNextInFlow: frame=%p nextInFlow=%p",
|
|
|
|
aFrame, nextInFlow));
|
|
|
|
|
|
|
|
aNextInFlowResult = nextInFlow;
|
|
|
|
}
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext& aPresContext,
|
|
|
|
nsIFrame* aFrame,
|
|
|
|
nsIStyleContext* aStyleContext,
|
|
|
|
PRBool aForce)
|
|
|
|
{
|
|
|
|
nsIView* view;
|
|
|
|
aFrame->GetView(view);
|
|
|
|
if (nsnull == view) {
|
|
|
|
// We don't yet have a view; see if we need a view
|
|
|
|
|
|
|
|
// See if the opacity is not the same as the geometric parent
|
|
|
|
// frames opacity.
|
|
|
|
if (!aForce) {
|
|
|
|
nsIFrame* parent;
|
|
|
|
aFrame->GetGeometricParent(parent);
|
|
|
|
if (nsnull != parent) {
|
|
|
|
// Get my nsStyleColor
|
|
|
|
const nsStyleColor* myColor = (const nsStyleColor*)
|
|
|
|
aStyleContext->GetStyleData(eStyleStruct_Color);
|
|
|
|
|
|
|
|
// Get parent's nsStyleColor
|
|
|
|
const nsStyleColor* parentColor;
|
|
|
|
parent->GetStyleData(eStyleStruct_Color,
|
|
|
|
(const nsStyleStruct*&)parentColor);
|
|
|
|
|
|
|
|
// If the opacities are different then I need a view
|
|
|
|
if (myColor->mOpacity != parentColor->mOpacity) {
|
|
|
|
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
|
|
|
|
("nsHTMLContainerFrame::CreateViewForFrame: frame=%p opacity=%g parentOpacity=%g",
|
|
|
|
aFrame, myColor->mOpacity, parentColor->mOpacity));
|
|
|
|
aForce = PR_TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// See if the frame is being relatively positioned
|
|
|
|
if (!aForce) {
|
|
|
|
const nsStylePosition* position = (const nsStylePosition*)
|
|
|
|
aStyleContext->GetStyleData(eStyleStruct_Position);
|
|
|
|
if (NS_STYLE_POSITION_RELATIVE == position->mPosition) {
|
|
|
|
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
|
|
|
|
("nsHTMLContainerFrame::CreateViewForFrame: frame=%p relatively positioned",
|
|
|
|
aFrame));
|
|
|
|
aForce = PR_TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (aForce) {
|
|
|
|
// Create a view
|
|
|
|
nsIFrame* parent;
|
|
|
|
nsIView* view;
|
|
|
|
|
|
|
|
aFrame->GetParentWithView(parent);
|
|
|
|
NS_ASSERTION(parent, "GetParentWithView failed");
|
|
|
|
nsIView* parView;
|
|
|
|
|
|
|
|
parent->GetView(parView);
|
|
|
|
NS_ASSERTION(parView, "no parent with view");
|
|
|
|
|
|
|
|
// Create a view
|
|
|
|
static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
|
|
|
|
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
|
|
|
|
|
|
|
nsresult result = nsRepository::CreateInstance(kViewCID,
|
|
|
|
nsnull,
|
|
|
|
kIViewIID,
|
|
|
|
(void **)&view);
|
|
|
|
if (NS_OK == result) {
|
|
|
|
nsIView* rootView = parView;
|
|
|
|
nsIViewManager* viewManager;
|
|
|
|
rootView->GetViewManager(viewManager);
|
|
|
|
|
|
|
|
// Initialize the view
|
|
|
|
NS_ASSERTION(nsnull != viewManager, "null view manager");
|
|
|
|
|
|
|
|
nsRect bounds;
|
|
|
|
aFrame->GetRect(bounds);
|
|
|
|
view->Init(viewManager, bounds, rootView);
|
|
|
|
viewManager->InsertChild(rootView, view, 0);
|
|
|
|
|
|
|
|
NS_RELEASE(viewManager);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Remember our view
|
|
|
|
aFrame->SetView(view);
|
|
|
|
|
|
|
|
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
|
|
|
|
("nsHTMLContainerFrame::CreateViewForFrame: frame=%p view=%p",
|
|
|
|
aFrame));
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NS_OK;
|
|
|
|
}
|
1998-09-25 04:00:22 +04:00
|
|
|
|
1998-09-25 04:51:45 +04:00
|
|
|
|