Bug 330934. Set a nsIFrame's stylecontext in its constructor, to ensure that there's always one available for GetPresContext() to use even if Init hasn't been called. Patch by Marc Liddell, r+sr=roc

git-svn-id: svn://10.0.0.236/trunk@193022 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
roc+%cs.cmu.edu 2006-03-26 21:30:36 +00:00
parent cbf12a16e3
commit 140fbb3377
228 changed files with 1576 additions and 1768 deletions

View File

@ -65,7 +65,7 @@ static const PRUnichar ALEF = 0x05D0;
// Note: The above code are moved from gfx/src/windows/nsRenderingContextWin.cpp
nsIFrame*
NS_NewDirectionalFrame(nsIPresShell* aPresShell, PRUnichar aChar);
NS_NewDirectionalFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUnichar aChar);
nsBidiPresUtils::nsBidiPresUtils() : mArraySize(8),
mIndexMap(nsnull),
@ -224,6 +224,7 @@ nsBidiPresUtils::Resolve(nsPresContext* aPresContext,
mContentToFrameIndex.Clear();
nsIPresShell* shell = aPresContext->PresShell();
nsStyleContext* styleContext = aBlockFrame->GetStyleContext();
// handle bidi-override being set on the block itself before calling
// InitLogicalArray.
@ -234,10 +235,10 @@ nsBidiPresUtils::Resolve(nsPresContext* aPresContext,
nsIFrame *directionalFrame = nsnull;
if (NS_STYLE_DIRECTION_RTL == vis->mDirection) {
directionalFrame = NS_NewDirectionalFrame(shell, kRLO);
directionalFrame = NS_NewDirectionalFrame(shell, styleContext, kRLO);
}
else if (NS_STYLE_DIRECTION_LTR == vis->mDirection) {
directionalFrame = NS_NewDirectionalFrame(shell, kLRO);
directionalFrame = NS_NewDirectionalFrame(shell, styleContext, kLRO);
}
if (directionalFrame) {
@ -247,7 +248,7 @@ nsBidiPresUtils::Resolve(nsPresContext* aPresContext,
mSuccess = InitLogicalArray(aPresContext, aFirstChild, nsnull, PR_TRUE);
if (text->mUnicodeBidi == NS_STYLE_UNICODE_BIDI_OVERRIDE) {
nsIFrame* directionalFrame = NS_NewDirectionalFrame(shell, kPDF);
nsIFrame* directionalFrame = NS_NewDirectionalFrame(shell, styleContext, kPDF);
if (directionalFrame) {
mLogicalFrames.AppendElement(directionalFrame);
}
@ -465,15 +466,16 @@ nsBidiPresUtils::InitLogicalArray(nsPresContext* aPresContext,
nsIFrame* frame;
nsIFrame* directionalFrame;
nsresult res = NS_OK;
nsIPresShell* shell = aPresContext->PresShell();
nsStyleContext* styleContext;
for (frame = aCurrentFrame;
frame && frame != aNextInFlow;
frame = frame->GetNextSibling()) {
directionalFrame = nsnull;
const nsStyleDisplay* display = frame->GetStyleDisplay();
if (aAddMarkers && !display->IsBlockLevel() ) {
const nsStyleVisibility* vis = frame->GetStyleVisibility();
const nsStyleTextReset* text = frame->GetStyleTextReset();
@ -481,19 +483,23 @@ nsBidiPresUtils::InitLogicalArray(nsPresContext* aPresContext,
case NS_STYLE_UNICODE_BIDI_NORMAL:
break;
case NS_STYLE_UNICODE_BIDI_EMBED:
styleContext = frame->GetStyleContext();
if (NS_STYLE_DIRECTION_RTL == vis->mDirection) {
directionalFrame = NS_NewDirectionalFrame(shell, kRLE);
directionalFrame = NS_NewDirectionalFrame(shell, styleContext, kRLE);
}
else if (NS_STYLE_DIRECTION_LTR == vis->mDirection) {
directionalFrame = NS_NewDirectionalFrame(shell, kLRE);
directionalFrame = NS_NewDirectionalFrame(shell, styleContext, kLRE);
}
break;
case NS_STYLE_UNICODE_BIDI_OVERRIDE:
styleContext = frame->GetStyleContext();
if (NS_STYLE_DIRECTION_RTL == vis->mDirection) {
directionalFrame = NS_NewDirectionalFrame(shell, kRLO);
directionalFrame = NS_NewDirectionalFrame(shell, styleContext, kRLO);
}
else if (NS_STYLE_DIRECTION_LTR == vis->mDirection) {
directionalFrame = NS_NewDirectionalFrame(shell, kLRO);
directionalFrame = NS_NewDirectionalFrame(shell, styleContext, kLRO);
}
break;
}
@ -524,7 +530,7 @@ nsBidiPresUtils::InitLogicalArray(nsPresContext* aPresContext,
// If the element is attributed by dir, indicate direction pop (add PDF frame)
if (directionalFrame) {
directionalFrame = NS_NewDirectionalFrame(shell, kPDF);
directionalFrame = NS_NewDirectionalFrame(shell, styleContext, kPDF);
// Create a directional frame after the last frame of an
// element specifying embedding or override

File diff suppressed because it is too large Load Diff

View File

@ -211,7 +211,6 @@ private:
nsresult InitAndRestoreFrame (const nsFrameConstructorState& aState,
nsIContent* aContent,
nsIFrame* aParentFrame,
nsStyleContext* aStyleContext,
nsIFrame* aPrevInFlow,
nsIFrame* aNewFrame,
PRBool aAllowCounters = PR_TRUE);
@ -672,7 +671,7 @@ private:
nsFrameItems& aFrameItems);
// A function that can be invoked to create some sort of image frame.
typedef nsIFrame* (* ImageFrameCreatorFunc)(nsIPresShell*);
typedef nsIFrame* (* ImageFrameCreatorFunc)(nsIPresShell*, nsStyleContext*);
/**
* CreateHTMLImageFrame will do some tests on aContent, and if it determines

View File

@ -198,9 +198,9 @@ NS_IMPL_ISUPPORTS1(nsComboButtonListener, nsIDOMMouseListener)
nsComboboxControlFrame * nsComboboxControlFrame::mFocused = nsnull;
nsIFrame*
NS_NewComboboxControlFrame(nsIPresShell* aPresShell, PRUint32 aStateFlags)
NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aStateFlags)
{
nsComboboxControlFrame* it = new (aPresShell) nsComboboxControlFrame;
nsComboboxControlFrame* it = new (aPresShell) nsComboboxControlFrame(aContext);
if (it) {
// set the state flags (if any are provided)
@ -317,8 +317,8 @@ if (aReflowState.mComputedWidth != NS_UNCONSTRAINEDSIZE) { \
//-- Done with macros
//------------------------------------------------------
nsComboboxControlFrame::nsComboboxControlFrame()
: nsAreaFrame()
nsComboboxControlFrame::nsComboboxControlFrame(nsStyleContext* aContext)
: nsAreaFrame(aContext)
{
mListControlFrame = nsnull;
mDroppedDown = PR_FALSE;
@ -1905,12 +1905,12 @@ nsComboboxControlFrame::CreateFrameFor(nsPresContext* aPresContext,
}
// Start by by creating our anonymous block frame
mDisplayFrame = NS_NewBlockFrame(shell, NS_BLOCK_SPACE_MGR);
mDisplayFrame = NS_NewBlockFrame(shell, styleContext, NS_BLOCK_SPACE_MGR);
if (NS_UNLIKELY(!mDisplayFrame)) {
return NS_ERROR_OUT_OF_MEMORY;
}
nsresult rv = mDisplayFrame->Init(mContent, this, styleContext, nsnull);
nsresult rv = mDisplayFrame->Init(mContent, this, nsnull);
if (NS_FAILED(rv)) {
mDisplayFrame->Destroy(aPresContext);
mDisplayFrame = nsnull;
@ -1918,13 +1918,13 @@ nsComboboxControlFrame::CreateFrameFor(nsPresContext* aPresContext,
}
// Create a text frame and put it inside the block frame
mTextFrame = NS_NewTextFrame(shell);
mTextFrame = NS_NewTextFrame(shell, textStyleContext);
if (NS_UNLIKELY(!mTextFrame)) {
return NS_ERROR_OUT_OF_MEMORY;
}
// initialize the text frame
rv = mTextFrame->Init(aContent, mDisplayFrame, textStyleContext, nsnull);
rv = mTextFrame->Init(aContent, mDisplayFrame, nsnull);
if (NS_FAILED(rv)) {
mDisplayFrame->Destroy(aPresContext);
mDisplayFrame = nsnull;

View File

@ -86,10 +86,10 @@ class nsComboboxControlFrame : public nsAreaFrame,
public nsIStatefulFrame
{
public:
friend nsIFrame* NS_NewComboboxControlFrame(nsIPresShell* aPresShell, PRUint32 aFlags);
friend nsIFrame* NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags);
friend class RedisplayTextEvent;
nsComboboxControlFrame();
nsComboboxControlFrame(nsStyleContext* aContext);
~nsComboboxControlFrame();
// nsISupports

View File

@ -68,7 +68,7 @@ class nsLegendFrame;
class nsFieldSetFrame : public nsHTMLContainerFrame {
public:
nsFieldSetFrame();
nsFieldSetFrame(nsStyleContext* aContext);
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
@ -120,13 +120,13 @@ protected:
};
nsIFrame*
NS_NewFieldSetFrame(nsIPresShell* aPresShell)
NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsFieldSetFrame;
return new (aPresShell) nsFieldSetFrame(aContext);
}
nsFieldSetFrame::nsFieldSetFrame()
: nsHTMLContainerFrame()
nsFieldSetFrame::nsFieldSetFrame(nsStyleContext* aContext)
: nsHTMLContainerFrame(aContext)
{
mContentFrame = nsnull;
mLegendFrame = nsnull;

View File

@ -77,12 +77,13 @@
#define SYNC_BOTH 0x3
nsIFrame*
NS_NewFileControlFrame(nsIPresShell* aPresShell)
NS_NewFileControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsFileControlFrame();
return new (aPresShell) nsFileControlFrame(aContext);
}
nsFileControlFrame::nsFileControlFrame():
nsFileControlFrame::nsFileControlFrame(nsStyleContext* aContext):
nsAreaFrame(aContext),
mTextFrame(nsnull),
mCachedState(nsnull),
mDidPreDestroy(PR_FALSE)

View File

@ -56,17 +56,9 @@ class nsFileControlFrame : public nsAreaFrame,
public nsIAnonymousContentCreator
{
public:
nsFileControlFrame();
nsFileControlFrame(nsStyleContext* aContext);
virtual ~nsFileControlFrame();
// XXX Hack so we can squirrel away the pres context pointer
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow) {
return nsAreaFrame::Init(aContent, aParent, aContext, aPrevInFlow);
}
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists);

View File

@ -46,9 +46,10 @@
const PRInt32 kSizeNotSet = -1;
nsFormControlFrame::nsFormControlFrame()
nsFormControlFrame::nsFormControlFrame(nsStyleContext* aContext) :
nsLeafFrame(aContext),
mDidInit(PR_FALSE)
{
mDidInit = PR_FALSE;
}
nsFormControlFrame::~nsFormControlFrame()

View File

@ -80,7 +80,7 @@ public:
* @param aContent the content representing this frame
* @param aParentFrame the parent frame
*/
nsFormControlFrame();
nsFormControlFrame(nsStyleContext*);
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);

View File

@ -60,15 +60,16 @@
const nscoord kSuggestedNotSet = -1;
nsGfxButtonControlFrame::nsGfxButtonControlFrame():
mSuggestedSize(kSuggestedNotSet, kSuggestedNotSet)
nsGfxButtonControlFrame::nsGfxButtonControlFrame(nsStyleContext* aContext):
nsHTMLButtonControlFrame(aContext),
mSuggestedSize(kSuggestedNotSet, kSuggestedNotSet)
{
}
nsIFrame*
NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell)
NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsGfxButtonControlFrame;
return new (aPresShell) nsGfxButtonControlFrame(aContext);
}
nsIAtom*
@ -143,19 +144,19 @@ nsGfxButtonControlFrame::CreateFrameFor(nsPresContext* aPresContext,
nsIFrame * parentFrame = mFrames.FirstChild();
nsStyleContext* styleContext = parentFrame->GetStyleContext();
newFrame = NS_NewTextFrame(aPresContext->PresShell());
if (NS_UNLIKELY(!newFrame)) {
return NS_ERROR_OUT_OF_MEMORY;
}
nsRefPtr<nsStyleContext> textStyleContext;
textStyleContext = aPresContext->StyleSet()->
ResolveStyleForNonElement(styleContext);
if (!textStyleContext) { return NS_ERROR_NULL_POINTER; }
if (styleContext) {
newFrame = NS_NewTextFrame(aPresContext->PresShell(), textStyleContext);
if (NS_UNLIKELY(!newFrame)) {
return NS_ERROR_OUT_OF_MEMORY;
}
// initialize the text frame
newFrame->Init(content, parentFrame, textStyleContext, nsnull);
newFrame->Init(content, parentFrame, nsnull);
newFrame->SetInitialChildList(aPresContext, nsnull, nsnull);
rv = NS_OK;
}

View File

@ -57,7 +57,7 @@ class nsGfxButtonControlFrame : public nsHTMLButtonControlFrame,
public nsIAnonymousContentCreator
{
public:
nsGfxButtonControlFrame();
nsGfxButtonControlFrame(nsStyleContext* aContext);
//nsIFrame
NS_IMETHOD Reflow(nsPresContext* aCX,

View File

@ -58,16 +58,16 @@
//------------------------------------------------------------
nsIFrame*
NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell)
NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsGfxCheckboxControlFrame;
return new (aPresShell) nsGfxCheckboxControlFrame(aContext);
}
//------------------------------------------------------------
// Initialize GFX-rendered state
nsGfxCheckboxControlFrame::nsGfxCheckboxControlFrame()
: mCheckButtonFaceStyle(nsnull)
nsGfxCheckboxControlFrame::nsGfxCheckboxControlFrame(nsStyleContext* aContext)
: nsFormControlFrame(aContext), mCheckButtonFaceStyle(nsnull)
{
}

View File

@ -56,7 +56,7 @@ public:
//NS_DECL_NSIACCESSIBLE
nsGfxCheckboxControlFrame();
nsGfxCheckboxControlFrame(nsStyleContext* aContext);
virtual ~nsGfxCheckboxControlFrame();
#ifdef DEBUG

View File

@ -55,12 +55,13 @@
#include "nsDisplayList.h"
nsIFrame*
NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell)
NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsGfxRadioControlFrame;
return new (aPresShell) nsGfxRadioControlFrame(aContext);
}
nsGfxRadioControlFrame::nsGfxRadioControlFrame()
nsGfxRadioControlFrame::nsGfxRadioControlFrame(nsStyleContext* aContext):
nsFormControlFrame(aContext)
{
// Initialize GFX-rendered state
mRadioButtonFaceStyle = nsnull;

View File

@ -57,7 +57,7 @@ class nsGfxRadioControlFrame : public nsFormControlFrame,
private:
public:
nsGfxRadioControlFrame();
nsGfxRadioControlFrame(nsStyleContext* aContext);
~nsGfxRadioControlFrame();
//nsIRadioControlFrame methods

View File

@ -73,13 +73,13 @@
#include "nsDisplayList.h"
nsIFrame*
NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell)
NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsHTMLButtonControlFrame;
return new (aPresShell) nsHTMLButtonControlFrame(aContext);
}
nsHTMLButtonControlFrame::nsHTMLButtonControlFrame()
: nsHTMLContainerFrame()
nsHTMLButtonControlFrame::nsHTMLButtonControlFrame(nsStyleContext* aContext)
: nsHTMLContainerFrame(aContext)
{
mCacheSize.width = -1;
mCacheSize.height = -1;
@ -101,11 +101,10 @@ NS_IMETHODIMP
nsHTMLButtonControlFrame::Init(
nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsHTMLContainerFrame::Init(aContent, aParent, aContext, aPrevInFlow);
mRenderer.SetFrame(this,GetPresContext());
nsresult rv = nsHTMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
mRenderer.SetFrame(this, GetPresContext());
return rv;
}

View File

@ -60,7 +60,7 @@ class nsHTMLButtonControlFrame : public nsHTMLContainerFrame,
public nsIFormControlFrame
{
public:
nsHTMLButtonControlFrame();
nsHTMLButtonControlFrame(nsStyleContext* aContext);
~nsHTMLButtonControlFrame();
@ -85,7 +85,6 @@ public:
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* asPrevInFlow);
virtual nsStyleContext* GetAdditionalStyleContext(PRInt32 aIndex) const;

View File

@ -69,7 +69,7 @@ class nsImageControlFrame : public nsImageControlFrameSuper,
public nsIImageControlFrame
{
public:
nsImageControlFrame();
nsImageControlFrame(nsStyleContext* aContext);
~nsImageControlFrame();
NS_IMETHOD Destroy(nsPresContext *aPresContext);
@ -115,7 +115,8 @@ protected:
};
nsImageControlFrame::nsImageControlFrame()
nsImageControlFrame::nsImageControlFrame(nsStyleContext* aContext):
nsImageControlFrameSuper(aContext)
{
mLastClickPoint = nsPoint(0,0);
}
@ -133,9 +134,9 @@ nsImageControlFrame::Destroy(nsPresContext *aPresContext)
}
nsIFrame*
NS_NewImageControlFrame(nsIPresShell* aPresShell)
NS_NewImageControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsImageControlFrame;
return new (aPresShell) nsImageControlFrame(aContext);
}
// Frames are not refcounted, no need to AddRef

View File

@ -83,12 +83,13 @@
static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
nsIFrame*
NS_NewIsIndexFrame(nsIPresShell* aPresShell)
NS_NewIsIndexFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsIsIndexFrame();
return new (aPresShell) nsIsIndexFrame(aContext);
}
nsIsIndexFrame::nsIsIndexFrame()
nsIsIndexFrame::nsIsIndexFrame(nsStyleContext* aContext) :
nsAreaFrame(aContext)
{
//Shrink the area around its contents
SetFlags(NS_BLOCK_SHRINK_WRAP | NS_BLOCK_SPACE_MGR);

View File

@ -57,17 +57,9 @@ class nsIsIndexFrame : public nsAreaFrame,
public nsIStatefulFrame
{
public:
nsIsIndexFrame();
nsIsIndexFrame(nsStyleContext* aContext);
virtual ~nsIsIndexFrame();
// XXX Hack so we can squirrel away the pres context pointer for the KeyPress method
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow) {
return nsAreaFrame::Init(aContent, aParent, aContext, aPrevInFlow);
}
/**
* Processes a key pressed event
* @param aKeyEvent @see nsIDOMEvent.h

View File

@ -56,9 +56,9 @@
static NS_DEFINE_IID(kLegendFrameCID, NS_LEGEND_FRAME_CID);
nsIFrame*
NS_NewLegendFrame(nsIPresShell* aPresShell)
NS_NewLegendFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
nsIFrame* f = new (aPresShell) nsLegendFrame;
nsIFrame* f = new (aPresShell) nsLegendFrame(aContext);
if (f) {
f->AddStateBits(NS_BLOCK_SPACE_MGR | NS_BLOCK_MARGIN_ROOT);
}

View File

@ -54,6 +54,7 @@ struct nsRect;
class nsLegendFrame : public nsAreaFrame {
public:
nsLegendFrame(nsStyleContext* aContext) : nsAreaFrame(aContext) {}
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);

View File

@ -155,10 +155,10 @@ private:
//---------------------------------------------------------
nsIFrame*
NS_NewListControlFrame(nsIPresShell* aPresShell)
NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
nsListControlFrame* it =
new (aPresShell) nsListControlFrame(aPresShell, aPresShell->GetDocument());
new (aPresShell) nsListControlFrame(aPresShell, aPresShell->GetDocument(), aContext);
if (it) {
it->AddStateBits(NS_FRAME_INDEPENDENT_SELECTION);
@ -275,9 +275,9 @@ if (aReflowState.mComputedWidth != NS_UNCONSTRAINEDSIZE) { \
//------------------------------------------------------
//---------------------------------------------------------
nsListControlFrame::nsListControlFrame(nsIPresShell* aShell,
nsIDocument* aDocument)
: nsHTMLScrollFrame(aShell, PR_FALSE)
nsListControlFrame::nsListControlFrame(
nsIPresShell* aShell, nsIDocument* aDocument, nsStyleContext* aContext)
: nsHTMLScrollFrame(aShell, aContext, PR_FALSE)
{
mComboboxFrame = nsnull;
mChangesSinceDragStart = PR_FALSE;
@ -1435,10 +1435,9 @@ nsListControlFrame::GetSizeAttribute(PRInt32 *aSize) {
NS_IMETHODIMP
nsListControlFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult result = nsHTMLScrollFrame::Init(aContent, aParent, aContext, aPrevInFlow);
nsresult result = nsHTMLScrollFrame::Init(aContent, aParent, aPrevInFlow);
// get the receiver interface from the browser button's content node
nsCOMPtr<nsIDOMEventReceiver> receiver(do_QueryInterface(mContent));

View File

@ -79,7 +79,7 @@ class nsListControlFrame : public nsHTMLScrollFrame,
public nsISelectControlFrame
{
public:
friend nsIFrame* NS_NewListControlFrame(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
// nsISupports
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
@ -100,7 +100,6 @@ public:
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD DidReflow(nsPresContext* aPresContext,
@ -210,7 +209,7 @@ protected:
PRInt32 aNumOptions, PRInt32 aDoAdjustInc, PRInt32 aDoAdjustIncNext);
virtual void ResetList(PRBool aAllowScrolling);
nsListControlFrame(nsIPresShell* aShell, nsIDocument* aDocument);
nsListControlFrame(nsIPresShell* aShell, nsIDocument* aDocument, nsStyleContext* aContext);
virtual ~nsListControlFrame();
// Utility methods

View File

@ -43,9 +43,9 @@
#include "nsDisplayList.h"
nsIFrame*
NS_NewSelectsAreaFrame(nsIPresShell* aShell, PRUint32 aFlags)
NS_NewSelectsAreaFrame(nsIPresShell* aShell, nsStyleContext* aContext, PRUint32 aFlags)
{
nsSelectsAreaFrame* it = new (aShell) nsSelectsAreaFrame;
nsSelectsAreaFrame* it = new (aShell) nsSelectsAreaFrame(aContext);
if (it) {
// We need NS_BLOCK_SPACE_MGR to ensure that the options inside the select

View File

@ -49,7 +49,7 @@ class nsIContent;
class nsSelectsAreaFrame : public nsAreaFrame
{
public:
friend nsIFrame* NS_NewSelectsAreaFrame(nsIPresShell* aShell, PRUint32 aFlags);
friend nsIFrame* NS_NewSelectsAreaFrame(nsIPresShell* aShell, nsStyleContext* aContext, PRUint32 aFlags);
// nsISupports
//NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
@ -64,6 +64,9 @@ public:
static PRBool IsOptionElement(nsIContent* aContent);
static PRBool IsOptionElementFrame(nsIFrame *aFrame);
protected:
nsSelectsAreaFrame(nsStyleContext* aContext) : nsAreaFrame(aContext) {}
};
#endif /* nsSelectsAreaFrame_h___ */

View File

@ -943,9 +943,9 @@ nsTextInputSelectionImpl::CheckVisibility(nsIDOMNode *node, PRInt16 startOffset,
}
nsIFrame*
NS_NewTextControlFrame(nsIPresShell* aPresShell)
NS_NewTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsTextControlFrame(aPresShell);
return new (aPresShell) nsTextControlFrame(aPresShell, aContext);
}
NS_IMPL_ADDREF_INHERITED(nsTextControlFrame, nsBoxFrame)
@ -995,8 +995,8 @@ NS_IMETHODIMP nsTextControlFrame::GetAccessible(nsIAccessible** aAccessible)
}
#endif
nsTextControlFrame::nsTextControlFrame(nsIPresShell* aShell)
: nsStackFrame(aShell)
nsTextControlFrame::nsTextControlFrame(nsIPresShell* aShell, nsStyleContext* aContext)
: nsStackFrame(aShell, aContext)
{
mUseEditor = PR_FALSE;
mIsProcessing = PR_FALSE;

View File

@ -72,7 +72,7 @@ class nsTextControlFrame : public nsStackFrame,
{
public:
nsTextControlFrame(nsIPresShell* aShell);
nsTextControlFrame(nsIPresShell* aShell, nsStyleContext* aContext);
virtual ~nsTextControlFrame();
virtual void RemovedAsPrimaryFrame(nsPresContext* aPresContext);

View File

@ -56,9 +56,9 @@
#undef NOISY_FINAL_SIZE
nsIFrame*
NS_NewAreaFrame(nsIPresShell* aPresShell, PRUint32 aFlags)
NS_NewAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags)
{
nsAreaFrame* it = new (aPresShell) nsAreaFrame;
nsAreaFrame* it = new (aPresShell) nsAreaFrame(aContext);
if (it != nsnull)
it->SetFlags(aFlags);
@ -66,10 +66,6 @@ NS_NewAreaFrame(nsIPresShell* aPresShell, PRUint32 aFlags)
return it;
}
nsAreaFrame::nsAreaFrame()
{
}
#ifdef MOZ_XUL
// If you make changes to this function, check its counterparts
@ -122,13 +118,9 @@ nsAreaFrame::RegUnregAccessKey(nsPresContext* aPresContext,
NS_IMETHODIMP
nsAreaFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsBlockFrame::Init(aContent,
aParent,
aContext,
aPrevInFlow);
nsresult rv = nsBlockFrame::Init(aContent, aParent, aPrevInFlow);
if (NS_FAILED(rv))
return rv;

View File

@ -53,14 +53,13 @@ struct nsStylePosition;
class nsAreaFrame : public nsBlockFrame
{
public:
friend nsIFrame* NS_NewAreaFrame(nsIPresShell* aPresShell, PRUint32 aFlags);
friend nsIFrame* NS_NewAreaFrame(nsIPresShell* aPresShell, nsStyleContext *aContext, PRUint32 aFlags);
// nsIFrame
#ifdef MOZ_XUL
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
@ -82,7 +81,7 @@ public:
#endif
protected:
nsAreaFrame();
nsAreaFrame(nsStyleContext *aContext) : nsBlockFrame(aContext) {}
#ifdef MOZ_XUL
nsresult RegUnregAccessKey(nsPresContext* aPresContext,

View File

@ -53,6 +53,8 @@
class BRFrame : public nsFrame {
public:
friend nsIFrame* NS_NewBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
virtual ContentOffsets CalcContentOffsetsFromFramePoint(nsPoint aPoint);
NS_IMETHOD PeekOffset(nsPresContext* aPresContext,
@ -65,13 +67,14 @@ public:
virtual nsIAtom* GetType() const;
protected:
BRFrame(nsStyleContext* aContext) : nsFrame(aContext) {}
virtual ~BRFrame();
};
nsIFrame*
NS_NewBRFrame(nsIPresShell* aPresShell)
NS_NewBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) BRFrame;
return new (aPresShell) BRFrame(aContext);
}
BRFrame::~BRFrame()

View File

@ -42,8 +42,8 @@
#include "nsLayoutAtoms.h"
nsDirectionalFrame::nsDirectionalFrame(PRUnichar aChar)
: mChar(aChar)
nsDirectionalFrame::nsDirectionalFrame(nsStyleContext* aContext, PRUnichar aChar)
: nsFrame(aContext), mChar(aChar)
{
}
@ -84,9 +84,9 @@ nsDirectionalFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
}
nsIFrame*
NS_NewDirectionalFrame(nsIPresShell* aPresShell, PRUnichar aChar)
NS_NewDirectionalFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUnichar aChar)
{
return new (aPresShell) nsDirectionalFrame(aChar);
return new (aPresShell) nsDirectionalFrame(aContext, aChar);
}
#endif /* IBMBIDI */

View File

@ -55,7 +55,7 @@ protected:
virtual ~nsDirectionalFrame();
public:
nsDirectionalFrame(PRUnichar aChar);
nsDirectionalFrame(nsStyleContext* aContext, PRUnichar aChar);
NS_DECLARE_STATIC_IID_ACCESSOR(NS_DIRECTIONAL_FRAME_IID)

View File

@ -263,22 +263,15 @@ RecordReflowStatus(PRBool aChildIsBlock, nsReflowStatus aFrameReflowStatus)
const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID;
nsIFrame*
NS_NewBlockFrame(nsIPresShell* aPresShell, PRUint32 aFlags)
NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags)
{
nsBlockFrame* it = new (aPresShell) nsBlockFrame;
nsBlockFrame* it = new (aPresShell) nsBlockFrame(aContext);
if (it) {
it->SetFlags(aFlags);
}
return it;
}
nsBlockFrame::nsBlockFrame()
{
#ifdef DEBUG
InitDebugFlags();
#endif
}
nsBlockFrame::~nsBlockFrame()
{
}
@ -6639,7 +6632,6 @@ nsBlockFrame::VerifyTree() const
NS_IMETHODIMP
nsBlockFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
if (aPrevInFlow) {
@ -6649,7 +6641,7 @@ nsBlockFrame::Init(nsIContent* aContent,
SetFlags(blockFrame->mState & NS_BLOCK_FLAGS_MASK);
}
nsresult rv = nsBlockFrameSuper::Init(aContent, aParent, aContext, aPrevInFlow);
nsresult rv = nsBlockFrameSuper::Init(aContent, aParent, aPrevInFlow);
if (IsBoxWrapped())
mState |= NS_BLOCK_SPACE_MGR;
@ -6716,12 +6708,11 @@ nsBlockFrame::SetInitialChildList(nsPresContext* aPresContext,
ResolvePseudoStyleFor(mContent, pseudoElement, mStyleContext);
// Create bullet frame
nsBulletFrame* bullet = new (shell) nsBulletFrame;
nsBulletFrame* bullet = new (shell) nsBulletFrame(kidSC);
if (nsnull == bullet) {
return NS_ERROR_OUT_OF_MEMORY;
}
bullet->Init(mContent, this, kidSC, nsnull);
bullet->Init(mContent, this, nsnull);
// If the list bullet frame should be positioned inside then add
// it to the flow now.

View File

@ -131,7 +131,7 @@ public:
const_reverse_line_iterator rbegin_lines() const { return mLines.rbegin(); }
const_reverse_line_iterator rend_lines() const { return mLines.rend(); }
friend nsIFrame* NS_NewBlockFrame(nsIPresShell* aPresShell, PRUint32 aFlags);
friend nsIFrame* NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags);
// nsISupports
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
@ -139,7 +139,6 @@ public:
// nsIFrame
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
@ -252,7 +251,12 @@ public:
nsBlockReflowState& aState, nsLineBox* aLine);
protected:
nsBlockFrame();
nsBlockFrame(nsStyleContext* aContext) : nsHTMLContainerFrame(aContext)
{
#ifdef DEBUG
InitDebugFlags();
#endif
}
virtual ~nsBlockFrame();
already_AddRefed<nsStyleContext> GetFirstLetterStyle(nsPresContext* aPresContext)

View File

@ -85,10 +85,6 @@ private:
nsBulletFrame::nsBulletFrame()
{
}
nsBulletFrame::~nsBulletFrame()
{
}

View File

@ -50,7 +50,7 @@ class gfxIImageFrame;
*/
class nsBulletFrame : public nsFrame {
public:
nsBulletFrame();
nsBulletFrame(nsStyleContext* aContext) : nsFrame(aContext) {}
virtual ~nsBulletFrame();
// nsIFrame

View File

@ -50,7 +50,7 @@
class nsColumnSetFrame : public nsHTMLContainerFrame {
public:
nsColumnSetFrame();
nsColumnSetFrame(nsStyleContext* aContext);
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
@ -143,9 +143,9 @@ protected:
* XXX should we support CSS columns applied to table elements?
*/
nsIFrame*
NS_NewColumnSetFrame(nsIPresShell* aPresShell, PRUint32 aStateFlags)
NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aStateFlags)
{
nsColumnSetFrame* it = new (aPresShell) nsColumnSetFrame;
nsColumnSetFrame* it = new (aPresShell) nsColumnSetFrame(aContext);
if (it) {
// set the state flags (if any are provided)
it->AddStateBits(aStateFlags);
@ -154,8 +154,8 @@ NS_NewColumnSetFrame(nsIPresShell* aPresShell, PRUint32 aStateFlags)
return it;
}
nsColumnSetFrame::nsColumnSetFrame()
: nsHTMLContainerFrame(), mLastBalanceHeight(NS_INTRINSICSIZE),
nsColumnSetFrame::nsColumnSetFrame(nsStyleContext* aContext)
: nsHTMLContainerFrame(aContext), mLastBalanceHeight(NS_INTRINSICSIZE),
mLastFrameStatus(NS_FRAME_COMPLETE)
{
}

View File

@ -70,10 +70,6 @@
#undef NOISY
#endif
nsContainerFrame::nsContainerFrame()
{
}
nsContainerFrame::~nsContainerFrame()
{
}
@ -81,11 +77,9 @@ nsContainerFrame::~nsContainerFrame()
NS_IMETHODIMP
nsContainerFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv;
rv = nsSplittableFrame::Init(aContent, aParent, aContext, aPrevInFlow);
nsresult rv = nsSplittableFrame::Init(aContent, aParent, aPrevInFlow);
if (aPrevInFlow) {
// Make sure we copy bits from our prev-in-flow that will affect
// us. A continuation for a container frame needs to know if it

View File

@ -56,7 +56,6 @@ public:
// nsIFrame overrides
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
@ -185,7 +184,7 @@ public:
const nsDisplayListSet& aLists);
protected:
nsContainerFrame();
nsContainerFrame(nsStyleContext* aContext) : nsSplittableFrame(aContext) {}
~nsContainerFrame();
/**

View File

@ -50,11 +50,10 @@
class nsFirstLetterFrame : public nsFirstLetterFrameSuper {
public:
nsFirstLetterFrame();
nsFirstLetterFrame(nsStyleContext* aContext) : nsHTMLContainerFrame(aContext) {}
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
@ -85,13 +84,9 @@ protected:
};
nsIFrame*
NS_NewFirstLetterFrame(nsIPresShell* aPresShell)
{
return new (aPresShell) nsFirstLetterFrame;
}
nsFirstLetterFrame::nsFirstLetterFrame()
NS_NewFirstLetterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsFirstLetterFrame(aContext);
}
#ifdef NS_DEBUG
@ -117,7 +112,6 @@ nsFirstLetterFrame::GetSkipSides() const
NS_IMETHODIMP
nsFirstLetterFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsRefPtr<nsStyleContext> newSC;
@ -125,16 +119,16 @@ nsFirstLetterFrame::Init(nsIContent* aContent,
// Get proper style context for ourselves. We're creating the frame
// that represents everything *except* the first letter, so just create
// a style context like we would for a text node.
nsStyleContext* parentStyleContext = aContext->GetParent();
nsStyleContext* parentStyleContext = mStyleContext->GetParent();
if (parentStyleContext) {
newSC = aContext->GetRuleNode()->GetPresContext()->StyleSet()->
newSC = mStyleContext->GetRuleNode()->GetPresContext()->StyleSet()->
ResolveStyleForNonElement(parentStyleContext);
if (newSC)
aContext = newSC;
SetStyleContextWithoutNotification(newSC);
}
}
return nsFirstLetterFrameSuper::Init(aContent, aParent, aContext, aPrevInFlow);
return nsFirstLetterFrameSuper::Init(aContent, aParent, aPrevInFlow);
}
NS_IMETHODIMP

View File

@ -450,9 +450,9 @@ void SetFontFromStyle(nsIRenderingContext* aRC, nsStyleContext* aSC)
}
nsIFrame*
NS_NewEmptyFrame(nsIPresShell* aPresShell)
NS_NewEmptyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsFrame;
return new (aPresShell) nsFrame(aContext);
}
MOZ_DECL_CTOR_COUNTER(nsFrame)
@ -488,11 +488,13 @@ nsFrame::operator delete(void* aPtr, size_t sz)
}
nsFrame::nsFrame()
nsFrame::nsFrame(nsStyleContext* aContext)
{
MOZ_COUNT_CTOR(nsFrame);
mState = NS_FRAME_FIRST_REFLOW | NS_FRAME_IS_DIRTY;
mStyleContext = aContext;
mStyleContext->AddRef();
}
nsFrame::~nsFrame()
@ -546,7 +548,6 @@ nsrefcnt nsFrame::Release(void)
NS_IMETHODIMP
nsFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
mContent = aContent;
@ -575,7 +576,7 @@ nsFrame::Init(nsIContent* aContent,
mState |= state & (NS_FRAME_INDEPENDENT_SELECTION |
NS_FRAME_GENERATED_CONTENT);
}
SetStyleContext(aContext);
DidSetStyleContext();
if (IsBoxWrapped())
InitBoxMetrics(PR_FALSE);

View File

@ -135,7 +135,7 @@ public:
* Create a new "empty" frame that maps a given piece of content into a
* 0,0 area.
*/
friend nsIFrame* NS_NewEmptyFrame(nsIPresShell* aShell);
friend nsIFrame* NS_NewEmptyFrame(nsIPresShell* aShell, nsStyleContext* aContext);
// Overloaded new operator. Initializes the memory to 0 and relies on an arena
// (which comes from the presShell) to perform the allocation.
@ -163,7 +163,6 @@ public:
// nsIFrame
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* asPrevInFlow);
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
@ -455,7 +454,7 @@ public:
protected:
// Protected constructor and destructor
nsFrame();
nsFrame(nsStyleContext* aContext);
virtual ~nsFrame();
/**

View File

@ -103,7 +103,7 @@ class nsSubDocumentFrame : public nsLeafFrame,
public nsIFrameFrame
{
public:
nsSubDocumentFrame();
nsSubDocumentFrame(nsStyleContext* aContext);
#ifdef DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const;
@ -118,7 +118,6 @@ public:
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
@ -169,8 +168,8 @@ protected:
PRPackedBool mIsInline;
};
nsSubDocumentFrame::nsSubDocumentFrame()
: nsLeafFrame(), mDidCreateDoc(PR_FALSE), mOwnsFrameLoader(PR_FALSE),
nsSubDocumentFrame::nsSubDocumentFrame(nsStyleContext* aContext)
: nsLeafFrame(aContext), mDidCreateDoc(PR_FALSE), mOwnsFrameLoader(PR_FALSE),
mIsInline(PR_FALSE)
{
}
@ -211,7 +210,6 @@ nsSubDocumentFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
NS_IMETHODIMP
nsSubDocumentFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
// determine if we are a <frame> or <iframe>
@ -220,7 +218,7 @@ nsSubDocumentFrame::Init(nsIContent* aContent,
mIsInline = frameElem ? PR_FALSE : PR_TRUE;
}
nsresult rv = nsLeafFrame::Init(aContent, aParent, aContext, aPrevInFlow);
nsresult rv = nsLeafFrame::Init(aContent, aParent, aPrevInFlow);
if (NS_FAILED(rv))
return rv;
@ -576,9 +574,9 @@ nsSubDocumentFrame::AttributeChanged(PRInt32 aNameSpaceID,
}
nsIFrame*
NS_NewSubDocumentFrame(nsIPresShell* aPresShell)
NS_NewSubDocumentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsSubDocumentFrame;
return new (aPresShell) nsSubDocumentFrame(aContext);
}
NS_IMETHODIMP

View File

@ -155,7 +155,7 @@ public:
void PaintBorder(nsIRenderingContext& aRenderingContext, nsPoint aPt);
protected:
nsHTMLFramesetBorderFrame(PRInt32 aWidth, PRBool aVertical, PRBool aVisible);
nsHTMLFramesetBorderFrame(nsStyleContext* aContext, PRInt32 aWidth, PRBool aVertical, PRBool aVisible);
virtual ~nsHTMLFramesetBorderFrame();
virtual void GetDesiredSize(nsPresContext* aPresContext,
const nsHTMLReflowState& aReflowState,
@ -192,6 +192,7 @@ public:
nsReflowStatus& aStatus);
protected:
nsHTMLFramesetBlankFrame(nsStyleContext* aContext) : nsLeafFrame(aContext) {}
virtual ~nsHTMLFramesetBlankFrame();
virtual void GetDesiredSize(nsPresContext* aPresContext,
const nsHTMLReflowState& aReflowState,
@ -207,8 +208,8 @@ PRBool nsHTMLFramesetFrame::gDragInProgress = PR_FALSE;
#define kFrameResizePref "layout.frames.force_resizability"
#define DEFAULT_BORDER_WIDTH_PX 6
nsHTMLFramesetFrame::nsHTMLFramesetFrame()
: nsHTMLContainerFrame()
nsHTMLFramesetFrame::nsHTMLFramesetFrame(nsStyleContext* aContext)
: nsHTMLContainerFrame(aContext)
{
mNumRows = 0;
mRowSizes = nsnull;
@ -300,10 +301,9 @@ nsHTMLFramesetFrame::FrameResizePrefCallback(const char* aPref, void* aClosure)
NS_IMETHODIMP
nsHTMLFramesetFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsHTMLContainerFrame::Init(aContent, aParent, aContext, aPrevInFlow);
nsHTMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
// find the highest ancestor that is a frameset
nsresult rv = NS_OK;
nsIFrame* parentFrame = GetParent();
@ -401,7 +401,7 @@ nsHTMLFramesetFrame::Init(nsIContent* aContent,
kidSC = shell->StyleSet()->ResolveStyleFor(child, mStyleContext);
if (tag == nsHTMLAtoms::frameset) {
frame = NS_NewHTMLFramesetFrame(shell);
frame = NS_NewHTMLFramesetFrame(shell, kidSC);
if (NS_UNLIKELY(!frame))
return NS_ERROR_OUT_OF_MEMORY;
@ -410,7 +410,7 @@ nsHTMLFramesetFrame::Init(nsIContent* aContent,
childFrame->SetParentFrameborder(frameborder);
childFrame->SetParentBorderWidth(borderWidth);
childFrame->SetParentBorderColor(borderColor);
result = frame->Init(child, this, kidSC, nsnull);
result = frame->Init(child, this, nsnull);
if (NS_FAILED(result)) {
frame->Destroy(aPresContext);
return result;
@ -418,11 +418,11 @@ nsHTMLFramesetFrame::Init(nsIContent* aContent,
mChildBorderColors[mChildCount].Set(childFrame->GetBorderColor());
} else { // frame
frame = NS_NewSubDocumentFrame(shell);
frame = NS_NewSubDocumentFrame(shell, kidSC);
if (NS_UNLIKELY(!frame))
return NS_ERROR_OUT_OF_MEMORY;
result = frame->Init(child, this, kidSC, nsnull);
result = frame->Init(child, this, nsnull);
if (NS_FAILED(result)) {
frame->Destroy(aPresContext);
return result;
@ -450,22 +450,20 @@ nsHTMLFramesetFrame::Init(nsIContent* aContent,
mNonBlankChildCount = mChildCount;
// add blank frames for frameset cells that had no content provided
for (int blankX = mChildCount; blankX < numCells; blankX++) {
// XXX the blank frame is using the content of its parent - at some point it
// should just have null content, if we support that
nsHTMLFramesetBlankFrame* blankFrame = new (shell) nsHTMLFramesetBlankFrame;
if (!blankFrame)
return NS_ERROR_OUT_OF_MEMORY;
nsRefPtr<nsStyleContext> pseudoStyleContext;
pseudoStyleContext = shell->StyleSet()->ResolvePseudoStyleFor(nsnull,
nsCSSAnonBoxes::framesetBlank,
mStyleContext);
pseudoStyleContext = shell->StyleSet()->
ResolvePseudoStyleFor(nsnull, nsCSSAnonBoxes::framesetBlank, mStyleContext);
if (!pseudoStyleContext) {
blankFrame->Destroy(aPresContext);
return NS_ERROR_OUT_OF_MEMORY;
}
result = blankFrame->Init(mContent, this, pseudoStyleContext, nsnull);
// XXX the blank frame is using the content of its parent - at some point it
// should just have null content, if we support that
nsHTMLFramesetBlankFrame* blankFrame = new (shell) nsHTMLFramesetBlankFrame(pseudoStyleContext);
if (!blankFrame)
return NS_ERROR_OUT_OF_MEMORY;
result = blankFrame->Init(mContent, this, nsnull);
if (NS_FAILED(result)) {
blankFrame->Destroy(aPresContext);
return result;
@ -1054,14 +1052,17 @@ nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
offset.x = 0;
offset.y += lastSize.height;
if (firstTime) { // create horizontal border
borderFrame = new (shell) nsHTMLFramesetBorderFrame(borderWidth,
PR_FALSE,
PR_FALSE);
nsRefPtr<nsStyleContext> pseudoStyleContext;
pseudoStyleContext = styleSet->ResolvePseudoStyleFor(mContent,
nsCSSPseudoElements::horizontalFramesetBorder,
mStyleContext);
borderFrame->Init(mContent, this, pseudoStyleContext, nsnull);
borderFrame = new (shell) nsHTMLFramesetBorderFrame(pseudoStyleContext,
borderWidth,
PR_FALSE,
PR_FALSE);
borderFrame->Init(mContent, this, nsnull);
mChildCount++;
lastChild->SetNextSibling(borderFrame);
@ -1083,14 +1084,17 @@ nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
if (cellIndex.x > 0) { // moved to next col in same row
if (0 == cellIndex.y) { // in 1st row
if (firstTime) { // create vertical border
borderFrame = new (shell) nsHTMLFramesetBorderFrame(borderWidth,
PR_TRUE,
PR_FALSE);
nsRefPtr<nsStyleContext> pseudoStyleContext;
pseudoStyleContext = styleSet->ResolvePseudoStyleFor(mContent,
nsCSSPseudoElements::verticalFramesetBorder,
mStyleContext);
borderFrame->Init(mContent, this, pseudoStyleContext, nsnull);
borderFrame = new (shell) nsHTMLFramesetBorderFrame(pseudoStyleContext,
borderWidth,
PR_TRUE,
PR_FALSE);
borderFrame->Init(mContent, this, nsnull);
mChildCount++;
lastChild->SetNextSibling(borderFrame);
@ -1560,18 +1564,19 @@ nsHTMLFramesetFrame::EndMouseDrag(nsPresContext* aPresContext)
}
nsIFrame*
NS_NewHTMLFramesetFrame(nsIPresShell* aPresShell)
NS_NewHTMLFramesetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsHTMLFramesetFrame;
return new (aPresShell) nsHTMLFramesetFrame(aContext);
}
/*******************************************************************************
* nsHTMLFramesetBorderFrame
******************************************************************************/
nsHTMLFramesetBorderFrame::nsHTMLFramesetBorderFrame(PRInt32 aWidth,
PRBool aVertical,
nsHTMLFramesetBorderFrame::nsHTMLFramesetBorderFrame(nsStyleContext* aContext,
PRInt32 aWidth,
PRBool aVertical,
PRBool aVisibility)
: nsLeafFrame(), mWidth(aWidth), mVertical(aVertical), mVisibility(aVisibility)
: nsLeafFrame(aContext), mWidth(aWidth), mVertical(aVertical), mVisibility(aVisibility)
{
mVisibilityOverride = PR_FALSE;
mCanResize = PR_TRUE;

View File

@ -108,7 +108,7 @@ public:
// Woohoo, concrete class with an IID!
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFRAMESETFRAME_IID)
nsHTMLFramesetFrame();
nsHTMLFramesetFrame(nsStyleContext* aContext);
virtual ~nsHTMLFramesetFrame();
@ -116,7 +116,6 @@ public:
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow);
static PRBool gDragInProgress;

View File

@ -92,13 +92,13 @@ static const char kEventQueueServiceCID[] = NS_EVENTQUEUESERVICE_CONTRACTID;
//----------nsHTMLScrollFrame-------------------------------------------
nsIFrame*
NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, PRBool aIsRoot)
NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot)
{
return new (aPresShell) nsHTMLScrollFrame(aPresShell, aIsRoot);
return new (aPresShell) nsHTMLScrollFrame(aPresShell, aContext, aIsRoot);
}
nsHTMLScrollFrame::nsHTMLScrollFrame(nsIPresShell* aShell, PRBool aIsRoot)
: nsHTMLContainerFrame(),
nsHTMLScrollFrame::nsHTMLScrollFrame(nsIPresShell* aShell, nsStyleContext* aContext, PRBool aIsRoot)
: nsHTMLContainerFrame(aContext),
mInner(this, aIsRoot, PR_FALSE)
{
}
@ -899,13 +899,13 @@ NS_INTERFACE_MAP_END_INHERITING(nsHTMLContainerFrame)
//----------nsXULScrollFrame-------------------------------------------
nsIFrame*
NS_NewXULScrollFrame(nsIPresShell* aPresShell, PRBool aIsRoot)
NS_NewXULScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot)
{
return new (aPresShell) nsXULScrollFrame(aPresShell, aIsRoot);
return new (aPresShell) nsXULScrollFrame(aPresShell, aContext, aIsRoot);
}
nsXULScrollFrame::nsXULScrollFrame(nsIPresShell* aShell, PRBool aIsRoot)
: nsBoxFrame(aShell, aIsRoot),
nsXULScrollFrame::nsXULScrollFrame(nsIPresShell* aShell, nsStyleContext* aContext, PRBool aIsRoot)
: nsBoxFrame(aShell, aContext, aIsRoot),
mInner(this, aIsRoot, PR_TRUE),
mMaxElementWidth(0)
{

View File

@ -196,7 +196,7 @@ class nsHTMLScrollFrame : public nsHTMLContainerFrame,
public nsIAnonymousContentCreator,
public nsIStatefulFrame {
public:
friend nsIFrame* NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, PRBool aIsRoot);
friend nsIFrame* NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot);
NS_DECL_ISUPPORTS
@ -320,7 +320,7 @@ public:
#endif
protected:
nsHTMLScrollFrame(nsIPresShell* aShell, PRBool aIsRoot);
nsHTMLScrollFrame(nsIPresShell* aShell, nsStyleContext* aContext, PRBool aIsRoot);
virtual PRIntn GetSkipSides() const;
void SetSuppressScrollbarUpdate(PRBool aSuppress) {
@ -347,7 +347,7 @@ class nsXULScrollFrame : public nsBoxFrame,
public nsIAnonymousContentCreator,
public nsIStatefulFrame {
public:
friend nsIFrame* NS_NewXULScrollFrame(nsIPresShell* aPresShell, PRBool aIsRoot);
friend nsIFrame* NS_NewXULScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot);
// Called to set the child frames. We typically have three: the scroll area,
// the vertical scrollbar, and the horizontal scrollbar.
@ -485,7 +485,7 @@ public:
virtual nsresult GetContentOf(nsIContent** aContent);
protected:
nsXULScrollFrame(nsIPresShell* aShell, PRBool aIsRoot);
nsXULScrollFrame(nsIPresShell* aShell, nsStyleContext* aContext, PRBool aIsRoot);
virtual PRIntn GetSkipSides() const;
private:

View File

@ -46,13 +46,9 @@
#include "nsDisplayList.h"
nsIFrame*
NS_NewHTMLCanvasFrame(nsIPresShell* aPresShell)
{
return new (aPresShell) nsHTMLCanvasFrame;
}
nsHTMLCanvasFrame::nsHTMLCanvasFrame()
NS_NewHTMLCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsHTMLCanvasFrame(aContext);
}
nsHTMLCanvasFrame::~nsHTMLCanvasFrame()

View File

@ -46,12 +46,12 @@
#include "gfxIImageFrame.h"
#include "imgIContainer.h"
nsIFrame* NS_NewHTMLCanvasFrame (nsIPresShell* aPresShell);
nsIFrame* NS_NewHTMLCanvasFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
class nsHTMLCanvasFrame : public nsSplittableFrame
{
public:
nsHTMLCanvasFrame();
nsHTMLCanvasFrame(nsStyleContext* aContext) : nsSplittableFrame(aContext) {}
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,

View File

@ -119,6 +119,8 @@ public:
nsLineBox* aLine);
protected:
nsHTMLContainerFrame(nsStyleContext *aContext) : nsContainerFrame(aContext) {}
/**
* Displays the below-children decorations, then the children, then
* the above-children decorations, with the decorations going in the

View File

@ -85,14 +85,14 @@ class CanvasFrame : public nsHTMLContainerFrame,
public nsIScrollPositionListener,
public nsICanvasFrame {
public:
CanvasFrame() : mDoPaintFocus(PR_FALSE) {}
CanvasFrame(nsStyleContext* aContext)
: nsHTMLContainerFrame(aContext), mDoPaintFocus(PR_FALSE) {}
// nsISupports
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
@ -155,9 +155,9 @@ private:
//----------------------------------------------------------------------
nsIFrame*
NS_NewCanvasFrame(nsIPresShell* aPresShell)
NS_NewCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell)CanvasFrame;
return new (aPresShell)CanvasFrame(aContext);
}
//--------------------------------------------------------------
@ -187,10 +187,9 @@ CanvasFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
NS_IMETHODIMP
CanvasFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsHTMLContainerFrame::Init(aContent, aParent, aContext, aPrevInFlow);
nsresult rv = nsHTMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
mViewManager = GetPresContext()->GetViewManager();

View File

@ -50,6 +50,7 @@ class nsIFrame;
class nsIHTMLContentSink;
class nsIFragmentContentSink;
class nsPresContext;
class nsStyleContext;
class nsITextContent;
class nsIURI;
class nsString;
@ -84,7 +85,7 @@ NS_NewFrameContentIterator(nsPresContext* aPresContext,
// Create a frame that supports "display: block" layout behavior
nsIFrame*
NS_NewBlockFrame(nsIPresShell* aPresShell, PRUint32 aFlags = 0);
NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags = 0);
// Special Generated Content Frame
nsresult
@ -97,153 +98,154 @@ NS_NewAttributeContent(nsNodeInfoManager *aNodeInfoManager,
// By default, area frames will extend
// their height to cover any children that "stick out".
nsIFrame*
NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, PRUint32 aFlags);
NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags);
// Create a basic area frame.
nsIFrame*
NS_NewAreaFrame(nsIPresShell* aPresShell, PRUint32 aFlags);
NS_NewAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags);
// These AreaFrame's shrink wrap around their contents
inline nsIFrame*
NS_NewTableCellInnerFrame(nsIPresShell* aPresShell) {
return NS_NewBlockFrame(aPresShell, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
NS_NewTableCellInnerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) {
return NS_NewBlockFrame(aPresShell, aContext, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
}
// This type of AreaFrame is the document root, a margin root, and the
// initial containing block for absolutely positioned elements
inline nsIFrame*
NS_NewDocumentElementFrame(nsIPresShell* aPresShell) {
return NS_NewAreaFrame(aPresShell, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
NS_NewDocumentElementFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) {
return NS_NewAreaFrame(aPresShell, aContext, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
}
// This type of AreaFrame is a margin root, but does not shrink wrap
inline nsIFrame*
NS_NewAbsoluteItemWrapperFrame(nsIPresShell* aPresShell) {
return NS_NewAreaFrame(aPresShell, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
NS_NewAbsoluteItemWrapperFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) {
return NS_NewAreaFrame(aPresShell, aContext, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
}
// This type of AreaFrame shrink wraps
inline nsIFrame*
NS_NewFloatingItemWrapperFrame(nsIPresShell* aPresShell) {
return NS_NewAreaFrame(aPresShell, NS_BLOCK_SPACE_MGR|NS_BLOCK_SHRINK_WRAP|NS_BLOCK_MARGIN_ROOT);
NS_NewFloatingItemWrapperFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) {
return NS_NewAreaFrame(aPresShell, aContext,
NS_BLOCK_SPACE_MGR|NS_BLOCK_SHRINK_WRAP|NS_BLOCK_MARGIN_ROOT);
}
// This type of AreaFrame doesn't use its own space manager and
// doesn't shrink wrap.
inline nsIFrame*
NS_NewRelativeItemWrapperFrame(nsIPresShell* aPresShell) {
return NS_NewAreaFrame(aPresShell, 0);
NS_NewRelativeItemWrapperFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) {
return NS_NewAreaFrame(aPresShell, aContext, 0);
}
nsIFrame*
NS_NewBRFrame(nsIPresShell* aPresShell);
NS_NewBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewCommentFrame(nsIPresShell* aPresShell);
NS_NewCommentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
// <frame> and <iframe>
nsIFrame*
NS_NewSubDocumentFrame(nsIPresShell* aPresShell);
NS_NewSubDocumentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
// <frameset>
nsIFrame*
NS_NewHTMLFramesetFrame(nsIPresShell* aPresShell);
NS_NewHTMLFramesetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewViewportFrame(nsIPresShell* aPresShell);
NS_NewViewportFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewCanvasFrame(nsIPresShell* aPresShell);
NS_NewCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewImageFrame(nsIPresShell* aPresShell);
NS_NewImageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewInlineFrame(nsIPresShell* aPresShell);
NS_NewInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewPositionedInlineFrame(nsIPresShell* aPresShell);
NS_NewPositionedInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewObjectFrame(nsIPresShell* aPresShell);
NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewSpacerFrame(nsIPresShell* aPresShell);
NS_NewSpacerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewTextFrame(nsIPresShell* aPresShell);
NS_NewTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewContinuingTextFrame(nsIPresShell* aPresShell);
NS_NewContinuingTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewEmptyFrame(nsIPresShell* aPresShell);
NS_NewEmptyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
inline nsIFrame*
NS_NewWBRFrame(nsIPresShell* aPresShell) {
return NS_NewEmptyFrame(aPresShell);
NS_NewWBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) {
return NS_NewEmptyFrame(aPresShell, aContext);
}
nsIFrame*
NS_NewColumnSetFrame(nsIPresShell* aPresShell, PRUint32 aStateFlags );
NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aStateFlags);
nsIFrame*
NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell);
NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewPageFrame(nsIPresShell* aPresShell);
NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewPageContentFrame(nsIPresShell* aPresShell);
NS_NewPageContentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewPageBreakFrame(nsIPresShell* aPresShell);
NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewFirstLetterFrame(nsIPresShell* aPresShell);
NS_NewFirstLetterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewFirstLineFrame(nsIPresShell* aPresShell);
NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
// forms
nsIFrame*
NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell);
NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewNativeButtonControlFrame(nsIPresShell* aPresShell);
NS_NewNativeButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewImageControlFrame(nsIPresShell* aPresShell);
NS_NewImageControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell);
NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell);
NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewNativeCheckboxControlFrame(nsIPresShell* aPresShell);
NS_NewNativeCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewFieldSetFrame(nsIPresShell* aPresShell);
NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewFileControlFrame(nsIPresShell* aPresShell);
NS_NewFileControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewLegendFrame(nsIPresShell* aPresShell);
NS_NewLegendFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewNativeTextControlFrame(nsIPresShell* aPresShell);
NS_NewNativeTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewTextControlFrame(nsIPresShell* aPresShell);
NS_NewTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewGfxAutoTextControlFrame(nsIPresShell* aPresShell);
NS_NewGfxAutoTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell);
NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewNativeRadioControlFrame(nsIPresShell* aPresShell);
NS_NewNativeRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewNativeSelectControlFrame(nsIPresShell* aPresShell);
NS_NewNativeSelectControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewListControlFrame(nsIPresShell* aPresShell);
NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewComboboxControlFrame(nsIPresShell* aPresShell, PRUint32 aFlags);
NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags);
nsIFrame*
NS_NewIsIndexFrame(nsIPresShell* aPresShell);
NS_NewIsIndexFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
// Table frame factories
nsIFrame*
NS_NewTableOuterFrame(nsIPresShell* aPresShell);
NS_NewTableOuterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewTableFrame(nsIPresShell* aPresShell);
NS_NewTableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewTableCaptionFrame(nsIPresShell* aPresShell);
NS_NewTableCaptionFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewTableColFrame(nsIPresShell* aPresShell);
NS_NewTableColFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewTableColGroupFrame(nsIPresShell* aPresShell);
NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewTableRowFrame(nsIPresShell* aPresShell);
NS_NewTableRowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewTableRowGroupFrame(nsIPresShell* aPresShell);
NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewTableCellFrame(nsIPresShell* aPresShell, PRBool aIsBorderCollapse);
NS_NewTableCellFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsBorderCollapse);
nsresult
NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult,

View File

@ -419,7 +419,6 @@ public:
*/
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow) = 0;
/**
@ -558,6 +557,18 @@ public:
}
}
}
void SetStyleContextWithoutNotification(nsStyleContext* aContext)
{
if (aContext != mStyleContext) {
if (mStyleContext)
mStyleContext->Release();
mStyleContext = aContext;
if (aContext) {
aContext->AddRef();
}
}
}
// Style post processing hook
NS_IMETHOD DidSetStyleContext() = 0;

View File

@ -166,13 +166,14 @@ inline PRBool HaveFixedSize(const nsHTMLReflowState& aReflowState)
}
nsIFrame*
NS_NewImageFrame(nsIPresShell* aPresShell)
NS_NewImageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsImageFrame;
return new (aPresShell) nsImageFrame(aContext);
}
nsImageFrame::nsImageFrame() :
nsImageFrame::nsImageFrame(nsStyleContext* aContext) :
ImageFrameSuper(aContext),
mComputedSize(0, 0),
mIntrinsicSize(0, 0)
{
@ -267,10 +268,9 @@ nsImageFrame::Destroy(nsPresContext* aPresContext)
NS_IMETHODIMP
nsImageFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsSplittableFrame::Init(aContent, aParent, aContext, aPrevInFlow);
nsresult rv = nsSplittableFrame::Init(aContent, aParent, aPrevInFlow);
NS_ENSURE_SUCCESS(rv, rv);
mListener = new nsImageListener(this);

View File

@ -84,7 +84,7 @@ private:
class nsImageFrame : public ImageFrameSuper, public nsIImageFrame {
public:
nsImageFrame();
nsImageFrame(nsStyleContext* aContext);
// nsISupports
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
@ -92,7 +92,6 @@ public:
NS_IMETHOD Destroy(nsPresContext* aPresContext);
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,

View File

@ -68,13 +68,9 @@ NS_DEFINE_IID(kInlineFrameCID, NS_INLINE_FRAME_CID);
// Basic nsInlineFrame methods
nsIFrame*
NS_NewInlineFrame(nsIPresShell* aPresShell)
{
return new (aPresShell) nsInlineFrame;
}
nsInlineFrame::nsInlineFrame()
NS_NewInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsInlineFrame(aContext);
}
NS_IMETHODIMP
@ -857,13 +853,9 @@ ReParentChildListStyle(nsPresContext* aPresContext,
}
nsIFrame*
NS_NewFirstLineFrame(nsIPresShell* aPresShell)
{
return new (aPresShell) nsFirstLineFrame;
}
nsFirstLineFrame::nsFirstLineFrame()
NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsFirstLineFrame(aContext);
}
#ifdef DEBUG
@ -1011,9 +1003,9 @@ nsFirstLineFrame::Reflow(nsPresContext* aPresContext,
//////////////////////////////////////////////////////////////////////
nsIFrame*
NS_NewPositionedInlineFrame(nsIPresShell* aPresShell)
NS_NewPositionedInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsPositionedInlineFrame();
return new (aPresShell) nsPositionedInlineFrame(aContext);
}
NS_IMETHODIMP

View File

@ -68,7 +68,7 @@ class nsAnonymousBlockFrame;
class nsInlineFrame : public nsInlineFrameSuper
{
public:
friend nsIFrame* NS_NewInlineFrame(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
// nsISupports overrides
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
@ -127,7 +127,7 @@ protected:
};
};
nsInlineFrame();
nsInlineFrame(nsStyleContext* aContext) : nsInlineFrameSuper(aContext) {}
virtual PRIntn GetSkipSides() const;
@ -161,7 +161,7 @@ protected:
*/
class nsFirstLineFrame : public nsInlineFrame {
public:
friend nsIFrame* NS_NewFirstLineFrame(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
#ifdef DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const;
@ -177,7 +177,7 @@ public:
void StealFramesFrom(nsIFrame* aFrame);
protected:
nsFirstLineFrame();
nsFirstLineFrame(nsStyleContext* aContext) : nsInlineFrame(aContext) {}
virtual nsIFrame* PullOneFrame(nsPresContext* aPresContext,
InlineReflowState& rs,
@ -193,7 +193,7 @@ protected:
class nsPositionedInlineFrame : public nsInlineFrame
{
public:
nsPositionedInlineFrame() { } // useful for debugging
nsPositionedInlineFrame(nsStyleContext* aContext) : nsInlineFrame(aContext) {}
virtual ~nsPositionedInlineFrame() { } // useful for debugging

View File

@ -60,6 +60,7 @@ public:
nsReflowStatus& aStatus);
protected:
nsLeafFrame(nsStyleContext* aContext) : nsFrame(aContext) {}
virtual ~nsLeafFrame();
/**

View File

@ -466,14 +466,13 @@ static NS_DEFINE_CID(kCPluginManagerCID, NS_PLUGINMANAGER_CID);
NS_IMETHODIMP
nsObjectFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
#ifdef DEBUG
mInstantiating = PR_FALSE;
#endif
nsresult rv = nsObjectFrameSuper::Init(aContent, aParent, aContext, aPrevInFlow);
nsresult rv = nsObjectFrameSuper::Init(aContent, aParent, aPrevInFlow);
nsCOMPtr<nsIObjectLoadingContent> objContent(do_QueryInterface(mContent));
NS_ASSERTION(objContent, "Why not an object loading content?");
objContent->HasNewFrame(this);
@ -1482,9 +1481,9 @@ nsObjectFrame::GetNextObjectFrame(nsPresContext* aPresContext, nsIFrame* aRoot)
}
nsIFrame*
NS_NewObjectFrame(nsIPresShell* aPresShell)
NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsObjectFrame;
return new (aPresShell) nsObjectFrame(aContext);
}

View File

@ -53,12 +53,13 @@ class nsPresContext;
class nsObjectFrame : public nsObjectFrameSuper, public nsIObjectFrame {
public:
friend nsIFrame* NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
// nsISupports
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
@ -123,6 +124,7 @@ protected:
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
nsObjectFrame(nsStyleContext* aContext) : nsObjectFrameSuper(aContext) {}
virtual ~nsObjectFrame();
// NOTE: This frame class does not inherit from |nsLeafFrame|, so

View File

@ -55,13 +55,9 @@
nsIFrame*
NS_NewPageContentFrame(nsIPresShell* aPresShell)
{
return new (aPresShell) nsPageContentFrame;
}
nsPageContentFrame::nsPageContentFrame()
NS_NewPageContentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsPageContentFrame(aContext);
}
NS_IMETHODIMP nsPageContentFrame::Reflow(nsPresContext* aPresContext,

View File

@ -45,7 +45,7 @@ class nsSharedPageData;
class nsPageContentFrame : public ViewportFrame {
public:
friend nsIFrame* NS_NewPageContentFrame(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewPageContentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
friend class nsPageFrame;
// nsIFrame
@ -75,7 +75,7 @@ public:
#endif
protected:
nsPageContentFrame();
nsPageContentFrame(nsStyleContext* aContext) : ViewportFrame(aContext) {}
nsSharedPageData* mPD;
};

View File

@ -96,13 +96,13 @@ extern PRLogModuleInfo * kLayoutPrintingLogMod;
PRBool nsPageFrame::mDoCreateWidget = PR_TRUE;
nsIFrame*
NS_NewPageFrame(nsIPresShell* aPresShell)
NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsPageFrame;
return new (aPresShell) nsPageFrame(aContext);
}
nsPageFrame::nsPageFrame() :
mSupressHF(PR_FALSE)
nsPageFrame::nsPageFrame(nsStyleContext* aContext)
: nsContainerFrame(aContext), mSupressHF(PR_FALSE)
{
}
@ -693,7 +693,7 @@ nsPageFrame::SetSharedPageData(nsSharedPageData* aPD)
}
nsIFrame*
NS_NewPageBreakFrame(nsIPresShell* aPresShell)
NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
NS_PRECONDITION(aPresShell, "null PresShell");
#ifdef DEBUG
@ -701,11 +701,11 @@ NS_NewPageBreakFrame(nsIPresShell* aPresShell)
NS_ASSERTION(aPresShell->GetPresContext()->IsPaginated(), "created a page break frame while not printing");
#endif
return new (aPresShell) nsPageBreakFrame;
return new (aPresShell) nsPageBreakFrame(aContext);
}
nsPageBreakFrame::nsPageBreakFrame()
: mHaveReflowed(PR_FALSE)
nsPageBreakFrame::nsPageBreakFrame(nsStyleContext* aContext) :
nsLeafFrame(aContext), mHaveReflowed(PR_FALSE)
{
}

View File

@ -47,7 +47,7 @@ class nsSharedPageData;
class nsPageFrame : public nsContainerFrame {
public:
friend nsIFrame* NS_NewPageFrame(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
// nsIFrame
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
@ -100,7 +100,7 @@ public:
nsPoint aPt);
protected:
nsPageFrame();
nsPageFrame(nsStyleContext* aContext);
virtual ~nsPageFrame();
typedef enum {
@ -154,7 +154,7 @@ protected:
class nsPageBreakFrame : public nsLeafFrame {
nsPageBreakFrame();
nsPageBreakFrame(nsStyleContext* aContext);
~nsPageBreakFrame();
NS_IMETHOD Reflow(nsPresContext* aPresContext,
@ -171,7 +171,7 @@ protected:
nsHTMLReflowMetrics& aDesiredSize);
PRBool mHaveReflowed;
friend nsIFrame* NS_NewPageBreakFrame(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
};
#endif /* nsPageFrame_h___ */

View File

@ -44,14 +44,9 @@
#include "nsDisplayList.h"
nsIFrame*
NS_NewPlaceholderFrame(nsIPresShell* aPresShell)
{
return new (aPresShell) nsPlaceholderFrame;
}
// These are useful for debugging
nsPlaceholderFrame::nsPlaceholderFrame()
NS_NewPlaceholderFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsPlaceholderFrame(aContext);
}
nsPlaceholderFrame::~nsPlaceholderFrame()

View File

@ -40,7 +40,7 @@
#include "nsSplittableFrame.h"
#include "nsLayoutAtoms.h"
nsIFrame* NS_NewPlaceholderFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewPlaceholderFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
/**
* Implementation of a frame that's used as a placeholder for a frame that
@ -51,8 +51,8 @@ public:
/**
* Create a new placeholder frame
*/
friend nsIFrame* NS_NewPlaceholderFrame(nsIPresShell* aPresShell);
nsPlaceholderFrame();
friend nsIFrame* NS_NewPlaceholderFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsPlaceholderFrame(nsStyleContext* aContext) : nsSplittableFrame(aContext) {}
virtual ~nsPlaceholderFrame();
// Get/Set the associated out of flow frame

View File

@ -108,12 +108,13 @@ nsSharedPageData::~nsSharedPageData()
}
nsIFrame*
NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell)
NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsSimplePageSequenceFrame;
return new (aPresShell) nsSimplePageSequenceFrame(aContext);
}
nsSimplePageSequenceFrame::nsSimplePageSequenceFrame() :
nsSimplePageSequenceFrame::nsSimplePageSequenceFrame(nsStyleContext* aContext) :
nsContainerFrame(aContext),
mIsPrintingSelection(PR_FALSE),
mTotalPages(-1),
mSelectionHeight(-1),

View File

@ -77,7 +77,7 @@ public:
class nsSimplePageSequenceFrame : public nsContainerFrame,
public nsIPageSequenceFrame {
public:
friend nsIFrame* NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
// nsISupports
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
@ -134,7 +134,7 @@ public:
protected:
nsSimplePageSequenceFrame();
nsSimplePageSequenceFrame(nsStyleContext* aContext);
virtual ~nsSimplePageSequenceFrame();
nsresult CreateContinuingPageFrame(nsPresContext* aPresContext,

View File

@ -50,7 +50,7 @@
class SpacerFrame : public nsFrame {
public:
friend nsIFrame* NS_NewSpacerFrame(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewSpacerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
// nsIHTMLReflow
NS_IMETHOD Reflow(nsPresContext* aPresContext,
@ -61,18 +61,14 @@ public:
PRUint8 GetType();
protected:
SpacerFrame();
SpacerFrame(nsStyleContext* aContext) : nsFrame(aContext) {}
virtual ~SpacerFrame();
};
nsIFrame*
NS_NewSpacerFrame(nsIPresShell* aPresShell)
{
return new (aPresShell) SpacerFrame;
}
SpacerFrame::SpacerFrame()
NS_NewSpacerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) SpacerFrame(aContext);
}
SpacerFrame::~SpacerFrame()

View File

@ -42,12 +42,9 @@
NS_IMETHODIMP
nsSplittableFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv;
rv = nsFrame::Init(aContent, aParent, aContext, aPrevInFlow);
nsresult rv = nsFrame::Init(aContent, aParent, aPrevInFlow);
if (aPrevInFlow) {
// Hook the frame into the flow

View File

@ -45,7 +45,6 @@ class nsSplittableFrame : public nsFrame
public:
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const;
@ -101,6 +100,8 @@ public:
static void BreakFromPrevFlow(nsIFrame* aFrame);
protected:
nsSplittableFrame(nsStyleContext* aContext) : nsFrame(aContext) {}
#ifdef DEBUG
virtual void DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent, PRBool aIncludeStyleData);
#endif

View File

@ -250,7 +250,7 @@ protected:
class nsTextFrame : public nsFrame {
public:
nsTextFrame();
nsTextFrame(nsStyleContext* aContext) : nsFrame(aContext) {}
// nsIFrame
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
@ -1400,9 +1400,10 @@ nsTextFrame::Destroy(nsPresContext* aPresContext)
class nsContinuingTextFrame : public nsTextFrame {
public:
friend nsIFrame* NS_NewContinuingTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
@ -1436,18 +1437,16 @@ public:
virtual nsIFrame* GetFirstContinuation() const;
protected:
nsContinuingTextFrame(nsStyleContext* aContext) : nsTextFrame(aContext) {}
nsIFrame* mPrevContinuation;
};
NS_IMETHODIMP
nsContinuingTextFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv;
rv = nsTextFrame::Init(aContent, aParent, aContext, aPrevInFlow);
nsresult rv = nsTextFrame::Init(aContent, aParent, aPrevInFlow);
if (aPrevInFlow) {
nsIFrame* nextContinuation = aPrevInFlow->GetNextContinuation();
@ -1827,19 +1826,15 @@ VerifyNotDirty(state)
#endif
nsIFrame*
NS_NewTextFrame(nsIPresShell* aPresShell)
NS_NewTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsTextFrame;
return new (aPresShell) nsTextFrame(aContext);
}
nsIFrame*
NS_NewContinuingTextFrame(nsIPresShell* aPresShell)
{
return new (aPresShell) nsContinuingTextFrame;
}
nsTextFrame::nsTextFrame()
NS_NewContinuingTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsContinuingTextFrame(aContext);
}
nsTextFrame::~nsTextFrame()
@ -1933,7 +1928,6 @@ nsTextFrame::CharacterDataChanged(nsPresContext* aPresContext,
if (markAllDirty) {
// Mark this frame and all the next-in-flow frames as dirty
nsTextFrame* textFrame = this;
nsPropertyTable *propTable = aPresContext->PropertyTable();
while (textFrame) {
textFrame->mState &= ~TEXT_WHITESPACE_FLAGS;
textFrame->mState |= NS_FRAME_IS_DIRTY;

View File

@ -46,9 +46,9 @@
#include "nsIPresShell.h"
nsIFrame*
NS_NewViewportFrame(nsIPresShell* aPresShell)
NS_NewViewportFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) ViewportFrame;
return new (aPresShell) ViewportFrame(aContext);
}
NS_IMETHODIMP

View File

@ -61,8 +61,7 @@ public:
*/
class ViewportFrame : public nsContainerFrame {
public:
ViewportFrame() { } // useful for debugging
ViewportFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {}
virtual ~ViewportFrame() { } // useful for debugging
NS_IMETHOD Destroy(nsPresContext* aPresContext);

View File

@ -748,13 +748,12 @@ nsMathMLContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
NS_IMETHODIMP
nsMathMLContainerFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
MapAttributesIntoCSS(aContext->GetRuleNode()->GetPresContext(), aContent);
MapAttributesIntoCSS(GetPresContext(), aContent);
// let the base class do its Init()
return nsHTMLContainerFrame::Init(aContent, aParent, aContext, aPrevInFlow);
return nsHTMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
// ...We will build our automatic MathML data once the entire <math>...</math>
// tree is constructed.
@ -1500,15 +1499,15 @@ nsMathMLContainerFrame::FixInterFrameSpacing(nsHTMLReflowMetrics& aDesiredSize)
//==========================
nsIFrame*
NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell)
NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsMathMLmathBlockFrame;
return new (aPresShell) nsMathMLmathBlockFrame(aContext);
}
//==========================
nsIFrame*
NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell)
NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsMathMLmathInlineFrame;
return new (aPresShell) nsMathMLmathInlineFrame(aContext);
}

View File

@ -76,6 +76,7 @@
class nsMathMLContainerFrame : public nsHTMLContainerFrame,
public nsMathMLFrame {
public:
nsMathMLContainerFrame(nsStyleContext* aContext) : nsHTMLContainerFrame(aContext) {}
NS_DECL_ISUPPORTS_INHERITED
@ -121,7 +122,6 @@ public:
NS_IMETHOD
Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD
@ -315,7 +315,7 @@ protected:
// Issues: If/when mathml becomes a pluggable component, the separation will be needed.
class nsMathMLmathBlockFrame : public nsBlockFrame {
public:
friend nsIFrame* NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
// beware, mFrames is not set by nsBlockFrame
// cannot use mFrames{.FirstChild()|.etc} since the block code doesn't set mFrames
@ -376,7 +376,7 @@ public:
}
protected:
nsMathMLmathBlockFrame() {}
nsMathMLmathBlockFrame(nsStyleContext* aContext) : nsBlockFrame(aContext) {}
virtual ~nsMathMLmathBlockFrame() {}
NS_IMETHOD
@ -393,7 +393,7 @@ protected:
class nsMathMLmathInlineFrame : public nsInlineFrame {
public:
friend nsIFrame* NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_IMETHOD
SetInitialChildList(nsPresContext* aPresContext,
@ -452,7 +452,7 @@ public:
}
protected:
nsMathMLmathInlineFrame() {}
nsMathMLmathInlineFrame(nsStyleContext* aContext) : nsInlineFrame(aContext) {}
virtual ~nsMathMLmathInlineFrame() {}
NS_IMETHOD

View File

@ -60,18 +60,9 @@ NS_IMPL_RELEASE_INHERITED(nsMathMLForeignFrameWrapper, nsMathMLFrame)
NS_IMPL_QUERY_INTERFACE_INHERITED1(nsMathMLForeignFrameWrapper, nsBlockFrame, nsMathMLFrame)
nsIFrame*
NS_NewMathMLForeignFrameWrapper(nsIPresShell* aPresShell)
NS_NewMathMLForeignFrameWrapper(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsMathMLForeignFrameWrapper;
}
NS_IMETHODIMP
nsMathMLForeignFrameWrapper::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
return nsBlockFrame::Init(aContent, aParent, aContext, aPrevInFlow);
return new (aPresShell) nsMathMLForeignFrameWrapper(aContext);
}
NS_IMETHODIMP

View File

@ -49,7 +49,7 @@
class nsMathMLForeignFrameWrapper : public nsBlockFrame,
public nsMathMLFrame {
public:
friend nsIFrame* NS_NewMathMLForeignFrameWrapper(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewMathMLForeignFrameWrapper(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_DECL_ISUPPORTS_INHERITED
@ -76,12 +76,6 @@ public:
// overloaded nsBlockFrame methods
NS_IMETHOD
Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow);
#ifdef NS_DEBUG
NS_IMETHOD
SetInitialChildList(nsPresContext* aPresContext,
@ -131,7 +125,7 @@ public:
}
protected:
nsMathMLForeignFrameWrapper() {}
nsMathMLForeignFrameWrapper(nsStyleContext* aContext) : nsBlockFrame(aContext) {}
virtual ~nsMathMLForeignFrameWrapper() {}
};

View File

@ -42,46 +42,46 @@
#include "nsISupports.h"
// Factory methods for creating MathML objects
nsIFrame* NS_NewMathMLForeignFrameWrapper(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLTokenFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmoFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmrowFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmphantomFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmpaddedFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmspaceFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmsFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmfencedFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmfracFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmsubFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmsupFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmsubsupFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmunderFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmoverFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmunderoverFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmmultiscriptsFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmstyleFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLForeignFrameWrapper(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLTokenFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmoFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmrowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmphantomFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmpaddedFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmspaceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmsFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmfencedFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmfracFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmsubFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmsupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmsubsupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmunderFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmoverFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmunderoverFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmmultiscriptsFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmstyleFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmtableOuterFrame(nsIPresShell* aPresShell);
inline nsIFrame* NS_NewMathMLmtableFrame(nsIPresShell* aPresShell)
nsIFrame* NS_NewMathMLmtableOuterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
inline nsIFrame* NS_NewMathMLmtableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return NS_NewTableFrame(aPresShell);
return NS_NewTableFrame(aPresShell, aContext);
}
inline nsIFrame* NS_NewMathMLmtrFrame(nsIPresShell* aPresShell)
inline nsIFrame* NS_NewMathMLmtrFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return NS_NewTableRowFrame(aPresShell);
return NS_NewTableRowFrame(aPresShell, aContext);
}
nsIFrame* NS_NewMathMLmtdFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmtdInnerFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmsqrtFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmrootFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmactionFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmtdFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmtdInnerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmsqrtFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmrootFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmactionFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell);
nsIFrame* NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell);
inline nsIFrame* NS_NewMathMLmathFrame(nsIPresShell* aPresShell, PRBool aIsBlock)
nsIFrame* NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
inline nsIFrame* NS_NewMathMLmathFrame(nsIPresShell* aPresShell, PRBool aIsBlock, nsStyleContext* aContext)
{
return (aIsBlock)
? NS_NewMathMLmathBlockFrame(aPresShell)
: NS_NewMathMLmathInlineFrame(aPresShell);
? NS_NewMathMLmathBlockFrame(aPresShell, aContext)
: NS_NewMathMLmathInlineFrame(aPresShell, aContext);
}
#endif /* nsMathMLParts_h___ */

View File

@ -55,15 +55,10 @@
#include "nsMathMLTokenFrame.h"
nsIFrame*
NS_NewMathMLTokenFrame(nsIPresShell* aPresShell)
NS_NewMathMLTokenFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsMathMLTokenFrame;
return new (aPresShell) nsMathMLTokenFrame(aContext);
}
nsMathMLTokenFrame::nsMathMLTokenFrame()
{
}
nsMathMLTokenFrame::~nsMathMLTokenFrame()
{
}
@ -104,7 +99,6 @@ CompressWhitespace(nsIContent* aContent)
NS_IMETHODIMP
nsMathMLTokenFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
// leading and trailing whitespace doesn't count -- bug 15402
@ -113,7 +107,7 @@ nsMathMLTokenFrame::Init(nsIContent* aContent,
CompressWhitespace(aContent);
// let the base class do its Init()
return nsMathMLContainerFrame::Init(aContent, aParent, aContext, aPrevInFlow);
return nsMathMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
}
NS_IMETHODIMP

View File

@ -47,14 +47,13 @@
class nsMathMLTokenFrame : public nsMathMLContainerFrame {
public:
friend nsIFrame* NS_NewMathMLTokenFrame(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewMathMLTokenFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
virtual nsIAtom* GetType() const;
NS_IMETHOD
Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD
@ -82,7 +81,7 @@ public:
nsIAtom* aAttribute,
PRInt32 aModType);
protected:
nsMathMLTokenFrame();
nsMathMLTokenFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
virtual ~nsMathMLTokenFrame();
virtual PRIntn GetSkipSides() const { return 0; }

View File

@ -78,13 +78,9 @@ NS_IMPL_RELEASE_INHERITED(nsMathMLmactionFrame, nsMathMLContainerFrame)
NS_IMPL_QUERY_INTERFACE_INHERITED1(nsMathMLmactionFrame, nsMathMLContainerFrame, nsIDOMMouseListener)
nsIFrame*
NS_NewMathMLmactionFrame(nsIPresShell* aPresShell)
{
return new (aPresShell) nsMathMLmactionFrame;
}
nsMathMLmactionFrame::nsMathMLmactionFrame()
NS_NewMathMLmactionFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsMathMLmactionFrame(aContext);
}
nsMathMLmactionFrame::~nsMathMLmactionFrame()
@ -98,7 +94,6 @@ nsMathMLmactionFrame::~nsMathMLmactionFrame()
NS_IMETHODIMP
nsMathMLmactionFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsAutoString value, prefix;
@ -147,14 +142,14 @@ nsMathMLmactionFrame::Init(nsIContent* aContent,
// then, re-resolve our style
nsStyleContext* parentStyleContext = aParent->GetStyleContext();
newStyleContext = aContext->GetRuleNode()->GetPresContext()->
StyleSet()->ResolveStyleFor(aContent, parentStyleContext);
newStyleContext = GetPresContext()->StyleSet()->
ResolveStyleFor(aContent, parentStyleContext);
if (!newStyleContext)
mRestyle.Truncate();
else {
if (newStyleContext != aContext)
aContext = newStyleContext;
if (newStyleContext != GetStyleContext())
SetStyleContextWithoutNotification(newStyleContext);
else
mRestyle.Truncate();
}
@ -163,7 +158,7 @@ nsMathMLmactionFrame::Init(nsIContent* aContent,
}
// Let the base class do the rest
return nsMathMLContainerFrame::Init(aContent, aParent, aContext, aPrevInFlow);
return nsMathMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
}
nsresult

