Reworked frame factory methods; fixed bug 4519

This commit is contained in:
kipp%netscape.com 1999-05-11 22:03:29 +00:00
Родитель 4ebeb3e6ce
Коммит fea30bc4eb
142 изменённых файлов: 1297 добавлений и 934 удалений

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

@ -76,19 +76,19 @@
#include "nsTreeCellFrame.h"
nsresult
NS_NewTabFrame ( nsIFrame*& aNewFrame );
NS_NewTabFrame ( nsIFrame** aNewFrame );
nsresult
NS_NewDeckFrame ( nsIFrame*& aNewFrame );
NS_NewDeckFrame ( nsIFrame** aNewFrame );
nsresult
NS_NewProgressMeterFrame ( nsIFrame*& aNewFrame );
NS_NewProgressMeterFrame ( nsIFrame** aNewFrame );
nsresult
NS_NewTitledButtonFrame ( nsIFrame*& aNewFrame );
NS_NewTitledButtonFrame ( nsIFrame** aNewFrame );
nsresult
NS_NewBoxFrame ( nsIFrame*& aNewFrame );
NS_NewBoxFrame ( nsIFrame** aNewFrame );
#endif
@ -252,41 +252,41 @@ nsFrameConstructorSaveState::~nsFrameConstructorSaveState()
// Structure used when creating table frames.
struct nsTableCreator {
virtual nsresult CreateTableFrame(nsIFrame*& aNewFrame);
virtual nsresult CreateTableRowGroupFrame(nsIFrame*& aNewFrame);
virtual nsresult CreateTableColFrame(nsIFrame*& aNewFrame);
virtual nsresult CreateTableColGroupFrame(nsIFrame*& aNewFrame);
virtual nsresult CreateTableRowFrame(nsIFrame*& aNewFrame);
virtual nsresult CreateTableCellFrame(nsIFrame*& aNewFrame);
virtual nsresult CreateTableFrame(nsIFrame** aNewFrame);
virtual nsresult CreateTableRowGroupFrame(nsIFrame** aNewFrame);
virtual nsresult CreateTableColFrame(nsIFrame** aNewFrame);
virtual nsresult CreateTableColGroupFrame(nsIFrame** aNewFrame);
virtual nsresult CreateTableRowFrame(nsIFrame** aNewFrame);
virtual nsresult CreateTableCellFrame(nsIFrame** aNewFrame);
};
nsresult
nsTableCreator::CreateTableFrame(nsIFrame*& aNewFrame) {
nsTableCreator::CreateTableFrame(nsIFrame** aNewFrame) {
return NS_NewTableFrame(aNewFrame);
}
nsresult
nsTableCreator::CreateTableRowGroupFrame(nsIFrame*& aNewFrame) {
nsTableCreator::CreateTableRowGroupFrame(nsIFrame** aNewFrame) {
return NS_NewTableRowGroupFrame(aNewFrame);
}
nsresult
nsTableCreator::CreateTableColFrame(nsIFrame*& aNewFrame) {
nsTableCreator::CreateTableColFrame(nsIFrame** aNewFrame) {
return NS_NewTableColFrame(aNewFrame);
}
nsresult
nsTableCreator::CreateTableColGroupFrame(nsIFrame*& aNewFrame) {
nsTableCreator::CreateTableColGroupFrame(nsIFrame** aNewFrame) {
return NS_NewTableColGroupFrame(aNewFrame);
}
nsresult
nsTableCreator::CreateTableRowFrame(nsIFrame*& aNewFrame) {
nsTableCreator::CreateTableRowFrame(nsIFrame** aNewFrame) {
return NS_NewTableRowFrame(aNewFrame);
}
nsresult
nsTableCreator::CreateTableCellFrame(nsIFrame*& aNewFrame) {
nsTableCreator::CreateTableCellFrame(nsIFrame** aNewFrame) {
return NS_NewTableCellFrame(aNewFrame);
}
@ -294,18 +294,18 @@ nsTableCreator::CreateTableCellFrame(nsIFrame*& aNewFrame) {
// Structure used when creating tree frames
struct nsTreeCreator: public nsTableCreator {
nsresult CreateTableFrame(nsIFrame*& aNewFrame);
nsresult CreateTableCellFrame(nsIFrame*& aNewFrame);
nsresult CreateTableFrame(nsIFrame** aNewFrame);
nsresult CreateTableCellFrame(nsIFrame** aNewFrame);
};
nsresult
nsTreeCreator::CreateTableFrame(nsIFrame*& aNewFrame)
nsTreeCreator::CreateTableFrame(nsIFrame** aNewFrame)
{
return NS_NewTreeFrame(aNewFrame);
}
nsresult
nsTreeCreator::CreateTableCellFrame(nsIFrame*& aNewFrame)
nsTreeCreator::CreateTableCellFrame(nsIFrame** aNewFrame)
{
return NS_NewTreeCellFrame(aNewFrame);
}
@ -426,7 +426,7 @@ nsCSSFrameConstructor::CreateGeneratedFrameFor(nsIPresContext* aPresContex
// Create an image frame and initialize it
nsIFrame* imageFrame;
NS_NewImageFrame(imageFrame);
NS_NewImageFrame(&imageFrame);
imageFrame->Init(*aPresContext, imageContent, aParentFrame, aStyleContext, nsnull);
NS_RELEASE(imageContent);
@ -494,7 +494,7 @@ nsCSSFrameConstructor::CreateGeneratedFrameFor(nsIPresContext* aPresContex
// Create a text frame and initialize it
nsIFrame* textFrame;
NS_NewTextFrame(textFrame);
NS_NewTextFrame(&textFrame);
textFrame->Init(*aPresContext, textContent, aParentFrame, aStyleContext, nsnull);
NS_RELEASE(textContent);
@ -582,9 +582,9 @@ nsCSSFrameConstructor::CreateGeneratedContentFrame(nsIPresContext* aPresContext
nsFrameItems childFrames;
if (NS_STYLE_DISPLAY_BLOCK == displayValue) {
NS_NewBlockFrame(containerFrame, 0);
NS_NewBlockFrame(&containerFrame);
} else {
NS_NewInlineFrame(containerFrame);
NS_NewInlineFrame(&containerFrame);
}
containerFrame->Init(*aPresContext, aContent, aFrame, pseudoStyleContext, nsnull);
@ -697,40 +697,40 @@ nsCSSFrameConstructor::CreateInputFrame(nsIContent* aContent, nsIFrame*& aFrame)
nsAutoString val;
if (NS_OK == aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::type, val)) {
if (val.EqualsIgnoreCase("submit")) {
rv = NS_NewButtonControlFrame(aFrame);
rv = NS_NewButtonControlFrame(&aFrame);
}
else if (val.EqualsIgnoreCase("reset")) {
rv = NS_NewButtonControlFrame(aFrame);
rv = NS_NewButtonControlFrame(&aFrame);
}
else if (val.EqualsIgnoreCase("button")) {
rv = NS_NewButtonControlFrame(aFrame);
rv = NS_NewButtonControlFrame(&aFrame);
}
else if (val.EqualsIgnoreCase("checkbox")) {
rv = NS_NewCheckboxControlFrame(aFrame);
rv = NS_NewCheckboxControlFrame(&aFrame);
}
else if (val.EqualsIgnoreCase("file")) {
rv = NS_NewFileControlFrame(aFrame);
rv = NS_NewFileControlFrame(&aFrame);
}
else if (val.EqualsIgnoreCase("hidden")) {
rv = NS_NewButtonControlFrame(aFrame);
rv = NS_NewButtonControlFrame(&aFrame);
}
else if (val.EqualsIgnoreCase("image")) {
rv = NS_NewImageControlFrame(aFrame);
rv = NS_NewImageControlFrame(&aFrame);
}
else if (val.EqualsIgnoreCase("password")) {
rv = NS_NewTextControlFrame(aFrame);
rv = NS_NewTextControlFrame(&aFrame);
}
else if (val.EqualsIgnoreCase("radio")) {
rv = NS_NewRadioControlFrame(aFrame);
rv = NS_NewRadioControlFrame(&aFrame);
}
else if (val.EqualsIgnoreCase("text")) {
rv = NS_NewTextControlFrame(aFrame);
rv = NS_NewTextControlFrame(&aFrame);
}
else {
rv = NS_NewTextControlFrame(aFrame);
rv = NS_NewTextControlFrame(&aFrame);
}
} else {
rv = NS_NewTextControlFrame(aFrame);
rv = NS_NewTextControlFrame(&aFrame);
}
return rv;
@ -770,7 +770,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresContext* aPresContext
nsIFrame* captionFrame = nsnull;
// Create an anonymous table outer frame which holds the caption and table frame
NS_NewTableOuterFrame(aNewFrame);
NS_NewTableOuterFrame(&aNewFrame);
// Init the table outer frame and see if we need to create a view, e.g.
// the frame is absolutely positioned
@ -789,7 +789,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresContext* aPresContext
outerStyleContext, PR_FALSE);
#endif
// Create the inner table frame
aTableCreator.CreateTableFrame(innerFrame);
aTableCreator.CreateTableFrame(&innerFrame);
// This gets reset later, since there may also be a caption.
// It allows descendants to get at the inner frame before that
@ -993,7 +993,7 @@ nsCSSFrameConstructor::ConstructAnonymousTableFrame(nsIPresContext* aPr
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::tableOuterPseudo,
tableParentSC, PR_FALSE,
getter_AddRefs(outerStyleContext));
rv = NS_NewTableOuterFrame(aOuterFrame);
rv = NS_NewTableOuterFrame(&aOuterFrame);
if (NS_FAILED(rv)) return rv;
aOuterFrame->Init(*aPresContext, aContent, tableParent, outerStyleContext,
nsnull);
@ -1003,7 +1003,7 @@ nsCSSFrameConstructor::ConstructAnonymousTableFrame(nsIPresContext* aPr
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::tablePseudo,
outerStyleContext, PR_FALSE,
getter_AddRefs(innerStyleContext));
rv = aTableCreator.CreateTableFrame(aInnerFrame);
rv = aTableCreator.CreateTableFrame(&aInnerFrame);
if (NS_FAILED(rv)) return rv;
aInnerFrame->Init(*aPresContext, aContent, aOuterFrame, innerStyleContext,
nsnull);
@ -1030,7 +1030,7 @@ nsCSSFrameConstructor::ConstructTableCaptionFrame(nsIPresContext* aPres
nsIFrame*& aNewCaptionFrame,
nsTableCreator& aTableCreator)
{
nsresult rv = NS_NewAreaFrame(aNewCaptionFrame, 0);
nsresult rv = NS_NewTableCaptionFrame(&aNewCaptionFrame);
if (NS_FAILED(rv)) return rv;
const nsStyleDisplay* parentDisplay = GetDisplay(aParentFrame);
@ -1177,7 +1177,7 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPr
if (IsScrollable(aPresContext, styleDisplay)) {
// Create a scroll frame and initialize it
rv = NS_NewScrollFrame(aNewTopFrame);
rv = NS_NewScrollFrame(&aNewTopFrame);
if (NS_FAILED(rv)) return rv;
aNewTopFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull);
@ -1189,8 +1189,8 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPr
getter_AddRefs(scrolledPseudoStyle));
// Create an area container for the frame
rv = (aIsRowGroup) ? aTableCreator.CreateTableRowGroupFrame(aNewGroupFrame)
: aTableCreator.CreateTableColGroupFrame(aNewGroupFrame);
rv = (aIsRowGroup) ? aTableCreator.CreateTableRowGroupFrame(&aNewGroupFrame)
: aTableCreator.CreateTableColGroupFrame(&aNewGroupFrame);
if (NS_FAILED(rv)) return rv;
// Initialize the frame and force it to have a view
aNewGroupFrame->Init(*aPresContext, aContent, aNewTopFrame, scrolledPseudoStyle,
@ -1199,8 +1199,8 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPr
scrolledPseudoStyle, PR_TRUE);
aNewTopFrame->SetInitialChildList(*aPresContext, nsnull, aNewGroupFrame);
} else {
rv = (aIsRowGroup) ? aTableCreator.CreateTableRowGroupFrame(aNewTopFrame)
: aTableCreator.CreateTableColGroupFrame(aNewTopFrame);
rv = (aIsRowGroup) ? aTableCreator.CreateTableRowGroupFrame(&aNewTopFrame)
: aTableCreator.CreateTableColGroupFrame(&aNewTopFrame);
if (NS_FAILED(rv)) return rv;
aNewTopFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext,
nsnull);
@ -1305,7 +1305,7 @@ nsCSSFrameConstructor::ConstructTableRowFrameOnly(nsIPresContext* aPres
nsIFrame*& aNewRowFrame,
nsTableCreator& aTableCreator)
{
nsresult rv = aTableCreator.CreateTableRowFrame(aNewRowFrame);
nsresult rv = aTableCreator.CreateTableRowFrame(&aNewRowFrame);
if (NS_FAILED(rv)) return rv;
aNewRowFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext,
nsnull);
@ -1371,7 +1371,7 @@ nsCSSFrameConstructor::ConstructTableColFrameOnly(nsIPresContext* aPres
nsIFrame*& aNewColFrame,
nsTableCreator& aTableCreator)
{
nsresult rv = aTableCreator.CreateTableColFrame(aNewColFrame);
nsresult rv = aTableCreator.CreateTableColFrame(&aNewColFrame);
if (NS_FAILED(rv)) return rv;
aNewColFrame->Init(*aPresContext, aContent, aParentFrame,
aStyleContext, nsnull);
@ -1470,7 +1470,7 @@ nsCSSFrameConstructor::ConstructTableCellFrameOnly(nsIPresContext* aPre
nsresult rv;
// Create a table cell frame
rv = aTableCreator.CreateTableCellFrame(aNewCellFrame);
rv = aTableCreator.CreateTableCellFrame(&aNewCellFrame);
if (NS_FAILED(rv)) return rv;
// Initialize the table cell frame
@ -1478,7 +1478,7 @@ nsCSSFrameConstructor::ConstructTableCellFrameOnly(nsIPresContext* aPre
nsnull);
// Create an area frame that will format the cell's content
rv = NS_NewAreaFrame(aNewCellBodyFrame, 0);
rv = NS_NewTableCellInnerFrame(&aNewCellBodyFrame);
if (NS_FAILED(rv)) {
aNewCellFrame->DeleteFrame(*aPresContext);
aNewCellFrame = nsnull;
@ -1805,9 +1805,10 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresContext* aPresCo
aNewFrame = tableFrame;
return NS_OK;
}
// Create an area frame for the document element
nsIFrame* areaFrame;
NS_NewAreaFrame(areaFrame, 0);
NS_NewAreaFrame(&areaFrame);
areaFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext, nsnull);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, areaFrame,
styleContext, PR_FALSE);
@ -1847,7 +1848,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresContext* aPresCo
nsIFrame* scrollFrame = nsnull;
if (IsScrollable(aPresContext, display)) {
NS_NewScrollFrame(scrollFrame);
NS_NewScrollFrame(&scrollFrame);
scrollFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext,
nsnull);
@ -1875,7 +1876,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresContext* aPresCo
// XXX Until we clean up how painting damage is handled, we need to use the
// flag that says that this is the body...
NS_NewAreaFrame(areaFrame, NS_BLOCK_DOCUMENT_ROOT|NS_BLOCK_MARGIN_ROOT);
NS_NewDocumentElementFrame(&areaFrame);
areaFrame->Init(*aPresContext, aDocElement, parFrame, styleContext, nsnull);
if (scrollFrame) {
@ -1971,7 +1972,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
nsCOMPtr<nsIStyleContext> viewportPseudoStyle;
// Create the viewport frame
NS_NewViewportFrame(viewportFrame);
NS_NewViewportFrame(&viewportFrame);
// Create a pseudo element style context
aPresContext->ResolvePseudoStyleContextFor(nsnull, nsLayoutAtoms::viewportPseudo,
@ -2035,7 +2036,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
// scroll frame
nsIFrame* scrollFrame;
if (isScrollable) {
NS_NewScrollFrame(scrollFrame);
NS_NewScrollFrame(&scrollFrame);
// XXX should probably be a scrolled content pseudo style context
scrollFrame->Init(*aPresContext, nsnull, viewportFrame, viewportPseudoStyle,
nsnull);
@ -2056,7 +2057,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
nsIFrame* pageSequenceFrame;
// Create a page sequence frame
NS_NewSimplePageSequenceFrame(pageSequenceFrame);
NS_NewSimplePageSequenceFrame(&pageSequenceFrame);
// XXX should probably be a page sequence pseudo style context
pageSequenceFrame->Init(*aPresContext, nsnull, isScrollable ? scrollFrame :
viewportFrame, viewportPseudoStyle, nsnull);
@ -2067,7 +2068,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
// Create the first page
nsIFrame* pageFrame;
NS_NewPageFrame(pageFrame);
NS_NewPageFrame(&pageFrame);
// The page is the containing block for 'fixed' elements. which are repeated
// on every page
@ -2112,7 +2113,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
// document element's frame, then we could eliminate the root frame and make
// the document element frame a child of the viewport (or its scroll frame)
nsIFrame* rootFrame;
NS_NewRootFrame(rootFrame);
NS_NewRootFrame(&rootFrame);
// XXX this should be a root pseudo style context
rootFrame->Init(*aPresContext, nsnull, isScrollable ? scrollFrame :
@ -2202,7 +2203,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresContext* aPresContex
if ((1 == size) || (kNoSizeSpecified == size)) {
// Construct a frame-based combo box
nsIFrame * comboboxFrame;
rv = NS_NewComboboxControlFrame(comboboxFrame);
rv = NS_NewComboboxControlFrame(&comboboxFrame);
nsIFrame* geometricParent = aParentFrame;
if (aIsAbsolutelyPositioned) {
@ -2215,7 +2216,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresContext* aPresContex
nsIComboboxControlFrame* comboBox = nsnull;
if (NS_OK == comboboxFrame->QueryInterface(kIComboboxControlFrameIID, (void**)&comboBox)) {
nsIFrame * listFrame;
rv = NS_NewListControlFrame(listFrame);
rv = NS_NewListControlFrame(&listFrame);
// This is important to do before it is initialized
// it tells it that it is in "DropDown Mode"
@ -2323,7 +2324,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresContext* aPresContex
} else {
// Construct a frame-based list box
nsIFrame * listFrame;
rv = NS_NewListControlFrame(listFrame);
rv = NS_NewListControlFrame(&listFrame);
aNewFrame = listFrame;
InitializeScrollFrame(aPresContext, aState, listFrame, aContent, aParentFrame,
aStyleContext, aNewFrame, aIsAbsolutelyPositioned, PR_FALSE,
@ -2341,12 +2342,12 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresContext* aPresContex
}
NS_RELEASE(select);
} else {
rv = NS_NewSelectControlFrame(aNewFrame);
rv = NS_NewSelectControlFrame(&aNewFrame);
}
}
else {
// Not frame based. Use a SelectFrame which creates a native widget.
rv = NS_NewSelectControlFrame(aNewFrame);
rv = NS_NewSelectControlFrame(&aNewFrame);
}
return rv;
@ -2374,7 +2375,7 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresContext* aPresContext
nsresult rv = NS_OK;
if (nsLayoutAtoms::textTagName == aTag) {
rv = NS_NewTextFrame(newFrame);
rv = NS_NewTextFrame(&newFrame);
isReplaced = PR_TRUE; // XXX kipp: temporary
}
else {
@ -2404,17 +2405,17 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresContext* aPresContext
isReplaced = PR_TRUE;
// XXX If image display is turned off, then use ConstructAlternateImageFrame()
// instead...
rv = NS_NewImageFrame(newFrame);
rv = NS_NewImageFrame(&newFrame);
}
else if (nsHTMLAtoms::hr == aTag) {
rv = NS_NewHRFrame(newFrame);
rv = NS_NewHRFrame(&newFrame);
}
else if (nsHTMLAtoms::br == aTag) {
rv = NS_NewBRFrame(newFrame);
rv = NS_NewBRFrame(&newFrame);
isReplaced = PR_TRUE;
}
else if (nsHTMLAtoms::wbr == aTag) {
rv = NS_NewWBRFrame(newFrame);
rv = NS_NewWBRFrame(&newFrame);
}
else if (nsHTMLAtoms::input == aTag) {
isReplaced = PR_TRUE;
@ -2422,7 +2423,7 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresContext* aPresContext
}
else if (nsHTMLAtoms::textarea == aTag) {
isReplaced = PR_TRUE;
rv = NS_NewTextControlFrame(newFrame);
rv = NS_NewTextControlFrame(&newFrame);
}
else if (nsHTMLAtoms::select == aTag) {
isReplaced = PR_TRUE;
@ -2433,41 +2434,41 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresContext* aPresContext
}
else if (nsHTMLAtoms::applet == aTag) {
isReplaced = PR_TRUE;
rv = NS_NewObjectFrame(newFrame);
rv = NS_NewObjectFrame(&newFrame);
}
else if (nsHTMLAtoms::embed == aTag) {
rv = NS_NewObjectFrame(newFrame);
rv = NS_NewObjectFrame(&newFrame);
}
else if (nsHTMLAtoms::fieldset == aTag) {
rv = NS_NewFieldSetFrame(newFrame);
rv = NS_NewFieldSetFrame(&newFrame);
processChildren = PR_TRUE;
}
else if (nsHTMLAtoms::legend == aTag) {
rv = NS_NewLegendFrame(newFrame);
rv = NS_NewLegendFrame(&newFrame);
processChildren = PR_TRUE;
canBePositioned = PR_FALSE;
}
else if (nsHTMLAtoms::object == aTag) {
isReplaced = PR_TRUE;
rv = NS_NewObjectFrame(newFrame);
rv = NS_NewObjectFrame(&newFrame);
}
else if (nsHTMLAtoms::form == aTag) {
rv = NS_NewFormFrame(newFrame);
rv = NS_NewFormFrame(&newFrame);
}
else if (nsHTMLAtoms::frameset == aTag) {
rv = NS_NewHTMLFramesetFrame(newFrame);
rv = NS_NewHTMLFramesetFrame(&newFrame);
canBePositioned = PR_FALSE;
}
else if (nsHTMLAtoms::iframe == aTag) {
isReplaced = PR_TRUE;
rv = NS_NewHTMLFrameOuterFrame(newFrame);
rv = NS_NewHTMLFrameOuterFrame(&newFrame);
}
else if (nsHTMLAtoms::spacer == aTag) {
rv = NS_NewSpacerFrame(newFrame);
rv = NS_NewSpacerFrame(&newFrame);
canBePositioned = PR_FALSE;
}
else if (nsHTMLAtoms::button == aTag) {
rv = NS_NewHTMLButtonControlFrame(newFrame);
rv = NS_NewHTMLButtonControlFrame(&newFrame);
// the html4 button needs to act just like a
// regular button except contain html content
// so it must be replaced or html outside it will
@ -2476,7 +2477,7 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresContext* aPresContext
processChildren = PR_TRUE;
}
else if (nsHTMLAtoms::label == aTag) {
rv = NS_NewLabelFrame(newFrame);
rv = NS_NewLabelFrame(&newFrame);
processChildren = PR_TRUE;
}
}
@ -2611,25 +2612,25 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
// Create a frame based on the tag
if (aTag == nsXULAtoms::button)
rv = NS_NewButtonControlFrame(newFrame);
rv = NS_NewButtonControlFrame(&newFrame);
else if (aTag == nsXULAtoms::checkbox)
rv = NS_NewTriStateCheckboxFrame(newFrame);
rv = NS_NewTriStateCheckboxFrame(&newFrame);
else if (aTag == nsXULAtoms::slider)
rv = NS_NewSliderFrame(newFrame);
rv = NS_NewSliderFrame(&newFrame);
else if (aTag == nsXULAtoms::spinner)
rv = NS_NewSpinnerFrame(newFrame);
rv = NS_NewSpinnerFrame(&newFrame);
else if (aTag == nsXULAtoms::scrollbar)
rv = NS_NewScrollbarFrame(newFrame);
rv = NS_NewScrollbarFrame(&newFrame);
else if (aTag == nsXULAtoms::colorpicker)
rv = NS_NewColorPickerFrame(newFrame);
rv = NS_NewColorPickerFrame(&newFrame);
else if (aTag == nsXULAtoms::fontpicker)
rv = NS_NewFontPickerFrame(newFrame);
rv = NS_NewFontPickerFrame(&newFrame);
else if (aTag == nsXULAtoms::radio)
rv = NS_NewRadioControlFrame(newFrame);
rv = NS_NewRadioControlFrame(&newFrame);
else if (aTag == nsXULAtoms::text)
rv = NS_NewTextControlFrame(newFrame);
rv = NS_NewTextControlFrame(&newFrame);
else if (aTag == nsXULAtoms::widget)
rv = NS_NewObjectFrame(newFrame);
rv = NS_NewObjectFrame(&newFrame);
// TREE CONSTRUCTION
// The following code is used to construct a tree view from the XUL content
@ -2736,18 +2737,18 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
}
else if (aTag == nsXULAtoms::treeindentation)
{
rv = NS_NewTreeIndentationFrame(newFrame);
rv = NS_NewTreeIndentationFrame(&newFrame);
}
// End of TREE CONSTRUCTION code here (there's more later on in the function)
// TOOLBAR CONSTRUCTION
else if (aTag == nsXULAtoms::toolbox) {
processChildren = PR_TRUE;
rv = NS_NewToolboxFrame(newFrame);
rv = NS_NewToolboxFrame(&newFrame);
}
else if (aTag == nsXULAtoms::toolbar) {
processChildren = PR_TRUE;
rv = NS_NewToolbarFrame(newFrame);
rv = NS_NewToolbarFrame(&newFrame);
}
// End of TOOLBAR CONSTRUCTION logic
@ -2755,7 +2756,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
else if (aTag == nsXULAtoms::progressmeter) {
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewProgressMeterFrame(newFrame);
rv = NS_NewProgressMeterFrame(&newFrame);
}
// End of PROGRESS METER CONSTRUCTION logic
@ -2763,7 +2764,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
else if (aTag == nsXULAtoms::box || aTag == nsXULAtoms::tabbox || aTag == nsXULAtoms::tabpage || aTag == nsXULAtoms::tabcontrol) {
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewBoxFrame(newFrame);
rv = NS_NewBoxFrame(&newFrame);
}
// End of BOX CONSTRUCTION logic
@ -2771,7 +2772,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
else if (aTag == nsXULAtoms::titledbutton) {
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewTitledButtonFrame(newFrame);
rv = NS_NewTitledButtonFrame(&newFrame);
}
// End of TITLED BUTTON CONSTRUCTION logic
@ -2779,7 +2780,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
else if (aTag == nsXULAtoms::deck || aTag == nsXULAtoms::tabpanel) {
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewDeckFrame(newFrame);
rv = NS_NewDeckFrame(&newFrame);
}
// End of DECK CONSTRUCTION logic
@ -2787,7 +2788,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
else if (aTag == nsXULAtoms::tab) {
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewTabFrame(newFrame);
rv = NS_NewTabFrame(&newFrame);
}
// End of TAB CONSTRUCTION logic
@ -2885,7 +2886,7 @@ nsCSSFrameConstructor::InitializeScrollFrame(nsIPresContext* aPresConte
// Create an area container for the frame
nsIFrame* scrolledFrame;
NS_NewAreaFrame(scrolledFrame, NS_BLOCK_SHRINK_WRAP);
NS_NewAreaFrame(&scrolledFrame, NS_BLOCK_SHRINK_WRAP);
// Initialize the frame and force it to have a view
scrolledFrame->Init(*aPresContext, aContent, scrollFrame,
@ -2984,7 +2985,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPre
// Create a scroll frame
nsIFrame* scrollFrame;
NS_NewScrollFrame(scrollFrame);
NS_NewScrollFrame(&scrollFrame);
// Initialize it
InitializeScrollFrame(aPresContext, aState, scrollFrame, aContent, aParentFrame,
@ -3003,8 +3004,8 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPre
isFixedPositioned = PR_TRUE;
}
// Create an area frame
NS_NewAreaFrame(newFrame, NS_BLOCK_MARGIN_ROOT);
// Create a frame to wrap up the absolute positioned item
NS_NewAbsoluteItemWrapperFrame(&newFrame);
newFrame->Init(*aPresContext, aContent,
(isAbsolutelyPositioned
? aState.mAbsoluteItems.containingBlock
@ -3044,7 +3045,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPre
(NS_STYLE_DISPLAY_INLINE == aDisplay->mDisplay) ||
(NS_STYLE_DISPLAY_LIST_ITEM == aDisplay->mDisplay))) {
// Create an area frame
NS_NewAreaFrame(newFrame, NS_BLOCK_SHRINK_WRAP);
NS_NewFloatingItemWrapperFrame(&newFrame);
// Initialize the frame
newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull);
@ -3072,11 +3073,11 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPre
else if (NS_STYLE_POSITION_RELATIVE == position->mPosition) {
// Is it block-level or inline-level?
if (NS_STYLE_DISPLAY_BLOCK == aDisplay->mDisplay) {
// Create an area frame. No space manager, though
NS_NewAreaFrame(newFrame, NS_AREA_NO_SPACE_MGR);
// Create a wrapper frame. No space manager, though
NS_NewRelativeItemWrapperFrame(&newFrame);
} else {
// Create a positioned inline frame
NS_NewPositionedInlineFrame(newFrame);
NS_NewPositionedInlineFrame(&newFrame);
}
// Initialize the frame
@ -3129,7 +3130,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPre
case NS_STYLE_DISPLAY_LIST_ITEM:
case NS_STYLE_DISPLAY_RUN_IN:
case NS_STYLE_DISPLAY_COMPACT:
rv = NS_NewBlockFrame(newFrame, 0);
rv = NS_NewBlockFrame(&newFrame);
processChildren = PR_TRUE;
newFrameIsFloaterContainer = PR_TRUE;
if (NS_SUCCEEDED(rv)) {
@ -3140,7 +3141,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPre
break;
case NS_STYLE_DISPLAY_INLINE:
rv = NS_NewInlineFrame(newFrame);
rv = NS_NewInlineFrame(&newFrame);
processChildren = PR_TRUE;
haveFirstLetterStyle = aHaveFirstLetterStyle;
break;
@ -4944,11 +4945,11 @@ nsCSSFrameConstructor::ConstructAlternateImageFrame(nsIPresContext* aPresContex
aStyleContext->GetStyleData(eStyleStruct_Position);
if (position->IsAbsolutelyPositioned()) {
NS_NewAreaFrame(containerFrame, NS_BLOCK_MARGIN_ROOT);
NS_NewAbsoluteItemWrapperFrame(&containerFrame);
} else if (display->IsFloating() || (NS_STYLE_DISPLAY_BLOCK == display->mDisplay)) {
NS_NewBlockFrame(containerFrame, 0);
NS_NewBlockFrame(&containerFrame);
} else {
NS_NewInlineFrame(containerFrame);
NS_NewInlineFrame(&containerFrame);
}
containerFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, containerFrame,
@ -4959,7 +4960,7 @@ nsCSSFrameConstructor::ConstructAlternateImageFrame(nsIPresContext* aPresContex
nsIFrame* textFrame;
nsIStyleContext* textStyleContext;
NS_NewTextFrame(textFrame);
NS_NewTextFrame(&textFrame);
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::textPseudo,
aStyleContext, PR_FALSE,
&textStyleContext);
@ -5129,7 +5130,7 @@ nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresContext* aPresCon
nsIFrame* newFrame;
nsresult rv;
rv = NS_NewTableOuterFrame(newFrame);
rv = NS_NewTableOuterFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -5171,7 +5172,7 @@ nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresContext* aPresCon
nsFrameConstructorState state(mFixedContainingBlock,
GetAbsoluteContainingBlock(aPresContext, newFrame),
captionFrame);
NS_NewAreaFrame(captionFrame, 0);
NS_NewTableCaptionFrame(&captionFrame);
captionFrame->Init(*aPresContext, caption, newFrame, captionStyle, nsnull);
ProcessChildren(aPresContext, state, caption, captionFrame,
PR_TRUE, childItems);
@ -5209,7 +5210,7 @@ nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresContext* aPresContext,
nsIFrame* newFrame;
nsresult rv;
rv = NS_NewTableFrame(newFrame);
rv = NS_NewTableFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -5239,7 +5240,7 @@ nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresContext* aPresContext,
GetAbsoluteContainingBlock(aPresContext, newFrame),
nsnull);
NS_NewTableRowGroupFrame(headerFooterFrame);
NS_NewTableRowGroupFrame(&headerFooterFrame);
rowGroupFrame->GetContent(&headerFooter);
headerFooterFrame->Init(*aPresContext, headerFooter, newFrame,
rowGroupStyle, nsnull);
@ -5296,7 +5297,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
aFrame->GetStyleContext(&styleContext);
if (nsLayoutAtoms::textFrame == frameType) {
rv = NS_NewTextFrame(newFrame);
rv = NS_NewTextFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -5304,7 +5305,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
}
} else if (nsLayoutAtoms::inlineFrame == frameType) {
rv = NS_NewInlineFrame(newFrame);
rv = NS_NewInlineFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -5312,7 +5313,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
}
} else if (nsLayoutAtoms::blockFrame == frameType) {
rv = NS_NewBlockFrame(newFrame, 0);
rv = NS_NewBlockFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -5320,15 +5321,16 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
}
} else if (nsLayoutAtoms::areaFrame == frameType) {
rv = NS_NewAreaFrame(newFrame, 0);
rv = NS_NewAreaFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
newFrame->Init(*aPresContext, content, aParentFrame, styleContext,
aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
styleContext, PR_FALSE);
}
} else if (nsLayoutAtoms::positionedInlineFrame == frameType) {
rv = NS_NewPositionedInlineFrame(newFrame);
rv = NS_NewPositionedInlineFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -5336,7 +5338,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
}
} else if (nsLayoutAtoms::pageFrame == frameType) {
rv = NS_NewPageFrame(newFrame);
rv = NS_NewPageFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -5352,7 +5354,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
content, styleContext, &newFrame);
} else if (nsLayoutAtoms::tableRowGroupFrame == frameType) {
rv = NS_NewTableRowGroupFrame(newFrame);
rv = NS_NewTableRowGroupFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -5360,7 +5362,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
}
} else if (nsLayoutAtoms::tableRowFrame == frameType) {
rv = NS_NewTableRowFrame(newFrame);
rv = NS_NewTableRowFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -5392,7 +5394,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
}
} else if (nsLayoutAtoms::tableCellFrame == frameType) {
rv = NS_NewTableCellFrame(newFrame);
rv = NS_NewTableCellFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,

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

@ -65,12 +65,17 @@ static NS_DEFINE_IID(kIDOMHTMLOptionElementIID, NS_IDOMHTMLOPTIONELEMENT_IID);
static NS_DEFINE_IID(kIListControlFrameIID, NS_ILISTCONTROLFRAME_IID);
nsresult
NS_NewComboboxControlFrame(nsIFrame*& aResult)
NS_NewComboboxControlFrame(nsIFrame** aNewFrame)
{
aResult = new nsComboboxControlFrame;
if (nsnull == aResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsComboboxControlFrame* it = new nsComboboxControlFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}

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

@ -93,12 +93,17 @@ protected:
};
nsresult
NS_NewFieldSetFrame(nsIFrame*& aResult)
NS_NewFieldSetFrame(nsIFrame** aNewFrame)
{
aResult = new nsFieldSetFrame;
if (nsnull == aResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsFieldSetFrame* it = new nsFieldSetFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
@ -123,7 +128,7 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext,
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
PRUint8 flags = (mInline) ? NS_BLOCK_SHRINK_WRAP : 0;
NS_NewAreaFrame(mContentFrame, flags);
NS_NewAreaFrame(&mContentFrame, flags);
mFrames.SetFrames(mContentFrame);
// Resolve style and initialize the frame

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

@ -48,12 +48,17 @@ static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID);
static NS_DEFINE_IID(kIDOMHTMLInputElementIID, NS_IDOMHTMLINPUTELEMENT_IID);
nsresult
NS_NewFileControlFrame(nsIFrame*& aResult)
NS_NewFileControlFrame(nsIFrame** aNewFrame)
{
aResult = new nsFileControlFrame;
if (nsnull == aResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsFileControlFrame* it = new nsFileControlFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
@ -206,7 +211,7 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
if (disabled) {
text->SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::disabled, nsAutoString("1"), PR_FALSE); // XXX this should use an "empty" bool value
}
NS_NewTextControlFrame(childFrame);
NS_NewTextControlFrame(&childFrame);
//XXX: This style should be cached, rather than resolved each time.
// Get pseudo style for the text field
@ -232,7 +237,7 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
if (disabled) {
browse->SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::disabled, nsAutoString("1"), PR_FALSE); // XXX should be "empty"
}
NS_NewButtonControlFrame(childFrame);
NS_NewButtonControlFrame(&childFrame);
((nsButtonControlFrame*)childFrame)->SetMouseListener((nsIFormControlFrame*)this);
mBrowseFrame = (nsButtonControlFrame*)childFrame;

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

@ -56,12 +56,17 @@ static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
nsresult
NS_NewHTMLButtonControlFrame(nsIFrame*& aResult)
NS_NewHTMLButtonControlFrame(nsIFrame** aNewFrame)
{
aResult = new nsHTMLButtonControlFrame;
if (nsnull == aResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsHTMLButtonControlFrame* it = new nsHTMLButtonControlFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
@ -356,7 +361,7 @@ nsHTMLButtonControlFrame::SetInitialChildList(nsIPresContext& aPresContext,
PRUint8 flags = (mInline) ? NS_BLOCK_SHRINK_WRAP : 0;
nsIFrame* areaFrame;
NS_NewAreaFrame(areaFrame, flags);
NS_NewAreaFrame(&areaFrame, flags);
mFrames.SetFrames(areaFrame);
// Resolve style and initialize the frame

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

@ -143,12 +143,17 @@ nsImageControlFrame::nsImageControlFrame()
}
nsresult
NS_NewImageControlFrame(nsIFrame*& aResult)
NS_NewImageControlFrame(nsIFrame** aNewFrame)
{
aResult = new nsImageControlFrame;
if (nsnull == aResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsImageControlFrame* it = new nsImageControlFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}

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

@ -50,12 +50,17 @@ static NS_DEFINE_IID(kLegendFrameCID, NS_LEGEND_FRAME_CID);
static NS_DEFINE_IID(kIDOMHTMLLegendElementIID, NS_IDOMHTMLLEGENDELEMENT_IID);
nsresult
NS_NewLegendFrame(nsIFrame*& aResult)
NS_NewLegendFrame(nsIFrame** aNewFrame)
{
aResult = new nsLegendFrame;
if (nsnull == aResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsLegendFrame* it = new nsLegendFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
@ -91,7 +96,7 @@ nsLegendFrame::SetInitialChildList(nsIPresContext& aPresContext,
PRUint8 flags = (mInline) ? NS_BLOCK_SHRINK_WRAP : 0;
nsIFrame* areaFrame;
NS_NewAreaFrame(areaFrame, flags);
NS_NewAreaFrame(&areaFrame, flags);
mFrames.SetFrames(areaFrame);
// Resolve style and initialize the frame

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

@ -92,13 +92,17 @@ static NS_DEFINE_IID(kIDOMHTMLOptGroupElementIID, NS_IDOMHTMLOPTGROUPELEMENT_IID
//----------------------------------------------------------------------
nsresult
NS_NewListControlFrame(nsIFrame*& aNewFrame)
NS_NewListControlFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsListControlFrame* it = new nsListControlFrame;
if (nsnull == it) {
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aNewFrame = it;
*aNewFrame = it;
return NS_OK;
}

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

@ -48,7 +48,7 @@ class nsListControlFrame : public nsScrollFrame,
public nsIListControlFrame
{
public:
friend nsresult NS_NewListControlFrame(nsIFrame*& aNewFrame);
friend nsresult NS_NewListControlFrame(nsIFrame** aNewFrame);
// nsISupports
NS_DECL_ISUPPORTS

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

@ -66,14 +66,18 @@ static NS_DEFINE_IID(kIDOMHTMLInputElementIID, NS_IDOMHTMLINPUTELEMENT_IID);
static NS_DEFINE_IID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
static NS_DEFINE_IID(kILookAndFeelIID, NS_ILOOKANDFEEL_IID);
nsresult NS_NewTextControlFrame(nsIFrame*& aResult);
nsresult
NS_NewTextControlFrame(nsIFrame*& aResult)
NS_NewTextControlFrame(nsIFrame** aNewFrame)
{
aResult = new nsTextControlFrame;
if (nsnull == aResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsTextControlFrame* it = new nsTextControlFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}

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

@ -33,14 +33,18 @@
static NS_DEFINE_IID(kAreaFrameIID, NS_IAREAFRAME_IID);
nsresult
NS_NewAreaFrame(nsIFrame*& aResult, PRUint32 aFlags)
NS_NewAreaFrame(nsIFrame** aNewFrame, PRUint32 aFlags)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsAreaFrame* it = new nsAreaFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
it->SetFlags(aFlags);
aResult = it;
*aNewFrame = it;
return NS_OK;
}
@ -269,7 +273,8 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext,
// Compute our desired size taking into account floaters that stick outside
// our box. Note that if this frame has a height specified by CSS then we
// don't do this
if ((NS_UNCONSTRAINEDSIZE == aReflowState.computedHeight) &&
if ((mFlags & NS_AREA_WRAP_HEIGHT) &&
(NS_UNCONSTRAINEDSIZE == aReflowState.computedHeight) &&
(NS_FRAME_OUTSIDE_CHILDREN & mState)) {
nscoord contentYMost = aDesiredSize.height;
nscoord yMost = aDesiredSize.mCombinedArea.YMost();

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

@ -44,7 +44,7 @@ struct nsStylePosition;
class nsAreaFrame : public nsBlockFrame, public nsIAreaFrame
{
public:
friend nsresult NS_NewAreaFrame(nsIFrame*& aResult, PRUint32 aFlags);
friend nsresult NS_NewAreaFrame(nsIFrame** aResult, PRUint32 aFlags);
// nsISupports
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);

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

@ -45,13 +45,17 @@ protected:
};
nsresult
NS_NewBRFrame(nsIFrame*& aResult)
NS_NewBRFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsIFrame* frame = new BRFrame;
if (nsnull == frame) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = frame;
*aNewFrame = frame;
return NS_OK;
}

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

@ -770,14 +770,17 @@ nsBlockReflowState::RecoverStateFrom(nsLineBox* aLine,
const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID;
nsresult
NS_NewBlockFrame(nsIFrame*& aNewFrame, PRUint32 aFlags)
NS_NewBlockFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsBlockFrame* it = new nsBlockFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
it->SetFlags(aFlags);
aNewFrame = it;
*aNewFrame = it;
return NS_OK;
}
@ -1298,9 +1301,10 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
// Set our width to the max width if we aren't already that
// wide. Note that the max-width has nothing to do with our
// contents (CSS2 section XXX)
nscoord maxWidth = borderPadding.left + aState.mContentArea.width +
computedWidth = borderPadding.left + aState.mContentArea.width +
borderPadding.right;
computedWidth = maxWidth;
// maxWidth = aState.mMaxElementSize.width +
// borderPadding.left + borderPadding.right;
}
else if (aState.mComputeMaxElementSize) {
if (aState.mNoWrap) {
@ -2714,7 +2718,6 @@ nsBlockFrame::ReflowInlineFrames(nsBlockReflowState& aState,
// Pull frames and reflow them until we can't
while (LINE_REFLOW_OK == lineReflowStatus) {
nsIFrame* frame;
rv = PullFrame(aState, aLine, frame);
if (NS_FAILED(rv)) {
return rv;
@ -5383,6 +5386,10 @@ nsBlockFrame::ComputeTextRuns(nsIPresContext* aPresContext)
nsresult
NS_NewAnonymousBlockFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsAnonymousBlockFrame* it = new nsAnonymousBlockFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;

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

@ -54,7 +54,7 @@ extern const nsIID kBlockFrameCID;
class nsBlockFrame : public nsBlockFrameSuper
{
public:
friend nsresult NS_NewBlockFrame(nsIFrame*& aNewFrame, PRUint32 aFlags);
friend nsresult NS_NewBlockFrame(nsIFrame** aNewFrame);
// nsISupports
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);

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

@ -770,14 +770,17 @@ nsBlockReflowState::RecoverStateFrom(nsLineBox* aLine,
const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID;
nsresult
NS_NewBlockFrame(nsIFrame*& aNewFrame, PRUint32 aFlags)
NS_NewBlockFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsBlockFrame* it = new nsBlockFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
it->SetFlags(aFlags);
aNewFrame = it;
*aNewFrame = it;
return NS_OK;
}
@ -1298,9 +1301,10 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
// Set our width to the max width if we aren't already that
// wide. Note that the max-width has nothing to do with our
// contents (CSS2 section XXX)
nscoord maxWidth = borderPadding.left + aState.mContentArea.width +
computedWidth = borderPadding.left + aState.mContentArea.width +
borderPadding.right;
computedWidth = maxWidth;
// maxWidth = aState.mMaxElementSize.width +
// borderPadding.left + borderPadding.right;
}
else if (aState.mComputeMaxElementSize) {
if (aState.mNoWrap) {
@ -2714,7 +2718,6 @@ nsBlockFrame::ReflowInlineFrames(nsBlockReflowState& aState,
// Pull frames and reflow them until we can't
while (LINE_REFLOW_OK == lineReflowStatus) {
nsIFrame* frame;
rv = PullFrame(aState, aLine, frame);
if (NS_FAILED(rv)) {
return rv;
@ -5383,6 +5386,10 @@ nsBlockFrame::ComputeTextRuns(nsIPresContext* aPresContext)
nsresult
NS_NewAnonymousBlockFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsAnonymousBlockFrame* it = new nsAnonymousBlockFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;

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

@ -770,14 +770,17 @@ nsBlockReflowState::RecoverStateFrom(nsLineBox* aLine,
const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID;
nsresult
NS_NewBlockFrame(nsIFrame*& aNewFrame, PRUint32 aFlags)
NS_NewBlockFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsBlockFrame* it = new nsBlockFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
it->SetFlags(aFlags);
aNewFrame = it;
*aNewFrame = it;
return NS_OK;
}
@ -1298,9 +1301,10 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
// Set our width to the max width if we aren't already that
// wide. Note that the max-width has nothing to do with our
// contents (CSS2 section XXX)
nscoord maxWidth = borderPadding.left + aState.mContentArea.width +
computedWidth = borderPadding.left + aState.mContentArea.width +
borderPadding.right;
computedWidth = maxWidth;
// maxWidth = aState.mMaxElementSize.width +
// borderPadding.left + borderPadding.right;
}
else if (aState.mComputeMaxElementSize) {
if (aState.mNoWrap) {
@ -2714,7 +2718,6 @@ nsBlockFrame::ReflowInlineFrames(nsBlockReflowState& aState,
// Pull frames and reflow them until we can't
while (LINE_REFLOW_OK == lineReflowStatus) {
nsIFrame* frame;
rv = PullFrame(aState, aLine, frame);
if (NS_FAILED(rv)) {
return rv;
@ -5383,6 +5386,10 @@ nsBlockFrame::ComputeTextRuns(nsIPresContext* aPresContext)
nsresult
NS_NewAnonymousBlockFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsAnonymousBlockFrame* it = new nsAnonymousBlockFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;

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

@ -55,7 +55,7 @@ protected:
nsresult
NS_NewFirstLetterFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(nsnull != aNewFrame, "null ptr");
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}

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

@ -143,17 +143,17 @@ nsIFrame::GetLogModuleInfo()
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
static NS_DEFINE_IID(kIFrameSelection, NS_IFRAMESELECTION_IID);
nsresult
NS_NewEmptyFrame(nsIFrame** aInstancePtrResult)
NS_NewEmptyFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
if (nsnull == aInstancePtrResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsIFrame* it = new nsFrame;
nsFrame* it = new nsFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aInstancePtrResult = it;
*aNewFrame = it;
return NS_OK;
}

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

@ -428,13 +428,17 @@ nsHTMLFrameOuterFrame::AttributeChanged(nsIPresContext* aPresContext,
}
nsresult
NS_NewHTMLFrameOuterFrame(nsIFrame*& aResult)
NS_NewHTMLFrameOuterFrame(nsIFrame** aNewFrame)
{
nsIFrame* frame = new nsHTMLFrameOuterFrame;
if (nsnull == frame) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsHTMLFrameOuterFrame* it = new nsHTMLFrameOuterFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = frame;
*aNewFrame = it;
return NS_OK;
}

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

@ -1006,7 +1006,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
aPresContext.ResolveStyleContextFor(child, mStyleContext,
PR_FALSE, &kidSC);
if (nsHTMLAtoms::frameset == tag) {
result = NS_NewHTMLFramesetFrame(frame);
result = NS_NewHTMLFramesetFrame(&frame);
frame->Init(aPresContext, child, this, kidSC, nsnull);
childTypes[mChildCount] = FRAMESET;
@ -1016,7 +1016,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
childFrame->SetParentBorderColor(borderColor);
childBorderColors[mChildCount].Set(childFrame->GetBorderColor());
} else { // frame
result = NS_NewHTMLFrameOuterFrame(frame);
result = NS_NewHTMLFrameOuterFrame(&frame);
frame->Init(aPresContext, child, this, kidSC, nsnull);
childTypes[mChildCount] = FRAME;
@ -1510,13 +1510,17 @@ nsHTMLFramesetFrame::EndMouseDrag()
}
nsresult
NS_NewHTMLFramesetFrame(nsIFrame*& aResult)
NS_NewHTMLFramesetFrame(nsIFrame** aNewFrame)
{
nsIFrame* frame = new nsHTMLFramesetFrame;
if (nsnull == frame) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsHTMLFramesetFrame* it = new nsHTMLFramesetFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = frame;
*aNewFrame = it;
return NS_OK;
}

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

@ -91,13 +91,17 @@ private:
//----------------------------------------------------------------------
nsresult
NS_NewRootFrame(nsIFrame*& aResult)
NS_NewRootFrame(nsIFrame** aNewFrame)
{
RootFrame* frame = new RootFrame;
if (nsnull == frame) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
RootFrame* it = new RootFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = frame;
*aNewFrame = it;
return NS_OK;
}

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

@ -235,9 +235,8 @@ NS_CreateHTMLElement(nsIHTMLContent** aResult,
// Factory methods for creating html layout objects
extern nsresult NS_NewAreaFrame(nsIFrame*& aNewFrame, PRUint32 aFlags);
extern nsresult NS_NewBRFrame(nsIFrame*& aNewFrame);
extern nsresult NS_NewBlockFrame(nsIFrame*& aNewFrame, PRUint32 aFlags);
// These are variations on AreaFrame with slightly different layout
// policies.
// Flags for block/area frames
#define NS_BLOCK_SHRINK_WRAP 0x1
@ -245,56 +244,99 @@ extern nsresult NS_NewBlockFrame(nsIFrame*& aNewFrame, PRUint32 aFlags);
#define NS_BLOCK_MARGIN_ROOT 0x4
#define NS_BLOCK_DOCUMENT_ROOT 0x8
#define NS_AREA_NO_SPACE_MGR 0x10
#define NS_AREA_WRAP_HEIGHT 0x20
extern nsresult NS_NewCommentFrame(nsIFrame*& aFrameResult);
extern nsresult NS_NewHRFrame(nsIFrame*& aNewFrame);
// Create a basic area frame. By default, area frames will extend
// their height to cover any children that "stick out".
extern nsresult NS_NewAreaFrame(nsIFrame** aNewFrame,
PRUint32 aFlags = NS_AREA_WRAP_HEIGHT);
// These AreaFrame's shrink wrap around their contents
inline nsresult NS_NewTableCellInnerFrame(nsIFrame** aNewFrame) {
return NS_NewAreaFrame(aNewFrame, NS_AREA_WRAP_HEIGHT);
}
inline nsresult NS_NewTableCaptionFrame(nsIFrame** aNewFrame) {
return NS_NewAreaFrame(aNewFrame, NS_AREA_WRAP_HEIGHT);
}
// This type of AreaFrame shrink wraps, and is the document root and is a
// margin root for margin collapsing.
inline nsresult NS_NewDocumentElementFrame(nsIFrame** aNewFrame) {
return NS_NewAreaFrame(aNewFrame, NS_BLOCK_DOCUMENT_ROOT |
NS_BLOCK_MARGIN_ROOT | NS_BLOCK_SHRINK_WRAP);
}
// This type of AreaFrame is a margin root, but does not shrink wrap
inline nsresult NS_NewAbsoluteItemWrapperFrame(nsIFrame** aNewFrame) {
return NS_NewAreaFrame(aNewFrame, NS_BLOCK_MARGIN_ROOT);
}
// This type of AreaFrame shrink wraps
inline nsresult NS_NewFloatingItemWrapperFrame(nsIFrame** aNewFrame) {
return NS_NewAreaFrame(aNewFrame, NS_AREA_WRAP_HEIGHT|NS_BLOCK_SHRINK_WRAP);
}
// This type of AreaFrame doesn't use its own space manager and
// doesn't shrink wrap.
inline nsresult NS_NewRelativeItemWrapperFrame(nsIFrame** aNewFrame) {
return NS_NewAreaFrame(aNewFrame, NS_AREA_NO_SPACE_MGR);
}
extern nsresult NS_NewBRFrame(nsIFrame** aNewFrame);
// Create a frame that supports "display: block" layout behavior
extern nsresult NS_NewBlockFrame(nsIFrame** aNewFrame);
extern nsresult NS_NewCommentFrame(nsIFrame** aFrameResult);
extern nsresult NS_NewHRFrame(nsIFrame** aNewFrame);
// <frame> and <iframe>
extern nsresult NS_NewHTMLFrameOuterFrame(nsIFrame*& aNewFrame);
extern nsresult NS_NewHTMLFrameOuterFrame(nsIFrame** aNewFrame);
// <frameset>
extern nsresult NS_NewHTMLFramesetFrame(nsIFrame*& aNewFrame);
extern nsresult NS_NewHTMLFramesetFrame(nsIFrame** aNewFrame);
extern nsresult NS_NewViewportFrame(nsIFrame*& aNewFrame);
extern nsresult NS_NewRootFrame(nsIFrame*& aNewFrame);
extern nsresult NS_NewImageFrame(nsIFrame*& aFrameResult);
extern nsresult NS_NewInlineFrame(nsIFrame*& aNewFrame);
extern nsresult NS_NewPositionedInlineFrame(nsIFrame*& aNewFrame);
extern nsresult NS_NewObjectFrame(nsIFrame*& aFrameResult);
extern nsresult NS_NewSpacerFrame(nsIFrame*& aResult);
extern nsresult NS_NewTextFrame(nsIFrame*& aResult);
extern nsresult NS_NewWBRFrame(nsIFrame*& aResult);
extern nsresult NS_NewScrollFrame(nsIFrame*& aResult);
extern nsresult NS_NewSimplePageSequenceFrame(nsIFrame*& aResult);
extern nsresult NS_NewPageFrame(nsIFrame*& aResult);
extern nsresult NS_NewViewportFrame(nsIFrame** aNewFrame);
extern nsresult NS_NewRootFrame(nsIFrame** aNewFrame);
extern nsresult NS_NewImageFrame(nsIFrame** aFrameResult);
extern nsresult NS_NewInlineFrame(nsIFrame** aNewFrame);
extern nsresult NS_NewPositionedInlineFrame(nsIFrame** aNewFrame);
extern nsresult NS_NewObjectFrame(nsIFrame** aFrameResult);
extern nsresult NS_NewSpacerFrame(nsIFrame** aResult);
extern nsresult NS_NewTextFrame(nsIFrame** aResult);
extern nsresult NS_NewEmptyFrame(nsIFrame** aResult);
inline nsresult NS_NewWBRFrame(nsIFrame** aResult) {
return NS_NewEmptyFrame(aResult);
}
extern nsresult NS_NewScrollFrame(nsIFrame** aResult);
extern nsresult NS_NewSimplePageSequenceFrame(nsIFrame** aResult);
extern nsresult NS_NewPageFrame(nsIFrame** aResult);
extern nsresult NS_NewFirstLetterFrame(nsIFrame** aNewFrame);
extern nsresult NS_NewFirstLineFrame(nsIFrame** aNewFrame);
// forms
extern nsresult NS_NewFormFrame(nsIFrame*& aResult);
extern nsresult NS_NewButtonControlFrame(nsIFrame*& aResult);
extern nsresult NS_NewImageControlFrame(nsIFrame*& aResult);
extern nsresult NS_NewHTMLButtonControlFrame(nsIFrame*& aResult);
extern nsresult NS_NewCheckboxControlFrame(nsIFrame*& aResult);
extern nsresult NS_NewFieldSetFrame(nsIFrame*& aResult);
extern nsresult NS_NewFileControlFrame(nsIFrame*& aResult);
extern nsresult NS_NewLabelFrame(nsIFrame*& aResult);
extern nsresult NS_NewLegendFrame(nsIFrame*& aResult);
extern nsresult NS_NewTextControlFrame(nsIFrame*& aResult);
extern nsresult NS_NewRadioControlFrame(nsIFrame*& aResult);
extern nsresult NS_NewSelectControlFrame(nsIFrame*& aResult);
extern nsresult NS_NewListControlFrame(nsIFrame*& aResult);
extern nsresult NS_NewComboboxControlFrame(nsIFrame*& aResult);
// table frame factories
extern nsresult NS_NewTableOuterFrame(nsIFrame*& aResult);
extern nsresult NS_NewTableFrame(nsIFrame*& aResult);
extern nsresult NS_NewTableColFrame(nsIFrame*& aResult);
extern nsresult NS_NewTableColGroupFrame(nsIFrame*& aResult);
extern nsresult NS_NewTableRowFrame(nsIFrame*& aResult);
extern nsresult NS_NewTableRowGroupFrame(nsIFrame*& aResult);
extern nsresult NS_NewTableCellFrame(nsIFrame*& aResult);
extern nsresult NS_NewFormFrame(nsIFrame** aResult);
extern nsresult NS_NewButtonControlFrame(nsIFrame** aResult);
extern nsresult NS_NewImageControlFrame(nsIFrame** aResult);
extern nsresult NS_NewHTMLButtonControlFrame(nsIFrame** aResult);
extern nsresult NS_NewCheckboxControlFrame(nsIFrame** aResult);
extern nsresult NS_NewFieldSetFrame(nsIFrame** aResult);
extern nsresult NS_NewFileControlFrame(nsIFrame** aResult);
extern nsresult NS_NewLabelFrame(nsIFrame** aResult);
extern nsresult NS_NewLegendFrame(nsIFrame** aResult);
extern nsresult NS_NewTextControlFrame(nsIFrame** aResult);
extern nsresult NS_NewRadioControlFrame(nsIFrame** aResult);
extern nsresult NS_NewSelectControlFrame(nsIFrame** aResult);
extern nsresult NS_NewListControlFrame(nsIFrame** aResult);
extern nsresult NS_NewComboboxControlFrame(nsIFrame** aResult);
// Table frame factories
extern nsresult NS_NewTableOuterFrame(nsIFrame** aResult);
extern nsresult NS_NewTableFrame(nsIFrame** aResult);
extern nsresult NS_NewTableColFrame(nsIFrame** aResult);
extern nsresult NS_NewTableColGroupFrame(nsIFrame** aResult);
extern nsresult NS_NewTableRowFrame(nsIFrame** aResult);
extern nsresult NS_NewTableRowGroupFrame(nsIFrame** aResult);
extern nsresult NS_NewTableCellFrame(nsIFrame** aResult);
// XXX passing aWebShell into this is wrong
extern nsresult NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult,

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

@ -65,13 +65,17 @@ static NS_DEFINE_IID(kIHTMLDocumentIID, NS_IHTMLDOCUMENT_IID);
#define ALIGN_UNSET PRUint8(-1)
nsresult
NS_NewImageFrame(nsIFrame*& aResult)
NS_NewImageFrame(nsIFrame** aNewFrame)
{
nsImageFrame* frame = new nsImageFrame;
if (nsnull == frame) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsImageFrame* it = new nsImageFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = frame;
*aNewFrame = it;
return NS_OK;
}

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

@ -53,13 +53,17 @@ nsIID nsInlineFrame::kInlineFrameCID = INLINE_FRAME_CID;
//////////////////////////////////////////////////////////////////////
nsresult
NS_NewPositionedInlineFrame(nsIFrame*& aNewFrame)
NS_NewPositionedInlineFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsPositionedInlineFrame* it = new nsPositionedInlineFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aNewFrame = it;
*aNewFrame = it;
return NS_OK;
}
@ -269,13 +273,17 @@ nsInlineFrame::SectionData::SplitFrameList(nsFrameList& aSection1,
// Basic nsInlineFrame methods
nsresult
NS_NewInlineFrame(nsIFrame*& aNewFrame)
NS_NewInlineFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsInlineFrame* it = new nsInlineFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aNewFrame = it;
*aNewFrame = it;
return NS_OK;
}

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

@ -30,7 +30,7 @@ class nsAnonymousBlockFrame;
class nsInlineFrame : public nsInlineFrameSuper
{
public:
friend nsresult NS_NewInlineFrame(nsIFrame*& aNewFrame);
friend nsresult NS_NewInlineFrame(nsIFrame** aNewFrame);
// nsISupports overrides
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);

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

@ -366,7 +366,7 @@ nsObjectFrame::Init(nsIPresContext& aPresContext,
if(bImage)
{
nsIFrame * aNewFrame = nsnull;
rv = NS_NewImageFrame(aNewFrame);
rv = NS_NewImageFrame(&aNewFrame);
if(rv != NS_OK)
return rv;
@ -1569,12 +1569,17 @@ nsresult nsObjectFrame::GetPluginInstance(nsIPluginInstance*& aPluginInstance)
}
nsresult
NS_NewObjectFrame(nsIFrame*& aFrameResult)
NS_NewObjectFrame(nsIFrame** aNewFrame)
{
aFrameResult = new nsObjectFrame;
if (nsnull == aFrameResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsObjectFrame* it = new nsObjectFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}

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

@ -28,6 +28,21 @@
#include "nsIStyleSet.h"
#include "nsIPresShell.h"
nsresult
NS_NewPageFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsPageFrame* it = new nsPageFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsPageFrame::nsPageFrame()
{
}
@ -157,17 +172,3 @@ nsPageFrame::IsPercentageBase(PRBool& aBase) const
aBase = PR_TRUE;
return NS_OK;
}
//----------------------------------------------------------------------
nsresult
NS_NewPageFrame(nsIFrame*& aResult)
{
nsPageFrame* it = new nsPageFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = it;
return NS_OK;
}

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

@ -23,7 +23,7 @@
// Page frame class used by the simple page sequence frame
class nsPageFrame : public nsContainerFrame {
public:
friend nsresult NS_NewPageFrame(nsIFrame*& aResult);
friend nsresult NS_NewPageFrame(nsIFrame** aResult);
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,

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

@ -25,17 +25,17 @@
#include "nsLayoutAtoms.h"
nsresult
NS_NewPlaceholderFrame(nsIFrame** aInstancePtrResult)
NS_NewPlaceholderFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
if (nsnull == aInstancePtrResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsIFrame* it = new nsPlaceholderFrame;
nsPlaceholderFrame* it = new nsPlaceholderFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aInstancePtrResult = it;
*aNewFrame = it;
return NS_OK;
}

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

@ -28,6 +28,25 @@
#include "nsIPresShell.h"
#include "nsIStyleSet.h"
nsresult
NS_NewSimplePageSequenceFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsSimplePageSequenceFrame* it = new nsSimplePageSequenceFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsSimplePageSequenceFrame::nsSimplePageSequenceFrame()
{
}
nsresult
nsSimplePageSequenceFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
@ -425,17 +444,3 @@ nsSimplePageSequenceFrame::Print(nsIPresContext& aPresContext,
return rv;
}
//----------------------------------------------------------------------
nsresult
NS_NewSimplePageSequenceFrame(nsIFrame*& aResult)
{
nsSimplePageSequenceFrame* it = new nsSimplePageSequenceFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = it;
return NS_OK;
}

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

@ -25,6 +25,8 @@
class nsSimplePageSequenceFrame : public nsContainerFrame,
public nsIPageSequenceFrame {
public:
friend nsresult NS_NewSimplePageSequenceFrame(nsIFrame** aResult);
// nsISupports
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
@ -49,6 +51,7 @@ public:
NS_IMETHOD GetFrameName(nsString& aResult) const;
protected:
nsSimplePageSequenceFrame();
virtual void PaintChild(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
@ -59,9 +62,5 @@ protected:
NS_IMETHOD_(nsrefcnt) Release(void) {return nsContainerFrame::Release();}
};
/* prototypes */
nsresult
NS_NewSimplePageSequenceFrame(nsIFrame*& aResult);
#endif /* nsSimplePageSequence_h___ */

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

@ -34,6 +34,8 @@
class SpacerFrame : public nsFrame {
public:
friend nsresult NS_NewSpacerFrame(nsIFrame** aNewFrame);
// nsIHTMLReflow
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
@ -43,20 +45,29 @@ public:
PRUint8 GetType();
protected:
SpacerFrame();
virtual ~SpacerFrame();
};
nsresult
NS_NewSpacerFrame(nsIFrame*& aResult)
NS_NewSpacerFrame(nsIFrame** aNewFrame)
{
nsIFrame* frame = new SpacerFrame;
if (nsnull == frame) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
SpacerFrame* it = new SpacerFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = frame;
*aNewFrame = it;
return NS_OK;
}
SpacerFrame::SpacerFrame()
{
}
SpacerFrame::~SpacerFrame()
{
}

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

@ -437,13 +437,17 @@ protected:
//----------------------------------------------------------------------
nsresult
NS_NewTextFrame(nsIFrame*& aResult)
NS_NewTextFrame(nsIFrame** aNewFrame)
{
nsIFrame* frame = new nsTextFrame;
if (nsnull == frame) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsTextFrame* it = new nsTextFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = frame;
*aNewFrame = it;
return NS_OK;
}

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

@ -94,13 +94,17 @@ private:
//----------------------------------------------------------------------
nsresult
NS_NewViewportFrame(nsIFrame*& aResult)
NS_NewViewportFrame(nsIFrame** aNewFrame)
{
ViewportFrame* frame = new ViewportFrame;
if (nsnull == frame) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
ViewportFrame* it = new ViewportFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = frame;
*aNewFrame = it;
return NS_OK;
}

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

@ -61,7 +61,6 @@ CPPSRCS= \
nsTextFrame.cpp \
nsTextTransformer.cpp \
nsViewportFrame.cpp \
nsWBRFrame.cpp \
$(NULL)
EXPORTS = \

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

@ -61,7 +61,6 @@ CPPSRCS= \
nsTextFrame.cpp \
nsTextTransformer.cpp \
nsViewportFrame.cpp \
nsWBRFrame.cpp \
$(NULL)
CPP_OBJS= \

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

@ -33,14 +33,18 @@
static NS_DEFINE_IID(kAreaFrameIID, NS_IAREAFRAME_IID);
nsresult
NS_NewAreaFrame(nsIFrame*& aResult, PRUint32 aFlags)
NS_NewAreaFrame(nsIFrame** aNewFrame, PRUint32 aFlags)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsAreaFrame* it = new nsAreaFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
it->SetFlags(aFlags);
aResult = it;
*aNewFrame = it;
return NS_OK;
}
@ -269,7 +273,8 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext,
// Compute our desired size taking into account floaters that stick outside
// our box. Note that if this frame has a height specified by CSS then we
// don't do this
if ((NS_UNCONSTRAINEDSIZE == aReflowState.computedHeight) &&
if ((mFlags & NS_AREA_WRAP_HEIGHT) &&
(NS_UNCONSTRAINEDSIZE == aReflowState.computedHeight) &&
(NS_FRAME_OUTSIDE_CHILDREN & mState)) {
nscoord contentYMost = aDesiredSize.height;
nscoord yMost = aDesiredSize.mCombinedArea.YMost();

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

@ -44,7 +44,7 @@ struct nsStylePosition;
class nsAreaFrame : public nsBlockFrame, public nsIAreaFrame
{
public:
friend nsresult NS_NewAreaFrame(nsIFrame*& aResult, PRUint32 aFlags);
friend nsresult NS_NewAreaFrame(nsIFrame** aResult, PRUint32 aFlags);
// nsISupports
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);

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

@ -45,13 +45,17 @@ protected:
};
nsresult
NS_NewBRFrame(nsIFrame*& aResult)
NS_NewBRFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsIFrame* frame = new BRFrame;
if (nsnull == frame) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = frame;
*aNewFrame = frame;
return NS_OK;
}

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

@ -770,14 +770,17 @@ nsBlockReflowState::RecoverStateFrom(nsLineBox* aLine,
const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID;
nsresult
NS_NewBlockFrame(nsIFrame*& aNewFrame, PRUint32 aFlags)
NS_NewBlockFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsBlockFrame* it = new nsBlockFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
it->SetFlags(aFlags);
aNewFrame = it;
*aNewFrame = it;
return NS_OK;
}
@ -1298,9 +1301,10 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
// Set our width to the max width if we aren't already that
// wide. Note that the max-width has nothing to do with our
// contents (CSS2 section XXX)
nscoord maxWidth = borderPadding.left + aState.mContentArea.width +
computedWidth = borderPadding.left + aState.mContentArea.width +
borderPadding.right;
computedWidth = maxWidth;
// maxWidth = aState.mMaxElementSize.width +
// borderPadding.left + borderPadding.right;
}
else if (aState.mComputeMaxElementSize) {
if (aState.mNoWrap) {
@ -2714,7 +2718,6 @@ nsBlockFrame::ReflowInlineFrames(nsBlockReflowState& aState,
// Pull frames and reflow them until we can't
while (LINE_REFLOW_OK == lineReflowStatus) {
nsIFrame* frame;
rv = PullFrame(aState, aLine, frame);
if (NS_FAILED(rv)) {
return rv;
@ -5383,6 +5386,10 @@ nsBlockFrame::ComputeTextRuns(nsIPresContext* aPresContext)
nsresult
NS_NewAnonymousBlockFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsAnonymousBlockFrame* it = new nsAnonymousBlockFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;

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

@ -54,7 +54,7 @@ extern const nsIID kBlockFrameCID;
class nsBlockFrame : public nsBlockFrameSuper
{
public:
friend nsresult NS_NewBlockFrame(nsIFrame*& aNewFrame, PRUint32 aFlags);
friend nsresult NS_NewBlockFrame(nsIFrame** aNewFrame);
// nsISupports
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);

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

@ -770,14 +770,17 @@ nsBlockReflowState::RecoverStateFrom(nsLineBox* aLine,
const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID;
nsresult
NS_NewBlockFrame(nsIFrame*& aNewFrame, PRUint32 aFlags)
NS_NewBlockFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsBlockFrame* it = new nsBlockFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
it->SetFlags(aFlags);
aNewFrame = it;
*aNewFrame = it;
return NS_OK;
}
@ -1298,9 +1301,10 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
// Set our width to the max width if we aren't already that
// wide. Note that the max-width has nothing to do with our
// contents (CSS2 section XXX)
nscoord maxWidth = borderPadding.left + aState.mContentArea.width +
computedWidth = borderPadding.left + aState.mContentArea.width +
borderPadding.right;
computedWidth = maxWidth;
// maxWidth = aState.mMaxElementSize.width +
// borderPadding.left + borderPadding.right;
}
else if (aState.mComputeMaxElementSize) {
if (aState.mNoWrap) {
@ -2714,7 +2718,6 @@ nsBlockFrame::ReflowInlineFrames(nsBlockReflowState& aState,
// Pull frames and reflow them until we can't
while (LINE_REFLOW_OK == lineReflowStatus) {
nsIFrame* frame;
rv = PullFrame(aState, aLine, frame);
if (NS_FAILED(rv)) {
return rv;
@ -5383,6 +5386,10 @@ nsBlockFrame::ComputeTextRuns(nsIPresContext* aPresContext)
nsresult
NS_NewAnonymousBlockFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsAnonymousBlockFrame* it = new nsAnonymousBlockFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;

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

@ -770,14 +770,17 @@ nsBlockReflowState::RecoverStateFrom(nsLineBox* aLine,
const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID;
nsresult
NS_NewBlockFrame(nsIFrame*& aNewFrame, PRUint32 aFlags)
NS_NewBlockFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsBlockFrame* it = new nsBlockFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
it->SetFlags(aFlags);
aNewFrame = it;
*aNewFrame = it;
return NS_OK;
}
@ -1298,9 +1301,10 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
// Set our width to the max width if we aren't already that
// wide. Note that the max-width has nothing to do with our
// contents (CSS2 section XXX)
nscoord maxWidth = borderPadding.left + aState.mContentArea.width +
computedWidth = borderPadding.left + aState.mContentArea.width +
borderPadding.right;
computedWidth = maxWidth;
// maxWidth = aState.mMaxElementSize.width +
// borderPadding.left + borderPadding.right;
}
else if (aState.mComputeMaxElementSize) {
if (aState.mNoWrap) {
@ -2714,7 +2718,6 @@ nsBlockFrame::ReflowInlineFrames(nsBlockReflowState& aState,
// Pull frames and reflow them until we can't
while (LINE_REFLOW_OK == lineReflowStatus) {
nsIFrame* frame;
rv = PullFrame(aState, aLine, frame);
if (NS_FAILED(rv)) {
return rv;
@ -5383,6 +5386,10 @@ nsBlockFrame::ComputeTextRuns(nsIPresContext* aPresContext)
nsresult
NS_NewAnonymousBlockFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsAnonymousBlockFrame* it = new nsAnonymousBlockFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;

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

@ -55,7 +55,7 @@ protected:
nsresult
NS_NewFirstLetterFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(nsnull != aNewFrame, "null ptr");
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}

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

@ -143,17 +143,17 @@ nsIFrame::GetLogModuleInfo()
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
static NS_DEFINE_IID(kIFrameSelection, NS_IFRAMESELECTION_IID);
nsresult
NS_NewEmptyFrame(nsIFrame** aInstancePtrResult)
NS_NewEmptyFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
if (nsnull == aInstancePtrResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsIFrame* it = new nsFrame;
nsFrame* it = new nsFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aInstancePtrResult = it;
*aNewFrame = it;
return NS_OK;
}

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

@ -60,13 +60,17 @@ protected:
};
nsresult
NS_NewHRFrame(nsIFrame*& aResult)
NS_NewHRFrame(nsIFrame** aNewFrame)
{
nsIFrame* frame = new HRuleFrame;
if (nsnull == frame) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
HRuleFrame* it = new HRuleFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = frame;
*aNewFrame = it;
return NS_OK;
}

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

@ -91,13 +91,17 @@ private:
//----------------------------------------------------------------------
nsresult
NS_NewRootFrame(nsIFrame*& aResult)
NS_NewRootFrame(nsIFrame** aNewFrame)
{
RootFrame* frame = new RootFrame;
if (nsnull == frame) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
RootFrame* it = new RootFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = frame;
*aNewFrame = it;
return NS_OK;
}

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

@ -235,9 +235,8 @@ NS_CreateHTMLElement(nsIHTMLContent** aResult,
// Factory methods for creating html layout objects
extern nsresult NS_NewAreaFrame(nsIFrame*& aNewFrame, PRUint32 aFlags);
extern nsresult NS_NewBRFrame(nsIFrame*& aNewFrame);
extern nsresult NS_NewBlockFrame(nsIFrame*& aNewFrame, PRUint32 aFlags);
// These are variations on AreaFrame with slightly different layout
// policies.
// Flags for block/area frames
#define NS_BLOCK_SHRINK_WRAP 0x1
@ -245,56 +244,99 @@ extern nsresult NS_NewBlockFrame(nsIFrame*& aNewFrame, PRUint32 aFlags);
#define NS_BLOCK_MARGIN_ROOT 0x4
#define NS_BLOCK_DOCUMENT_ROOT 0x8
#define NS_AREA_NO_SPACE_MGR 0x10
#define NS_AREA_WRAP_HEIGHT 0x20
extern nsresult NS_NewCommentFrame(nsIFrame*& aFrameResult);
extern nsresult NS_NewHRFrame(nsIFrame*& aNewFrame);
// Create a basic area frame. By default, area frames will extend
// their height to cover any children that "stick out".
extern nsresult NS_NewAreaFrame(nsIFrame** aNewFrame,
PRUint32 aFlags = NS_AREA_WRAP_HEIGHT);
// These AreaFrame's shrink wrap around their contents
inline nsresult NS_NewTableCellInnerFrame(nsIFrame** aNewFrame) {
return NS_NewAreaFrame(aNewFrame, NS_AREA_WRAP_HEIGHT);
}
inline nsresult NS_NewTableCaptionFrame(nsIFrame** aNewFrame) {
return NS_NewAreaFrame(aNewFrame, NS_AREA_WRAP_HEIGHT);
}
// This type of AreaFrame shrink wraps, and is the document root and is a
// margin root for margin collapsing.
inline nsresult NS_NewDocumentElementFrame(nsIFrame** aNewFrame) {
return NS_NewAreaFrame(aNewFrame, NS_BLOCK_DOCUMENT_ROOT |
NS_BLOCK_MARGIN_ROOT | NS_BLOCK_SHRINK_WRAP);
}
// This type of AreaFrame is a margin root, but does not shrink wrap
inline nsresult NS_NewAbsoluteItemWrapperFrame(nsIFrame** aNewFrame) {
return NS_NewAreaFrame(aNewFrame, NS_BLOCK_MARGIN_ROOT);
}
// This type of AreaFrame shrink wraps
inline nsresult NS_NewFloatingItemWrapperFrame(nsIFrame** aNewFrame) {
return NS_NewAreaFrame(aNewFrame, NS_AREA_WRAP_HEIGHT|NS_BLOCK_SHRINK_WRAP);
}
// This type of AreaFrame doesn't use its own space manager and
// doesn't shrink wrap.
inline nsresult NS_NewRelativeItemWrapperFrame(nsIFrame** aNewFrame) {
return NS_NewAreaFrame(aNewFrame, NS_AREA_NO_SPACE_MGR);
}
extern nsresult NS_NewBRFrame(nsIFrame** aNewFrame);
// Create a frame that supports "display: block" layout behavior
extern nsresult NS_NewBlockFrame(nsIFrame** aNewFrame);
extern nsresult NS_NewCommentFrame(nsIFrame** aFrameResult);
extern nsresult NS_NewHRFrame(nsIFrame** aNewFrame);
// <frame> and <iframe>
extern nsresult NS_NewHTMLFrameOuterFrame(nsIFrame*& aNewFrame);
extern nsresult NS_NewHTMLFrameOuterFrame(nsIFrame** aNewFrame);
// <frameset>
extern nsresult NS_NewHTMLFramesetFrame(nsIFrame*& aNewFrame);
extern nsresult NS_NewHTMLFramesetFrame(nsIFrame** aNewFrame);
extern nsresult NS_NewViewportFrame(nsIFrame*& aNewFrame);
extern nsresult NS_NewRootFrame(nsIFrame*& aNewFrame);
extern nsresult NS_NewImageFrame(nsIFrame*& aFrameResult);
extern nsresult NS_NewInlineFrame(nsIFrame*& aNewFrame);
extern nsresult NS_NewPositionedInlineFrame(nsIFrame*& aNewFrame);
extern nsresult NS_NewObjectFrame(nsIFrame*& aFrameResult);
extern nsresult NS_NewSpacerFrame(nsIFrame*& aResult);
extern nsresult NS_NewTextFrame(nsIFrame*& aResult);
extern nsresult NS_NewWBRFrame(nsIFrame*& aResult);
extern nsresult NS_NewScrollFrame(nsIFrame*& aResult);
extern nsresult NS_NewSimplePageSequenceFrame(nsIFrame*& aResult);
extern nsresult NS_NewPageFrame(nsIFrame*& aResult);
extern nsresult NS_NewViewportFrame(nsIFrame** aNewFrame);
extern nsresult NS_NewRootFrame(nsIFrame** aNewFrame);
extern nsresult NS_NewImageFrame(nsIFrame** aFrameResult);
extern nsresult NS_NewInlineFrame(nsIFrame** aNewFrame);
extern nsresult NS_NewPositionedInlineFrame(nsIFrame** aNewFrame);
extern nsresult NS_NewObjectFrame(nsIFrame** aFrameResult);
extern nsresult NS_NewSpacerFrame(nsIFrame** aResult);
extern nsresult NS_NewTextFrame(nsIFrame** aResult);
extern nsresult NS_NewEmptyFrame(nsIFrame** aResult);
inline nsresult NS_NewWBRFrame(nsIFrame** aResult) {
return NS_NewEmptyFrame(aResult);
}
extern nsresult NS_NewScrollFrame(nsIFrame** aResult);
extern nsresult NS_NewSimplePageSequenceFrame(nsIFrame** aResult);
extern nsresult NS_NewPageFrame(nsIFrame** aResult);
extern nsresult NS_NewFirstLetterFrame(nsIFrame** aNewFrame);
extern nsresult NS_NewFirstLineFrame(nsIFrame** aNewFrame);
// forms
extern nsresult NS_NewFormFrame(nsIFrame*& aResult);
extern nsresult NS_NewButtonControlFrame(nsIFrame*& aResult);
extern nsresult NS_NewImageControlFrame(nsIFrame*& aResult);
extern nsresult NS_NewHTMLButtonControlFrame(nsIFrame*& aResult);
extern nsresult NS_NewCheckboxControlFrame(nsIFrame*& aResult);
extern nsresult NS_NewFieldSetFrame(nsIFrame*& aResult);
extern nsresult NS_NewFileControlFrame(nsIFrame*& aResult);
extern nsresult NS_NewLabelFrame(nsIFrame*& aResult);
extern nsresult NS_NewLegendFrame(nsIFrame*& aResult);
extern nsresult NS_NewTextControlFrame(nsIFrame*& aResult);
extern nsresult NS_NewRadioControlFrame(nsIFrame*& aResult);
extern nsresult NS_NewSelectControlFrame(nsIFrame*& aResult);
extern nsresult NS_NewListControlFrame(nsIFrame*& aResult);
extern nsresult NS_NewComboboxControlFrame(nsIFrame*& aResult);
// table frame factories
extern nsresult NS_NewTableOuterFrame(nsIFrame*& aResult);
extern nsresult NS_NewTableFrame(nsIFrame*& aResult);
extern nsresult NS_NewTableColFrame(nsIFrame*& aResult);
extern nsresult NS_NewTableColGroupFrame(nsIFrame*& aResult);
extern nsresult NS_NewTableRowFrame(nsIFrame*& aResult);
extern nsresult NS_NewTableRowGroupFrame(nsIFrame*& aResult);
extern nsresult NS_NewTableCellFrame(nsIFrame*& aResult);
extern nsresult NS_NewFormFrame(nsIFrame** aResult);
extern nsresult NS_NewButtonControlFrame(nsIFrame** aResult);
extern nsresult NS_NewImageControlFrame(nsIFrame** aResult);
extern nsresult NS_NewHTMLButtonControlFrame(nsIFrame** aResult);
extern nsresult NS_NewCheckboxControlFrame(nsIFrame** aResult);
extern nsresult NS_NewFieldSetFrame(nsIFrame** aResult);
extern nsresult NS_NewFileControlFrame(nsIFrame** aResult);
extern nsresult NS_NewLabelFrame(nsIFrame** aResult);
extern nsresult NS_NewLegendFrame(nsIFrame** aResult);
extern nsresult NS_NewTextControlFrame(nsIFrame** aResult);
extern nsresult NS_NewRadioControlFrame(nsIFrame** aResult);
extern nsresult NS_NewSelectControlFrame(nsIFrame** aResult);
extern nsresult NS_NewListControlFrame(nsIFrame** aResult);
extern nsresult NS_NewComboboxControlFrame(nsIFrame** aResult);
// Table frame factories
extern nsresult NS_NewTableOuterFrame(nsIFrame** aResult);
extern nsresult NS_NewTableFrame(nsIFrame** aResult);
extern nsresult NS_NewTableColFrame(nsIFrame** aResult);
extern nsresult NS_NewTableColGroupFrame(nsIFrame** aResult);
extern nsresult NS_NewTableRowFrame(nsIFrame** aResult);
extern nsresult NS_NewTableRowGroupFrame(nsIFrame** aResult);
extern nsresult NS_NewTableCellFrame(nsIFrame** aResult);
// XXX passing aWebShell into this is wrong
extern nsresult NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult,

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

@ -65,13 +65,17 @@ static NS_DEFINE_IID(kIHTMLDocumentIID, NS_IHTMLDOCUMENT_IID);
#define ALIGN_UNSET PRUint8(-1)
nsresult
NS_NewImageFrame(nsIFrame*& aResult)
NS_NewImageFrame(nsIFrame** aNewFrame)
{
nsImageFrame* frame = new nsImageFrame;
if (nsnull == frame) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsImageFrame* it = new nsImageFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = frame;
*aNewFrame = it;
return NS_OK;
}

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

@ -53,13 +53,17 @@ nsIID nsInlineFrame::kInlineFrameCID = INLINE_FRAME_CID;
//////////////////////////////////////////////////////////////////////
nsresult
NS_NewPositionedInlineFrame(nsIFrame*& aNewFrame)
NS_NewPositionedInlineFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsPositionedInlineFrame* it = new nsPositionedInlineFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aNewFrame = it;
*aNewFrame = it;
return NS_OK;
}
@ -269,13 +273,17 @@ nsInlineFrame::SectionData::SplitFrameList(nsFrameList& aSection1,
// Basic nsInlineFrame methods
nsresult
NS_NewInlineFrame(nsIFrame*& aNewFrame)
NS_NewInlineFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsInlineFrame* it = new nsInlineFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aNewFrame = it;
*aNewFrame = it;
return NS_OK;
}

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

@ -30,7 +30,7 @@ class nsAnonymousBlockFrame;
class nsInlineFrame : public nsInlineFrameSuper
{
public:
friend nsresult NS_NewInlineFrame(nsIFrame*& aNewFrame);
friend nsresult NS_NewInlineFrame(nsIFrame** aNewFrame);
// nsISupports overrides
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);

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

@ -366,7 +366,7 @@ nsObjectFrame::Init(nsIPresContext& aPresContext,
if(bImage)
{
nsIFrame * aNewFrame = nsnull;
rv = NS_NewImageFrame(aNewFrame);
rv = NS_NewImageFrame(&aNewFrame);
if(rv != NS_OK)
return rv;
@ -1569,12 +1569,17 @@ nsresult nsObjectFrame::GetPluginInstance(nsIPluginInstance*& aPluginInstance)
}
nsresult
NS_NewObjectFrame(nsIFrame*& aFrameResult)
NS_NewObjectFrame(nsIFrame** aNewFrame)
{
aFrameResult = new nsObjectFrame;
if (nsnull == aFrameResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsObjectFrame* it = new nsObjectFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}

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

@ -28,6 +28,21 @@
#include "nsIStyleSet.h"
#include "nsIPresShell.h"
nsresult
NS_NewPageFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsPageFrame* it = new nsPageFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsPageFrame::nsPageFrame()
{
}
@ -157,17 +172,3 @@ nsPageFrame::IsPercentageBase(PRBool& aBase) const
aBase = PR_TRUE;
return NS_OK;
}
//----------------------------------------------------------------------
nsresult
NS_NewPageFrame(nsIFrame*& aResult)
{
nsPageFrame* it = new nsPageFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = it;
return NS_OK;
}

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

@ -23,7 +23,7 @@
// Page frame class used by the simple page sequence frame
class nsPageFrame : public nsContainerFrame {
public:
friend nsresult NS_NewPageFrame(nsIFrame*& aResult);
friend nsresult NS_NewPageFrame(nsIFrame** aResult);
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,

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

@ -25,17 +25,17 @@
#include "nsLayoutAtoms.h"
nsresult
NS_NewPlaceholderFrame(nsIFrame** aInstancePtrResult)
NS_NewPlaceholderFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
if (nsnull == aInstancePtrResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsIFrame* it = new nsPlaceholderFrame;
nsPlaceholderFrame* it = new nsPlaceholderFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aInstancePtrResult = it;
*aNewFrame = it;
return NS_OK;
}

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

@ -47,6 +47,25 @@ static NS_DEFINE_IID(kAreaFrameIID, NS_IAREAFRAME_IID);
//----------------------------------------------------------------------
nsresult
NS_NewScrollFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsScrollFrame* it = new nsScrollFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsScrollFrame::nsScrollFrame()
{
}
NS_IMETHODIMP
nsScrollFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
@ -592,15 +611,3 @@ nsScrollFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("Scroll", aResult);
}
//----------------------------------------------------------------------
nsresult
NS_NewScrollFrame(nsIFrame*& aResult)
{
aResult = new nsScrollFrame;
if (nsnull == aResult) {
return NS_ERROR_OUT_OF_MEMORY;
}
return NS_OK;
}

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

@ -29,6 +29,8 @@
*/
class nsScrollFrame : public nsHTMLContainerFrame {
public:
friend nsresult NS_NewScrollFrame(nsIFrame** aNewFrame);
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
@ -62,6 +64,7 @@ public:
NS_IMETHOD GetFrameName(nsString& aResult) const;
protected:
nsScrollFrame();
virtual PRIntn GetSkipSides() const;
private:
@ -69,4 +72,3 @@ private:
};
#endif /* nsScrollFrame_h___ */

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

@ -28,6 +28,25 @@
#include "nsIPresShell.h"
#include "nsIStyleSet.h"
nsresult
NS_NewSimplePageSequenceFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsSimplePageSequenceFrame* it = new nsSimplePageSequenceFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
nsSimplePageSequenceFrame::nsSimplePageSequenceFrame()
{
}
nsresult
nsSimplePageSequenceFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
@ -425,17 +444,3 @@ nsSimplePageSequenceFrame::Print(nsIPresContext& aPresContext,
return rv;
}
//----------------------------------------------------------------------
nsresult
NS_NewSimplePageSequenceFrame(nsIFrame*& aResult)
{
nsSimplePageSequenceFrame* it = new nsSimplePageSequenceFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = it;
return NS_OK;
}

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

@ -25,6 +25,8 @@
class nsSimplePageSequenceFrame : public nsContainerFrame,
public nsIPageSequenceFrame {
public:
friend nsresult NS_NewSimplePageSequenceFrame(nsIFrame** aResult);
// nsISupports
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
@ -49,6 +51,7 @@ public:
NS_IMETHOD GetFrameName(nsString& aResult) const;
protected:
nsSimplePageSequenceFrame();
virtual void PaintChild(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
@ -59,9 +62,5 @@ protected:
NS_IMETHOD_(nsrefcnt) Release(void) {return nsContainerFrame::Release();}
};
/* prototypes */
nsresult
NS_NewSimplePageSequenceFrame(nsIFrame*& aResult);
#endif /* nsSimplePageSequence_h___ */

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

@ -34,6 +34,8 @@
class SpacerFrame : public nsFrame {
public:
friend nsresult NS_NewSpacerFrame(nsIFrame** aNewFrame);
// nsIHTMLReflow
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
@ -43,20 +45,29 @@ public:
PRUint8 GetType();
protected:
SpacerFrame();
virtual ~SpacerFrame();
};
nsresult
NS_NewSpacerFrame(nsIFrame*& aResult)
NS_NewSpacerFrame(nsIFrame** aNewFrame)
{
nsIFrame* frame = new SpacerFrame;
if (nsnull == frame) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
SpacerFrame* it = new SpacerFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = frame;
*aNewFrame = it;
return NS_OK;
}
SpacerFrame::SpacerFrame()
{
}
SpacerFrame::~SpacerFrame()
{
}

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

@ -437,13 +437,17 @@ protected:
//----------------------------------------------------------------------
nsresult
NS_NewTextFrame(nsIFrame*& aResult)
NS_NewTextFrame(nsIFrame** aNewFrame)
{
nsIFrame* frame = new nsTextFrame;
if (nsnull == frame) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsTextFrame* it = new nsTextFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = frame;
*aNewFrame = it;
return NS_OK;
}

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

@ -94,13 +94,17 @@ private:
//----------------------------------------------------------------------
nsresult
NS_NewViewportFrame(nsIFrame*& aResult)
NS_NewViewportFrame(nsIFrame** aNewFrame)
{
ViewportFrame* frame = new ViewportFrame;
if (nsnull == frame) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
ViewportFrame* it = new ViewportFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = frame;
*aNewFrame = it;
return NS_OK;
}

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

@ -19,8 +19,13 @@
#include "nsFrame.h"
nsresult
NS_NewWBRFrame(nsIFrame*& aResult)
NS_NewWBRFrame(nsIFrame** aNewFrame)
{
return NS_
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsIFrame* frame = nsnull;
nsresult rv = NS_NewEmptyFrame(&frame);
if (NS_OK != rv) {

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

@ -428,13 +428,17 @@ nsHTMLFrameOuterFrame::AttributeChanged(nsIPresContext* aPresContext,
}
nsresult
NS_NewHTMLFrameOuterFrame(nsIFrame*& aResult)
NS_NewHTMLFrameOuterFrame(nsIFrame** aNewFrame)
{
nsIFrame* frame = new nsHTMLFrameOuterFrame;
if (nsnull == frame) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsHTMLFrameOuterFrame* it = new nsHTMLFrameOuterFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = frame;
*aNewFrame = it;
return NS_OK;
}

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

@ -1006,7 +1006,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
aPresContext.ResolveStyleContextFor(child, mStyleContext,
PR_FALSE, &kidSC);
if (nsHTMLAtoms::frameset == tag) {
result = NS_NewHTMLFramesetFrame(frame);
result = NS_NewHTMLFramesetFrame(&frame);
frame->Init(aPresContext, child, this, kidSC, nsnull);
childTypes[mChildCount] = FRAMESET;
@ -1016,7 +1016,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
childFrame->SetParentBorderColor(borderColor);
childBorderColors[mChildCount].Set(childFrame->GetBorderColor());
} else { // frame
result = NS_NewHTMLFrameOuterFrame(frame);
result = NS_NewHTMLFrameOuterFrame(&frame);
frame->Init(aPresContext, child, this, kidSC, nsnull);
childTypes[mChildCount] = FRAME;
@ -1510,13 +1510,17 @@ nsHTMLFramesetFrame::EndMouseDrag()
}
nsresult
NS_NewHTMLFramesetFrame(nsIFrame*& aResult)
NS_NewHTMLFramesetFrame(nsIFrame** aNewFrame)
{
nsIFrame* frame = new nsHTMLFramesetFrame;
if (nsnull == frame) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsHTMLFramesetFrame* it = new nsHTMLFramesetFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = frame;
*aNewFrame = it;
return NS_OK;
}

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

@ -142,12 +142,17 @@ nsButtonControlFrame::GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,
}
nsresult
NS_NewButtonControlFrame(nsIFrame*& aResult)
NS_NewButtonControlFrame(nsIFrame** aNewFrame)
{
aResult = new nsButtonControlFrame;
if (nsnull == aResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsButtonControlFrame* it = new nsButtonControlFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}

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

@ -118,14 +118,18 @@ protected:
PRBool mChecked;
};
nsresult NS_NewCheckboxControlFrame(nsIFrame*& aResult);
nsresult
NS_NewCheckboxControlFrame(nsIFrame*& aResult)
NS_NewCheckboxControlFrame(nsIFrame** aNewFrame)
{
aResult = new nsCheckboxControlFrame;
if (nsnull == aResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsCheckboxControlFrame* it = new nsCheckboxControlFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}

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

@ -65,12 +65,17 @@ static NS_DEFINE_IID(kIDOMHTMLOptionElementIID, NS_IDOMHTMLOPTIONELEMENT_IID);
static NS_DEFINE_IID(kIListControlFrameIID, NS_ILISTCONTROLFRAME_IID);
nsresult
NS_NewComboboxControlFrame(nsIFrame*& aResult)
NS_NewComboboxControlFrame(nsIFrame** aNewFrame)
{
aResult = new nsComboboxControlFrame;
if (nsnull == aResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsComboboxControlFrame* it = new nsComboboxControlFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}

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

@ -93,12 +93,17 @@ protected:
};
nsresult
NS_NewFieldSetFrame(nsIFrame*& aResult)
NS_NewFieldSetFrame(nsIFrame** aNewFrame)
{
aResult = new nsFieldSetFrame;
if (nsnull == aResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsFieldSetFrame* it = new nsFieldSetFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
@ -123,7 +128,7 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext,
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
PRUint8 flags = (mInline) ? NS_BLOCK_SHRINK_WRAP : 0;
NS_NewAreaFrame(mContentFrame, flags);
NS_NewAreaFrame(&mContentFrame, flags);
mFrames.SetFrames(mContentFrame);
// Resolve style and initialize the frame

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

@ -48,12 +48,17 @@ static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID);
static NS_DEFINE_IID(kIDOMHTMLInputElementIID, NS_IDOMHTMLINPUTELEMENT_IID);
nsresult
NS_NewFileControlFrame(nsIFrame*& aResult)
NS_NewFileControlFrame(nsIFrame** aNewFrame)
{
aResult = new nsFileControlFrame;
if (nsnull == aResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsFileControlFrame* it = new nsFileControlFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
@ -206,7 +211,7 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
if (disabled) {
text->SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::disabled, nsAutoString("1"), PR_FALSE); // XXX this should use an "empty" bool value
}
NS_NewTextControlFrame(childFrame);
NS_NewTextControlFrame(&childFrame);
//XXX: This style should be cached, rather than resolved each time.
// Get pseudo style for the text field
@ -232,7 +237,7 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
if (disabled) {
browse->SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::disabled, nsAutoString("1"), PR_FALSE); // XXX should be "empty"
}
NS_NewButtonControlFrame(childFrame);
NS_NewButtonControlFrame(&childFrame);
((nsButtonControlFrame*)childFrame)->SetMouseListener((nsIFormControlFrame*)this);
mBrowseFrame = (nsButtonControlFrame*)childFrame;

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

@ -405,13 +405,17 @@ nsFormFrame::OnRadioChecked(nsRadioControlFrame& aControl, PRBool aChecked)
nsresult
NS_NewFormFrame(nsIFrame*& aResult)
NS_NewFormFrame(nsIFrame** aNewFrame)
{
nsIFrame* frame = new nsFormFrame;
if (nsnull == frame) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsFormFrame* it = new nsFormFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = frame;
*aNewFrame = it;
return NS_OK;
}

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

@ -56,12 +56,17 @@ static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
nsresult
NS_NewHTMLButtonControlFrame(nsIFrame*& aResult)
NS_NewHTMLButtonControlFrame(nsIFrame** aNewFrame)
{
aResult = new nsHTMLButtonControlFrame;
if (nsnull == aResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsHTMLButtonControlFrame* it = new nsHTMLButtonControlFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
@ -356,7 +361,7 @@ nsHTMLButtonControlFrame::SetInitialChildList(nsIPresContext& aPresContext,
PRUint8 flags = (mInline) ? NS_BLOCK_SHRINK_WRAP : 0;
nsIFrame* areaFrame;
NS_NewAreaFrame(areaFrame, flags);
NS_NewAreaFrame(&areaFrame, flags);
mFrames.SetFrames(areaFrame);
// Resolve style and initialize the frame

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

@ -143,12 +143,17 @@ nsImageControlFrame::nsImageControlFrame()
}
nsresult
NS_NewImageControlFrame(nsIFrame*& aResult)
NS_NewImageControlFrame(nsIFrame** aNewFrame)
{
aResult = new nsImageControlFrame;
if (nsnull == aResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsImageControlFrame* it = new nsImageControlFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}

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

@ -111,12 +111,17 @@ protected:
};
nsresult
NS_NewLabelFrame(nsIFrame*& aResult)
NS_NewLabelFrame(nsIFrame** aNewFrame)
{
aResult = new nsLabelFrame;
if (nsnull == aResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsLabelFrame* it = new nsLabelFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
@ -353,7 +358,7 @@ nsLabelFrame::SetInitialChildList(nsIPresContext& aPresContext,
PRUint8 flags = (mInline) ? NS_BLOCK_SHRINK_WRAP : 0;
nsIFrame* areaFrame;
NS_NewAreaFrame(areaFrame, flags);
NS_NewAreaFrame(&areaFrame, flags);
mFrames.SetFrames(areaFrame);
// Resolve style and initialize the frame

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

@ -50,12 +50,17 @@ static NS_DEFINE_IID(kLegendFrameCID, NS_LEGEND_FRAME_CID);
static NS_DEFINE_IID(kIDOMHTMLLegendElementIID, NS_IDOMHTMLLEGENDELEMENT_IID);
nsresult
NS_NewLegendFrame(nsIFrame*& aResult)
NS_NewLegendFrame(nsIFrame** aNewFrame)
{
aResult = new nsLegendFrame;
if (nsnull == aResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsLegendFrame* it = new nsLegendFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}
@ -91,7 +96,7 @@ nsLegendFrame::SetInitialChildList(nsIPresContext& aPresContext,
PRUint8 flags = (mInline) ? NS_BLOCK_SHRINK_WRAP : 0;
nsIFrame* areaFrame;
NS_NewAreaFrame(areaFrame, flags);
NS_NewAreaFrame(&areaFrame, flags);
mFrames.SetFrames(areaFrame);
// Resolve style and initialize the frame

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

@ -92,13 +92,17 @@ static NS_DEFINE_IID(kIDOMHTMLOptGroupElementIID, NS_IDOMHTMLOPTGROUPELEMENT_IID
//----------------------------------------------------------------------
nsresult
NS_NewListControlFrame(nsIFrame*& aNewFrame)
NS_NewListControlFrame(nsIFrame** aNewFrame)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsListControlFrame* it = new nsListControlFrame;
if (nsnull == it) {
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aNewFrame = it;
*aNewFrame = it;
return NS_OK;
}

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

@ -48,7 +48,7 @@ class nsListControlFrame : public nsScrollFrame,
public nsIListControlFrame
{
public:
friend nsresult NS_NewListControlFrame(nsIFrame*& aNewFrame);
friend nsresult NS_NewListControlFrame(nsIFrame** aNewFrame);
// nsISupports
NS_DECL_ISUPPORTS

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

@ -50,14 +50,18 @@ static NS_DEFINE_IID(kILookAndFeelIID, NS_ILOOKANDFEEL_IID);
#define NS_DEFAULT_RADIOBOX_SIZE 12
nsresult NS_NewRadioControlFrame(nsIFrame*& aResult);
nsresult
NS_NewRadioControlFrame(nsIFrame*& aResult)
NS_NewRadioControlFrame(nsIFrame** aNewFrame)
{
aResult = new nsRadioControlFrame;
if (nsnull == aResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsRadioControlFrame* it = new nsRadioControlFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}

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

@ -163,12 +163,17 @@ protected:
};
nsresult
NS_NewSelectControlFrame(nsIFrame*& aResult)
NS_NewSelectControlFrame(nsIFrame** aNewFrame)
{
aResult = new nsSelectControlFrame;
if (nsnull == aResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsSelectControlFrame* it = new nsSelectControlFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}

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

@ -66,14 +66,18 @@ static NS_DEFINE_IID(kIDOMHTMLInputElementIID, NS_IDOMHTMLINPUTELEMENT_IID);
static NS_DEFINE_IID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
static NS_DEFINE_IID(kILookAndFeelIID, NS_ILOOKANDFEEL_IID);
nsresult NS_NewTextControlFrame(nsIFrame*& aResult);
nsresult
NS_NewTextControlFrame(nsIFrame*& aResult)
NS_NewTextControlFrame(nsIFrame** aNewFrame)
{
aResult = new nsTextControlFrame;
if (nsnull == aResult) {
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsTextControlFrame* it = new nsTextControlFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
}

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

@ -76,19 +76,19 @@
#include "nsTreeCellFrame.h"
nsresult
NS_NewTabFrame ( nsIFrame*& aNewFrame );
NS_NewTabFrame ( nsIFrame** aNewFrame );
nsresult
NS_NewDeckFrame ( nsIFrame*& aNewFrame );
NS_NewDeckFrame ( nsIFrame** aNewFrame );
nsresult
NS_NewProgressMeterFrame ( nsIFrame*& aNewFrame );
NS_NewProgressMeterFrame ( nsIFrame** aNewFrame );
nsresult
NS_NewTitledButtonFrame ( nsIFrame*& aNewFrame );
NS_NewTitledButtonFrame ( nsIFrame** aNewFrame );
nsresult
NS_NewBoxFrame ( nsIFrame*& aNewFrame );
NS_NewBoxFrame ( nsIFrame** aNewFrame );
#endif
@ -252,41 +252,41 @@ nsFrameConstructorSaveState::~nsFrameConstructorSaveState()
// Structure used when creating table frames.
struct nsTableCreator {
virtual nsresult CreateTableFrame(nsIFrame*& aNewFrame);
virtual nsresult CreateTableRowGroupFrame(nsIFrame*& aNewFrame);
virtual nsresult CreateTableColFrame(nsIFrame*& aNewFrame);
virtual nsresult CreateTableColGroupFrame(nsIFrame*& aNewFrame);
virtual nsresult CreateTableRowFrame(nsIFrame*& aNewFrame);
virtual nsresult CreateTableCellFrame(nsIFrame*& aNewFrame);
virtual nsresult CreateTableFrame(nsIFrame** aNewFrame);
virtual nsresult CreateTableRowGroupFrame(nsIFrame** aNewFrame);
virtual nsresult CreateTableColFrame(nsIFrame** aNewFrame);
virtual nsresult CreateTableColGroupFrame(nsIFrame** aNewFrame);
virtual nsresult CreateTableRowFrame(nsIFrame** aNewFrame);
virtual nsresult CreateTableCellFrame(nsIFrame** aNewFrame);
};
nsresult
nsTableCreator::CreateTableFrame(nsIFrame*& aNewFrame) {
nsTableCreator::CreateTableFrame(nsIFrame** aNewFrame) {
return NS_NewTableFrame(aNewFrame);
}
nsresult
nsTableCreator::CreateTableRowGroupFrame(nsIFrame*& aNewFrame) {
nsTableCreator::CreateTableRowGroupFrame(nsIFrame** aNewFrame) {
return NS_NewTableRowGroupFrame(aNewFrame);
}
nsresult
nsTableCreator::CreateTableColFrame(nsIFrame*& aNewFrame) {
nsTableCreator::CreateTableColFrame(nsIFrame** aNewFrame) {
return NS_NewTableColFrame(aNewFrame);
}
nsresult
nsTableCreator::CreateTableColGroupFrame(nsIFrame*& aNewFrame) {
nsTableCreator::CreateTableColGroupFrame(nsIFrame** aNewFrame) {
return NS_NewTableColGroupFrame(aNewFrame);
}
nsresult
nsTableCreator::CreateTableRowFrame(nsIFrame*& aNewFrame) {
nsTableCreator::CreateTableRowFrame(nsIFrame** aNewFrame) {
return NS_NewTableRowFrame(aNewFrame);
}
nsresult
nsTableCreator::CreateTableCellFrame(nsIFrame*& aNewFrame) {
nsTableCreator::CreateTableCellFrame(nsIFrame** aNewFrame) {
return NS_NewTableCellFrame(aNewFrame);
}
@ -294,18 +294,18 @@ nsTableCreator::CreateTableCellFrame(nsIFrame*& aNewFrame) {
// Structure used when creating tree frames
struct nsTreeCreator: public nsTableCreator {
nsresult CreateTableFrame(nsIFrame*& aNewFrame);
nsresult CreateTableCellFrame(nsIFrame*& aNewFrame);
nsresult CreateTableFrame(nsIFrame** aNewFrame);
nsresult CreateTableCellFrame(nsIFrame** aNewFrame);
};
nsresult
nsTreeCreator::CreateTableFrame(nsIFrame*& aNewFrame)
nsTreeCreator::CreateTableFrame(nsIFrame** aNewFrame)
{
return NS_NewTreeFrame(aNewFrame);
}
nsresult
nsTreeCreator::CreateTableCellFrame(nsIFrame*& aNewFrame)
nsTreeCreator::CreateTableCellFrame(nsIFrame** aNewFrame)
{
return NS_NewTreeCellFrame(aNewFrame);
}
@ -426,7 +426,7 @@ nsCSSFrameConstructor::CreateGeneratedFrameFor(nsIPresContext* aPresContex
// Create an image frame and initialize it
nsIFrame* imageFrame;
NS_NewImageFrame(imageFrame);
NS_NewImageFrame(&imageFrame);
imageFrame->Init(*aPresContext, imageContent, aParentFrame, aStyleContext, nsnull);
NS_RELEASE(imageContent);
@ -494,7 +494,7 @@ nsCSSFrameConstructor::CreateGeneratedFrameFor(nsIPresContext* aPresContex
// Create a text frame and initialize it
nsIFrame* textFrame;
NS_NewTextFrame(textFrame);
NS_NewTextFrame(&textFrame);
textFrame->Init(*aPresContext, textContent, aParentFrame, aStyleContext, nsnull);
NS_RELEASE(textContent);
@ -582,9 +582,9 @@ nsCSSFrameConstructor::CreateGeneratedContentFrame(nsIPresContext* aPresContext
nsFrameItems childFrames;
if (NS_STYLE_DISPLAY_BLOCK == displayValue) {
NS_NewBlockFrame(containerFrame, 0);
NS_NewBlockFrame(&containerFrame);
} else {
NS_NewInlineFrame(containerFrame);
NS_NewInlineFrame(&containerFrame);
}
containerFrame->Init(*aPresContext, aContent, aFrame, pseudoStyleContext, nsnull);
@ -697,40 +697,40 @@ nsCSSFrameConstructor::CreateInputFrame(nsIContent* aContent, nsIFrame*& aFrame)
nsAutoString val;
if (NS_OK == aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::type, val)) {
if (val.EqualsIgnoreCase("submit")) {
rv = NS_NewButtonControlFrame(aFrame);
rv = NS_NewButtonControlFrame(&aFrame);
}
else if (val.EqualsIgnoreCase("reset")) {
rv = NS_NewButtonControlFrame(aFrame);
rv = NS_NewButtonControlFrame(&aFrame);
}
else if (val.EqualsIgnoreCase("button")) {
rv = NS_NewButtonControlFrame(aFrame);
rv = NS_NewButtonControlFrame(&aFrame);
}
else if (val.EqualsIgnoreCase("checkbox")) {
rv = NS_NewCheckboxControlFrame(aFrame);
rv = NS_NewCheckboxControlFrame(&aFrame);
}
else if (val.EqualsIgnoreCase("file")) {
rv = NS_NewFileControlFrame(aFrame);
rv = NS_NewFileControlFrame(&aFrame);
}
else if (val.EqualsIgnoreCase("hidden")) {
rv = NS_NewButtonControlFrame(aFrame);
rv = NS_NewButtonControlFrame(&aFrame);
}
else if (val.EqualsIgnoreCase("image")) {
rv = NS_NewImageControlFrame(aFrame);
rv = NS_NewImageControlFrame(&aFrame);
}
else if (val.EqualsIgnoreCase("password")) {
rv = NS_NewTextControlFrame(aFrame);
rv = NS_NewTextControlFrame(&aFrame);
}
else if (val.EqualsIgnoreCase("radio")) {
rv = NS_NewRadioControlFrame(aFrame);
rv = NS_NewRadioControlFrame(&aFrame);
}
else if (val.EqualsIgnoreCase("text")) {
rv = NS_NewTextControlFrame(aFrame);
rv = NS_NewTextControlFrame(&aFrame);
}
else {
rv = NS_NewTextControlFrame(aFrame);
rv = NS_NewTextControlFrame(&aFrame);
}
} else {
rv = NS_NewTextControlFrame(aFrame);
rv = NS_NewTextControlFrame(&aFrame);
}
return rv;
@ -770,7 +770,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresContext* aPresContext
nsIFrame* captionFrame = nsnull;
// Create an anonymous table outer frame which holds the caption and table frame
NS_NewTableOuterFrame(aNewFrame);
NS_NewTableOuterFrame(&aNewFrame);
// Init the table outer frame and see if we need to create a view, e.g.
// the frame is absolutely positioned
@ -789,7 +789,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresContext* aPresContext
outerStyleContext, PR_FALSE);
#endif
// Create the inner table frame
aTableCreator.CreateTableFrame(innerFrame);
aTableCreator.CreateTableFrame(&innerFrame);
// This gets reset later, since there may also be a caption.
// It allows descendants to get at the inner frame before that
@ -993,7 +993,7 @@ nsCSSFrameConstructor::ConstructAnonymousTableFrame(nsIPresContext* aPr
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::tableOuterPseudo,
tableParentSC, PR_FALSE,
getter_AddRefs(outerStyleContext));
rv = NS_NewTableOuterFrame(aOuterFrame);
rv = NS_NewTableOuterFrame(&aOuterFrame);
if (NS_FAILED(rv)) return rv;
aOuterFrame->Init(*aPresContext, aContent, tableParent, outerStyleContext,
nsnull);
@ -1003,7 +1003,7 @@ nsCSSFrameConstructor::ConstructAnonymousTableFrame(nsIPresContext* aPr
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::tablePseudo,
outerStyleContext, PR_FALSE,
getter_AddRefs(innerStyleContext));
rv = aTableCreator.CreateTableFrame(aInnerFrame);
rv = aTableCreator.CreateTableFrame(&aInnerFrame);
if (NS_FAILED(rv)) return rv;
aInnerFrame->Init(*aPresContext, aContent, aOuterFrame, innerStyleContext,
nsnull);
@ -1030,7 +1030,7 @@ nsCSSFrameConstructor::ConstructTableCaptionFrame(nsIPresContext* aPres
nsIFrame*& aNewCaptionFrame,
nsTableCreator& aTableCreator)
{
nsresult rv = NS_NewAreaFrame(aNewCaptionFrame, 0);
nsresult rv = NS_NewTableCaptionFrame(&aNewCaptionFrame);
if (NS_FAILED(rv)) return rv;
const nsStyleDisplay* parentDisplay = GetDisplay(aParentFrame);
@ -1177,7 +1177,7 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPr
if (IsScrollable(aPresContext, styleDisplay)) {
// Create a scroll frame and initialize it
rv = NS_NewScrollFrame(aNewTopFrame);
rv = NS_NewScrollFrame(&aNewTopFrame);
if (NS_FAILED(rv)) return rv;
aNewTopFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull);
@ -1189,8 +1189,8 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPr
getter_AddRefs(scrolledPseudoStyle));
// Create an area container for the frame
rv = (aIsRowGroup) ? aTableCreator.CreateTableRowGroupFrame(aNewGroupFrame)
: aTableCreator.CreateTableColGroupFrame(aNewGroupFrame);
rv = (aIsRowGroup) ? aTableCreator.CreateTableRowGroupFrame(&aNewGroupFrame)
: aTableCreator.CreateTableColGroupFrame(&aNewGroupFrame);
if (NS_FAILED(rv)) return rv;
// Initialize the frame and force it to have a view
aNewGroupFrame->Init(*aPresContext, aContent, aNewTopFrame, scrolledPseudoStyle,
@ -1199,8 +1199,8 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPr
scrolledPseudoStyle, PR_TRUE);
aNewTopFrame->SetInitialChildList(*aPresContext, nsnull, aNewGroupFrame);
} else {
rv = (aIsRowGroup) ? aTableCreator.CreateTableRowGroupFrame(aNewTopFrame)
: aTableCreator.CreateTableColGroupFrame(aNewTopFrame);
rv = (aIsRowGroup) ? aTableCreator.CreateTableRowGroupFrame(&aNewTopFrame)
: aTableCreator.CreateTableColGroupFrame(&aNewTopFrame);
if (NS_FAILED(rv)) return rv;
aNewTopFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext,
nsnull);
@ -1305,7 +1305,7 @@ nsCSSFrameConstructor::ConstructTableRowFrameOnly(nsIPresContext* aPres
nsIFrame*& aNewRowFrame,
nsTableCreator& aTableCreator)
{
nsresult rv = aTableCreator.CreateTableRowFrame(aNewRowFrame);
nsresult rv = aTableCreator.CreateTableRowFrame(&aNewRowFrame);
if (NS_FAILED(rv)) return rv;
aNewRowFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext,
nsnull);
@ -1371,7 +1371,7 @@ nsCSSFrameConstructor::ConstructTableColFrameOnly(nsIPresContext* aPres
nsIFrame*& aNewColFrame,
nsTableCreator& aTableCreator)
{
nsresult rv = aTableCreator.CreateTableColFrame(aNewColFrame);
nsresult rv = aTableCreator.CreateTableColFrame(&aNewColFrame);
if (NS_FAILED(rv)) return rv;
aNewColFrame->Init(*aPresContext, aContent, aParentFrame,
aStyleContext, nsnull);
@ -1470,7 +1470,7 @@ nsCSSFrameConstructor::ConstructTableCellFrameOnly(nsIPresContext* aPre
nsresult rv;
// Create a table cell frame
rv = aTableCreator.CreateTableCellFrame(aNewCellFrame);
rv = aTableCreator.CreateTableCellFrame(&aNewCellFrame);
if (NS_FAILED(rv)) return rv;
// Initialize the table cell frame
@ -1478,7 +1478,7 @@ nsCSSFrameConstructor::ConstructTableCellFrameOnly(nsIPresContext* aPre
nsnull);
// Create an area frame that will format the cell's content
rv = NS_NewAreaFrame(aNewCellBodyFrame, 0);
rv = NS_NewTableCellInnerFrame(&aNewCellBodyFrame);
if (NS_FAILED(rv)) {
aNewCellFrame->DeleteFrame(*aPresContext);
aNewCellFrame = nsnull;
@ -1805,9 +1805,10 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresContext* aPresCo
aNewFrame = tableFrame;
return NS_OK;
}
// Create an area frame for the document element
nsIFrame* areaFrame;
NS_NewAreaFrame(areaFrame, 0);
NS_NewAreaFrame(&areaFrame);
areaFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext, nsnull);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, areaFrame,
styleContext, PR_FALSE);
@ -1847,7 +1848,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresContext* aPresCo
nsIFrame* scrollFrame = nsnull;
if (IsScrollable(aPresContext, display)) {
NS_NewScrollFrame(scrollFrame);
NS_NewScrollFrame(&scrollFrame);
scrollFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext,
nsnull);
@ -1875,7 +1876,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresContext* aPresCo
// XXX Until we clean up how painting damage is handled, we need to use the
// flag that says that this is the body...
NS_NewAreaFrame(areaFrame, NS_BLOCK_DOCUMENT_ROOT|NS_BLOCK_MARGIN_ROOT);
NS_NewDocumentElementFrame(&areaFrame);
areaFrame->Init(*aPresContext, aDocElement, parFrame, styleContext, nsnull);
if (scrollFrame) {
@ -1971,7 +1972,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
nsCOMPtr<nsIStyleContext> viewportPseudoStyle;
// Create the viewport frame
NS_NewViewportFrame(viewportFrame);
NS_NewViewportFrame(&viewportFrame);
// Create a pseudo element style context
aPresContext->ResolvePseudoStyleContextFor(nsnull, nsLayoutAtoms::viewportPseudo,
@ -2035,7 +2036,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
// scroll frame
nsIFrame* scrollFrame;
if (isScrollable) {
NS_NewScrollFrame(scrollFrame);
NS_NewScrollFrame(&scrollFrame);
// XXX should probably be a scrolled content pseudo style context
scrollFrame->Init(*aPresContext, nsnull, viewportFrame, viewportPseudoStyle,
nsnull);
@ -2056,7 +2057,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
nsIFrame* pageSequenceFrame;
// Create a page sequence frame
NS_NewSimplePageSequenceFrame(pageSequenceFrame);
NS_NewSimplePageSequenceFrame(&pageSequenceFrame);
// XXX should probably be a page sequence pseudo style context
pageSequenceFrame->Init(*aPresContext, nsnull, isScrollable ? scrollFrame :
viewportFrame, viewportPseudoStyle, nsnull);
@ -2067,7 +2068,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
// Create the first page
nsIFrame* pageFrame;
NS_NewPageFrame(pageFrame);
NS_NewPageFrame(&pageFrame);
// The page is the containing block for 'fixed' elements. which are repeated
// on every page
@ -2112,7 +2113,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
// document element's frame, then we could eliminate the root frame and make
// the document element frame a child of the viewport (or its scroll frame)
nsIFrame* rootFrame;
NS_NewRootFrame(rootFrame);
NS_NewRootFrame(&rootFrame);
// XXX this should be a root pseudo style context
rootFrame->Init(*aPresContext, nsnull, isScrollable ? scrollFrame :
@ -2202,7 +2203,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresContext* aPresContex
if ((1 == size) || (kNoSizeSpecified == size)) {
// Construct a frame-based combo box
nsIFrame * comboboxFrame;
rv = NS_NewComboboxControlFrame(comboboxFrame);
rv = NS_NewComboboxControlFrame(&comboboxFrame);
nsIFrame* geometricParent = aParentFrame;
if (aIsAbsolutelyPositioned) {
@ -2215,7 +2216,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresContext* aPresContex
nsIComboboxControlFrame* comboBox = nsnull;
if (NS_OK == comboboxFrame->QueryInterface(kIComboboxControlFrameIID, (void**)&comboBox)) {
nsIFrame * listFrame;
rv = NS_NewListControlFrame(listFrame);
rv = NS_NewListControlFrame(&listFrame);
// This is important to do before it is initialized
// it tells it that it is in "DropDown Mode"
@ -2323,7 +2324,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresContext* aPresContex
} else {
// Construct a frame-based list box
nsIFrame * listFrame;
rv = NS_NewListControlFrame(listFrame);
rv = NS_NewListControlFrame(&listFrame);
aNewFrame = listFrame;
InitializeScrollFrame(aPresContext, aState, listFrame, aContent, aParentFrame,
aStyleContext, aNewFrame, aIsAbsolutelyPositioned, PR_FALSE,
@ -2341,12 +2342,12 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresContext* aPresContex
}
NS_RELEASE(select);
} else {
rv = NS_NewSelectControlFrame(aNewFrame);
rv = NS_NewSelectControlFrame(&aNewFrame);
}
}
else {
// Not frame based. Use a SelectFrame which creates a native widget.
rv = NS_NewSelectControlFrame(aNewFrame);
rv = NS_NewSelectControlFrame(&aNewFrame);
}
return rv;
@ -2374,7 +2375,7 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresContext* aPresContext
nsresult rv = NS_OK;
if (nsLayoutAtoms::textTagName == aTag) {
rv = NS_NewTextFrame(newFrame);
rv = NS_NewTextFrame(&newFrame);
isReplaced = PR_TRUE; // XXX kipp: temporary
}
else {
@ -2404,17 +2405,17 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresContext* aPresContext
isReplaced = PR_TRUE;
// XXX If image display is turned off, then use ConstructAlternateImageFrame()
// instead...
rv = NS_NewImageFrame(newFrame);
rv = NS_NewImageFrame(&newFrame);
}
else if (nsHTMLAtoms::hr == aTag) {
rv = NS_NewHRFrame(newFrame);
rv = NS_NewHRFrame(&newFrame);
}
else if (nsHTMLAtoms::br == aTag) {
rv = NS_NewBRFrame(newFrame);
rv = NS_NewBRFrame(&newFrame);
isReplaced = PR_TRUE;
}
else if (nsHTMLAtoms::wbr == aTag) {
rv = NS_NewWBRFrame(newFrame);
rv = NS_NewWBRFrame(&newFrame);
}
else if (nsHTMLAtoms::input == aTag) {
isReplaced = PR_TRUE;
@ -2422,7 +2423,7 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresContext* aPresContext
}
else if (nsHTMLAtoms::textarea == aTag) {
isReplaced = PR_TRUE;
rv = NS_NewTextControlFrame(newFrame);
rv = NS_NewTextControlFrame(&newFrame);
}
else if (nsHTMLAtoms::select == aTag) {
isReplaced = PR_TRUE;
@ -2433,41 +2434,41 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresContext* aPresContext
}
else if (nsHTMLAtoms::applet == aTag) {
isReplaced = PR_TRUE;
rv = NS_NewObjectFrame(newFrame);
rv = NS_NewObjectFrame(&newFrame);
}
else if (nsHTMLAtoms::embed == aTag) {
rv = NS_NewObjectFrame(newFrame);
rv = NS_NewObjectFrame(&newFrame);
}
else if (nsHTMLAtoms::fieldset == aTag) {
rv = NS_NewFieldSetFrame(newFrame);
rv = NS_NewFieldSetFrame(&newFrame);
processChildren = PR_TRUE;
}
else if (nsHTMLAtoms::legend == aTag) {
rv = NS_NewLegendFrame(newFrame);
rv = NS_NewLegendFrame(&newFrame);
processChildren = PR_TRUE;
canBePositioned = PR_FALSE;
}
else if (nsHTMLAtoms::object == aTag) {
isReplaced = PR_TRUE;
rv = NS_NewObjectFrame(newFrame);
rv = NS_NewObjectFrame(&newFrame);
}
else if (nsHTMLAtoms::form == aTag) {
rv = NS_NewFormFrame(newFrame);
rv = NS_NewFormFrame(&newFrame);
}
else if (nsHTMLAtoms::frameset == aTag) {
rv = NS_NewHTMLFramesetFrame(newFrame);
rv = NS_NewHTMLFramesetFrame(&newFrame);
canBePositioned = PR_FALSE;
}
else if (nsHTMLAtoms::iframe == aTag) {
isReplaced = PR_TRUE;
rv = NS_NewHTMLFrameOuterFrame(newFrame);
rv = NS_NewHTMLFrameOuterFrame(&newFrame);
}
else if (nsHTMLAtoms::spacer == aTag) {
rv = NS_NewSpacerFrame(newFrame);
rv = NS_NewSpacerFrame(&newFrame);
canBePositioned = PR_FALSE;
}
else if (nsHTMLAtoms::button == aTag) {
rv = NS_NewHTMLButtonControlFrame(newFrame);
rv = NS_NewHTMLButtonControlFrame(&newFrame);
// the html4 button needs to act just like a
// regular button except contain html content
// so it must be replaced or html outside it will
@ -2476,7 +2477,7 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresContext* aPresContext
processChildren = PR_TRUE;
}
else if (nsHTMLAtoms::label == aTag) {
rv = NS_NewLabelFrame(newFrame);
rv = NS_NewLabelFrame(&newFrame);
processChildren = PR_TRUE;
}
}
@ -2611,25 +2612,25 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
// Create a frame based on the tag
if (aTag == nsXULAtoms::button)
rv = NS_NewButtonControlFrame(newFrame);
rv = NS_NewButtonControlFrame(&newFrame);
else if (aTag == nsXULAtoms::checkbox)
rv = NS_NewTriStateCheckboxFrame(newFrame);
rv = NS_NewTriStateCheckboxFrame(&newFrame);
else if (aTag == nsXULAtoms::slider)
rv = NS_NewSliderFrame(newFrame);
rv = NS_NewSliderFrame(&newFrame);
else if (aTag == nsXULAtoms::spinner)
rv = NS_NewSpinnerFrame(newFrame);
rv = NS_NewSpinnerFrame(&newFrame);
else if (aTag == nsXULAtoms::scrollbar)
rv = NS_NewScrollbarFrame(newFrame);
rv = NS_NewScrollbarFrame(&newFrame);
else if (aTag == nsXULAtoms::colorpicker)
rv = NS_NewColorPickerFrame(newFrame);
rv = NS_NewColorPickerFrame(&newFrame);
else if (aTag == nsXULAtoms::fontpicker)
rv = NS_NewFontPickerFrame(newFrame);
rv = NS_NewFontPickerFrame(&newFrame);
else if (aTag == nsXULAtoms::radio)
rv = NS_NewRadioControlFrame(newFrame);
rv = NS_NewRadioControlFrame(&newFrame);
else if (aTag == nsXULAtoms::text)
rv = NS_NewTextControlFrame(newFrame);
rv = NS_NewTextControlFrame(&newFrame);
else if (aTag == nsXULAtoms::widget)
rv = NS_NewObjectFrame(newFrame);
rv = NS_NewObjectFrame(&newFrame);
// TREE CONSTRUCTION
// The following code is used to construct a tree view from the XUL content
@ -2736,18 +2737,18 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
}
else if (aTag == nsXULAtoms::treeindentation)
{
rv = NS_NewTreeIndentationFrame(newFrame);
rv = NS_NewTreeIndentationFrame(&newFrame);
}
// End of TREE CONSTRUCTION code here (there's more later on in the function)
// TOOLBAR CONSTRUCTION
else if (aTag == nsXULAtoms::toolbox) {
processChildren = PR_TRUE;
rv = NS_NewToolboxFrame(newFrame);
rv = NS_NewToolboxFrame(&newFrame);
}
else if (aTag == nsXULAtoms::toolbar) {
processChildren = PR_TRUE;
rv = NS_NewToolbarFrame(newFrame);
rv = NS_NewToolbarFrame(&newFrame);
}
// End of TOOLBAR CONSTRUCTION logic
@ -2755,7 +2756,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
else if (aTag == nsXULAtoms::progressmeter) {
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewProgressMeterFrame(newFrame);
rv = NS_NewProgressMeterFrame(&newFrame);
}
// End of PROGRESS METER CONSTRUCTION logic
@ -2763,7 +2764,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
else if (aTag == nsXULAtoms::box || aTag == nsXULAtoms::tabbox || aTag == nsXULAtoms::tabpage || aTag == nsXULAtoms::tabcontrol) {
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewBoxFrame(newFrame);
rv = NS_NewBoxFrame(&newFrame);
}
// End of BOX CONSTRUCTION logic
@ -2771,7 +2772,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
else if (aTag == nsXULAtoms::titledbutton) {
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewTitledButtonFrame(newFrame);
rv = NS_NewTitledButtonFrame(&newFrame);
}
// End of TITLED BUTTON CONSTRUCTION logic
@ -2779,7 +2780,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
else if (aTag == nsXULAtoms::deck || aTag == nsXULAtoms::tabpanel) {
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewDeckFrame(newFrame);
rv = NS_NewDeckFrame(&newFrame);
}
// End of DECK CONSTRUCTION logic
@ -2787,7 +2788,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
else if (aTag == nsXULAtoms::tab) {
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewTabFrame(newFrame);
rv = NS_NewTabFrame(&newFrame);
}
// End of TAB CONSTRUCTION logic
@ -2885,7 +2886,7 @@ nsCSSFrameConstructor::InitializeScrollFrame(nsIPresContext* aPresConte
// Create an area container for the frame
nsIFrame* scrolledFrame;
NS_NewAreaFrame(scrolledFrame, NS_BLOCK_SHRINK_WRAP);
NS_NewAreaFrame(&scrolledFrame, NS_BLOCK_SHRINK_WRAP);
// Initialize the frame and force it to have a view
scrolledFrame->Init(*aPresContext, aContent, scrollFrame,
@ -2984,7 +2985,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPre
// Create a scroll frame
nsIFrame* scrollFrame;
NS_NewScrollFrame(scrollFrame);
NS_NewScrollFrame(&scrollFrame);
// Initialize it
InitializeScrollFrame(aPresContext, aState, scrollFrame, aContent, aParentFrame,
@ -3003,8 +3004,8 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPre
isFixedPositioned = PR_TRUE;
}
// Create an area frame
NS_NewAreaFrame(newFrame, NS_BLOCK_MARGIN_ROOT);
// Create a frame to wrap up the absolute positioned item
NS_NewAbsoluteItemWrapperFrame(&newFrame);
newFrame->Init(*aPresContext, aContent,
(isAbsolutelyPositioned
? aState.mAbsoluteItems.containingBlock
@ -3044,7 +3045,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPre
(NS_STYLE_DISPLAY_INLINE == aDisplay->mDisplay) ||
(NS_STYLE_DISPLAY_LIST_ITEM == aDisplay->mDisplay))) {
// Create an area frame
NS_NewAreaFrame(newFrame, NS_BLOCK_SHRINK_WRAP);
NS_NewFloatingItemWrapperFrame(&newFrame);
// Initialize the frame
newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull);
@ -3072,11 +3073,11 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPre
else if (NS_STYLE_POSITION_RELATIVE == position->mPosition) {
// Is it block-level or inline-level?
if (NS_STYLE_DISPLAY_BLOCK == aDisplay->mDisplay) {
// Create an area frame. No space manager, though
NS_NewAreaFrame(newFrame, NS_AREA_NO_SPACE_MGR);
// Create a wrapper frame. No space manager, though
NS_NewRelativeItemWrapperFrame(&newFrame);
} else {
// Create a positioned inline frame
NS_NewPositionedInlineFrame(newFrame);
NS_NewPositionedInlineFrame(&newFrame);
}
// Initialize the frame
@ -3129,7 +3130,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPre
case NS_STYLE_DISPLAY_LIST_ITEM:
case NS_STYLE_DISPLAY_RUN_IN:
case NS_STYLE_DISPLAY_COMPACT:
rv = NS_NewBlockFrame(newFrame, 0);
rv = NS_NewBlockFrame(&newFrame);
processChildren = PR_TRUE;
newFrameIsFloaterContainer = PR_TRUE;
if (NS_SUCCEEDED(rv)) {
@ -3140,7 +3141,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPre
break;
case NS_STYLE_DISPLAY_INLINE:
rv = NS_NewInlineFrame(newFrame);
rv = NS_NewInlineFrame(&newFrame);
processChildren = PR_TRUE;
haveFirstLetterStyle = aHaveFirstLetterStyle;
break;
@ -4944,11 +4945,11 @@ nsCSSFrameConstructor::ConstructAlternateImageFrame(nsIPresContext* aPresContex
aStyleContext->GetStyleData(eStyleStruct_Position);
if (position->IsAbsolutelyPositioned()) {
NS_NewAreaFrame(containerFrame, NS_BLOCK_MARGIN_ROOT);
NS_NewAbsoluteItemWrapperFrame(&containerFrame);
} else if (display->IsFloating() || (NS_STYLE_DISPLAY_BLOCK == display->mDisplay)) {
NS_NewBlockFrame(containerFrame, 0);
NS_NewBlockFrame(&containerFrame);
} else {
NS_NewInlineFrame(containerFrame);
NS_NewInlineFrame(&containerFrame);
}
containerFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, containerFrame,
@ -4959,7 +4960,7 @@ nsCSSFrameConstructor::ConstructAlternateImageFrame(nsIPresContext* aPresContex
nsIFrame* textFrame;
nsIStyleContext* textStyleContext;
NS_NewTextFrame(textFrame);
NS_NewTextFrame(&textFrame);
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::textPseudo,
aStyleContext, PR_FALSE,
&textStyleContext);
@ -5129,7 +5130,7 @@ nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresContext* aPresCon
nsIFrame* newFrame;
nsresult rv;
rv = NS_NewTableOuterFrame(newFrame);
rv = NS_NewTableOuterFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -5171,7 +5172,7 @@ nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresContext* aPresCon
nsFrameConstructorState state(mFixedContainingBlock,
GetAbsoluteContainingBlock(aPresContext, newFrame),
captionFrame);
NS_NewAreaFrame(captionFrame, 0);
NS_NewTableCaptionFrame(&captionFrame);
captionFrame->Init(*aPresContext, caption, newFrame, captionStyle, nsnull);
ProcessChildren(aPresContext, state, caption, captionFrame,
PR_TRUE, childItems);
@ -5209,7 +5210,7 @@ nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresContext* aPresContext,
nsIFrame* newFrame;
nsresult rv;
rv = NS_NewTableFrame(newFrame);
rv = NS_NewTableFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -5239,7 +5240,7 @@ nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresContext* aPresContext,
GetAbsoluteContainingBlock(aPresContext, newFrame),
nsnull);
NS_NewTableRowGroupFrame(headerFooterFrame);
NS_NewTableRowGroupFrame(&headerFooterFrame);
rowGroupFrame->GetContent(&headerFooter);
headerFooterFrame->Init(*aPresContext, headerFooter, newFrame,
rowGroupStyle, nsnull);
@ -5296,7 +5297,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
aFrame->GetStyleContext(&styleContext);
if (nsLayoutAtoms::textFrame == frameType) {
rv = NS_NewTextFrame(newFrame);
rv = NS_NewTextFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -5304,7 +5305,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
}
} else if (nsLayoutAtoms::inlineFrame == frameType) {
rv = NS_NewInlineFrame(newFrame);
rv = NS_NewInlineFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -5312,7 +5313,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
}
} else if (nsLayoutAtoms::blockFrame == frameType) {
rv = NS_NewBlockFrame(newFrame, 0);
rv = NS_NewBlockFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -5320,15 +5321,16 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
}
} else if (nsLayoutAtoms::areaFrame == frameType) {
rv = NS_NewAreaFrame(newFrame, 0);
rv = NS_NewAreaFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
newFrame->Init(*aPresContext, content, aParentFrame, styleContext,
aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
styleContext, PR_FALSE);
}
} else if (nsLayoutAtoms::positionedInlineFrame == frameType) {
rv = NS_NewPositionedInlineFrame(newFrame);
rv = NS_NewPositionedInlineFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -5336,7 +5338,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
}
} else if (nsLayoutAtoms::pageFrame == frameType) {
rv = NS_NewPageFrame(newFrame);
rv = NS_NewPageFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -5352,7 +5354,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
content, styleContext, &newFrame);
} else if (nsLayoutAtoms::tableRowGroupFrame == frameType) {
rv = NS_NewTableRowGroupFrame(newFrame);
rv = NS_NewTableRowGroupFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -5360,7 +5362,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
}
} else if (nsLayoutAtoms::tableRowFrame == frameType) {
rv = NS_NewTableRowFrame(newFrame);
rv = NS_NewTableRowFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -5392,7 +5394,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
}
} else if (nsLayoutAtoms::tableCellFrame == frameType) {
rv = NS_NewTableCellFrame(newFrame);
rv = NS_NewTableCellFrame(&newFrame);
if (NS_SUCCEEDED(rv)) {
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,

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

@ -380,25 +380,27 @@ void DebugCheckChildSize(nsIFrame* aChild,
if (aMet.width > aAvailSize.width) {
nsAutoString tmp;
aChild->GetFrameName(tmp);
printf("WARNING: cell %s content has desired width %d given avail width %d\n",
tmp, aMet.width, aAvailSize.width);
printf("WARNING: cell ");
fputs(tmp, stdout);
printf(" content has desired width %d given avail width %d\n",
aMet.width, aAvailSize.width);
}
if (aIsPass2Reflow) {
if ((aMet.width < 0) || (aMet.width > 60000)) {
printf("WARNING: cell content %X has large width %d \n", aChild, aMet.width);
printf("WARNING: cell content %p has large width %d \n", aChild, aMet.width);
}
if ((aMet.height < 0) || (aMet.height > 60000)) {
printf("WARNING: cell content %X has large height %d \n", aChild, aMet.height);
printf("WARNING: cell content %p has large height %d \n", aChild, aMet.height);
}
}
if (aMet.maxElementSize) {
nscoord tmp = aMet.maxElementSize->width;
if ((tmp < 0) || (tmp > 60000)) {
printf("WARNING: cell content %X has large max element width %d \n", aChild, tmp);
printf("WARNING: cell content %p has large max element width %d \n", aChild, tmp);
}
tmp = aMet.maxElementSize->height;
if ((tmp < 0) || (tmp > 60000)) {
printf("WARNING: cell content %X has large max element height %d \n", aChild, tmp);
printf("WARNING: cell content %p has large max element height %d \n", aChild, tmp);
}
}
}
@ -435,7 +437,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext,
nsSize *pMaxElementSize = aDesiredSize.maxElementSize;
if (NS_UNCONSTRAINEDSIZE==aReflowState.availableWidth)
pMaxElementSize = &maxElementSize;
nscoord x = 0;
// SEC: what about ascent and decent???
// Compute the insets (sum of border and padding)
@ -768,8 +770,6 @@ void nsTableCellFrame::MapHTMLBorderStyle(nsIPresContext* aPresContext,
PRBool nsTableCellFrame::ConvertToPixelValue(nsHTMLValue& aValue, PRInt32 aDefault, PRInt32& aResult)
{
PRInt32 result = 0;
if (aValue.GetUnit() == eHTMLUnit_Pixel)
aResult = aValue.GetPixelValue();
else if (aValue.GetUnit() == eHTMLUnit_Empty)
@ -937,13 +937,17 @@ NS_IMPL_ISUPPORTS_INHERITED(nsTableCellFrame, nsHTMLContainerFrame, nsITableCell
/* ----- global methods ----- */
nsresult
NS_NewTableCellFrame(nsIFrame*& aResult)
NS_NewTableCellFrame(nsIFrame** aNewFrame)
{
nsIFrame* it = new nsTableCellFrame;
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsTableCellFrame* it = new nsTableCellFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = it;
*aNewFrame = it;
return NS_OK;
}

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

@ -73,7 +73,7 @@ public:
* @return NS_OK if the frame was properly allocated, otherwise an error code
*/
friend nsresult
NS_NewTableCellFrame(nsIFrame*& aResult);
NS_NewTableCellFrame(nsIFrame** aResult);
NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,

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

@ -86,13 +86,17 @@ nscoord nsTableColFrame::GetColWidthForComputation()
/* ----- global methods ----- */
nsresult
NS_NewTableColFrame(nsIFrame*& aResult)
NS_NewTableColFrame(nsIFrame** aNewFrame)
{
nsIFrame* it = new nsTableColFrame;
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsTableColFrame* it = new nsTableColFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = it;
*aNewFrame = it;
return NS_OK;
}

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

@ -41,7 +41,7 @@ public:
* @return NS_OK if the frame was properly allocated, otherwise an error code
*/
friend nsresult
NS_NewTableColFrame(nsIFrame*& aResult);
NS_NewTableColFrame(nsIFrame** aResult);
NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,

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

@ -85,7 +85,7 @@ nsTableColGroupFrame::InitNewFrames(nsIPresContext& aPresContext, nsIFrame* aChi
// Create a new col frame
nsIFrame* colFrame;
NS_NewTableColFrame(colFrame);
NS_NewTableColFrame(&colFrame);
// Set its style context
nsCOMPtr<nsIStyleContext> colStyleContext;
@ -698,13 +698,17 @@ PRInt32 nsTableColGroupFrame::SetStartColumnIndex (int aIndex)
/* ----- global methods ----- */
nsresult
NS_NewTableColGroupFrame(nsIFrame*& aResult)
NS_NewTableColGroupFrame(nsIFrame** aNewFrame)
{
nsIFrame* it = new nsTableColGroupFrame;
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsTableColGroupFrame* it = new nsTableColGroupFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = it;
*aNewFrame = it;
return NS_OK;
}

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

@ -42,7 +42,7 @@ public:
* @return NS_OK if the frame was properly allocated, otherwise an error code
*/
friend nsresult
NS_NewTableColGroupFrame(nsIFrame*& aResult);
NS_NewTableColGroupFrame(nsIFrame** aResult);
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
nsIAtom* aListName,

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

@ -780,7 +780,7 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext)
&colGroupStyleContext); // colGroupStyleContext: REFCNT++
// Create a col group frame
nsIFrame* newFrame;
NS_NewTableColGroupFrame(newFrame);
NS_NewTableColGroupFrame(&newFrame);
newFrame->Init(aPresContext, lastColGroupElement, this, colGroupStyleContext,
nsnull);
lastColGroupFrame = (nsTableColGroupFrame*)newFrame;
@ -814,7 +814,7 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext)
lastColGroupStyle,
PR_TRUE,
&colStyleContext); // colStyleContext: REFCNT++
NS_NewTableColFrame(colFrame);
NS_NewTableColFrame(&colFrame);
colFrame->Init(aPresContext, lastColGroupElement, lastColGroupFrame,
colStyleContext, nsnull);
NS_RELEASE(colStyleContext);
@ -4908,13 +4908,17 @@ void nsTableFrame::GetColumnsByType(const nsStyleUnit aType,
/* ----- global methods ----- */
nsresult
NS_NewTableFrame(nsIFrame*& aResult)
NS_NewTableFrame(nsIFrame** aNewFrame)
{
nsIFrame* it = new nsTableFrame;
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsTableFrame* it = new nsTableFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = it;
*aNewFrame = it;
return NS_OK;
}

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

@ -76,7 +76,7 @@ public:
* @return NS_OK if the frame was properly allocated, otherwise an error code
*/
friend nsresult
NS_NewTableFrame(nsIFrame*& aResult);
NS_NewTableFrame(nsIFrame** aResult);
/** sets defaults for table-specific style.
* @see nsIFrame::Init

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

@ -1219,13 +1219,17 @@ nsTableOuterFrame::GetFrameType(nsIAtom** aType) const
/* ----- global methods ----- */
nsresult
NS_NewTableOuterFrame(nsIFrame*& aResult)
NS_NewTableOuterFrame(nsIFrame** aNewFrame)
{
nsIFrame* it = new nsTableOuterFrame;
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsTableOuterFrame* it = new nsTableOuterFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = it;
*aNewFrame = it;
return NS_OK;
}

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

@ -48,7 +48,7 @@ public:
* @return NS_OK if the frame was properly allocated, otherwise an error code
*/
friend nsresult
NS_NewTableOuterFrame(nsIFrame*& aResult);
NS_NewTableOuterFrame(nsIFrame** aResult);
/** @see nsIFrame::SetInitialChildList */
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,

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

@ -1541,13 +1541,17 @@ nsTableRowFrame::GetFrameType(nsIAtom** aType) const
/* ----- global methods ----- */
nsresult
NS_NewTableRowFrame(nsIFrame*& aResult)
NS_NewTableRowFrame(nsIFrame** aNewFrame)
{
nsIFrame* it = new nsTableRowFrame;
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsTableRowFrame* it = new nsTableRowFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = it;
*aNewFrame = it;
return NS_OK;
}

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

@ -57,7 +57,7 @@ public:
* @return NS_OK if the frame was properly allocated, otherwise an error code
*/
friend nsresult
NS_NewTableRowFrame(nsIFrame*& aResult);
NS_NewTableRowFrame(nsIFrame** aResult);
/** @see nsIFrame::Paint */
NS_IMETHOD Paint(nsIPresContext& aPresContext,

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

@ -1368,13 +1368,17 @@ nsTableRowGroupFrame::GetFrameType(nsIAtom** aType) const
/* ----- global methods ----- */
nsresult
NS_NewTableRowGroupFrame(nsIFrame*& aResult)
NS_NewTableRowGroupFrame(nsIFrame** aNewFrame)
{
nsIFrame* it = new nsTableRowGroupFrame;
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsTableRowGroupFrame* it = new nsTableRowGroupFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = it;
*aNewFrame = it;
return NS_OK;
}

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

@ -53,7 +53,7 @@ public:
* @return NS_OK if the frame was properly allocated, otherwise an error code
*/
friend nsresult
NS_NewTableRowGroupFrame(nsIFrame*& aResult);
NS_NewTableRowGroupFrame(nsIFrame** aResult);
NS_METHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);

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

@ -380,25 +380,27 @@ void DebugCheckChildSize(nsIFrame* aChild,
if (aMet.width > aAvailSize.width) {
nsAutoString tmp;
aChild->GetFrameName(tmp);
printf("WARNING: cell %s content has desired width %d given avail width %d\n",
tmp, aMet.width, aAvailSize.width);
printf("WARNING: cell ");
fputs(tmp, stdout);
printf(" content has desired width %d given avail width %d\n",
aMet.width, aAvailSize.width);
}
if (aIsPass2Reflow) {
if ((aMet.width < 0) || (aMet.width > 60000)) {
printf("WARNING: cell content %X has large width %d \n", aChild, aMet.width);
printf("WARNING: cell content %p has large width %d \n", aChild, aMet.width);
}
if ((aMet.height < 0) || (aMet.height > 60000)) {
printf("WARNING: cell content %X has large height %d \n", aChild, aMet.height);
printf("WARNING: cell content %p has large height %d \n", aChild, aMet.height);
}
}
if (aMet.maxElementSize) {
nscoord tmp = aMet.maxElementSize->width;
if ((tmp < 0) || (tmp > 60000)) {
printf("WARNING: cell content %X has large max element width %d \n", aChild, tmp);
printf("WARNING: cell content %p has large max element width %d \n", aChild, tmp);
}
tmp = aMet.maxElementSize->height;
if ((tmp < 0) || (tmp > 60000)) {
printf("WARNING: cell content %X has large max element height %d \n", aChild, tmp);
printf("WARNING: cell content %p has large max element height %d \n", aChild, tmp);
}
}
}
@ -435,7 +437,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext,
nsSize *pMaxElementSize = aDesiredSize.maxElementSize;
if (NS_UNCONSTRAINEDSIZE==aReflowState.availableWidth)
pMaxElementSize = &maxElementSize;
nscoord x = 0;
// SEC: what about ascent and decent???
// Compute the insets (sum of border and padding)
@ -768,8 +770,6 @@ void nsTableCellFrame::MapHTMLBorderStyle(nsIPresContext* aPresContext,
PRBool nsTableCellFrame::ConvertToPixelValue(nsHTMLValue& aValue, PRInt32 aDefault, PRInt32& aResult)
{
PRInt32 result = 0;
if (aValue.GetUnit() == eHTMLUnit_Pixel)
aResult = aValue.GetPixelValue();
else if (aValue.GetUnit() == eHTMLUnit_Empty)
@ -937,13 +937,17 @@ NS_IMPL_ISUPPORTS_INHERITED(nsTableCellFrame, nsHTMLContainerFrame, nsITableCell
/* ----- global methods ----- */
nsresult
NS_NewTableCellFrame(nsIFrame*& aResult)
NS_NewTableCellFrame(nsIFrame** aNewFrame)
{
nsIFrame* it = new nsTableCellFrame;
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsTableCellFrame* it = new nsTableCellFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = it;
*aNewFrame = it;
return NS_OK;
}

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

@ -73,7 +73,7 @@ public:
* @return NS_OK if the frame was properly allocated, otherwise an error code
*/
friend nsresult
NS_NewTableCellFrame(nsIFrame*& aResult);
NS_NewTableCellFrame(nsIFrame** aResult);
NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,

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

@ -86,13 +86,17 @@ nscoord nsTableColFrame::GetColWidthForComputation()
/* ----- global methods ----- */
nsresult
NS_NewTableColFrame(nsIFrame*& aResult)
NS_NewTableColFrame(nsIFrame** aNewFrame)
{
nsIFrame* it = new nsTableColFrame;
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsTableColFrame* it = new nsTableColFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
aResult = it;
*aNewFrame = it;
return NS_OK;
}

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

@ -41,7 +41,7 @@ public:
* @return NS_OK if the frame was properly allocated, otherwise an error code
*/
friend nsresult
NS_NewTableColFrame(nsIFrame*& aResult);
NS_NewTableColFrame(nsIFrame** aResult);
NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше