зеркало из https://github.com/mozilla/pjs.git
Moved logic that deals with moving absolutely positioned frames out of the
flow to the frame construction code
This commit is contained in:
Родитель
500f4e3185
Коммит
e1f9e8b29f
|
@ -88,10 +88,9 @@ public:
|
|||
nsIStyleContext* aParentContext,
|
||||
PRBool aForceUnique = PR_FALSE);
|
||||
|
||||
NS_IMETHOD ConstructFrame(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame*& aFrameSubTree);
|
||||
NS_IMETHOD ConstructRootFrame(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame*& aFrameSubTree);
|
||||
NS_IMETHOD ReconstructFrames(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
|
@ -716,13 +715,12 @@ nsIStyleContext* StyleSetImpl::ProbePseudoStyleFor(nsIPresContext* aPresContext,
|
|||
return result;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP StyleSetImpl::ConstructFrame(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame*& aFrameSubTree)
|
||||
NS_IMETHODIMP StyleSetImpl::ConstructRootFrame(nsIPresContext* aPresContext,
|
||||
nsIContent* aDocElement,
|
||||
nsIFrame*& aFrameSubTree)
|
||||
{
|
||||
return mFrameConstructor->ConstructFrame(aPresContext, aContent,
|
||||
aParentFrame, aFrameSubTree);
|
||||
return mFrameConstructor->ConstructRootFrame(aPresContext, aDocElement,
|
||||
aFrameSubTree);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -175,6 +175,7 @@ nsIAtom* nsHTMLAtoms::p;
|
|||
nsIAtom* nsHTMLAtoms::pagex;
|
||||
nsIAtom* nsHTMLAtoms::pagey;
|
||||
nsIAtom* nsHTMLAtoms::param;
|
||||
nsIAtom* nsHTMLAtoms::placeholderPseudo;
|
||||
nsIAtom* nsHTMLAtoms::pointSize;
|
||||
nsIAtom* nsHTMLAtoms::pre;
|
||||
nsIAtom* nsHTMLAtoms::profile;
|
||||
|
@ -406,6 +407,7 @@ void nsHTMLAtoms::AddrefAtoms()
|
|||
pagex = NS_NewAtom("PAGEX");
|
||||
pagey = NS_NewAtom("PAGEY");
|
||||
param = NS_NewAtom("PARAM");
|
||||
placeholderPseudo = NS_NewAtom(":PLACEHOLDER-FRAME");
|
||||
pointSize = NS_NewAtom("POINT-SIZE");
|
||||
pre = NS_NewAtom("PRE");
|
||||
profile = NS_NewAtom("PROFILE");
|
||||
|
@ -632,6 +634,7 @@ void nsHTMLAtoms::ReleaseAtoms()
|
|||
NS_RELEASE(pagex);
|
||||
NS_RELEASE(pagey);
|
||||
NS_RELEASE(param);
|
||||
NS_RELEASE(placeholderPseudo);
|
||||
NS_RELEASE(pointSize);
|
||||
NS_RELEASE(pre);
|
||||
NS_RELEASE(profile);
|
||||
|
|
|
@ -207,6 +207,7 @@ public:
|
|||
static nsIAtom* pagex;
|
||||
static nsIAtom* pagey;
|
||||
static nsIAtom* param;
|
||||
static nsIAtom* placeholderPseudo;
|
||||
static nsIAtom* pointSize;
|
||||
static nsIAtom* pre;
|
||||
static nsIAtom* profile;
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -207,6 +207,7 @@ public:
|
|||
static nsIAtom* pagex;
|
||||
static nsIAtom* pagey;
|
||||
static nsIAtom* param;
|
||||
static nsIAtom* placeholderPseudo;
|
||||
static nsIAtom* pointSize;
|
||||
static nsIAtom* pre;
|
||||
static nsIAtom* profile;
|
||||
|
|
|
@ -175,6 +175,7 @@ nsIAtom* nsHTMLAtoms::p;
|
|||
nsIAtom* nsHTMLAtoms::pagex;
|
||||
nsIAtom* nsHTMLAtoms::pagey;
|
||||
nsIAtom* nsHTMLAtoms::param;
|
||||
nsIAtom* nsHTMLAtoms::placeholderPseudo;
|
||||
nsIAtom* nsHTMLAtoms::pointSize;
|
||||
nsIAtom* nsHTMLAtoms::pre;
|
||||
nsIAtom* nsHTMLAtoms::profile;
|
||||
|
@ -406,6 +407,7 @@ void nsHTMLAtoms::AddrefAtoms()
|
|||
pagex = NS_NewAtom("PAGEX");
|
||||
pagey = NS_NewAtom("PAGEY");
|
||||
param = NS_NewAtom("PARAM");
|
||||
placeholderPseudo = NS_NewAtom(":PLACEHOLDER-FRAME");
|
||||
pointSize = NS_NewAtom("POINT-SIZE");
|
||||
pre = NS_NewAtom("PRE");
|
||||
profile = NS_NewAtom("PROFILE");
|
||||
|
@ -632,6 +634,7 @@ void nsHTMLAtoms::ReleaseAtoms()
|
|||
NS_RELEASE(pagex);
|
||||
NS_RELEASE(pagey);
|
||||
NS_RELEASE(param);
|
||||
NS_RELEASE(placeholderPseudo);
|
||||
NS_RELEASE(pointSize);
|
||||
NS_RELEASE(pre);
|
||||
NS_RELEASE(profile);
|
||||
|
|
|
@ -109,6 +109,18 @@ public:
|
|||
|
||||
virtual nsIFrame* FindFrameWithContent(nsIContent* aContent) = 0;
|
||||
|
||||
/**
|
||||
* Get/Set the placeholder frame associated with the specified frame.
|
||||
*
|
||||
* Out of flow frames (e.g., absolutely positioned frames and floated frames)
|
||||
* can have placeholder frames that are inserted into the flow and indicate
|
||||
* where the frame would be if it were part of the flow
|
||||
*/
|
||||
NS_IMETHOD GetPlaceholderFrameFor(nsIFrame* aFrame,
|
||||
nsIFrame*& aPlaceholderFrame) const = 0;
|
||||
NS_IMETHOD SetPlaceholderFrameFor(nsIFrame* aFrame,
|
||||
nsIFrame* aPlaceholderFrame) = 0;
|
||||
|
||||
virtual void AppendReflowCommand(nsIReflowCommand* aReflowCommand) = 0;
|
||||
|
||||
virtual void ProcessReflowCommands() = 0;
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
static PRBool gsNoisyRefs = PR_FALSE;
|
||||
#undef NOISY
|
||||
|
||||
#if 0
|
||||
static PLHashNumber
|
||||
HashKey(nsIFrame* key)
|
||||
{
|
||||
|
@ -87,7 +86,6 @@ FrameHashTable::FrameHashTable()
|
|||
|
||||
FrameHashTable::~FrameHashTable()
|
||||
{
|
||||
// XXX if debugging then we should assert that the table is empty
|
||||
PL_HashTableDestroy(mTable);
|
||||
}
|
||||
|
||||
|
@ -143,7 +141,6 @@ FrameHashTable::Remove(nsIFrame* aKey)
|
|||
}
|
||||
return oldValue;
|
||||
}
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
@ -244,6 +241,10 @@ public:
|
|||
virtual nsIFrame* GetRootFrame();
|
||||
NS_IMETHOD GetPageSequenceFrame(nsIPageSequenceFrame*& aPageSequenceFrame);
|
||||
virtual nsIFrame* FindFrameWithContent(nsIContent* aContent);
|
||||
NS_IMETHOD GetPlaceholderFrameFor(nsIFrame* aFrame,
|
||||
nsIFrame*& aPlaceholderFrame) const;
|
||||
NS_IMETHOD SetPlaceholderFrameFor(nsIFrame* aFrame,
|
||||
nsIFrame* aPlaceholderFrame);
|
||||
virtual void AppendReflowCommand(nsIReflowCommand* aReflowCommand);
|
||||
virtual void ProcessReflowCommands();
|
||||
virtual void ClearFrameRefs(nsIFrame*);
|
||||
|
@ -288,6 +289,7 @@ protected:
|
|||
nsIFrame* mFocusEventFrame; //keeps track of which frame has focus.
|
||||
nsIFrame* mAnchorEventFrame; //keeps track of which frame has focus.
|
||||
nsISelection *mSelection;
|
||||
FrameHashTable* mPlaceholderMap;
|
||||
};
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
|
@ -429,6 +431,7 @@ PresShell::~PresShell()
|
|||
}
|
||||
NS_IF_RELEASE(mSelection);
|
||||
mRefCnt = 0;
|
||||
delete mPlaceholderMap;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -598,7 +601,7 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
|
|||
if (nsnull != root) {
|
||||
// Have style sheet processor construct a frame for the
|
||||
// root content object
|
||||
mStyleSet->ConstructFrame(mPresContext, root, nsnull, mRootFrame);
|
||||
mStyleSet->ConstructRootFrame(mPresContext, root, mRootFrame);
|
||||
NS_RELEASE(root);
|
||||
}
|
||||
}
|
||||
|
@ -1189,6 +1192,38 @@ PresShell::FindFrameWithContent(nsIContent* aContent)
|
|||
return ::FindFrameWithContent(mRootFrame, aContent);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PresShell::GetPlaceholderFrameFor(nsIFrame* aFrame,
|
||||
nsIFrame*& aPlaceholderFrame) const
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aFrame, "no frame");
|
||||
|
||||
if (nsnull == mPlaceholderMap) {
|
||||
aPlaceholderFrame = nsnull;
|
||||
} else {
|
||||
aPlaceholderFrame = (nsIFrame*)mPlaceholderMap->Get(aFrame);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PresShell::SetPlaceholderFrameFor(nsIFrame* aFrame,
|
||||
nsIFrame* aPlaceholderFrame)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aFrame, "no frame");
|
||||
|
||||
if (nsnull == mPlaceholderMap) {
|
||||
mPlaceholderMap = new FrameHashTable;
|
||||
if (nsnull == mPlaceholderMap) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
mPlaceholderMap->Put(aFrame, (void*)aPlaceholderFrame);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//nsIViewObserver
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -145,12 +145,14 @@ public:
|
|||
* now.
|
||||
*
|
||||
* @param aContent the content object associated with the frame
|
||||
* @param aParent the parent frame
|
||||
* @param aGeometricParent the geometric parent frame
|
||||
* @param aContentParent the content parent frame
|
||||
* @param aContext the style context associated with the frame
|
||||
*/
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aGeometricParent,
|
||||
nsIFrame* aContentParent,
|
||||
nsIStyleContext* aContext) = 0;
|
||||
|
||||
/**
|
||||
|
|
|
@ -109,6 +109,18 @@ public:
|
|||
|
||||
virtual nsIFrame* FindFrameWithContent(nsIContent* aContent) = 0;
|
||||
|
||||
/**
|
||||
* Get/Set the placeholder frame associated with the specified frame.
|
||||
*
|
||||
* Out of flow frames (e.g., absolutely positioned frames and floated frames)
|
||||
* can have placeholder frames that are inserted into the flow and indicate
|
||||
* where the frame would be if it were part of the flow
|
||||
*/
|
||||
NS_IMETHOD GetPlaceholderFrameFor(nsIFrame* aFrame,
|
||||
nsIFrame*& aPlaceholderFrame) const = 0;
|
||||
NS_IMETHOD SetPlaceholderFrameFor(nsIFrame* aFrame,
|
||||
nsIFrame* aPlaceholderFrame) = 0;
|
||||
|
||||
virtual void AppendReflowCommand(nsIReflowCommand* aReflowCommand) = 0;
|
||||
|
||||
virtual void ProcessReflowCommands() = 0;
|
||||
|
|
|
@ -196,6 +196,13 @@ public:
|
|||
*/
|
||||
NS_IMETHOD GetChildListName(nsIAtom*& aListName) const = 0;
|
||||
|
||||
/**
|
||||
* Sets the name of the child list to which the child frame belongs.
|
||||
* Only used for reflow command types FrameAppended, FrameInserted, and
|
||||
* FrameRemoved
|
||||
*/
|
||||
NS_IMETHOD SetChildListName(nsIAtom* aListName) = 0;
|
||||
|
||||
/**
|
||||
* Get the previous sibling frame associated with the reflow command.
|
||||
* This is used for FrameInserted reflow commands.
|
||||
|
|
|
@ -29,15 +29,13 @@ class nsIFrame;
|
|||
class nsIStyleFrameConstruction : public nsISupports {
|
||||
public:
|
||||
/**
|
||||
* Handles association of elements in the content model to frames. Finds the
|
||||
* applicable construction rule, applies the action, and produces a sub-tree
|
||||
* of frame objects. Can return nsnull.
|
||||
* Create frames for the root content element and its child content.
|
||||
*/
|
||||
NS_IMETHOD ConstructFrame(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame*& aFrameSubTree) = 0;
|
||||
NS_IMETHOD ConstructRootFrame(nsIPresContext* aPresContext,
|
||||
nsIContent* aDocElement,
|
||||
nsIFrame*& aFrameSubTree) = 0;
|
||||
|
||||
// XXX TROY Is this what we want?
|
||||
// Causes reconstruction of a frame hierarchy rooted by the
|
||||
// frame aFrameSubTree. This is often called when radical style
|
||||
// change precludes incremental reflow.
|
||||
|
|
|
@ -90,13 +90,10 @@ public:
|
|||
nsIStyleContext* aParentContext,
|
||||
PRBool aForceUnique = PR_FALSE) = 0;
|
||||
|
||||
// Handles association of elements in the content model to frames. Finds the
|
||||
// applicable construction rule, applies the action, and produces a sub-tree
|
||||
// of frame objects. Can return nsnull.
|
||||
NS_IMETHOD ConstructFrame(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame*& aFrameSubTree) = 0;
|
||||
// Create frames for the root content element and its child content
|
||||
NS_IMETHOD ConstructRootFrame(nsIPresContext* aPresContext,
|
||||
nsIContent* aDocElement,
|
||||
nsIFrame*& aFrameSubTree) = 0;
|
||||
|
||||
// Causes reconstruction of a frame hierarchy rooted by the
|
||||
// frame aFrameSubTree. This is often called when radical style
|
||||
|
|
|
@ -88,10 +88,9 @@ public:
|
|||
nsIStyleContext* aParentContext,
|
||||
PRBool aForceUnique = PR_FALSE);
|
||||
|
||||
NS_IMETHOD ConstructFrame(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame*& aFrameSubTree);
|
||||
NS_IMETHOD ConstructRootFrame(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame*& aFrameSubTree);
|
||||
NS_IMETHOD ReconstructFrames(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
|
@ -716,13 +715,12 @@ nsIStyleContext* StyleSetImpl::ProbePseudoStyleFor(nsIPresContext* aPresContext,
|
|||
return result;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP StyleSetImpl::ConstructFrame(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame*& aFrameSubTree)
|
||||
NS_IMETHODIMP StyleSetImpl::ConstructRootFrame(nsIPresContext* aPresContext,
|
||||
nsIContent* aDocElement,
|
||||
nsIFrame*& aFrameSubTree)
|
||||
{
|
||||
return mFrameConstructor->ConstructFrame(aPresContext, aContent,
|
||||
aParentFrame, aFrameSubTree);
|
||||
return mFrameConstructor->ConstructRootFrame(aPresContext, aDocElement,
|
||||
aFrameSubTree);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -131,7 +131,7 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
nsIStyleContext* styleContext = aPresContext.ResolvePseudoStyleContextFor(mContent,
|
||||
nsHTMLAtoms::fieldsetContentPseudo,
|
||||
mStyleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, styleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, this, styleContext);
|
||||
NS_RELEASE(styleContext);
|
||||
|
||||
nsIFrame* newChildList = aChildList;
|
||||
|
|
|
@ -196,7 +196,7 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
|
|||
text->SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::disabled, nsAutoString("1"), PR_FALSE); // XXX this should use an "empty" bool value
|
||||
}
|
||||
NS_NewTextControlFrame(childFrame);
|
||||
childFrame->Init(aPresContext, text, this, mStyleContext);
|
||||
childFrame->Init(aPresContext, text, this, this, mStyleContext);
|
||||
mTextFrame = (nsTextControlFrame*)childFrame;
|
||||
mFirstChild = childFrame;
|
||||
|
||||
|
@ -210,7 +210,7 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
|
|||
NS_NewButtonControlFrame(childFrame);
|
||||
((nsButtonControlFrame*)childFrame)->SetFileControlFrame(this);
|
||||
mBrowseFrame = (nsButtonControlFrame*)childFrame;
|
||||
childFrame->Init(aPresContext, browse, this, mStyleContext);
|
||||
childFrame->Init(aPresContext, browse, this, this, mStyleContext);
|
||||
|
||||
mFirstChild->SetNextSibling(childFrame);
|
||||
|
||||
|
|
|
@ -511,7 +511,7 @@ nsHTMLButtonControlFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
// Resolve style and initialize the frame
|
||||
nsIStyleContext* styleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::buttonContentPseudo, mStyleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, styleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, this, styleContext);
|
||||
NS_RELEASE(styleContext);
|
||||
|
||||
// Set the geometric and content parent for each of the child frames
|
||||
|
|
|
@ -95,7 +95,7 @@ nsLegendFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
// Resolve style and initialize the frame
|
||||
nsIStyleContext* styleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::legendContentPseudo, mStyleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, styleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, this, styleContext);
|
||||
NS_RELEASE(styleContext);
|
||||
|
||||
// Set the geometric and content parent for each of the child frames
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#include "nsHTMLAtoms.h"
|
||||
#include "nsIView.h"
|
||||
#include "nsViewsCID.h"
|
||||
#include "nsAbsoluteFrame.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIWebShell.h"
|
||||
#include "nsHTMLValue.h"
|
||||
|
@ -61,24 +60,6 @@ nsAreaFrame::~nsAreaFrame()
|
|||
NS_RELEASE(mSpaceManager);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// nsISupports
|
||||
|
||||
nsresult
|
||||
nsAreaFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_PRECONDITION(0 != aInstancePtr, "null ptr");
|
||||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kIAbsoluteItemsIID)) {
|
||||
nsIAbsoluteItems* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
return NS_OK;
|
||||
}
|
||||
return nsBlockFrame::QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// nsIFrame
|
||||
|
||||
|
@ -89,6 +70,23 @@ nsAreaFrame::DeleteFrame(nsIPresContext& aPresContext)
|
|||
return nsBlockFrame::DeleteFrame(aPresContext);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAreaFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
if (nsLayoutAtoms::absoluteList == aListName) {
|
||||
mAbsoluteFrames = aChildList;
|
||||
rv = NS_OK;
|
||||
} else {
|
||||
rv = nsBlockFrame::SetInitialChildList(aPresContext, aListName, aChildList);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAreaFrame::GetAdditionalChildListName(PRInt32 aIndex,
|
||||
nsIAtom*& aListName) const
|
||||
|
@ -247,6 +245,8 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext,
|
|||
aReflowState.maxSize.height,
|
||||
aReflowState.reason));
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
// Make a copy of the reflow state so we can set the space manager
|
||||
nsHTMLReflowState reflowState(aReflowState);
|
||||
reflowState.spaceManager = mSpaceManager;
|
||||
|
@ -254,9 +254,40 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext,
|
|||
// Clear the spacemanager's regions.
|
||||
mSpaceManager->ClearRegions();
|
||||
|
||||
// XXX We need to peek at incremental reflow commands and see if the next
|
||||
// frame is one of the absolutely positioned frames...
|
||||
nsresult rv = nsBlockFrame::Reflow(aPresContext, aDesiredSize, reflowState, aStatus);
|
||||
// See if the reflow command is for an absolutely positioned frame
|
||||
PRBool wasHandled = PR_FALSE;
|
||||
if (eReflowReason_Incremental == aReflowState.reason) {
|
||||
nsIFrame* targetFrame;
|
||||
|
||||
aReflowState.reflowCommand->GetTarget(targetFrame);
|
||||
if (this == targetFrame) {
|
||||
nsIAtom* listName;
|
||||
|
||||
aReflowState.reflowCommand->GetChildListName(listName);
|
||||
if (nsLayoutAtoms::absoluteList == listName) {
|
||||
nsIReflowCommand::ReflowType type;
|
||||
|
||||
aReflowState.reflowCommand->GetType(type);
|
||||
NS_ASSERTION(nsIReflowCommand::FrameAppended == type, "unexpected reflow type");
|
||||
|
||||
// Add the frames to our list of absolutely position frames
|
||||
nsIFrame* childFrames;
|
||||
aReflowState.reflowCommand->GetChildFrame(childFrames);
|
||||
NS_ASSERTION(nsnull != childFrames, "null child list");
|
||||
AddAbsoluteFrame(childFrames);
|
||||
|
||||
// Indicate we handled the reflow command
|
||||
wasHandled = PR_TRUE;
|
||||
}
|
||||
NS_IF_RELEASE(listName);
|
||||
}
|
||||
}
|
||||
|
||||
if (!wasHandled) {
|
||||
// XXX We need to peek at incremental reflow commands and see if the next
|
||||
// frame is one of the absolutely positioned frames...
|
||||
rv = nsBlockFrame::Reflow(aPresContext, aDesiredSize, reflowState, aStatus);
|
||||
}
|
||||
|
||||
// Reflow any absolutely positioned frames that need reflowing
|
||||
// XXX We shouldn't really be doing this for all incremental reflow commands
|
||||
|
@ -286,13 +317,10 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext,
|
|||
mStyleContext->GetStyleData(eStyleStruct_Display);
|
||||
|
||||
if (NS_STYLE_OVERFLOW_HIDDEN != display->mOverflow) {
|
||||
for (PRInt32 i = 0; i < mAbsoluteItems.Count(); i++) {
|
||||
// Get the anchor frame
|
||||
nsAbsoluteFrame* anchorFrame = (nsAbsoluteFrame*)mAbsoluteItems[i];
|
||||
nsIFrame* absoluteFrame = anchorFrame->GetAbsoluteFrame();
|
||||
nsRect rect;
|
||||
for (nsIFrame* f = mAbsoluteFrames; nsnull != f; f->GetNextSibling(f)) {
|
||||
nsRect rect;
|
||||
|
||||
absoluteFrame->GetRect(rect);
|
||||
f->GetRect(rect);
|
||||
nscoord xmost = rect.XMost();
|
||||
nscoord ymost = rect.YMost();
|
||||
if (xmost > aDesiredSize.width) {
|
||||
|
@ -369,7 +397,7 @@ nsAreaFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->SetFlags(mFlags);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
|
@ -392,49 +420,21 @@ void nsAreaFrame::AddAbsoluteFrame(nsIFrame* aFrame)
|
|||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// nsIAbsoluteItems
|
||||
|
||||
NS_METHOD nsAreaFrame::AddAbsoluteItem(nsAbsoluteFrame* aAnchorFrame)
|
||||
{
|
||||
// Add the absolute anchor frame to our list of absolutely positioned
|
||||
// items.
|
||||
mAbsoluteItems.AppendElement(aAnchorFrame);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsAreaFrame::IsAbsoluteFrame(nsIFrame* aFrame)
|
||||
{
|
||||
// Check whether the frame is in our list of absolutely positioned frames
|
||||
for (nsIFrame* f = mAbsoluteFrames; nsnull != f; f->GetNextSibling(f)) {
|
||||
if (f == aFrame) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
NS_METHOD nsAreaFrame::RemoveAbsoluteItem(nsAbsoluteFrame* aAnchorFrame)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("removing an absolutely positioned frame");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
// Called at the end of the Reflow() member function so we can process
|
||||
// any abolutely positioned items that need to be reflowed
|
||||
void
|
||||
nsAreaFrame::ReflowAbsoluteItems(nsIPresContext& aPresContext,
|
||||
const nsHTMLReflowState& aReflowState)
|
||||
{
|
||||
for (PRInt32 i = 0; i < mAbsoluteItems.Count(); i++) {
|
||||
// Get the anchor frame and its absolutely positioned frame
|
||||
nsAbsoluteFrame* anchorFrame = (nsAbsoluteFrame*)mAbsoluteItems[i];
|
||||
nsIFrame* absoluteFrame = anchorFrame->GetAbsoluteFrame();
|
||||
for (nsIFrame* absoluteFrame = mAbsoluteFrames;
|
||||
nsnull != absoluteFrame; absoluteFrame->GetNextSibling(absoluteFrame)) {
|
||||
|
||||
PRBool placeFrame = PR_FALSE;
|
||||
#if 0
|
||||
PRBool reflowFrame = PR_FALSE;
|
||||
#else
|
||||
PRBool reflowFrame = PR_TRUE;
|
||||
#endif
|
||||
nsReflowReason reflowReason = eReflowReason_Resize;
|
||||
|
||||
// Get its style information
|
||||
|
@ -444,6 +444,7 @@ nsAreaFrame::ReflowAbsoluteItems(nsIPresContext& aPresContext,
|
|||
absoluteFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display);
|
||||
absoluteFrame->GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)position);
|
||||
|
||||
#if 0
|
||||
// See whether the frame is a newly added frame
|
||||
if (!IsAbsoluteFrame(absoluteFrame)) {
|
||||
// The absolutely position item hasn't yet been added to our child list
|
||||
|
@ -463,6 +464,7 @@ nsAreaFrame::ReflowAbsoluteItems(nsIPresContext& aPresContext,
|
|||
placeFrame = reflowFrame = PR_TRUE;
|
||||
|
||||
} else {
|
||||
#endif
|
||||
// We need to place the frame if the left-offset or the top-offset are
|
||||
// auto or a percentage
|
||||
if ((eStyleUnit_Coord != position->mLeftOffset.GetUnit()) ||
|
||||
|
@ -476,12 +478,15 @@ nsAreaFrame::ReflowAbsoluteItems(nsIPresContext& aPresContext,
|
|||
(eStyleUnit_Coord != position->mHeight.GetUnit())) {
|
||||
reflowFrame = PR_TRUE;
|
||||
}
|
||||
#if 0
|
||||
}
|
||||
#endif
|
||||
|
||||
if (placeFrame || reflowFrame) {
|
||||
// Get the rect for the absolutely positioned element
|
||||
nsRect rect;
|
||||
ComputeAbsoluteFrameBounds(anchorFrame, aReflowState, position, rect);
|
||||
ComputeAbsoluteFrameBounds(aPresContext, absoluteFrame, aReflowState,
|
||||
position, rect);
|
||||
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
if (NS_OK == absoluteFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
|
@ -541,7 +546,8 @@ void nsAreaFrame::TranslatePoint(nsIFrame* aFrameFrom, nsPoint& aPoint) const
|
|||
}
|
||||
}
|
||||
|
||||
void nsAreaFrame::ComputeAbsoluteFrameBounds(nsIFrame* aAnchorFrame,
|
||||
void nsAreaFrame::ComputeAbsoluteFrameBounds(nsIPresContext& aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
const nsStylePosition* aPosition,
|
||||
nsRect& aRect) const
|
||||
|
@ -552,11 +558,20 @@ void nsAreaFrame::ComputeAbsoluteFrameBounds(nsIFrame* aAnchorFra
|
|||
//
|
||||
// If either the left or top are 'auto' then get the offset of the anchor
|
||||
// frame from this frame
|
||||
nsPoint offset;
|
||||
nsPoint offset(0, 0);
|
||||
if ((eStyleUnit_Auto == aPosition->mLeftOffset.GetUnit()) ||
|
||||
(eStyleUnit_Auto == aPosition->mTopOffset.GetUnit())) {
|
||||
aAnchorFrame->GetOrigin(offset);
|
||||
TranslatePoint(aAnchorFrame, offset);
|
||||
// Get the placeholder frame
|
||||
nsIFrame* placeholderFrame;
|
||||
nsIPresShell* presShell = aPresContext.GetShell();
|
||||
|
||||
presShell->GetPlaceholderFrameFor(aFrame, placeholderFrame);
|
||||
NS_RELEASE(presShell);
|
||||
NS_ASSERTION(nsnull != placeholderFrame, "no placeholder frame");
|
||||
if (nsnull != placeholderFrame) {
|
||||
placeholderFrame->GetOrigin(offset);
|
||||
TranslatePoint(placeholderFrame, offset);
|
||||
}
|
||||
}
|
||||
|
||||
// left-offset
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#define nsAreaFrame_h___
|
||||
|
||||
#include "nsBlockFrame.h"
|
||||
#include "nsIAbsoluteItems.h"
|
||||
#include "nsISpaceManager.h"
|
||||
#include "nsVoidArray.h"
|
||||
|
||||
|
@ -40,18 +39,18 @@ struct nsStylePosition;
|
|||
*
|
||||
* @see nsLayoutAtoms::absoluteList
|
||||
*/
|
||||
class nsAreaFrame : public nsBlockFrame,
|
||||
public nsIAbsoluteItems
|
||||
class nsAreaFrame : public nsBlockFrame
|
||||
{
|
||||
public:
|
||||
friend nsresult NS_NewAreaFrame(nsIFrame*& aResult, PRUint32 aFlags);
|
||||
|
||||
// nsISupports
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
// nsIFrame
|
||||
NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext);
|
||||
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList);
|
||||
|
||||
NS_IMETHOD GetAdditionalChildListName(PRInt32 aIndex,
|
||||
nsIAtom*& aListName) const;
|
||||
|
||||
|
@ -77,10 +76,6 @@ public:
|
|||
NS_IMETHOD List(FILE* out, PRInt32 aIndent, nsIListFilter* aFilter) const;
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
|
||||
// nsIAbsoluteItems
|
||||
NS_IMETHOD AddAbsoluteItem(nsAbsoluteFrame* aAnchorFrame);
|
||||
NS_IMETHOD RemoveAbsoluteItem(nsAbsoluteFrame* aAnchorFrame);
|
||||
|
||||
protected:
|
||||
nsAreaFrame();
|
||||
virtual ~nsAreaFrame();
|
||||
|
@ -90,17 +85,16 @@ protected:
|
|||
|
||||
void TranslatePoint(nsIFrame* aFrameFrom, nsPoint& aPoint) const;
|
||||
|
||||
void ComputeAbsoluteFrameBounds(nsIFrame* aAnchorFrame,
|
||||
void ComputeAbsoluteFrameBounds(nsIPresContext& aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
const nsHTMLReflowState& aState,
|
||||
const nsStylePosition* aPosition,
|
||||
nsRect& aRect) const;
|
||||
|
||||
void AddAbsoluteFrame(nsIFrame* aFrame);
|
||||
PRBool IsAbsoluteFrame(nsIFrame* aFrame);
|
||||
|
||||
private:
|
||||
nsSpaceManager* mSpaceManager;
|
||||
nsVoidArray mAbsoluteItems;
|
||||
nsIFrame* mAbsoluteFrames; // additional named child list
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "nsFrameReflowState.h"
|
||||
#include "nsLineLayout.h"
|
||||
#include "nsInlineReflow.h"
|
||||
#include "nsAbsoluteFrame.h"
|
||||
#include "nsPlaceholderFrame.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
|
@ -4166,7 +4165,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
NS_RELEASE(kidSC);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mBullet->Init(aPresContext, mContent, this, kidSC);
|
||||
mBullet->Init(aPresContext, mContent, this, this, kidSC);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
// If the list bullet frame should be positioned inside then add
|
||||
|
@ -4329,7 +4328,7 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->SetFlags(mFlags);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "nsFrameReflowState.h"
|
||||
#include "nsLineLayout.h"
|
||||
#include "nsInlineReflow.h"
|
||||
#include "nsAbsoluteFrame.h"
|
||||
#include "nsPlaceholderFrame.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
|
@ -4166,7 +4165,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
NS_RELEASE(kidSC);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mBullet->Init(aPresContext, mContent, this, kidSC);
|
||||
mBullet->Init(aPresContext, mContent, this, this, kidSC);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
// If the list bullet frame should be positioned inside then add
|
||||
|
@ -4329,7 +4328,7 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->SetFlags(mFlags);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "nsFrameReflowState.h"
|
||||
#include "nsLineLayout.h"
|
||||
#include "nsInlineReflow.h"
|
||||
#include "nsAbsoluteFrame.h"
|
||||
#include "nsPlaceholderFrame.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
|
@ -4166,7 +4165,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
NS_RELEASE(kidSC);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mBullet->Init(aPresContext, mContent, this, kidSC);
|
||||
mBullet->Init(aPresContext, mContent, this, this, kidSC);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
// If the list bullet frame should be positioned inside then add
|
||||
|
@ -4329,7 +4328,7 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->SetFlags(mFlags);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
|
|
|
@ -272,12 +272,14 @@ nsrefcnt nsFrame::Release(void)
|
|||
NS_IMETHODIMP
|
||||
nsFrame::Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aGeometricParent,
|
||||
nsIFrame* aContentParent,
|
||||
nsIStyleContext* aContext)
|
||||
{
|
||||
mContent = aContent;
|
||||
NS_IF_ADDREF(mContent);
|
||||
mGeometricParent = mContentParent = aParent;
|
||||
mGeometricParent = aGeometricParent;
|
||||
mContentParent = aContentParent;
|
||||
return SetStyleContext(&aPresContext, aContext);
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,8 @@ public:
|
|||
// nsIFrame
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aGeometricParent,
|
||||
nsIFrame* aContentParent,
|
||||
nsIStyleContext* aContext);
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
|
|
|
@ -321,7 +321,7 @@ nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext,
|
|||
if (nsnull == mFirstChild) {
|
||||
mFirstChild = new nsHTMLFrameInnerFrame;
|
||||
// XXX temporary! use style system to get correct style!
|
||||
mFirstChild->Init(aPresContext, mContent, this, mStyleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, this, mStyleContext);
|
||||
}
|
||||
|
||||
// nsContainerFrame::PaintBorder has some problems, kludge it here
|
||||
|
|
|
@ -936,7 +936,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
if (nsHTMLAtoms::frameset == tag) {
|
||||
result = NS_NewHTMLFramesetFrame(frame);
|
||||
frame->Init(aPresContext, child, this, kidSC);
|
||||
frame->Init(aPresContext, child, this, this, kidSC);
|
||||
|
||||
childTypes[mChildCount] = FRAMESET;
|
||||
nsHTMLFramesetFrame* childFrame = (nsHTMLFramesetFrame*)frame;
|
||||
|
@ -946,7 +946,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
|||
childBorderColors[mChildCount].Set(childFrame->GetBorderColor());
|
||||
} else { // frame
|
||||
result = NS_NewHTMLFrameOuterFrame(frame);
|
||||
frame->Init(aPresContext, child, this, kidSC);
|
||||
frame->Init(aPresContext, child, this, this, kidSC);
|
||||
|
||||
childTypes[mChildCount] = FRAME;
|
||||
//
|
||||
|
@ -979,7 +979,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
|||
nsHTMLFramesetBlankFrame* blankFrame = new nsHTMLFramesetBlankFrame;
|
||||
nsIStyleContext* pseudoStyleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::framesetBlankPseudo, mStyleContext);
|
||||
blankFrame->Init(aPresContext, mContent, this, pseudoStyleContext);
|
||||
blankFrame->Init(aPresContext, mContent, this, this, pseudoStyleContext);
|
||||
NS_RELEASE(pseudoStyleContext);
|
||||
|
||||
if (nsnull == lastChild) {
|
||||
|
@ -1017,7 +1017,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
|||
borderFrame = new nsHTMLFramesetBorderFrame(borderWidth, PR_FALSE, PR_FALSE);
|
||||
nsIStyleContext* pseudoStyleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::horizontalFramesetBorderPseudo, mStyleContext);
|
||||
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext);
|
||||
borderFrame->Init(aPresContext, mContent, this, this, pseudoStyleContext);
|
||||
NS_RELEASE(pseudoStyleContext);
|
||||
|
||||
mChildCount++;
|
||||
|
@ -1042,7 +1042,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
|||
borderFrame = new nsHTMLFramesetBorderFrame(borderWidth, PR_TRUE, PR_FALSE);
|
||||
nsIStyleContext* pseudoStyleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::verticalFramesetBorderPseudo, mStyleContext);
|
||||
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext);
|
||||
borderFrame->Init(aPresContext, mContent, this, this, pseudoStyleContext);
|
||||
NS_RELEASE(pseudoStyleContext);
|
||||
|
||||
mChildCount++;
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "nsIDocument.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIPtr.h"
|
||||
#include "nsAbsoluteFrame.h"
|
||||
#include "nsPlaceholderFrame.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLParts.h"
|
||||
|
@ -90,7 +89,7 @@ nsHTMLContainerFrame::CreatePlaceholderFrame(nsIPresContext& aPresContext,
|
|||
|
||||
nsPlaceholderFrame* placeholder;
|
||||
NS_NewPlaceholderFrame((nsIFrame**)&placeholder);
|
||||
placeholder->Init(aPresContext, content, this, kidSC);
|
||||
placeholder->Init(aPresContext, content, this, this, kidSC);
|
||||
placeholder->SetAnchoredItem(aFloatedFrame);
|
||||
NS_IF_RELEASE(content);
|
||||
NS_RELEASE(kidSC);
|
||||
|
@ -98,27 +97,6 @@ nsHTMLContainerFrame::CreatePlaceholderFrame(nsIPresContext& aPresContext,
|
|||
return placeholder;
|
||||
}
|
||||
|
||||
nsAbsoluteFrame*
|
||||
nsHTMLContainerFrame::CreateAbsolutePlaceholderFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aAbsoluteFrame)
|
||||
{
|
||||
nsIContent* content;
|
||||
aAbsoluteFrame->GetContent(content);
|
||||
|
||||
// Let the placeholder share the same style context as the floated element
|
||||
nsIStyleContext* kidSC;
|
||||
aAbsoluteFrame->GetStyleContext(kidSC);
|
||||
|
||||
nsAbsoluteFrame* placeholder;
|
||||
NS_NewAbsoluteFrame((nsIFrame**)&placeholder);
|
||||
placeholder->Init(aPresContext, content, this, kidSC);
|
||||
placeholder->SetAbsoluteFrame(aAbsoluteFrame);
|
||||
NS_IF_RELEASE(content);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
return placeholder;
|
||||
}
|
||||
|
||||
// XXX pass in aFrame's style context instead
|
||||
PRBool
|
||||
nsHTMLContainerFrame::MoveFrameOutOfFlow(nsIPresContext& aPresContext,
|
||||
|
@ -134,9 +112,8 @@ nsHTMLContainerFrame::MoveFrameOutOfFlow(nsIPresContext& aPresContext,
|
|||
PRBool isFloated =
|
||||
(NS_STYLE_FLOAT_LEFT == aDisplay->mFloats) ||
|
||||
(NS_STYLE_FLOAT_RIGHT == aDisplay->mFloats);
|
||||
PRBool isAbsolute = NS_STYLE_POSITION_ABSOLUTE == aPosition->mPosition;
|
||||
|
||||
if (isFloated || isAbsolute) {
|
||||
if (isFloated) {
|
||||
nsIFrame* nextSibling;
|
||||
|
||||
// Set aFrame's next sibling to nsnull, and remember the current next
|
||||
|
@ -144,21 +121,9 @@ nsHTMLContainerFrame::MoveFrameOutOfFlow(nsIPresContext& aPresContext,
|
|||
aFrame->GetNextSibling(nextSibling);
|
||||
aFrame->SetNextSibling(nsnull);
|
||||
|
||||
nsIFrame* frameToWrapWithAView = aFrame;
|
||||
if (isFloated) {
|
||||
// Create a placeholder frame that will serve as the anchor point.
|
||||
nsPlaceholderFrame* placeholder =
|
||||
CreatePlaceholderFrame(aPresContext, aFrame);
|
||||
|
||||
aPlaceholderFrame = placeholder;
|
||||
|
||||
} else {
|
||||
// Create a placeholder frame that will serve as the anchor point.
|
||||
nsAbsoluteFrame* placeholder =
|
||||
CreateAbsolutePlaceholderFrame(aPresContext, aFrame);
|
||||
|
||||
aPlaceholderFrame = placeholder;
|
||||
}
|
||||
// Create a placeholder frame that will serve as the anchor point.
|
||||
nsPlaceholderFrame* placeholder = CreatePlaceholderFrame(aPresContext, aFrame);
|
||||
aPlaceholderFrame = placeholder;
|
||||
|
||||
// Set the placeholder's next sibling to what aFrame's next sibling was
|
||||
aPlaceholderFrame->SetNextSibling(nextSibling);
|
||||
|
|
|
@ -35,8 +35,6 @@ public:
|
|||
nsFramePaintLayer aWhichLayer);
|
||||
nsPlaceholderFrame* CreatePlaceholderFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aFloatedFrame);
|
||||
nsAbsoluteFrame* CreateAbsolutePlaceholderFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aAbsoluteFrame);
|
||||
|
||||
// If the frame should be floated or absolutely positioned creates a placeholder
|
||||
// frame and returns PR_TRUE. The sibling list is modified so aFrame's next
|
||||
|
|
|
@ -73,7 +73,7 @@ nsHTMLReflowCommand::nsHTMLReflowCommand(nsIFrame* aTargetFrame,
|
|||
nsIFrame* aChildFrame,
|
||||
nsIAtom* aAttribute)
|
||||
: mType(aReflowType), mTargetFrame(aTargetFrame), mChildFrame(aChildFrame),
|
||||
mAttribute(aAttribute), mPrevSiblingFrame(nsnull)
|
||||
mAttribute(aAttribute), mPrevSiblingFrame(nsnull), mListName(nsnull)
|
||||
{
|
||||
NS_PRECONDITION(mTargetFrame != nsnull, "null target frame");
|
||||
if (nsnull!=mAttribute)
|
||||
|
@ -85,7 +85,7 @@ nsHTMLReflowCommand::nsHTMLReflowCommand(nsIFrame* aTargetFrame,
|
|||
nsIFrame* aChildFrame,
|
||||
nsIFrame* aPrevSiblingFrame)
|
||||
: mType(FrameInserted), mTargetFrame(aTargetFrame), mChildFrame(aChildFrame),
|
||||
mPrevSiblingFrame(aPrevSiblingFrame), mAttribute(nsnull)
|
||||
mPrevSiblingFrame(aPrevSiblingFrame), mAttribute(nsnull), mListName(nsnull)
|
||||
{
|
||||
NS_PRECONDITION(mTargetFrame != nsnull, "null target frame");
|
||||
NS_INIT_REFCNT();
|
||||
|
@ -94,6 +94,7 @@ nsHTMLReflowCommand::nsHTMLReflowCommand(nsIFrame* aTargetFrame,
|
|||
nsHTMLReflowCommand::~nsHTMLReflowCommand()
|
||||
{
|
||||
NS_IF_RELEASE(mAttribute);
|
||||
NS_IF_RELEASE(mListName);
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsHTMLReflowCommand, kIReflowCommandIID);
|
||||
|
@ -210,7 +211,15 @@ NS_IMETHODIMP nsHTMLReflowCommand::GetChildFrame(nsIFrame*& aChildFrame) const
|
|||
|
||||
NS_IMETHODIMP nsHTMLReflowCommand::GetChildListName(nsIAtom*& aListName) const
|
||||
{
|
||||
aListName = nsnull;
|
||||
aListName = mListName;
|
||||
NS_IF_ADDREF(aListName);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsHTMLReflowCommand::SetChildListName(nsIAtom* aListName)
|
||||
{
|
||||
mListName = aListName;
|
||||
NS_IF_ADDREF(mListName);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -67,6 +67,7 @@ public:
|
|||
|
||||
NS_IMETHOD GetChildFrame(nsIFrame*& aChildFrame) const;
|
||||
NS_IMETHOD GetChildListName(nsIAtom*& aListName) const;
|
||||
NS_IMETHOD SetChildListName(nsIAtom* aListName);
|
||||
NS_IMETHOD GetPrevSiblingFrame(nsIFrame*& aSiblingFrame) const;
|
||||
|
||||
protected:
|
||||
|
@ -79,6 +80,7 @@ private:
|
|||
nsIFrame* mChildFrame;
|
||||
nsIFrame* mPrevSiblingFrame;
|
||||
nsIAtom* mAttribute;
|
||||
nsIAtom* mListName;
|
||||
nsVoidArray mPath;
|
||||
};
|
||||
|
||||
|
|
|
@ -145,12 +145,14 @@ public:
|
|||
* now.
|
||||
*
|
||||
* @param aContent the content object associated with the frame
|
||||
* @param aParent the parent frame
|
||||
* @param aGeometricParent the geometric parent frame
|
||||
* @param aContentParent the content parent frame
|
||||
* @param aContext the style context associated with the frame
|
||||
*/
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aGeometricParent,
|
||||
nsIFrame* aContentParent,
|
||||
nsIStyleContext* aContext) = 0;
|
||||
|
||||
/**
|
||||
|
|
|
@ -340,6 +340,30 @@ nsImageFrame::DeleteFrame(nsIPresContext& aPresContext)
|
|||
return nsLeafFrame::DeleteFrame(aPresContext);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImageFrame::Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aGeometricParent,
|
||||
nsIFrame* aContentParent,
|
||||
nsIStyleContext* aContext)
|
||||
{
|
||||
nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aGeometricParent,
|
||||
aContentParent, aContext);
|
||||
|
||||
// Set the image loader's source URL and base URL
|
||||
nsAutoString src, base;
|
||||
if ((NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::src, src)) &&
|
||||
(src.Length() > 0)) {
|
||||
mImageLoader.SetURL(src);
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE ==
|
||||
mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::_baseHref, base)) {
|
||||
mImageLoader.SetBaseHREF(base);
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImageFrame::SizeOf(nsISizeOfHandler* aHandler) const
|
||||
{
|
||||
|
@ -420,20 +444,6 @@ nsImageFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow");
|
||||
|
||||
// If this is the initial reflow then set the image loader's
|
||||
// source URL and base URL
|
||||
if (eReflowReason_Initial == aReflowState.reason) {
|
||||
nsAutoString src, base;
|
||||
if ((NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::src, src)) &&
|
||||
(src.Length() > 0)) {
|
||||
mImageLoader.SetURL(src);
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE ==
|
||||
mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::_baseHref, base)) {
|
||||
mImageLoader.SetBaseHREF(base);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GetDesiredSize(&aPresContext, aReflowState, aMetrics);
|
||||
AddBordersAndPadding(&aPresContext, aReflowState, aMetrics, mBorderPadding);
|
||||
if (nsnull != aMetrics.maxElementSize) {
|
||||
|
|
|
@ -276,7 +276,7 @@ nsInlineFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->SetFlags(mFlags);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
|
|
|
@ -132,7 +132,7 @@ nsPageFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
|
|
|
@ -481,7 +481,7 @@ TextFrame::CreateContinuingFrame(nsIPresContext& aCX,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aCX, mContent, aParent, aStyleContext);
|
||||
cf->Init(aCX, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
|
|
|
@ -27,7 +27,6 @@ LIBRARY_NAME = raptorhtmlbase_s
|
|||
# Note the sophisticated alphabetical ordering :-|
|
||||
CPPSRCS= \
|
||||
nsAreaFrame.cpp \
|
||||
nsAbsoluteFrame.cpp \
|
||||
nsBRFrame.cpp \
|
||||
nsBlockBandData.cpp \
|
||||
nsBlockFrame.cpp \
|
||||
|
|
|
@ -26,7 +26,6 @@ DEFINES = $(DEFINES) -DXP_NEW_SELECTION
|
|||
!endif
|
||||
|
||||
CPPSRCS= \
|
||||
nsAbsoluteFrame.cpp \
|
||||
nsAreaFrame.cpp \
|
||||
nsBRFrame.cpp \
|
||||
nsBlockBandData.cpp \
|
||||
|
@ -64,7 +63,6 @@ CPPSRCS= \
|
|||
$(NULL)
|
||||
|
||||
CPP_OBJS= \
|
||||
.\$(OBJDIR)\nsAbsoluteFrame.obj \
|
||||
.\$(OBJDIR)\nsAreaFrame.obj \
|
||||
.\$(OBJDIR)\nsBRFrame.obj \
|
||||
.\$(OBJDIR)\nsBlockBandData.obj \
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#include "nsHTMLAtoms.h"
|
||||
#include "nsIView.h"
|
||||
#include "nsViewsCID.h"
|
||||
#include "nsAbsoluteFrame.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIWebShell.h"
|
||||
#include "nsHTMLValue.h"
|
||||
|
@ -61,24 +60,6 @@ nsAreaFrame::~nsAreaFrame()
|
|||
NS_RELEASE(mSpaceManager);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// nsISupports
|
||||
|
||||
nsresult
|
||||
nsAreaFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_PRECONDITION(0 != aInstancePtr, "null ptr");
|
||||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kIAbsoluteItemsIID)) {
|
||||
nsIAbsoluteItems* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
return NS_OK;
|
||||
}
|
||||
return nsBlockFrame::QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// nsIFrame
|
||||
|
||||
|
@ -89,6 +70,23 @@ nsAreaFrame::DeleteFrame(nsIPresContext& aPresContext)
|
|||
return nsBlockFrame::DeleteFrame(aPresContext);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAreaFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
if (nsLayoutAtoms::absoluteList == aListName) {
|
||||
mAbsoluteFrames = aChildList;
|
||||
rv = NS_OK;
|
||||
} else {
|
||||
rv = nsBlockFrame::SetInitialChildList(aPresContext, aListName, aChildList);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAreaFrame::GetAdditionalChildListName(PRInt32 aIndex,
|
||||
nsIAtom*& aListName) const
|
||||
|
@ -247,6 +245,8 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext,
|
|||
aReflowState.maxSize.height,
|
||||
aReflowState.reason));
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
// Make a copy of the reflow state so we can set the space manager
|
||||
nsHTMLReflowState reflowState(aReflowState);
|
||||
reflowState.spaceManager = mSpaceManager;
|
||||
|
@ -254,9 +254,40 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext,
|
|||
// Clear the spacemanager's regions.
|
||||
mSpaceManager->ClearRegions();
|
||||
|
||||
// XXX We need to peek at incremental reflow commands and see if the next
|
||||
// frame is one of the absolutely positioned frames...
|
||||
nsresult rv = nsBlockFrame::Reflow(aPresContext, aDesiredSize, reflowState, aStatus);
|
||||
// See if the reflow command is for an absolutely positioned frame
|
||||
PRBool wasHandled = PR_FALSE;
|
||||
if (eReflowReason_Incremental == aReflowState.reason) {
|
||||
nsIFrame* targetFrame;
|
||||
|
||||
aReflowState.reflowCommand->GetTarget(targetFrame);
|
||||
if (this == targetFrame) {
|
||||
nsIAtom* listName;
|
||||
|
||||
aReflowState.reflowCommand->GetChildListName(listName);
|
||||
if (nsLayoutAtoms::absoluteList == listName) {
|
||||
nsIReflowCommand::ReflowType type;
|
||||
|
||||
aReflowState.reflowCommand->GetType(type);
|
||||
NS_ASSERTION(nsIReflowCommand::FrameAppended == type, "unexpected reflow type");
|
||||
|
||||
// Add the frames to our list of absolutely position frames
|
||||
nsIFrame* childFrames;
|
||||
aReflowState.reflowCommand->GetChildFrame(childFrames);
|
||||
NS_ASSERTION(nsnull != childFrames, "null child list");
|
||||
AddAbsoluteFrame(childFrames);
|
||||
|
||||
// Indicate we handled the reflow command
|
||||
wasHandled = PR_TRUE;
|
||||
}
|
||||
NS_IF_RELEASE(listName);
|
||||
}
|
||||
}
|
||||
|
||||
if (!wasHandled) {
|
||||
// XXX We need to peek at incremental reflow commands and see if the next
|
||||
// frame is one of the absolutely positioned frames...
|
||||
rv = nsBlockFrame::Reflow(aPresContext, aDesiredSize, reflowState, aStatus);
|
||||
}
|
||||
|
||||
// Reflow any absolutely positioned frames that need reflowing
|
||||
// XXX We shouldn't really be doing this for all incremental reflow commands
|
||||
|
@ -286,13 +317,10 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext,
|
|||
mStyleContext->GetStyleData(eStyleStruct_Display);
|
||||
|
||||
if (NS_STYLE_OVERFLOW_HIDDEN != display->mOverflow) {
|
||||
for (PRInt32 i = 0; i < mAbsoluteItems.Count(); i++) {
|
||||
// Get the anchor frame
|
||||
nsAbsoluteFrame* anchorFrame = (nsAbsoluteFrame*)mAbsoluteItems[i];
|
||||
nsIFrame* absoluteFrame = anchorFrame->GetAbsoluteFrame();
|
||||
nsRect rect;
|
||||
for (nsIFrame* f = mAbsoluteFrames; nsnull != f; f->GetNextSibling(f)) {
|
||||
nsRect rect;
|
||||
|
||||
absoluteFrame->GetRect(rect);
|
||||
f->GetRect(rect);
|
||||
nscoord xmost = rect.XMost();
|
||||
nscoord ymost = rect.YMost();
|
||||
if (xmost > aDesiredSize.width) {
|
||||
|
@ -369,7 +397,7 @@ nsAreaFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->SetFlags(mFlags);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
|
@ -392,49 +420,21 @@ void nsAreaFrame::AddAbsoluteFrame(nsIFrame* aFrame)
|
|||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// nsIAbsoluteItems
|
||||
|
||||
NS_METHOD nsAreaFrame::AddAbsoluteItem(nsAbsoluteFrame* aAnchorFrame)
|
||||
{
|
||||
// Add the absolute anchor frame to our list of absolutely positioned
|
||||
// items.
|
||||
mAbsoluteItems.AppendElement(aAnchorFrame);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsAreaFrame::IsAbsoluteFrame(nsIFrame* aFrame)
|
||||
{
|
||||
// Check whether the frame is in our list of absolutely positioned frames
|
||||
for (nsIFrame* f = mAbsoluteFrames; nsnull != f; f->GetNextSibling(f)) {
|
||||
if (f == aFrame) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
NS_METHOD nsAreaFrame::RemoveAbsoluteItem(nsAbsoluteFrame* aAnchorFrame)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("removing an absolutely positioned frame");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
// Called at the end of the Reflow() member function so we can process
|
||||
// any abolutely positioned items that need to be reflowed
|
||||
void
|
||||
nsAreaFrame::ReflowAbsoluteItems(nsIPresContext& aPresContext,
|
||||
const nsHTMLReflowState& aReflowState)
|
||||
{
|
||||
for (PRInt32 i = 0; i < mAbsoluteItems.Count(); i++) {
|
||||
// Get the anchor frame and its absolutely positioned frame
|
||||
nsAbsoluteFrame* anchorFrame = (nsAbsoluteFrame*)mAbsoluteItems[i];
|
||||
nsIFrame* absoluteFrame = anchorFrame->GetAbsoluteFrame();
|
||||
for (nsIFrame* absoluteFrame = mAbsoluteFrames;
|
||||
nsnull != absoluteFrame; absoluteFrame->GetNextSibling(absoluteFrame)) {
|
||||
|
||||
PRBool placeFrame = PR_FALSE;
|
||||
#if 0
|
||||
PRBool reflowFrame = PR_FALSE;
|
||||
#else
|
||||
PRBool reflowFrame = PR_TRUE;
|
||||
#endif
|
||||
nsReflowReason reflowReason = eReflowReason_Resize;
|
||||
|
||||
// Get its style information
|
||||
|
@ -444,6 +444,7 @@ nsAreaFrame::ReflowAbsoluteItems(nsIPresContext& aPresContext,
|
|||
absoluteFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display);
|
||||
absoluteFrame->GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)position);
|
||||
|
||||
#if 0
|
||||
// See whether the frame is a newly added frame
|
||||
if (!IsAbsoluteFrame(absoluteFrame)) {
|
||||
// The absolutely position item hasn't yet been added to our child list
|
||||
|
@ -463,6 +464,7 @@ nsAreaFrame::ReflowAbsoluteItems(nsIPresContext& aPresContext,
|
|||
placeFrame = reflowFrame = PR_TRUE;
|
||||
|
||||
} else {
|
||||
#endif
|
||||
// We need to place the frame if the left-offset or the top-offset are
|
||||
// auto or a percentage
|
||||
if ((eStyleUnit_Coord != position->mLeftOffset.GetUnit()) ||
|
||||
|
@ -476,12 +478,15 @@ nsAreaFrame::ReflowAbsoluteItems(nsIPresContext& aPresContext,
|
|||
(eStyleUnit_Coord != position->mHeight.GetUnit())) {
|
||||
reflowFrame = PR_TRUE;
|
||||
}
|
||||
#if 0
|
||||
}
|
||||
#endif
|
||||
|
||||
if (placeFrame || reflowFrame) {
|
||||
// Get the rect for the absolutely positioned element
|
||||
nsRect rect;
|
||||
ComputeAbsoluteFrameBounds(anchorFrame, aReflowState, position, rect);
|
||||
ComputeAbsoluteFrameBounds(aPresContext, absoluteFrame, aReflowState,
|
||||
position, rect);
|
||||
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
if (NS_OK == absoluteFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
|
@ -541,7 +546,8 @@ void nsAreaFrame::TranslatePoint(nsIFrame* aFrameFrom, nsPoint& aPoint) const
|
|||
}
|
||||
}
|
||||
|
||||
void nsAreaFrame::ComputeAbsoluteFrameBounds(nsIFrame* aAnchorFrame,
|
||||
void nsAreaFrame::ComputeAbsoluteFrameBounds(nsIPresContext& aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
const nsStylePosition* aPosition,
|
||||
nsRect& aRect) const
|
||||
|
@ -552,11 +558,20 @@ void nsAreaFrame::ComputeAbsoluteFrameBounds(nsIFrame* aAnchorFra
|
|||
//
|
||||
// If either the left or top are 'auto' then get the offset of the anchor
|
||||
// frame from this frame
|
||||
nsPoint offset;
|
||||
nsPoint offset(0, 0);
|
||||
if ((eStyleUnit_Auto == aPosition->mLeftOffset.GetUnit()) ||
|
||||
(eStyleUnit_Auto == aPosition->mTopOffset.GetUnit())) {
|
||||
aAnchorFrame->GetOrigin(offset);
|
||||
TranslatePoint(aAnchorFrame, offset);
|
||||
// Get the placeholder frame
|
||||
nsIFrame* placeholderFrame;
|
||||
nsIPresShell* presShell = aPresContext.GetShell();
|
||||
|
||||
presShell->GetPlaceholderFrameFor(aFrame, placeholderFrame);
|
||||
NS_RELEASE(presShell);
|
||||
NS_ASSERTION(nsnull != placeholderFrame, "no placeholder frame");
|
||||
if (nsnull != placeholderFrame) {
|
||||
placeholderFrame->GetOrigin(offset);
|
||||
TranslatePoint(placeholderFrame, offset);
|
||||
}
|
||||
}
|
||||
|
||||
// left-offset
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#define nsAreaFrame_h___
|
||||
|
||||
#include "nsBlockFrame.h"
|
||||
#include "nsIAbsoluteItems.h"
|
||||
#include "nsISpaceManager.h"
|
||||
#include "nsVoidArray.h"
|
||||
|
||||
|
@ -40,18 +39,18 @@ struct nsStylePosition;
|
|||
*
|
||||
* @see nsLayoutAtoms::absoluteList
|
||||
*/
|
||||
class nsAreaFrame : public nsBlockFrame,
|
||||
public nsIAbsoluteItems
|
||||
class nsAreaFrame : public nsBlockFrame
|
||||
{
|
||||
public:
|
||||
friend nsresult NS_NewAreaFrame(nsIFrame*& aResult, PRUint32 aFlags);
|
||||
|
||||
// nsISupports
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
// nsIFrame
|
||||
NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext);
|
||||
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList);
|
||||
|
||||
NS_IMETHOD GetAdditionalChildListName(PRInt32 aIndex,
|
||||
nsIAtom*& aListName) const;
|
||||
|
||||
|
@ -77,10 +76,6 @@ public:
|
|||
NS_IMETHOD List(FILE* out, PRInt32 aIndent, nsIListFilter* aFilter) const;
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
|
||||
// nsIAbsoluteItems
|
||||
NS_IMETHOD AddAbsoluteItem(nsAbsoluteFrame* aAnchorFrame);
|
||||
NS_IMETHOD RemoveAbsoluteItem(nsAbsoluteFrame* aAnchorFrame);
|
||||
|
||||
protected:
|
||||
nsAreaFrame();
|
||||
virtual ~nsAreaFrame();
|
||||
|
@ -90,17 +85,16 @@ protected:
|
|||
|
||||
void TranslatePoint(nsIFrame* aFrameFrom, nsPoint& aPoint) const;
|
||||
|
||||
void ComputeAbsoluteFrameBounds(nsIFrame* aAnchorFrame,
|
||||
void ComputeAbsoluteFrameBounds(nsIPresContext& aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
const nsHTMLReflowState& aState,
|
||||
const nsStylePosition* aPosition,
|
||||
nsRect& aRect) const;
|
||||
|
||||
void AddAbsoluteFrame(nsIFrame* aFrame);
|
||||
PRBool IsAbsoluteFrame(nsIFrame* aFrame);
|
||||
|
||||
private:
|
||||
nsSpaceManager* mSpaceManager;
|
||||
nsVoidArray mAbsoluteItems;
|
||||
nsIFrame* mAbsoluteFrames; // additional named child list
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "nsFrameReflowState.h"
|
||||
#include "nsLineLayout.h"
|
||||
#include "nsInlineReflow.h"
|
||||
#include "nsAbsoluteFrame.h"
|
||||
#include "nsPlaceholderFrame.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
|
@ -4166,7 +4165,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
NS_RELEASE(kidSC);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mBullet->Init(aPresContext, mContent, this, kidSC);
|
||||
mBullet->Init(aPresContext, mContent, this, this, kidSC);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
// If the list bullet frame should be positioned inside then add
|
||||
|
@ -4329,7 +4328,7 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->SetFlags(mFlags);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "nsFrameReflowState.h"
|
||||
#include "nsLineLayout.h"
|
||||
#include "nsInlineReflow.h"
|
||||
#include "nsAbsoluteFrame.h"
|
||||
#include "nsPlaceholderFrame.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
|
@ -4166,7 +4165,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
NS_RELEASE(kidSC);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mBullet->Init(aPresContext, mContent, this, kidSC);
|
||||
mBullet->Init(aPresContext, mContent, this, this, kidSC);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
// If the list bullet frame should be positioned inside then add
|
||||
|
@ -4329,7 +4328,7 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->SetFlags(mFlags);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "nsFrameReflowState.h"
|
||||
#include "nsLineLayout.h"
|
||||
#include "nsInlineReflow.h"
|
||||
#include "nsAbsoluteFrame.h"
|
||||
#include "nsPlaceholderFrame.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
|
@ -4166,7 +4165,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
NS_RELEASE(kidSC);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mBullet->Init(aPresContext, mContent, this, kidSC);
|
||||
mBullet->Init(aPresContext, mContent, this, this, kidSC);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
// If the list bullet frame should be positioned inside then add
|
||||
|
@ -4329,7 +4328,7 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->SetFlags(mFlags);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#define nsBodyFrame_h___
|
||||
|
||||
#include "nsBlockFrame.h"
|
||||
#include "nsIAbsoluteItems.h"
|
||||
#include "nsISpaceManager.h"
|
||||
#include "nsVoidArray.h"
|
||||
|
||||
|
|
|
@ -272,12 +272,14 @@ nsrefcnt nsFrame::Release(void)
|
|||
NS_IMETHODIMP
|
||||
nsFrame::Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aGeometricParent,
|
||||
nsIFrame* aContentParent,
|
||||
nsIStyleContext* aContext)
|
||||
{
|
||||
mContent = aContent;
|
||||
NS_IF_ADDREF(mContent);
|
||||
mGeometricParent = mContentParent = aParent;
|
||||
mGeometricParent = aGeometricParent;
|
||||
mContentParent = aContentParent;
|
||||
return SetStyleContext(&aPresContext, aContext);
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,8 @@ public:
|
|||
// nsIFrame
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aGeometricParent,
|
||||
nsIFrame* aContentParent,
|
||||
nsIStyleContext* aContext);
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
|
|
|
@ -175,6 +175,7 @@ nsIAtom* nsHTMLAtoms::p;
|
|||
nsIAtom* nsHTMLAtoms::pagex;
|
||||
nsIAtom* nsHTMLAtoms::pagey;
|
||||
nsIAtom* nsHTMLAtoms::param;
|
||||
nsIAtom* nsHTMLAtoms::placeholderPseudo;
|
||||
nsIAtom* nsHTMLAtoms::pointSize;
|
||||
nsIAtom* nsHTMLAtoms::pre;
|
||||
nsIAtom* nsHTMLAtoms::profile;
|
||||
|
@ -406,6 +407,7 @@ void nsHTMLAtoms::AddrefAtoms()
|
|||
pagex = NS_NewAtom("PAGEX");
|
||||
pagey = NS_NewAtom("PAGEY");
|
||||
param = NS_NewAtom("PARAM");
|
||||
placeholderPseudo = NS_NewAtom(":PLACEHOLDER-FRAME");
|
||||
pointSize = NS_NewAtom("POINT-SIZE");
|
||||
pre = NS_NewAtom("PRE");
|
||||
profile = NS_NewAtom("PROFILE");
|
||||
|
@ -632,6 +634,7 @@ void nsHTMLAtoms::ReleaseAtoms()
|
|||
NS_RELEASE(pagex);
|
||||
NS_RELEASE(pagey);
|
||||
NS_RELEASE(param);
|
||||
NS_RELEASE(placeholderPseudo);
|
||||
NS_RELEASE(pointSize);
|
||||
NS_RELEASE(pre);
|
||||
NS_RELEASE(profile);
|
||||
|
|
|
@ -207,6 +207,7 @@ public:
|
|||
static nsIAtom* pagex;
|
||||
static nsIAtom* pagey;
|
||||
static nsIAtom* param;
|
||||
static nsIAtom* placeholderPseudo;
|
||||
static nsIAtom* pointSize;
|
||||
static nsIAtom* pre;
|
||||
static nsIAtom* profile;
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "nsIDocument.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIPtr.h"
|
||||
#include "nsAbsoluteFrame.h"
|
||||
#include "nsPlaceholderFrame.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLParts.h"
|
||||
|
@ -90,7 +89,7 @@ nsHTMLContainerFrame::CreatePlaceholderFrame(nsIPresContext& aPresContext,
|
|||
|
||||
nsPlaceholderFrame* placeholder;
|
||||
NS_NewPlaceholderFrame((nsIFrame**)&placeholder);
|
||||
placeholder->Init(aPresContext, content, this, kidSC);
|
||||
placeholder->Init(aPresContext, content, this, this, kidSC);
|
||||
placeholder->SetAnchoredItem(aFloatedFrame);
|
||||
NS_IF_RELEASE(content);
|
||||
NS_RELEASE(kidSC);
|
||||
|
@ -98,27 +97,6 @@ nsHTMLContainerFrame::CreatePlaceholderFrame(nsIPresContext& aPresContext,
|
|||
return placeholder;
|
||||
}
|
||||
|
||||
nsAbsoluteFrame*
|
||||
nsHTMLContainerFrame::CreateAbsolutePlaceholderFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aAbsoluteFrame)
|
||||
{
|
||||
nsIContent* content;
|
||||
aAbsoluteFrame->GetContent(content);
|
||||
|
||||
// Let the placeholder share the same style context as the floated element
|
||||
nsIStyleContext* kidSC;
|
||||
aAbsoluteFrame->GetStyleContext(kidSC);
|
||||
|
||||
nsAbsoluteFrame* placeholder;
|
||||
NS_NewAbsoluteFrame((nsIFrame**)&placeholder);
|
||||
placeholder->Init(aPresContext, content, this, kidSC);
|
||||
placeholder->SetAbsoluteFrame(aAbsoluteFrame);
|
||||
NS_IF_RELEASE(content);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
return placeholder;
|
||||
}
|
||||
|
||||
// XXX pass in aFrame's style context instead
|
||||
PRBool
|
||||
nsHTMLContainerFrame::MoveFrameOutOfFlow(nsIPresContext& aPresContext,
|
||||
|
@ -134,9 +112,8 @@ nsHTMLContainerFrame::MoveFrameOutOfFlow(nsIPresContext& aPresContext,
|
|||
PRBool isFloated =
|
||||
(NS_STYLE_FLOAT_LEFT == aDisplay->mFloats) ||
|
||||
(NS_STYLE_FLOAT_RIGHT == aDisplay->mFloats);
|
||||
PRBool isAbsolute = NS_STYLE_POSITION_ABSOLUTE == aPosition->mPosition;
|
||||
|
||||
if (isFloated || isAbsolute) {
|
||||
if (isFloated) {
|
||||
nsIFrame* nextSibling;
|
||||
|
||||
// Set aFrame's next sibling to nsnull, and remember the current next
|
||||
|
@ -144,21 +121,9 @@ nsHTMLContainerFrame::MoveFrameOutOfFlow(nsIPresContext& aPresContext,
|
|||
aFrame->GetNextSibling(nextSibling);
|
||||
aFrame->SetNextSibling(nsnull);
|
||||
|
||||
nsIFrame* frameToWrapWithAView = aFrame;
|
||||
if (isFloated) {
|
||||
// Create a placeholder frame that will serve as the anchor point.
|
||||
nsPlaceholderFrame* placeholder =
|
||||
CreatePlaceholderFrame(aPresContext, aFrame);
|
||||
|
||||
aPlaceholderFrame = placeholder;
|
||||
|
||||
} else {
|
||||
// Create a placeholder frame that will serve as the anchor point.
|
||||
nsAbsoluteFrame* placeholder =
|
||||
CreateAbsolutePlaceholderFrame(aPresContext, aFrame);
|
||||
|
||||
aPlaceholderFrame = placeholder;
|
||||
}
|
||||
// Create a placeholder frame that will serve as the anchor point.
|
||||
nsPlaceholderFrame* placeholder = CreatePlaceholderFrame(aPresContext, aFrame);
|
||||
aPlaceholderFrame = placeholder;
|
||||
|
||||
// Set the placeholder's next sibling to what aFrame's next sibling was
|
||||
aPlaceholderFrame->SetNextSibling(nextSibling);
|
||||
|
|
|
@ -35,8 +35,6 @@ public:
|
|||
nsFramePaintLayer aWhichLayer);
|
||||
nsPlaceholderFrame* CreatePlaceholderFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aFloatedFrame);
|
||||
nsAbsoluteFrame* CreateAbsolutePlaceholderFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aAbsoluteFrame);
|
||||
|
||||
// If the frame should be floated or absolutely positioned creates a placeholder
|
||||
// frame and returns PR_TRUE. The sibling list is modified so aFrame's next
|
||||
|
|
|
@ -17,12 +17,10 @@
|
|||
*/
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsIAbsoluteItems.h"
|
||||
#include "nsIAnchoredItems.h"
|
||||
#include "nsIHTMLReflow.h"
|
||||
#include "nsIPageSequenceFrame.h"
|
||||
|
||||
const nsIID kIAbsoluteItemsIID = NS_IABSOLUTE_ITEMS_IID;
|
||||
const nsIID kIHTMLContentIID = NS_IHTMLCONTENT_IID;
|
||||
const nsIID kIHTMLReflowIID = NS_IHTMLREFLOW_IID;
|
||||
const nsIID kIPageSequenceFrameIID = NS_IPAGESEQUENCEFRAME_IID;
|
||||
|
|
|
@ -100,6 +100,11 @@ protected:
|
|||
class nsImageFrame : public ImageFrameSuper {
|
||||
public:
|
||||
NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext);
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aGeometricParent,
|
||||
nsIFrame* aContentParent,
|
||||
nsIStyleContext* aContext);
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler) const;
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
|
|
|
@ -73,7 +73,7 @@ nsHTMLReflowCommand::nsHTMLReflowCommand(nsIFrame* aTargetFrame,
|
|||
nsIFrame* aChildFrame,
|
||||
nsIAtom* aAttribute)
|
||||
: mType(aReflowType), mTargetFrame(aTargetFrame), mChildFrame(aChildFrame),
|
||||
mAttribute(aAttribute), mPrevSiblingFrame(nsnull)
|
||||
mAttribute(aAttribute), mPrevSiblingFrame(nsnull), mListName(nsnull)
|
||||
{
|
||||
NS_PRECONDITION(mTargetFrame != nsnull, "null target frame");
|
||||
if (nsnull!=mAttribute)
|
||||
|
@ -85,7 +85,7 @@ nsHTMLReflowCommand::nsHTMLReflowCommand(nsIFrame* aTargetFrame,
|
|||
nsIFrame* aChildFrame,
|
||||
nsIFrame* aPrevSiblingFrame)
|
||||
: mType(FrameInserted), mTargetFrame(aTargetFrame), mChildFrame(aChildFrame),
|
||||
mPrevSiblingFrame(aPrevSiblingFrame), mAttribute(nsnull)
|
||||
mPrevSiblingFrame(aPrevSiblingFrame), mAttribute(nsnull), mListName(nsnull)
|
||||
{
|
||||
NS_PRECONDITION(mTargetFrame != nsnull, "null target frame");
|
||||
NS_INIT_REFCNT();
|
||||
|
@ -94,6 +94,7 @@ nsHTMLReflowCommand::nsHTMLReflowCommand(nsIFrame* aTargetFrame,
|
|||
nsHTMLReflowCommand::~nsHTMLReflowCommand()
|
||||
{
|
||||
NS_IF_RELEASE(mAttribute);
|
||||
NS_IF_RELEASE(mListName);
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsHTMLReflowCommand, kIReflowCommandIID);
|
||||
|
@ -210,7 +211,15 @@ NS_IMETHODIMP nsHTMLReflowCommand::GetChildFrame(nsIFrame*& aChildFrame) const
|
|||
|
||||
NS_IMETHODIMP nsHTMLReflowCommand::GetChildListName(nsIAtom*& aListName) const
|
||||
{
|
||||
aListName = nsnull;
|
||||
aListName = mListName;
|
||||
NS_IF_ADDREF(aListName);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsHTMLReflowCommand::SetChildListName(nsIAtom* aListName)
|
||||
{
|
||||
mListName = aListName;
|
||||
NS_IF_ADDREF(mListName);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -67,6 +67,7 @@ public:
|
|||
|
||||
NS_IMETHOD GetChildFrame(nsIFrame*& aChildFrame) const;
|
||||
NS_IMETHOD GetChildListName(nsIAtom*& aListName) const;
|
||||
NS_IMETHOD SetChildListName(nsIAtom* aListName);
|
||||
NS_IMETHOD GetPrevSiblingFrame(nsIFrame*& aSiblingFrame) const;
|
||||
|
||||
protected:
|
||||
|
@ -79,6 +80,7 @@ private:
|
|||
nsIFrame* mChildFrame;
|
||||
nsIFrame* mPrevSiblingFrame;
|
||||
nsIAtom* mAttribute;
|
||||
nsIAtom* mListName;
|
||||
nsVoidArray mPath;
|
||||
};
|
||||
|
||||
|
|
|
@ -340,6 +340,30 @@ nsImageFrame::DeleteFrame(nsIPresContext& aPresContext)
|
|||
return nsLeafFrame::DeleteFrame(aPresContext);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImageFrame::Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aGeometricParent,
|
||||
nsIFrame* aContentParent,
|
||||
nsIStyleContext* aContext)
|
||||
{
|
||||
nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aGeometricParent,
|
||||
aContentParent, aContext);
|
||||
|
||||
// Set the image loader's source URL and base URL
|
||||
nsAutoString src, base;
|
||||
if ((NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::src, src)) &&
|
||||
(src.Length() > 0)) {
|
||||
mImageLoader.SetURL(src);
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE ==
|
||||
mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::_baseHref, base)) {
|
||||
mImageLoader.SetBaseHREF(base);
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImageFrame::SizeOf(nsISizeOfHandler* aHandler) const
|
||||
{
|
||||
|
@ -420,20 +444,6 @@ nsImageFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow");
|
||||
|
||||
// If this is the initial reflow then set the image loader's
|
||||
// source URL and base URL
|
||||
if (eReflowReason_Initial == aReflowState.reason) {
|
||||
nsAutoString src, base;
|
||||
if ((NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::src, src)) &&
|
||||
(src.Length() > 0)) {
|
||||
mImageLoader.SetURL(src);
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE ==
|
||||
mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::_baseHref, base)) {
|
||||
mImageLoader.SetBaseHREF(base);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GetDesiredSize(&aPresContext, aReflowState, aMetrics);
|
||||
AddBordersAndPadding(&aPresContext, aReflowState, aMetrics, mBorderPadding);
|
||||
if (nsnull != aMetrics.maxElementSize) {
|
||||
|
|
|
@ -276,7 +276,7 @@ nsInlineFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->SetFlags(mFlags);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
|
|
|
@ -132,7 +132,7 @@ nsPageFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
static PRBool gsNoisyRefs = PR_FALSE;
|
||||
#undef NOISY
|
||||
|
||||
#if 0
|
||||
static PLHashNumber
|
||||
HashKey(nsIFrame* key)
|
||||
{
|
||||
|
@ -87,7 +86,6 @@ FrameHashTable::FrameHashTable()
|
|||
|
||||
FrameHashTable::~FrameHashTable()
|
||||
{
|
||||
// XXX if debugging then we should assert that the table is empty
|
||||
PL_HashTableDestroy(mTable);
|
||||
}
|
||||
|
||||
|
@ -143,7 +141,6 @@ FrameHashTable::Remove(nsIFrame* aKey)
|
|||
}
|
||||
return oldValue;
|
||||
}
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
@ -244,6 +241,10 @@ public:
|
|||
virtual nsIFrame* GetRootFrame();
|
||||
NS_IMETHOD GetPageSequenceFrame(nsIPageSequenceFrame*& aPageSequenceFrame);
|
||||
virtual nsIFrame* FindFrameWithContent(nsIContent* aContent);
|
||||
NS_IMETHOD GetPlaceholderFrameFor(nsIFrame* aFrame,
|
||||
nsIFrame*& aPlaceholderFrame) const;
|
||||
NS_IMETHOD SetPlaceholderFrameFor(nsIFrame* aFrame,
|
||||
nsIFrame* aPlaceholderFrame);
|
||||
virtual void AppendReflowCommand(nsIReflowCommand* aReflowCommand);
|
||||
virtual void ProcessReflowCommands();
|
||||
virtual void ClearFrameRefs(nsIFrame*);
|
||||
|
@ -288,6 +289,7 @@ protected:
|
|||
nsIFrame* mFocusEventFrame; //keeps track of which frame has focus.
|
||||
nsIFrame* mAnchorEventFrame; //keeps track of which frame has focus.
|
||||
nsISelection *mSelection;
|
||||
FrameHashTable* mPlaceholderMap;
|
||||
};
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
|
@ -429,6 +431,7 @@ PresShell::~PresShell()
|
|||
}
|
||||
NS_IF_RELEASE(mSelection);
|
||||
mRefCnt = 0;
|
||||
delete mPlaceholderMap;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -598,7 +601,7 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
|
|||
if (nsnull != root) {
|
||||
// Have style sheet processor construct a frame for the
|
||||
// root content object
|
||||
mStyleSet->ConstructFrame(mPresContext, root, nsnull, mRootFrame);
|
||||
mStyleSet->ConstructRootFrame(mPresContext, root, mRootFrame);
|
||||
NS_RELEASE(root);
|
||||
}
|
||||
}
|
||||
|
@ -1189,6 +1192,38 @@ PresShell::FindFrameWithContent(nsIContent* aContent)
|
|||
return ::FindFrameWithContent(mRootFrame, aContent);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PresShell::GetPlaceholderFrameFor(nsIFrame* aFrame,
|
||||
nsIFrame*& aPlaceholderFrame) const
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aFrame, "no frame");
|
||||
|
||||
if (nsnull == mPlaceholderMap) {
|
||||
aPlaceholderFrame = nsnull;
|
||||
} else {
|
||||
aPlaceholderFrame = (nsIFrame*)mPlaceholderMap->Get(aFrame);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PresShell::SetPlaceholderFrameFor(nsIFrame* aFrame,
|
||||
nsIFrame* aPlaceholderFrame)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aFrame, "no frame");
|
||||
|
||||
if (nsnull == mPlaceholderMap) {
|
||||
mPlaceholderMap = new FrameHashTable;
|
||||
if (nsnull == mPlaceholderMap) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
mPlaceholderMap->Put(aFrame, (void*)aPlaceholderFrame);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//nsIViewObserver
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include "nsViewsCID.h"
|
||||
#include "nsIView.h"
|
||||
#include "nsIViewManager.h"
|
||||
#include "nsBodyFrame.h"
|
||||
#include "nsHTMLContainerFrame.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsCSSRendering.h"
|
||||
|
@ -49,7 +48,8 @@ class nsScrollFrame : public nsHTMLContainerFrame {
|
|||
public:
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aGeometricParent,
|
||||
nsIFrame* aContentParent,
|
||||
nsIStyleContext* aContext);
|
||||
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
|
@ -81,11 +81,13 @@ private:
|
|||
NS_IMETHODIMP
|
||||
nsScrollFrame::Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aGeometricParent,
|
||||
nsIFrame* aContentParent,
|
||||
nsIStyleContext* aStyleContext)
|
||||
{
|
||||
nsresult rv = nsHTMLContainerFrame::Init(aPresContext, aContent,
|
||||
aParent, aStyleContext);
|
||||
aGeometricParent, aContentParent,
|
||||
aStyleContext);
|
||||
|
||||
// Create the scrolling view
|
||||
CreateScrollingView();
|
||||
|
|
|
@ -481,7 +481,7 @@ TextFrame::CreateContinuingFrame(nsIPresContext& aCX,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aCX, mContent, aParent, aStyleContext);
|
||||
cf->Init(aCX, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
|
|
|
@ -321,7 +321,7 @@ nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext,
|
|||
if (nsnull == mFirstChild) {
|
||||
mFirstChild = new nsHTMLFrameInnerFrame;
|
||||
// XXX temporary! use style system to get correct style!
|
||||
mFirstChild->Init(aPresContext, mContent, this, mStyleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, this, mStyleContext);
|
||||
}
|
||||
|
||||
// nsContainerFrame::PaintBorder has some problems, kludge it here
|
||||
|
|
|
@ -936,7 +936,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
if (nsHTMLAtoms::frameset == tag) {
|
||||
result = NS_NewHTMLFramesetFrame(frame);
|
||||
frame->Init(aPresContext, child, this, kidSC);
|
||||
frame->Init(aPresContext, child, this, this, kidSC);
|
||||
|
||||
childTypes[mChildCount] = FRAMESET;
|
||||
nsHTMLFramesetFrame* childFrame = (nsHTMLFramesetFrame*)frame;
|
||||
|
@ -946,7 +946,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
|||
childBorderColors[mChildCount].Set(childFrame->GetBorderColor());
|
||||
} else { // frame
|
||||
result = NS_NewHTMLFrameOuterFrame(frame);
|
||||
frame->Init(aPresContext, child, this, kidSC);
|
||||
frame->Init(aPresContext, child, this, this, kidSC);
|
||||
|
||||
childTypes[mChildCount] = FRAME;
|
||||
//
|
||||
|
@ -979,7 +979,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
|||
nsHTMLFramesetBlankFrame* blankFrame = new nsHTMLFramesetBlankFrame;
|
||||
nsIStyleContext* pseudoStyleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::framesetBlankPseudo, mStyleContext);
|
||||
blankFrame->Init(aPresContext, mContent, this, pseudoStyleContext);
|
||||
blankFrame->Init(aPresContext, mContent, this, this, pseudoStyleContext);
|
||||
NS_RELEASE(pseudoStyleContext);
|
||||
|
||||
if (nsnull == lastChild) {
|
||||
|
@ -1017,7 +1017,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
|||
borderFrame = new nsHTMLFramesetBorderFrame(borderWidth, PR_FALSE, PR_FALSE);
|
||||
nsIStyleContext* pseudoStyleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::horizontalFramesetBorderPseudo, mStyleContext);
|
||||
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext);
|
||||
borderFrame->Init(aPresContext, mContent, this, this, pseudoStyleContext);
|
||||
NS_RELEASE(pseudoStyleContext);
|
||||
|
||||
mChildCount++;
|
||||
|
@ -1042,7 +1042,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
|||
borderFrame = new nsHTMLFramesetBorderFrame(borderWidth, PR_TRUE, PR_FALSE);
|
||||
nsIStyleContext* pseudoStyleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::verticalFramesetBorderPseudo, mStyleContext);
|
||||
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext);
|
||||
borderFrame->Init(aPresContext, mContent, this, this, pseudoStyleContext);
|
||||
NS_RELEASE(pseudoStyleContext);
|
||||
|
||||
mChildCount++;
|
||||
|
|
|
@ -500,8 +500,8 @@ NOFRAMES {
|
|||
|
||||
:SCROLLBAR-LOOK {
|
||||
background-color: #c0c0c0;
|
||||
//border-color: inherit;
|
||||
//border: 2px outset #c0c0c0;
|
||||
/* border-color: inherit; */
|
||||
/* border: 2px outset #c0c0c0; */
|
||||
}
|
||||
|
||||
:SCROLLBAR-ARROW-LOOK {
|
||||
|
@ -526,6 +526,12 @@ NOFRAMES {
|
|||
display: inherit;
|
||||
}
|
||||
|
||||
:PLACEHOLDER-FRAME {
|
||||
display: inline;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
:ROOT {
|
||||
background-color: inherit;
|
||||
}
|
||||
|
|
|
@ -131,7 +131,7 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
nsIStyleContext* styleContext = aPresContext.ResolvePseudoStyleContextFor(mContent,
|
||||
nsHTMLAtoms::fieldsetContentPseudo,
|
||||
mStyleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, styleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, this, styleContext);
|
||||
NS_RELEASE(styleContext);
|
||||
|
||||
nsIFrame* newChildList = aChildList;
|
||||
|
|
|
@ -196,7 +196,7 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
|
|||
text->SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::disabled, nsAutoString("1"), PR_FALSE); // XXX this should use an "empty" bool value
|
||||
}
|
||||
NS_NewTextControlFrame(childFrame);
|
||||
childFrame->Init(aPresContext, text, this, mStyleContext);
|
||||
childFrame->Init(aPresContext, text, this, this, mStyleContext);
|
||||
mTextFrame = (nsTextControlFrame*)childFrame;
|
||||
mFirstChild = childFrame;
|
||||
|
||||
|
@ -210,7 +210,7 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
|
|||
NS_NewButtonControlFrame(childFrame);
|
||||
((nsButtonControlFrame*)childFrame)->SetFileControlFrame(this);
|
||||
mBrowseFrame = (nsButtonControlFrame*)childFrame;
|
||||
childFrame->Init(aPresContext, browse, this, mStyleContext);
|
||||
childFrame->Init(aPresContext, browse, this, this, mStyleContext);
|
||||
|
||||
mFirstChild->SetNextSibling(childFrame);
|
||||
|
||||
|
|
|
@ -511,7 +511,7 @@ nsHTMLButtonControlFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
// Resolve style and initialize the frame
|
||||
nsIStyleContext* styleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::buttonContentPseudo, mStyleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, styleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, this, styleContext);
|
||||
NS_RELEASE(styleContext);
|
||||
|
||||
// Set the geometric and content parent for each of the child frames
|
||||
|
|
|
@ -359,7 +359,7 @@ nsLabelFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
// Resolve style and initialize the frame
|
||||
nsIStyleContext* styleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::labelContentPseudo, mStyleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, styleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, this, styleContext);
|
||||
NS_RELEASE(styleContext);
|
||||
|
||||
// Set the geometric and content parent for each of the child frames
|
||||
|
|
|
@ -95,7 +95,7 @@ nsLegendFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
// Resolve style and initialize the frame
|
||||
nsIStyleContext* styleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::legendContentPseudo, mStyleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, styleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, this, styleContext);
|
||||
NS_RELEASE(styleContext);
|
||||
|
||||
// Set the geometric and content parent for each of the child frames
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -561,7 +561,7 @@ nsTableCellFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->AppendToFlow(this);
|
||||
cf->InitCellFrame(GetColIndex());
|
||||
aContinuingFrame = cf;
|
||||
|
|
|
@ -90,7 +90,7 @@ nsTableColGroupFrame::InitNewFrames(nsIPresContext& aPresContext, nsIFrame* aChi
|
|||
// Set its style context
|
||||
nsIStyleContextPtr colStyleContext =
|
||||
aPresContext.ResolveStyleContextFor(col, mStyleContext, PR_TRUE);
|
||||
colFrame->Init(aPresContext, col, this, colStyleContext);
|
||||
colFrame->Init(aPresContext, col, this, this, colStyleContext);
|
||||
colFrame->SetInitialChildList(aPresContext, nsnull, nsnull);
|
||||
|
||||
// Set nsColFrame-specific information
|
||||
|
|
|
@ -290,7 +290,8 @@ nsTableFrame::nsTableFrame()
|
|||
NS_IMETHODIMP
|
||||
nsTableFrame::Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aGeometricParent,
|
||||
nsIFrame* aContentParent,
|
||||
nsIStyleContext* aContext)
|
||||
{
|
||||
float p2t = aPresContext.GetPixelsToTwips();
|
||||
|
@ -298,7 +299,8 @@ nsTableFrame::Init(nsIPresContext& aPresContext,
|
|||
mDefaultCellSpacingY = NSIntPixelsToTwips(2, p2t);
|
||||
mDefaultCellPadding = NSIntPixelsToTwips(1, p2t);
|
||||
|
||||
return nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext);
|
||||
return nsHTMLContainerFrame::Init(aPresContext, aContent, aGeometricParent,
|
||||
aContentParent, aContext);
|
||||
}
|
||||
|
||||
|
||||
|
@ -726,7 +728,7 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext)
|
|||
// Create a col group frame
|
||||
nsIFrame* newFrame;
|
||||
NS_NewTableColGroupFrame(newFrame);
|
||||
newFrame->Init(aPresContext, lastColGroupElement, this, colGroupStyleContext);
|
||||
newFrame->Init(aPresContext, lastColGroupElement, this, this, colGroupStyleContext);
|
||||
lastColGroupFrame = (nsTableColGroupFrame*)newFrame;
|
||||
NS_RELEASE(colGroupStyleContext); // kidStyleContenxt: REFCNT--
|
||||
|
||||
|
@ -758,7 +760,8 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext)
|
|||
lastColGroupStyle,
|
||||
PR_TRUE); // colStyleContext: REFCNT++
|
||||
NS_NewTableColFrame(colFrame);
|
||||
colFrame->Init(aPresContext, lastColGroupElement, lastColGroupFrame, colStyleContext);
|
||||
colFrame->Init(aPresContext, lastColGroupElement, lastColGroupFrame,
|
||||
lastColGroupFrame, colStyleContext);
|
||||
NS_RELEASE(colStyleContext);
|
||||
colFrame->SetInitialChildList(aPresContext, nsnull, nsnull);
|
||||
|
||||
|
@ -4197,7 +4200,7 @@ nsTableFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->AppendToFlow(this);
|
||||
if (PR_TRUE==gsDebug) printf("nsTableFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf);
|
||||
// set my width, because all frames in a table flow are the same width
|
||||
|
@ -4229,7 +4232,7 @@ nsTableFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
|
||||
nsIFrame* duplicateFrame;
|
||||
NS_NewTableRowGroupFrame(duplicateFrame);
|
||||
duplicateFrame->Init(aPresContext, content, cf, kidStyleContext);
|
||||
duplicateFrame->Init(aPresContext, content, cf, cf, kidStyleContext);
|
||||
NS_RELEASE(kidStyleContext); // kidStyleContenxt: REFCNT--
|
||||
|
||||
if (nsnull==lastSib)
|
||||
|
|
|
@ -80,7 +80,8 @@ public:
|
|||
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aGeometricParent,
|
||||
nsIFrame* aContentParent,
|
||||
nsIStyleContext* aContext);
|
||||
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
*/
|
||||
#include "nsTableOuterFrame.h"
|
||||
#include "nsTableFrame.h"
|
||||
#include "nsBodyFrame.h"
|
||||
#include "nsIReflowCommand.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
|
@ -1142,7 +1141,7 @@ nsTableOuterFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->AppendToFlow(this);
|
||||
if (PR_TRUE==gsDebug)
|
||||
printf("nsTableOuterFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf);
|
||||
|
|
|
@ -1439,7 +1439,7 @@ nsTableRowFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->AppendToFlow(this);
|
||||
cf->SetRowIndex(GetRowIndex());
|
||||
|
||||
|
|
|
@ -1399,7 +1399,7 @@ nsTableRowGroupFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->AppendToFlow(this);
|
||||
if (PR_TRUE==gsDebug) printf("nsTableRowGroupFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf);
|
||||
aContinuingFrame = cf;
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -88,10 +88,9 @@ public:
|
|||
nsIStyleContext* aParentContext,
|
||||
PRBool aForceUnique = PR_FALSE);
|
||||
|
||||
NS_IMETHOD ConstructFrame(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame*& aFrameSubTree);
|
||||
NS_IMETHOD ConstructRootFrame(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame*& aFrameSubTree);
|
||||
NS_IMETHOD ReconstructFrames(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
|
@ -716,13 +715,12 @@ nsIStyleContext* StyleSetImpl::ProbePseudoStyleFor(nsIPresContext* aPresContext,
|
|||
return result;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP StyleSetImpl::ConstructFrame(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame*& aFrameSubTree)
|
||||
NS_IMETHODIMP StyleSetImpl::ConstructRootFrame(nsIPresContext* aPresContext,
|
||||
nsIContent* aDocElement,
|
||||
nsIFrame*& aFrameSubTree)
|
||||
{
|
||||
return mFrameConstructor->ConstructFrame(aPresContext, aContent,
|
||||
aParentFrame, aFrameSubTree);
|
||||
return mFrameConstructor->ConstructRootFrame(aPresContext, aDocElement,
|
||||
aFrameSubTree);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -500,8 +500,8 @@ NOFRAMES {
|
|||
|
||||
:SCROLLBAR-LOOK {
|
||||
background-color: #c0c0c0;
|
||||
//border-color: inherit;
|
||||
//border: 2px outset #c0c0c0;
|
||||
/* border-color: inherit; */
|
||||
/* border: 2px outset #c0c0c0; */
|
||||
}
|
||||
|
||||
:SCROLLBAR-ARROW-LOOK {
|
||||
|
@ -526,6 +526,12 @@ NOFRAMES {
|
|||
display: inherit;
|
||||
}
|
||||
|
||||
:PLACEHOLDER-FRAME {
|
||||
display: inline;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
:ROOT {
|
||||
background-color: inherit;
|
||||
}
|
||||
|
|
|
@ -561,7 +561,7 @@ nsTableCellFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->AppendToFlow(this);
|
||||
cf->InitCellFrame(GetColIndex());
|
||||
aContinuingFrame = cf;
|
||||
|
|
|
@ -90,7 +90,7 @@ nsTableColGroupFrame::InitNewFrames(nsIPresContext& aPresContext, nsIFrame* aChi
|
|||
// Set its style context
|
||||
nsIStyleContextPtr colStyleContext =
|
||||
aPresContext.ResolveStyleContextFor(col, mStyleContext, PR_TRUE);
|
||||
colFrame->Init(aPresContext, col, this, colStyleContext);
|
||||
colFrame->Init(aPresContext, col, this, this, colStyleContext);
|
||||
colFrame->SetInitialChildList(aPresContext, nsnull, nsnull);
|
||||
|
||||
// Set nsColFrame-specific information
|
||||
|
|
|
@ -290,7 +290,8 @@ nsTableFrame::nsTableFrame()
|
|||
NS_IMETHODIMP
|
||||
nsTableFrame::Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aGeometricParent,
|
||||
nsIFrame* aContentParent,
|
||||
nsIStyleContext* aContext)
|
||||
{
|
||||
float p2t = aPresContext.GetPixelsToTwips();
|
||||
|
@ -298,7 +299,8 @@ nsTableFrame::Init(nsIPresContext& aPresContext,
|
|||
mDefaultCellSpacingY = NSIntPixelsToTwips(2, p2t);
|
||||
mDefaultCellPadding = NSIntPixelsToTwips(1, p2t);
|
||||
|
||||
return nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext);
|
||||
return nsHTMLContainerFrame::Init(aPresContext, aContent, aGeometricParent,
|
||||
aContentParent, aContext);
|
||||
}
|
||||
|
||||
|
||||
|
@ -726,7 +728,7 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext)
|
|||
// Create a col group frame
|
||||
nsIFrame* newFrame;
|
||||
NS_NewTableColGroupFrame(newFrame);
|
||||
newFrame->Init(aPresContext, lastColGroupElement, this, colGroupStyleContext);
|
||||
newFrame->Init(aPresContext, lastColGroupElement, this, this, colGroupStyleContext);
|
||||
lastColGroupFrame = (nsTableColGroupFrame*)newFrame;
|
||||
NS_RELEASE(colGroupStyleContext); // kidStyleContenxt: REFCNT--
|
||||
|
||||
|
@ -758,7 +760,8 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext)
|
|||
lastColGroupStyle,
|
||||
PR_TRUE); // colStyleContext: REFCNT++
|
||||
NS_NewTableColFrame(colFrame);
|
||||
colFrame->Init(aPresContext, lastColGroupElement, lastColGroupFrame, colStyleContext);
|
||||
colFrame->Init(aPresContext, lastColGroupElement, lastColGroupFrame,
|
||||
lastColGroupFrame, colStyleContext);
|
||||
NS_RELEASE(colStyleContext);
|
||||
colFrame->SetInitialChildList(aPresContext, nsnull, nsnull);
|
||||
|
||||
|
@ -4197,7 +4200,7 @@ nsTableFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->AppendToFlow(this);
|
||||
if (PR_TRUE==gsDebug) printf("nsTableFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf);
|
||||
// set my width, because all frames in a table flow are the same width
|
||||
|
@ -4229,7 +4232,7 @@ nsTableFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
|
||||
nsIFrame* duplicateFrame;
|
||||
NS_NewTableRowGroupFrame(duplicateFrame);
|
||||
duplicateFrame->Init(aPresContext, content, cf, kidStyleContext);
|
||||
duplicateFrame->Init(aPresContext, content, cf, cf, kidStyleContext);
|
||||
NS_RELEASE(kidStyleContext); // kidStyleContenxt: REFCNT--
|
||||
|
||||
if (nsnull==lastSib)
|
||||
|
|
|
@ -80,7 +80,8 @@ public:
|
|||
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aGeometricParent,
|
||||
nsIFrame* aContentParent,
|
||||
nsIStyleContext* aContext);
|
||||
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
*/
|
||||
#include "nsTableOuterFrame.h"
|
||||
#include "nsTableFrame.h"
|
||||
#include "nsBodyFrame.h"
|
||||
#include "nsIReflowCommand.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
|
@ -1142,7 +1141,7 @@ nsTableOuterFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->AppendToFlow(this);
|
||||
if (PR_TRUE==gsDebug)
|
||||
printf("nsTableOuterFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf);
|
||||
|
|
|
@ -1439,7 +1439,7 @@ nsTableRowFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->AppendToFlow(this);
|
||||
cf->SetRowIndex(GetRowIndex());
|
||||
|
||||
|
|
|
@ -1399,7 +1399,7 @@ nsTableRowGroupFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
|||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext);
|
||||
cf->AppendToFlow(this);
|
||||
if (PR_TRUE==gsDebug) printf("nsTableRowGroupFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf);
|
||||
aContinuingFrame = cf;
|
||||
|
|
Загрузка…
Ссылка в новой задаче