View File

@ -56,14 +56,13 @@
class nsMathMLmactionFrame : public nsMathMLContainerFrame,
public nsIDOMMouseListener {
public:
friend nsIFrame* NS_NewMathMLmactionFrame(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewMathMLmactionFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_DECL_ISUPPORTS_INHERITED
NS_IMETHOD
Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD
@ -101,7 +100,7 @@ public:
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent) { MOUSE(event); return NS_OK; }
protected:
nsMathMLmactionFrame();
nsMathMLmactionFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
virtual ~nsMathMLmactionFrame();
virtual PRIntn GetSkipSides() const { return 0; }

View File

@ -54,13 +54,9 @@
//
nsIFrame*
NS_NewMathMLmfencedFrame(nsIPresShell* aPresShell)
{
return new (aPresShell) nsMathMLmfencedFrame;
}
nsMathMLmfencedFrame::nsMathMLmfencedFrame()
NS_NewMathMLmfencedFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsMathMLmfencedFrame(aContext);
}
nsMathMLmfencedFrame::~nsMathMLmfencedFrame()

View File

@ -48,7 +48,7 @@
class nsMathMLmfencedFrame : public nsMathMLContainerFrame {
public:
friend nsIFrame* NS_NewMathMLmfencedFrame(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewMathMLmfencedFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
virtual void
SetAdditionalStyleContext(PRInt32 aIndex,
@ -120,7 +120,7 @@ public:
nscoord& dx);
protected:
nsMathMLmfencedFrame();
nsMathMLmfencedFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
virtual ~nsMathMLmfencedFrame();
virtual PRIntn GetSkipSides() const { return 0; }

View File

@ -71,13 +71,9 @@
static const PRUnichar kSlashChar = PRUnichar('/');
nsIFrame*
NS_NewMathMLmfracFrame(nsIPresShell* aPresShell)
{
return new (aPresShell) nsMathMLmfracFrame;
}
nsMathMLmfracFrame::nsMathMLmfracFrame()
NS_NewMathMLmfracFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsMathMLmfracFrame(aContext);
}
nsMathMLmfracFrame::~nsMathMLmfracFrame()
@ -100,21 +96,19 @@ nsMathMLmfracFrame::IsBevelled()
NS_IMETHODIMP
nsMathMLmfracFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsMathMLContainerFrame::Init(aContent, aParent, aContext, aPrevInFlow);
if (NS_FAILED(rv)) return rv;
nsresult rv = nsMathMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
if (IsBevelled()) {
// enable the bevelled rendering
mSlashChar = new nsMathMLChar();
if (mSlashChar) {
nsPresContext *aPresContext = GetPresContext();
nsPresContext* presContext = GetPresContext();
nsAutoString slashChar; slashChar.Assign(kSlashChar);
mSlashChar->SetData(aPresContext, slashChar);
ResolveMathMLCharStyle(aPresContext, mContent, mStyleContext, mSlashChar, PR_TRUE);
mSlashChar->SetData(presContext, slashChar);
ResolveMathMLCharStyle(presContext, mContent, mStyleContext, mSlashChar, PR_TRUE);
}
}

View File

@ -85,7 +85,7 @@ element.
class nsMathMLmfracFrame : public nsMathMLContainerFrame {
public:
friend nsIFrame* NS_NewMathMLmfracFrame(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewMathMLmfracFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
virtual void
SetAdditionalStyleContext(PRInt32 aIndex,
@ -103,7 +103,6 @@ public:
NS_IMETHOD
Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD
@ -149,7 +148,7 @@ public:
nscoord aDefaultRuleThickness);
protected:
nsMathMLmfracFrame();
nsMathMLmfracFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
virtual ~nsMathMLmfracFrame();
virtual PRIntn GetSkipSides() const { return 0; }

View File

@ -54,13 +54,9 @@
//
nsIFrame*
NS_NewMathMLmmultiscriptsFrame(nsIPresShell* aPresShell)
{
return new (aPresShell) nsMathMLmmultiscriptsFrame;
}
nsMathMLmmultiscriptsFrame::nsMathMLmmultiscriptsFrame()
NS_NewMathMLmmultiscriptsFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsMathMLmmultiscriptsFrame(aContext);
}
nsMathMLmmultiscriptsFrame::~nsMathMLmmultiscriptsFrame()

View File

@ -49,7 +49,7 @@
class nsMathMLmmultiscriptsFrame : public nsMathMLContainerFrame {
public:
friend nsIFrame* NS_NewMathMLmmultiscriptsFrame(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewMathMLmmultiscriptsFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_IMETHOD
TransmitAutomaticData();
@ -60,7 +60,7 @@ public:
nsHTMLReflowMetrics& aDesiredSize);
protected:
nsMathMLmmultiscriptsFrame();
nsMathMLmmultiscriptsFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
virtual ~nsMathMLmmultiscriptsFrame();
virtual PRIntn GetSkipSides() const { return 0; }

View File

@ -59,13 +59,9 @@
#define NS_MATHML_CHAR_STYLE_CONTEXT_INDEX 0
nsIFrame*
NS_NewMathMLmoFrame(nsIPresShell* aPresShell)
{
return new (aPresShell) nsMathMLmoFrame;
}
nsMathMLmoFrame::nsMathMLmoFrame()
NS_NewMathMLmoFrame(nsIPresShell* aPresShell, nsStyleContext *aContext)
{
return new (aPresShell) nsMathMLmoFrame(aContext);
}
nsMathMLmoFrame::~nsMathMLmoFrame()

View File

@ -49,7 +49,7 @@
class nsMathMLmoFrame : public nsMathMLTokenFrame {
public:
friend nsIFrame* NS_NewMathMLmoFrame(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewMathMLmoFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
virtual nsIAtom* GetType() const;
@ -93,7 +93,7 @@ public:
nsHTMLReflowMetrics& aDesiredStretchSize);
protected:
nsMathMLmoFrame();
nsMathMLmoFrame(nsStyleContext* aContext) : nsMathMLTokenFrame(aContext) {}
virtual ~nsMathMLmoFrame();
virtual PRIntn GetSkipSides() const { return 0; }

View File

@ -57,13 +57,9 @@
//
nsIFrame*
NS_NewMathMLmoverFrame(nsIPresShell* aPresShell)
{
return new (aPresShell) nsMathMLmoverFrame;
}
nsMathMLmoverFrame::nsMathMLmoverFrame()
NS_NewMathMLmoverFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsMathMLmoverFrame(aContext);
}
nsMathMLmoverFrame::~nsMathMLmoverFrame()

View File

@ -49,7 +49,7 @@
class nsMathMLmoverFrame : public nsMathMLContainerFrame {
public:
friend nsIFrame* NS_NewMathMLmoverFrame(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewMathMLmoverFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_IMETHOD
Place(nsIRenderingContext& aRenderingContext,
@ -80,7 +80,7 @@ public:
PRInt32 aModType);
protected:
nsMathMLmoverFrame();
nsMathMLmoverFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
virtual ~nsMathMLmoverFrame();
virtual PRIntn GetSkipSides() const { return 0; }

View File

@ -67,13 +67,9 @@
#define NS_MATHML_PSEUDO_UNIT_NAMEDSPACE 6
nsIFrame*
NS_NewMathMLmpaddedFrame(nsIPresShell* aPresShell)
{
return new (aPresShell) nsMathMLmpaddedFrame;
}
nsMathMLmpaddedFrame::nsMathMLmpaddedFrame()
NS_NewMathMLmpaddedFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsMathMLmpaddedFrame(aContext);
}
nsMathMLmpaddedFrame::~nsMathMLmpaddedFrame()

View File

@ -48,7 +48,7 @@
class nsMathMLmpaddedFrame : public nsMathMLContainerFrame {
public:
friend nsIFrame* NS_NewMathMLmpaddedFrame(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewMathMLmpaddedFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_IMETHOD
InheritAutomaticData(nsIFrame* aParent);
@ -60,7 +60,7 @@ public:
nsReflowStatus& aStatus);
protected:
nsMathMLmpaddedFrame();
nsMathMLmpaddedFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
virtual ~nsMathMLmpaddedFrame();
virtual PRIntn GetSkipSides() const { return 0; }

View File

@ -52,13 +52,9 @@
//
nsIFrame*
NS_NewMathMLmphantomFrame(nsIPresShell* aPresShell)
{
return new (aPresShell) nsMathMLmphantomFrame;
}
nsMathMLmphantomFrame::nsMathMLmphantomFrame()
NS_NewMathMLmphantomFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsMathMLmphantomFrame(aContext);
}
nsMathMLmphantomFrame::~nsMathMLmphantomFrame()

View File

@ -48,7 +48,7 @@
class nsMathMLmphantomFrame : public nsMathMLContainerFrame {
public:
friend nsIFrame* NS_NewMathMLmphantomFrame(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewMathMLmphantomFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_IMETHOD
InheritAutomaticData(nsIFrame* aParent);
@ -58,7 +58,8 @@ public:
const nsDisplayListSet& aLists) { return NS_OK; }
protected:
nsMathMLmphantomFrame();
nsMathMLmphantomFrame(nsStyleContext* aContext)
: nsMathMLContainerFrame(aContext) {}
virtual ~nsMathMLmphantomFrame();
virtual PRIntn GetSkipSides() const { return 0; }

View File

@ -69,12 +69,13 @@
static const PRUnichar kSqrChar = PRUnichar(0x221A);
nsIFrame*
NS_NewMathMLmrootFrame(nsIPresShell* aPresShell)
NS_NewMathMLmrootFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsMathMLmrootFrame;
return new (aPresShell) nsMathMLmrootFrame(aContext);
}
nsMathMLmrootFrame::nsMathMLmrootFrame() :
nsMathMLmrootFrame::nsMathMLmrootFrame(nsStyleContext* aContext) :
nsMathMLContainerFrame(aContext),
mSqrChar(),
mBarRect()
{
@ -87,19 +88,18 @@ nsMathMLmrootFrame::~nsMathMLmrootFrame()
NS_IMETHODIMP
nsMathMLmrootFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsMathMLContainerFrame::Init(aContent, aParent, aContext, aPrevInFlow);
nsresult rv = nsMathMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
nsPresContext *aPresContext = GetPresContext();
nsPresContext *presContext = GetPresContext();
// No need to tract the style context given to our MathML char.
// The Style System will use Get/SetAdditionalStyleContext() to keep it
// up-to-date if dynamic changes arise.
nsAutoString sqrChar; sqrChar.Assign(kSqrChar);
mSqrChar.SetData(aPresContext, sqrChar);
ResolveMathMLCharStyle(aPresContext, mContent, mStyleContext, &mSqrChar, PR_TRUE);
mSqrChar.SetData(presContext, sqrChar);
ResolveMathMLCharStyle(presContext, mContent, mStyleContext, &mSqrChar, PR_TRUE);
return rv;
}

Some files were not shown because too many files have changed in this diff Show More