Added Init() member function to nsIFrame
git-svn-id: svn://10.0.0.236/trunk@15682 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
2c8f8fff45
commit
01f27b2a31
@ -380,9 +380,7 @@ protected:
|
||||
nsIContent* aContent,
|
||||
nsIFrame*& aChildList);
|
||||
|
||||
nsresult CreateInputFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame*& aFrame);
|
||||
nsresult CreateInputFrame(nsIContent* aContent, nsIFrame*& aFrame);
|
||||
|
||||
PRBool IsScrollable(nsIPresContext* aPresContext, nsIAtom* aTag, const nsStyleDisplay* aDisplay);
|
||||
|
||||
@ -1008,9 +1006,7 @@ HTMLStyleSheetImpl::ProcessChildren(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
nsresult
|
||||
HTMLStyleSheetImpl::CreateInputFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame*& aFrame)
|
||||
HTMLStyleSheetImpl::CreateInputFrame(nsIContent* aContent, nsIFrame*& aFrame)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
@ -1018,40 +1014,40 @@ HTMLStyleSheetImpl::CreateInputFrame(nsIContent* aContent,
|
||||
nsAutoString val;
|
||||
if (NS_OK == aContent->GetAttribute(nsAutoString("type"), val)) {
|
||||
if (val.EqualsIgnoreCase("submit")) {
|
||||
rv = NS_NewButtonControlFrame(aContent, aParentFrame, aFrame);
|
||||
rv = NS_NewButtonControlFrame(aFrame);
|
||||
}
|
||||
else if (val.EqualsIgnoreCase("reset")) {
|
||||
rv = NS_NewButtonControlFrame(aContent, aParentFrame, aFrame);
|
||||
rv = NS_NewButtonControlFrame(aFrame);
|
||||
}
|
||||
else if (val.EqualsIgnoreCase("button")) {
|
||||
rv = NS_NewButtonControlFrame(aContent, aParentFrame, aFrame);
|
||||
rv = NS_NewButtonControlFrame(aFrame);
|
||||
}
|
||||
else if (val.EqualsIgnoreCase("checkbox")) {
|
||||
rv = NS_NewCheckboxControlFrame(aContent, aParentFrame, aFrame);
|
||||
rv = NS_NewCheckboxControlFrame(aFrame);
|
||||
}
|
||||
else if (val.EqualsIgnoreCase("file")) {
|
||||
rv = NS_NewFileControlFrame(aContent, aParentFrame, aFrame);
|
||||
rv = NS_NewFileControlFrame(aFrame);
|
||||
}
|
||||
else if (val.EqualsIgnoreCase("hidden")) {
|
||||
rv = NS_NewButtonControlFrame(aContent, aParentFrame, aFrame);
|
||||
rv = NS_NewButtonControlFrame(aFrame);
|
||||
}
|
||||
else if (val.EqualsIgnoreCase("image")) {
|
||||
rv = NS_NewImageControlFrame(aContent, aParentFrame, aFrame);
|
||||
rv = NS_NewImageControlFrame(aFrame);
|
||||
}
|
||||
else if (val.EqualsIgnoreCase("password")) {
|
||||
rv = NS_NewTextControlFrame(aContent, aParentFrame, aFrame);
|
||||
rv = NS_NewTextControlFrame(aFrame);
|
||||
}
|
||||
else if (val.EqualsIgnoreCase("radio")) {
|
||||
rv = NS_NewRadioControlFrame(aContent, aParentFrame, aFrame);
|
||||
rv = NS_NewRadioControlFrame(aFrame);
|
||||
}
|
||||
else if (val.EqualsIgnoreCase("text")) {
|
||||
rv = NS_NewTextControlFrame(aContent, aParentFrame, aFrame);
|
||||
rv = NS_NewTextControlFrame(aFrame);
|
||||
}
|
||||
else {
|
||||
rv = NS_NewTextControlFrame(aContent, aParentFrame, aFrame);
|
||||
rv = NS_NewTextControlFrame(aFrame);
|
||||
}
|
||||
} else {
|
||||
rv = NS_NewTextControlFrame(aContent, aParentFrame, aFrame);
|
||||
rv = NS_NewTextControlFrame(aFrame);
|
||||
}
|
||||
|
||||
return rv;
|
||||
@ -1071,11 +1067,11 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext,
|
||||
|
||||
// Create an anonymous table outer frame which holds the caption and the
|
||||
// table frame
|
||||
NS_NewTableOuterFrame(aContent, aParentFrame, aNewFrame);
|
||||
aNewFrame->SetStyleContext(aPresContext, aStyleContext);
|
||||
NS_NewTableOuterFrame(aNewFrame);
|
||||
aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
|
||||
|
||||
// Create the inner table frame
|
||||
NS_NewTableFrame(aContent, aNewFrame, innerFrame);
|
||||
NS_NewTableFrame(innerFrame);
|
||||
childList = innerFrame;
|
||||
|
||||
// Have the inner table frame use a pseudo style context based on the outer table frame's
|
||||
@ -1085,7 +1081,7 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext,
|
||||
nsHTMLAtoms::tablePseudo,
|
||||
aStyleContext);
|
||||
*/
|
||||
innerFrame->SetStyleContext(aPresContext, aStyleContext);
|
||||
innerFrame->Init(*aPresContext, aContent, aNewFrame, aStyleContext);
|
||||
// this should be "innerTableStyleContext" but I haven't tested that thoroughly yet
|
||||
|
||||
// Iterate the child content
|
||||
@ -1112,9 +1108,8 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext,
|
||||
case NS_STYLE_DISPLAY_TABLE_CAPTION:
|
||||
// Have we already created a caption? If so, ignore this caption
|
||||
if (nsnull == captionFrame) {
|
||||
NS_NewBodyFrame(childContent, aNewFrame, captionFrame,
|
||||
NS_BODY_NO_AUTO_MARGINS);
|
||||
captionFrame->SetStyleContext(aPresContext, childStyleContext);
|
||||
NS_NewBodyFrame(captionFrame, NS_BODY_NO_AUTO_MARGINS);
|
||||
captionFrame->Init(*aPresContext, childContent, aNewFrame, childStyleContext);
|
||||
// Process the caption's child content and set the initial child list
|
||||
nsIFrame* captionChildList;
|
||||
ProcessChildren(aPresContext, captionFrame, childContent, captionChildList);
|
||||
@ -1128,7 +1123,8 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext,
|
||||
case NS_STYLE_DISPLAY_TABLE_HEADER_GROUP:
|
||||
case NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP:
|
||||
case NS_STYLE_DISPLAY_TABLE_ROW_GROUP:
|
||||
NS_NewTableRowGroupFrame(childContent, innerFrame, frame);
|
||||
NS_NewTableRowGroupFrame(frame);
|
||||
frame->Init(*aPresContext, childContent, innerFrame, childStyleContext);
|
||||
break;
|
||||
|
||||
case NS_STYLE_DISPLAY_TABLE_ROW:
|
||||
@ -1142,15 +1138,16 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext,
|
||||
aStyleContext);
|
||||
nsStyleDisplay *rowGroupDisplay = (nsStyleDisplay *)rowGroupStyleContext->GetMutableStyleData(eStyleStruct_Display);
|
||||
rowGroupDisplay->mDisplay = NS_STYLE_DISPLAY_TABLE_ROW_GROUP;
|
||||
NS_NewTableRowGroupFrame(childContent, innerFrame, frame);
|
||||
NS_NewTableRowGroupFrame(frame);
|
||||
NS_RELEASE(childStyleContext); // we can't use this resolved style, so get rid of it
|
||||
childStyleContext = rowGroupStyleContext; // the row group style context will get set to childStyleContext after the switch ends.
|
||||
frame->Init(*aPresContext, childContent, innerFrame, childStyleContext);
|
||||
// need to resolve the style context for the column again to be sure it's a child of the colgroup style context
|
||||
rowStyleContext = aPresContext->ResolveStyleContextFor(childContent, rowGroupStyleContext);
|
||||
nsIFrame *rowFrame;
|
||||
NS_NewTableRowFrame(childContent, frame, rowFrame);
|
||||
NS_NewTableRowFrame(rowFrame);
|
||||
rowFrame->Init(*aPresContext, childContent, frame, rowStyleContext);
|
||||
rowFrame->SetInitialChildList(*aPresContext, nsnull, nsnull);
|
||||
rowFrame->SetStyleContext(aPresContext, rowStyleContext);
|
||||
grandChildList = rowFrame;
|
||||
break;
|
||||
}
|
||||
@ -1192,21 +1189,23 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext,
|
||||
aStyleContext);
|
||||
nsStyleDisplay *colGroupDisplay = (nsStyleDisplay *)colGroupStyleContext->GetMutableStyleData(eStyleStruct_Display);
|
||||
colGroupDisplay->mDisplay = NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP;
|
||||
NS_NewTableColGroupFrame(childContent, innerFrame, frame);
|
||||
NS_NewTableColGroupFrame(frame);
|
||||
NS_RELEASE(childStyleContext); // we can't use this resolved style, so get rid of it
|
||||
childStyleContext = colGroupStyleContext; // the col group style context will get set to childStyleContext after the switch ends.
|
||||
frame->Init(*aPresContext, childContent, innerFrame, childStyleContext);
|
||||
// need to resolve the style context for the column again to be sure it's a child of the colgroup style context
|
||||
colStyleContext = aPresContext->ResolveStyleContextFor(childContent, colGroupStyleContext);
|
||||
nsIFrame *colFrame;
|
||||
NS_NewTableColFrame(childContent, frame, colFrame);
|
||||
NS_NewTableColFrame(colFrame);
|
||||
colFrame->Init(*aPresContext, childContent, frame, colStyleContext);
|
||||
colFrame->SetInitialChildList(*aPresContext, nsnull, nsnull);
|
||||
colFrame->SetStyleContext(aPresContext, colStyleContext);
|
||||
grandChildList = colFrame;
|
||||
break;
|
||||
}
|
||||
|
||||
case NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP:
|
||||
NS_NewTableColGroupFrame(childContent, innerFrame, frame);
|
||||
NS_NewTableColGroupFrame(frame);
|
||||
frame->Init(*aPresContext, childContent, innerFrame, childStyleContext);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -1215,11 +1214,9 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext,
|
||||
break;
|
||||
}
|
||||
|
||||
// If it's not a caption frame, then set the style context and link the
|
||||
// frame into the inner frame's child list
|
||||
// If it's not a caption frame, then link the frame into the inner
|
||||
// frame's child list
|
||||
if (nsnull != frame) {
|
||||
frame->SetStyleContext(aPresContext, childStyleContext);
|
||||
|
||||
// Process the children, and set the frame's initial child list
|
||||
nsIFrame* childChildList;
|
||||
if (nsnull==grandChildList)
|
||||
@ -1275,7 +1272,7 @@ HTMLStyleSheetImpl::ConstructRootFrame(nsIPresContext* aPresContext,
|
||||
#endif
|
||||
|
||||
// Create the root frame
|
||||
nsresult rv = NS_NewHTMLFrame(aContent, nsnull, aNewFrame);
|
||||
nsresult rv = NS_NewHTMLFrame(aNewFrame);
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Bind root frame to root view (and root window)
|
||||
@ -1288,8 +1285,8 @@ HTMLStyleSheetImpl::ConstructRootFrame(nsIPresContext* aPresContext,
|
||||
aNewFrame->SetView(rootView);
|
||||
NS_RELEASE(viewManager);
|
||||
|
||||
// Set the style context
|
||||
aNewFrame->SetStyleContext(aPresContext, aStyleContext);
|
||||
// Initialize the frame
|
||||
aNewFrame->Init(*aPresContext, aContent, nsnull, aStyleContext);
|
||||
|
||||
// See if we're paginated
|
||||
if (aPresContext->IsPaginated()) {
|
||||
@ -1303,17 +1300,17 @@ HTMLStyleSheetImpl::ConstructRootFrame(nsIPresContext* aPresContext,
|
||||
|
||||
// Wrap the simple page sequence frame in a scroll frame
|
||||
// XXX Only do this if it's print preview
|
||||
if NS_SUCCEEDED(NS_NewScrollFrame(aContent, aNewFrame, scrollFrame)) {
|
||||
// Set the scroll frame's style context
|
||||
scrollFrame->SetStyleContext(aPresContext, pseudoStyle);
|
||||
if NS_SUCCEEDED(NS_NewScrollFrame(scrollFrame)) {
|
||||
// Initialize the frame
|
||||
scrollFrame->Init(*aPresContext, aContent, aNewFrame, pseudoStyle);
|
||||
|
||||
// Create a simple page sequence frame
|
||||
rv = NS_NewSimplePageSequenceFrame(aContent, scrollFrame, pageSequenceFrame);
|
||||
rv = NS_NewSimplePageSequenceFrame(pageSequenceFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsIFrame* childList;
|
||||
|
||||
// Set the page sequence frame's style context
|
||||
pageSequenceFrame->SetStyleContext(aPresContext, pseudoStyle);
|
||||
// Initialize the frame
|
||||
pageSequenceFrame->Init(*aPresContext, aContent, scrollFrame, pseudoStyle);
|
||||
NS_RELEASE(pseudoStyle);
|
||||
|
||||
// Process the child content, and set the page sequence frame's initial
|
||||
@ -1357,13 +1354,13 @@ HTMLStyleSheetImpl::ConstructXMLRootDescendants(nsIPresContext* aPresContext,
|
||||
// we create a scroll frame or just a body wrapper frame...
|
||||
nsIFrame* scrollFrame = nsnull;
|
||||
|
||||
rv = NS_NewScrollFrame(nsnull, aParentFrame, scrollFrame);
|
||||
rv = NS_NewScrollFrame(scrollFrame);
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// The scroll frame gets the root pseudo style context, and the scrolled
|
||||
// frame gets a SCROLLED-CONTENT pseudo element style context.
|
||||
// XXX We should probably use a different pseudo style context...
|
||||
scrollFrame->SetStyleContext(aPresContext, aRootPseudoStyle);
|
||||
scrollFrame->Init(*aPresContext, nsnull, aParentFrame, aRootPseudoStyle);
|
||||
|
||||
nsIStyleContext* scrolledPseudoStyle;
|
||||
nsIFrame* wrapperFrame;
|
||||
@ -1373,9 +1370,8 @@ HTMLStyleSheetImpl::ConstructXMLRootDescendants(nsIPresContext* aPresContext,
|
||||
aRootPseudoStyle);
|
||||
|
||||
// Create a body frame to wrap the document element
|
||||
NS_NewBodyFrame(nsnull, scrollFrame,
|
||||
wrapperFrame, NS_BODY_THE_BODY|NS_BODY_SHRINK_WRAP);
|
||||
wrapperFrame->SetStyleContext(aPresContext, scrolledPseudoStyle);
|
||||
NS_NewBodyFrame(wrapperFrame, NS_BODY_THE_BODY|NS_BODY_SHRINK_WRAP);
|
||||
wrapperFrame->Init(*aPresContext, nsnull, scrollFrame, scrolledPseudoStyle);
|
||||
|
||||
// Construct a frame for the document element and process its children
|
||||
nsIFrame* docElementFrame;
|
||||
@ -1410,7 +1406,7 @@ HTMLStyleSheetImpl::ConstructXMLRootFrame(nsIPresContext* aPresContext,
|
||||
|
||||
// XXX It would be nice if we didn't need this and we made the scroll
|
||||
// frame (or the body wrapper frame) the root of the frame hierarchy
|
||||
nsresult rv = NS_NewHTMLFrame(nsnull, nsnull, aNewFrame);
|
||||
nsresult rv = NS_NewHTMLFrame(aNewFrame);
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Bind root frame to root view (and root window)
|
||||
@ -1423,8 +1419,8 @@ HTMLStyleSheetImpl::ConstructXMLRootFrame(nsIPresContext* aPresContext,
|
||||
aNewFrame->SetView(rootView);
|
||||
NS_RELEASE(viewManager);
|
||||
|
||||
// Set the style context
|
||||
aNewFrame->SetStyleContext(aPresContext, rootPseudoStyle);
|
||||
// Initialize the frame
|
||||
aNewFrame->Init(*aPresContext, nsnull, nsnull, rootPseudoStyle);
|
||||
|
||||
// Create a scroll frame.
|
||||
// XXX Use the rootPseudoStyle overflow style information to decide whether
|
||||
@ -1459,74 +1455,72 @@ HTMLStyleSheetImpl::ConstructFrameByTag(nsIPresContext* aPresContext,
|
||||
aNewFrame = nsnull;
|
||||
|
||||
if (nsnull == aTag) {
|
||||
rv = NS_NewTextFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewTextFrame(aNewFrame);
|
||||
}
|
||||
else {
|
||||
nsIHTMLContent *htmlContent;
|
||||
rv = aContent->QueryInterface(kIHTMLContentIID, (void **)&htmlContent);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (nsHTMLAtoms::img == aTag) {
|
||||
rv = NS_NewImageFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewImageFrame(aNewFrame);
|
||||
}
|
||||
else if (nsHTMLAtoms::hr == aTag) {
|
||||
rv = NS_NewHRFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewHRFrame(aNewFrame);
|
||||
}
|
||||
else if (nsHTMLAtoms::br == aTag) {
|
||||
rv = NS_NewBRFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewBRFrame(aNewFrame);
|
||||
}
|
||||
else if (nsHTMLAtoms::wbr == aTag) {
|
||||
rv = NS_NewWBRFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewWBRFrame(aNewFrame);
|
||||
}
|
||||
else if (nsHTMLAtoms::input == aTag) {
|
||||
rv = CreateInputFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = CreateInputFrame(aContent, aNewFrame);
|
||||
}
|
||||
else if (nsHTMLAtoms::textarea == aTag) {
|
||||
rv = NS_NewTextControlFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewTextControlFrame(aNewFrame);
|
||||
}
|
||||
else if (nsHTMLAtoms::select == aTag) {
|
||||
rv = NS_NewSelectControlFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewSelectControlFrame(aNewFrame);
|
||||
}
|
||||
else if (nsHTMLAtoms::applet == aTag) {
|
||||
rv = NS_NewObjectFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewObjectFrame(aNewFrame);
|
||||
}
|
||||
else if (nsHTMLAtoms::embed == aTag) {
|
||||
rv = NS_NewObjectFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewObjectFrame(aNewFrame);
|
||||
}
|
||||
else if (nsHTMLAtoms::fieldset == aTag) {
|
||||
rv = NS_NewFieldSetFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewFieldSetFrame(aNewFrame);
|
||||
processChildren = PR_TRUE;
|
||||
}
|
||||
else if (nsHTMLAtoms::legend == aTag) {
|
||||
rv = NS_NewLegendFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewLegendFrame(aNewFrame);
|
||||
processChildren = PR_TRUE;
|
||||
}
|
||||
else if (nsHTMLAtoms::object == aTag) {
|
||||
rv = NS_NewObjectFrame(aContent, aParentFrame, aNewFrame);
|
||||
// processChildren = PR_TRUE;
|
||||
rv = NS_NewObjectFrame(aNewFrame);
|
||||
}
|
||||
else if (nsHTMLAtoms::body == aTag) {
|
||||
rv = NS_NewBodyFrame(aContent, aParentFrame, aNewFrame,
|
||||
NS_BODY_THE_BODY|NS_BODY_NO_AUTO_MARGINS);
|
||||
rv = NS_NewBodyFrame(aNewFrame, NS_BODY_THE_BODY|NS_BODY_NO_AUTO_MARGINS);
|
||||
processChildren = PR_TRUE;
|
||||
}
|
||||
else if (nsHTMLAtoms::form == aTag) {
|
||||
rv = NS_NewFormFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewFormFrame(aNewFrame);
|
||||
}
|
||||
else if (nsHTMLAtoms::frameset == aTag) {
|
||||
rv = NS_NewHTMLFramesetFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewHTMLFramesetFrame(aNewFrame);
|
||||
}
|
||||
else if (nsHTMLAtoms::iframe == aTag) {
|
||||
rv = NS_NewHTMLFrameOuterFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewHTMLFrameOuterFrame(aNewFrame);
|
||||
}
|
||||
else if (nsHTMLAtoms::spacer == aTag) {
|
||||
rv = NS_NewSpacerFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewSpacerFrame(aNewFrame);
|
||||
}
|
||||
else if (nsHTMLAtoms::button == aTag) {
|
||||
rv = NS_NewHTMLButtonControlFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewHTMLButtonControlFrame(aNewFrame);
|
||||
processChildren = PR_TRUE;
|
||||
}
|
||||
else if (nsHTMLAtoms::label == aTag) {
|
||||
rv = NS_NewLabelFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewLabelFrame(aNewFrame);
|
||||
processChildren = PR_TRUE;
|
||||
}
|
||||
NS_RELEASE(htmlContent);
|
||||
@ -1537,10 +1531,10 @@ HTMLStyleSheetImpl::ConstructFrameByTag(nsIPresContext* aPresContext,
|
||||
}
|
||||
}
|
||||
|
||||
// If we succeeded in creating a frame then set its style context,
|
||||
// process its children (if requested), and initialize the frame
|
||||
// If we succeeded in creating a frame then initialize it, process its
|
||||
// children (if requested), and set the initial child list
|
||||
if (NS_SUCCEEDED(rv) && (nsnull != aNewFrame)) {
|
||||
aNewFrame->SetStyleContext(aPresContext, aStyleContext);
|
||||
aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
|
||||
|
||||
// Process the child content if requested
|
||||
nsIFrame* childList = nsnull;
|
||||
@ -1556,12 +1550,12 @@ HTMLStyleSheetImpl::ConstructFrameByTag(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
nsresult
|
||||
HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresContext,
|
||||
HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresContext,
|
||||
const nsStyleDisplay* aDisplay,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aNewFrame)
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aNewFrame)
|
||||
{
|
||||
PRBool processChildren = PR_FALSE; // whether we should process child content
|
||||
nsresult rv = NS_OK;
|
||||
@ -1574,19 +1568,19 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresContext,
|
||||
case NS_STYLE_DISPLAY_LIST_ITEM:
|
||||
case NS_STYLE_DISPLAY_RUN_IN:
|
||||
case NS_STYLE_DISPLAY_COMPACT:
|
||||
rv = NS_NewBlockFrame(aContent, aParentFrame, aNewFrame, PR_FALSE);
|
||||
rv = NS_NewBlockFrame(aNewFrame, 0);
|
||||
processChildren = PR_TRUE;
|
||||
break;
|
||||
|
||||
case NS_STYLE_DISPLAY_INLINE:
|
||||
rv = NS_NewInlineFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewInlineFrame(aNewFrame);
|
||||
processChildren = PR_TRUE;
|
||||
break;
|
||||
|
||||
case NS_STYLE_DISPLAY_TABLE:
|
||||
rv = ConstructTableFrame(aPresContext, aContent, aParentFrame,
|
||||
aStyleContext, aNewFrame);
|
||||
// Note: table construction function takes care of setting the style context,
|
||||
// Note: table construction function takes care of initializing the frame,
|
||||
// processing children, and setting the initial child list
|
||||
return rv;
|
||||
|
||||
@ -1602,7 +1596,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresContext,
|
||||
rv = GetAdjustedParentFrame(aParentFrame, aDisplay->mDisplay, parentFrame);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
rv = NS_NewTableRowGroupFrame(aContent, parentFrame, aNewFrame);
|
||||
rv = NS_NewTableRowGroupFrame(aNewFrame);
|
||||
processChildren = PR_TRUE;
|
||||
}
|
||||
}
|
||||
@ -1610,7 +1604,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresContext,
|
||||
|
||||
case NS_STYLE_DISPLAY_TABLE_COLUMN:
|
||||
// XXX We should check for being inside of a table column group...
|
||||
rv = NS_NewTableColFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewTableColFrame(aNewFrame);
|
||||
processChildren = PR_TRUE;
|
||||
break;
|
||||
|
||||
@ -1621,7 +1615,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresContext,
|
||||
rv = GetAdjustedParentFrame(aParentFrame, aDisplay->mDisplay, parentFrame);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
rv = NS_NewTableColGroupFrame(aContent, parentFrame, aNewFrame);
|
||||
rv = NS_NewTableColGroupFrame(aNewFrame);
|
||||
processChildren = PR_TRUE;
|
||||
}
|
||||
}
|
||||
@ -1629,19 +1623,19 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresContext,
|
||||
|
||||
case NS_STYLE_DISPLAY_TABLE_ROW:
|
||||
// XXX We should check for being inside of a table row group...
|
||||
rv = NS_NewTableRowFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewTableRowFrame(aNewFrame);
|
||||
processChildren = PR_TRUE;
|
||||
break;
|
||||
|
||||
case NS_STYLE_DISPLAY_TABLE_CELL:
|
||||
// XXX We should check for being inside of a table row frame...
|
||||
rv = NS_NewTableCellFrame(aContent, aParentFrame, aNewFrame);
|
||||
rv = NS_NewTableCellFrame(aNewFrame);
|
||||
processChildren = PR_TRUE;
|
||||
break;
|
||||
|
||||
case NS_STYLE_DISPLAY_TABLE_CAPTION:
|
||||
// XXX We should check for being inside of a table row frame...
|
||||
rv = NS_NewBodyFrame(aContent, aParentFrame, aNewFrame, NS_BODY_NO_AUTO_MARGINS);
|
||||
rv = NS_NewBodyFrame(aNewFrame, NS_BODY_NO_AUTO_MARGINS);
|
||||
processChildren = PR_TRUE;
|
||||
break;
|
||||
|
||||
@ -1650,10 +1644,10 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresContext,
|
||||
break;
|
||||
}
|
||||
|
||||
// If we succeeded in creating a frame then set its style context,
|
||||
// If we succeeded in creating a frame then initialize the frame,
|
||||
// process children (if requested), and initialize the frame
|
||||
if (NS_SUCCEEDED(rv) && (nsnull != aNewFrame)) {
|
||||
aNewFrame->SetStyleContext(aPresContext, aStyleContext);
|
||||
aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
|
||||
|
||||
// Process the child content if requested
|
||||
nsIFrame* childList = nsnull;
|
||||
@ -1844,13 +1838,13 @@ HTMLStyleSheetImpl::ConstructFrame(nsIPresContext* aPresContext,
|
||||
if ((display->mDisplay!=NS_STYLE_DISPLAY_TABLE) && display->IsBlockLevel() && IsScrollable(aPresContext, tag, display)) {
|
||||
// Create a scroll frame which will wrap the frame that needs to
|
||||
// be scrolled
|
||||
if (NS_SUCCEEDED(NS_NewScrollFrame(aContent, aParentFrame, scrollFrame))) {
|
||||
if (NS_SUCCEEDED(NS_NewScrollFrame(scrollFrame))) {
|
||||
nsIStyleContext* scrolledPseudoStyle;
|
||||
|
||||
// The scroll frame gets the original style context, and the scrolled
|
||||
// frame gets a SCROLLED-CONTENT pseudo element style context that
|
||||
// inherits the background properties
|
||||
scrollFrame->SetStyleContext(aPresContext, styleContext);
|
||||
scrollFrame->Init(*aPresContext, aContent, aParentFrame, styleContext);
|
||||
scrolledPseudoStyle = aPresContext->ResolvePseudoStyleContextFor
|
||||
(aContent, nsHTMLAtoms::scrolledContentPseudo,
|
||||
styleContext);
|
||||
@ -1861,8 +1855,8 @@ HTMLStyleSheetImpl::ConstructFrame(nsIPresContext* aPresContext,
|
||||
PRBool isContainer;
|
||||
aContent->CanContainChildren(isContainer);
|
||||
if (isContainer && (tag != nsHTMLAtoms::body)) {
|
||||
NS_NewBodyFrame(aContent, scrollFrame, wrapperFrame, NS_BODY_SHRINK_WRAP);
|
||||
wrapperFrame->SetStyleContext(aPresContext, scrolledPseudoStyle);
|
||||
NS_NewBodyFrame(wrapperFrame, NS_BODY_SHRINK_WRAP);
|
||||
wrapperFrame->Init(*aPresContext, aContent, scrollFrame, scrolledPseudoStyle);
|
||||
|
||||
// The wrapped frame also gets a pseudo style context, but it doesn't
|
||||
// inherit any background properties. It does inherit the 'display'
|
||||
|
||||
@ -129,9 +129,22 @@ typedef PRUint32 nsFrameState;
|
||||
class nsIFrame : public nsISupports
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Called to initialize the frame. This is the first thing that happens
|
||||
* after creating the frame.
|
||||
*
|
||||
* @param aContent the content object associated with the frame
|
||||
* @param aParent the parent frame
|
||||
* @param aContext the style context associated with the frame
|
||||
*/
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext) = 0;
|
||||
|
||||
/**
|
||||
* Called to set the initial list of frames. This happens after the frame
|
||||
* has been initialized and had its style context set.
|
||||
* has been initialized.
|
||||
*
|
||||
* This is only called once for a given child list, and won't be called
|
||||
* at all for child lists with no initial list of frames.
|
||||
@ -144,6 +157,7 @@ public:
|
||||
* NS_ERROR_UNEXPECTED if the frame is an atomic frame or if the
|
||||
* initial list of frames has already been set for that child list,
|
||||
* NS_OK otherwise
|
||||
* @see #Init()
|
||||
*/
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
@ -198,7 +212,7 @@ public:
|
||||
/**
|
||||
* Accessor functions for geometric and content parent.
|
||||
*/
|
||||
NS_IMETHOD GetContentParent(nsIFrame*& aParent) const = 0;
|
||||
NS_IMETHOD GetContentParent(nsIFrame*& aParent) const = 0;
|
||||
NS_IMETHOD SetContentParent(const nsIFrame* aParent) = 0;
|
||||
NS_IMETHOD GetGeometricParent(nsIFrame*& aParent) const = 0;
|
||||
NS_IMETHOD SetGeometricParent(const nsIFrame* aParent) = 0;
|
||||
|
||||
@ -36,15 +36,15 @@ void XXXNeverCalled()
|
||||
NS_NewHTMLDocument(&doc);
|
||||
NS_NewImageDocument(&doc);
|
||||
nsIFrame* f;
|
||||
NS_NewTextFrame(nsnull, nsnull, f);
|
||||
NS_NewInlineFrame(nsnull, nsnull, f);
|
||||
NS_NewBRFrame(nsnull, nsnull, f);
|
||||
NS_NewWBRFrame(nsnull, nsnull, f);
|
||||
NS_NewHRFrame(nsnull, nsnull, f);
|
||||
NS_NewObjectFrame(nsnull, nsnull, f);
|
||||
NS_NewSpacerFrame(nsnull, nsnull, f);
|
||||
NS_NewHTMLFramesetFrame(nsnull, nsnull, f);
|
||||
NS_NewHTMLFrame(nsnull, nsnull, f);
|
||||
NS_NewScrollFrame(nsnull, nsnull, f);
|
||||
NS_NewSimplePageSequenceFrame(nsnull, nsnull, f);
|
||||
NS_NewTextFrame(f);
|
||||
NS_NewInlineFrame(f);
|
||||
NS_NewBRFrame(f);
|
||||
NS_NewWBRFrame(f);
|
||||
NS_NewHRFrame(f);
|
||||
NS_NewObjectFrame(f);
|
||||
NS_NewSpacerFrame(f);
|
||||
NS_NewHTMLFramesetFrame(f);
|
||||
NS_NewHTMLFrame(f);
|
||||
NS_NewScrollFrame(f);
|
||||
NS_NewSimplePageSequenceFrame(f);
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ class nsLegendFrame;
|
||||
class nsFieldSetFrame : public nsHTMLContainerFrame {
|
||||
public:
|
||||
|
||||
nsFieldSetFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
nsFieldSetFrame();
|
||||
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
@ -78,8 +78,6 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~nsFieldSetFrame();
|
||||
|
||||
void SetMaxElementSize(nsSize& maxSize, nsSize* aSize);
|
||||
virtual PRIntn GetSkipSides() const;
|
||||
//virtual void GetDesiredSize(nsIPresContext* aPresContext,
|
||||
@ -95,20 +93,17 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewFieldSetFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewFieldSetFrame(nsIFrame*& aResult)
|
||||
{
|
||||
aResult = new nsFieldSetFrame(aContent, aParent);
|
||||
aResult = new nsFieldSetFrame;
|
||||
if (nsnull == aResult) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsFieldSetFrame::nsFieldSetFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsHTMLContainerFrame(aContent, aParentFrame)
|
||||
nsFieldSetFrame::nsFieldSetFrame()
|
||||
: nsHTMLContainerFrame()
|
||||
{
|
||||
mContentFrame = nsnull;
|
||||
mLegendFrame = nsnull;
|
||||
@ -117,10 +112,6 @@ nsFieldSetFrame::nsFieldSetFrame(nsIContent* aContent,
|
||||
mInline = PR_TRUE;
|
||||
}
|
||||
|
||||
nsFieldSetFrame::~nsFieldSetFrame()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
@ -132,14 +123,14 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
|
||||
|
||||
PRUint8 flags = (mInline) ? NS_BODY_SHRINK_WRAP : 0;
|
||||
NS_NewBodyFrame(mContent, this, mFirstChild, flags);
|
||||
NS_NewBodyFrame(mFirstChild, flags);
|
||||
mContentFrame = mFirstChild;
|
||||
|
||||
// Resolve style and set the style context
|
||||
// Resolve style and initialize the frame
|
||||
nsIStyleContext* styleContext = aPresContext.ResolvePseudoStyleContextFor(mContent,
|
||||
nsHTMLAtoms::fieldsetContentPseudo,
|
||||
mStyleContext);
|
||||
mFirstChild->SetStyleContext(&aPresContext, styleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, styleContext);
|
||||
NS_RELEASE(styleContext);
|
||||
|
||||
nsIFrame* newChildList = aChildList;
|
||||
|
||||
@ -46,29 +46,23 @@ static NS_DEFINE_IID(kITextWidgetIID, NS_ITEXTWIDGET_IID);
|
||||
static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID);
|
||||
|
||||
nsresult
|
||||
NS_NewFileControlFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewFileControlFrame(nsIFrame*& aResult)
|
||||
{
|
||||
aResult = new nsFileControlFrame(aContent, aParent);
|
||||
aResult = new nsFileControlFrame;
|
||||
if (nsnull == aResult) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsFileControlFrame::nsFileControlFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsHTMLContainerFrame(aContent, aParentFrame)
|
||||
nsFileControlFrame::nsFileControlFrame()
|
||||
: nsHTMLContainerFrame()
|
||||
{
|
||||
mTextFrame = nsnull;
|
||||
mBrowseFrame = nsnull;
|
||||
mFormFrame = nsnull;
|
||||
}
|
||||
|
||||
nsFileControlFrame::~nsFileControlFrame()
|
||||
{
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsFileControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
@ -211,8 +205,8 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
|
||||
if (disabled) {
|
||||
text->SetAttribute("disabled", "1", PR_FALSE);
|
||||
}
|
||||
NS_NewTextControlFrame(text, this, childFrame);
|
||||
childFrame->SetStyleContext(&aPresContext, mStyleContext);
|
||||
NS_NewTextControlFrame(childFrame);
|
||||
childFrame->Init(aPresContext, text, this, mStyleContext);
|
||||
mTextFrame = (nsTextControlFrame*)childFrame;
|
||||
mFirstChild = childFrame;
|
||||
|
||||
@ -223,10 +217,10 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
|
||||
if (disabled) {
|
||||
browse->SetAttribute("disabled", "1", PR_FALSE);
|
||||
}
|
||||
NS_NewButtonControlFrame(browse, this, childFrame);
|
||||
NS_NewButtonControlFrame(childFrame);
|
||||
((nsButtonControlFrame*)childFrame)->SetFileControlFrame(this);
|
||||
mBrowseFrame = (nsButtonControlFrame*)childFrame;
|
||||
childFrame->SetStyleContext(&aPresContext, mStyleContext);
|
||||
childFrame->Init(aPresContext, browse, this, mStyleContext);
|
||||
|
||||
mFirstChild->SetNextSibling(childFrame);
|
||||
|
||||
|
||||
@ -29,8 +29,7 @@ class nsFileControlFrame : public nsHTMLContainerFrame,
|
||||
public nsIFormControlFrame
|
||||
{
|
||||
public:
|
||||
nsFileControlFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame);
|
||||
nsFileControlFrame();
|
||||
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
@ -64,7 +63,6 @@ public:
|
||||
//static PRInt32 gSpacing;
|
||||
|
||||
protected:
|
||||
virtual ~nsFileControlFrame();
|
||||
virtual PRIntn GetSkipSides() const;
|
||||
|
||||
nsTextControlFrame* mTextFrame;
|
||||
|
||||
@ -56,8 +56,8 @@ static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
|
||||
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
||||
|
||||
|
||||
nsFormControlFrame::nsFormControlFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsLeafFrame(aContent, aParentFrame)
|
||||
nsFormControlFrame::nsFormControlFrame()
|
||||
: nsLeafFrame()
|
||||
{
|
||||
mLastMouseState = eMouseNone;
|
||||
mDidInit = PR_FALSE;
|
||||
|
||||
@ -86,7 +86,7 @@ public:
|
||||
* @param aContent the content representing this frame
|
||||
* @param aParentFrame the parent frame
|
||||
*/
|
||||
nsFormControlFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
nsFormControlFrame();
|
||||
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ class nsHTMLButtonControlFrame : public nsHTMLContainerFrame,
|
||||
public nsIFormControlFrame
|
||||
{
|
||||
public:
|
||||
nsHTMLButtonControlFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
nsHTMLButtonControlFrame();
|
||||
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
@ -106,7 +106,6 @@ public:
|
||||
void GetDefaultLabel(nsString& aLabel);
|
||||
|
||||
protected:
|
||||
virtual ~nsHTMLButtonControlFrame();
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void);
|
||||
NS_IMETHOD_(nsrefcnt) Release(void);
|
||||
void AddToPadding(nsIPresContext& aPresContext, nsStyleUnit aStyleUnit,
|
||||
@ -125,20 +124,17 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLButtonControlFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewHTMLButtonControlFrame(nsIFrame*& aResult)
|
||||
{
|
||||
aResult = new nsHTMLButtonControlFrame(aContent, aParent);
|
||||
aResult = new nsHTMLButtonControlFrame;
|
||||
if (nsnull == aResult) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsHTMLButtonControlFrame::nsHTMLButtonControlFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsHTMLContainerFrame(aContent, aParentFrame)
|
||||
nsHTMLButtonControlFrame::nsHTMLButtonControlFrame()
|
||||
: nsHTMLContainerFrame()
|
||||
{
|
||||
mInline = PR_TRUE;
|
||||
mLastMouseState = eMouseNone;
|
||||
@ -148,10 +144,6 @@ nsHTMLButtonControlFrame::nsHTMLButtonControlFrame(nsIContent* aContent,
|
||||
mDidInit = PR_FALSE;
|
||||
}
|
||||
|
||||
nsHTMLButtonControlFrame::~nsHTMLButtonControlFrame()
|
||||
{
|
||||
}
|
||||
|
||||
nsrefcnt nsHTMLButtonControlFrame::AddRef(void)
|
||||
{
|
||||
NS_WARNING("not supported");
|
||||
@ -512,12 +504,12 @@ nsHTMLButtonControlFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
|
||||
|
||||
PRUint8 flags = (mInline) ? NS_BODY_SHRINK_WRAP : 0;
|
||||
NS_NewBodyFrame(mContent, this, mFirstChild, flags);
|
||||
NS_NewBodyFrame(mFirstChild, flags);
|
||||
|
||||
// Resolve style and set the style context
|
||||
// Resolve style and initialize the frame
|
||||
nsIStyleContext* styleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::buttonContentPseudo, mStyleContext);
|
||||
mFirstChild->SetStyleContext(&aPresContext, styleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, styleContext);
|
||||
NS_RELEASE(styleContext);
|
||||
|
||||
// Set the geometric and content parent for each of the child frames
|
||||
|
||||
@ -60,7 +60,7 @@ class nsImageControlFrame : public nsImageControlFrameSuper,
|
||||
public nsIFormControlFrame
|
||||
{
|
||||
public:
|
||||
nsImageControlFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
nsImageControlFrame();
|
||||
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
@ -95,7 +95,6 @@ public:
|
||||
|
||||
void SetFocus(PRBool aOn, PRBool aRepaint);
|
||||
protected:
|
||||
virtual ~nsImageControlFrame();
|
||||
void GetTranslatedRect(nsRect& aRect); // XXX this implementation is a copy of nsHTMLButtonControlFrame
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void);
|
||||
NS_IMETHOD_(nsrefcnt) Release(void);
|
||||
@ -109,9 +108,8 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
nsImageControlFrame::nsImageControlFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsImageControlFrameSuper(aContent, aParentFrame)
|
||||
nsImageControlFrame::nsImageControlFrame()
|
||||
: nsImageControlFrameSuper()
|
||||
{
|
||||
mLastMouseState = eMouseNone;
|
||||
mLastClickPoint = nsPoint(0,0);
|
||||
@ -120,16 +118,10 @@ nsImageControlFrame::nsImageControlFrame(nsIContent* aContent,
|
||||
mGotFocus = PR_FALSE;
|
||||
}
|
||||
|
||||
nsImageControlFrame::~nsImageControlFrame()
|
||||
{
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewImageControlFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewImageControlFrame(nsIFrame*& aResult)
|
||||
{
|
||||
aResult = new nsImageControlFrame(aContent, aParent);
|
||||
aResult = new nsImageControlFrame;
|
||||
if (nsnull == aResult) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
@ -50,28 +50,21 @@ static NS_DEFINE_IID(kLegendFrameCID, NS_LEGEND_FRAME_CID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLLegendElementIID, NS_IDOMHTMLLEGENDELEMENT_IID);
|
||||
|
||||
nsresult
|
||||
NS_NewLegendFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewLegendFrame(nsIFrame*& aResult)
|
||||
{
|
||||
aResult = new nsLegendFrame(aContent, aParent);
|
||||
aResult = new nsLegendFrame;
|
||||
if (nsnull == aResult) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsLegendFrame::nsLegendFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsHTMLContainerFrame(aContent, aParentFrame)
|
||||
nsLegendFrame::nsLegendFrame()
|
||||
: nsHTMLContainerFrame()
|
||||
{
|
||||
mInline = PR_FALSE;
|
||||
}
|
||||
|
||||
nsLegendFrame::~nsLegendFrame()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLegendFrame::QueryInterface(REFNSIID aIID, void** aInstancePtrResult)
|
||||
{
|
||||
@ -97,12 +90,12 @@ nsLegendFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
|
||||
|
||||
PRUint8 flags = (mInline) ? NS_BODY_SHRINK_WRAP : 0;
|
||||
NS_NewBodyFrame(mContent, this, mFirstChild, flags);
|
||||
NS_NewBodyFrame(mFirstChild, flags);
|
||||
|
||||
// Resolve style and set the style context
|
||||
// Resolve style and initialize the frame
|
||||
nsIStyleContext* styleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::legendContentPseudo, mStyleContext);
|
||||
mFirstChild->SetStyleContext(&aPresContext, styleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, styleContext);
|
||||
NS_RELEASE(styleContext);
|
||||
|
||||
// Set the geometric and content parent for each of the child frames
|
||||
|
||||
@ -33,7 +33,7 @@ struct nsRect;
|
||||
class nsLegendFrame : public nsHTMLContainerFrame {
|
||||
public:
|
||||
|
||||
nsLegendFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
nsLegendFrame();
|
||||
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
@ -58,7 +58,6 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~nsLegendFrame();
|
||||
PRIntn GetSkipSides() const;
|
||||
PRBool mInline;
|
||||
|
||||
|
||||
@ -59,27 +59,15 @@ static NS_DEFINE_IID(kIDOMHTMLTextAreaElementIID, NS_IDOMHTMLTEXTAREAELEMENT_IID
|
||||
static NS_DEFINE_IID(kIDOMHTMLInputElementIID, NS_IDOMHTMLINPUTELEMENT_IID);
|
||||
|
||||
nsresult
|
||||
NS_NewTextControlFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewTextControlFrame(nsIFrame*& aResult)
|
||||
{
|
||||
aResult = new nsTextControlFrame(aContent, aParent);
|
||||
aResult = new nsTextControlFrame;
|
||||
if (nsnull == aResult) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsTextControlFrame::nsTextControlFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsFormControlFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
nsTextControlFrame::~nsTextControlFrame()
|
||||
{
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsTextControlFrame::GetVerticalBorderWidth(float aPixToTwip) const
|
||||
{
|
||||
|
||||
@ -26,8 +26,6 @@ class nsIPresContext;
|
||||
|
||||
class nsTextControlFrame : public nsFormControlFrame {
|
||||
public:
|
||||
nsTextControlFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
virtual nsWidgetInitData* GetWidgetInitData(nsIPresContext& aPresContext);
|
||||
|
||||
NS_IMETHOD AttributeChanged(nsIPresContext* aPresContext,
|
||||
@ -66,8 +64,6 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~nsTextControlFrame();
|
||||
|
||||
virtual void GetDesiredSize(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsHTMLReflowMetrics& aDesiredLayoutSize,
|
||||
|
||||
@ -28,8 +28,6 @@
|
||||
|
||||
class BRFrame : public nsFrame {
|
||||
public:
|
||||
BRFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
// nsIFrame
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
@ -46,10 +44,9 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewBRFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewBRFrame(nsIFrame*& aResult)
|
||||
{
|
||||
nsIFrame* frame = new BRFrame(aContent, aParentFrame);
|
||||
nsIFrame* frame = new BRFrame;
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -57,12 +54,6 @@ NS_NewBRFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
BRFrame::BRFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
BRFrame::~BRFrame()
|
||||
{
|
||||
}
|
||||
|
||||
@ -212,7 +212,6 @@ DumpStyleGeneaology(nsIFrame* aFrame, const char* gap)
|
||||
#include "nsHTMLImage.h"
|
||||
class BulletFrame : public nsFrame {
|
||||
public:
|
||||
BulletFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
virtual ~BulletFrame();
|
||||
|
||||
// nsIFrame
|
||||
@ -244,11 +243,6 @@ public:
|
||||
nsHTMLImageLoader mImageLoader;
|
||||
};
|
||||
|
||||
BulletFrame::BulletFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
BulletFrame::~BulletFrame()
|
||||
{
|
||||
}
|
||||
@ -1225,20 +1219,19 @@ nsIAtom* nsBlockFrame::gFloaterAtom;
|
||||
nsIAtom* nsBlockFrame::gBulletAtom;
|
||||
|
||||
nsresult
|
||||
NS_NewBlockFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame, PRUint32 aFlags)
|
||||
NS_NewBlockFrame(nsIFrame*& aNewFrame, PRUint32 aFlags)
|
||||
{
|
||||
nsBlockFrame* it = new nsBlockFrame(aContent, aParentFrame);
|
||||
nsBlockFrame* it = new nsBlockFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
aNewFrame = it;
|
||||
it->SetFlags(aFlags);
|
||||
aNewFrame = it;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsBlockFrame::nsBlockFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsBlockFrameSuper(aContent, aParent)
|
||||
nsBlockFrame::nsBlockFrame()
|
||||
: nsBlockFrameSuper()
|
||||
{
|
||||
// XXX for now these are a memory leak
|
||||
if (nsnull == gFloaterAtom) {
|
||||
@ -1362,18 +1355,18 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
if ((nsnull == mPrevInFlow) &&
|
||||
(NS_STYLE_DISPLAY_LIST_ITEM == styleDisplay->mDisplay) &&
|
||||
(nsnull == mBullet)) {
|
||||
// Create bullet frame
|
||||
mBullet = new BulletFrame(mContent, this);
|
||||
if (nsnull == mBullet) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
// Resolve style for the bullet frame
|
||||
nsIStyleContext* kidSC;
|
||||
kidSC = aPresContext.ResolvePseudoStyleContextFor(mContent,
|
||||
nsHTMLAtoms::bulletPseudo,
|
||||
mStyleContext);
|
||||
mBullet->SetStyleContext(&aPresContext, kidSC);
|
||||
// Create bullet frame
|
||||
mBullet = new BulletFrame;
|
||||
if (nsnull == mBullet) {
|
||||
NS_RELEASE(kidSC);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mBullet->Init(aPresContext, mContent, this, kidSC);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
// If the list bullet frame should be positioned inside then add
|
||||
@ -1434,15 +1427,17 @@ nsBlockFrame::IsSplittable(nsSplittableType& aIsSplittable) const
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::CreateContinuingFrame(nsIPresContext& aCX,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsBlockFrame* cf = new nsBlockFrame(mContent, aParent);
|
||||
nsBlockFrame* cf = new nsBlockFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
PrepareContinuingFrame(aCX, aParent, aStyleContext, cf);
|
||||
cf->Init(aCX, mContent, aParent, aStyleContext);
|
||||
cf->SetFlags(mFlags);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||
("nsBlockFrame::CreateContinuingFrame: newFrame=%p", cf));
|
||||
|
||||
@ -39,7 +39,7 @@ struct nsBlockReflowState;
|
||||
class nsBlockFrame : public nsBlockFrameSuper
|
||||
{
|
||||
public:
|
||||
nsBlockFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
nsBlockFrame();
|
||||
~nsBlockFrame();
|
||||
|
||||
// nsISupports
|
||||
|
||||
@ -212,7 +212,6 @@ DumpStyleGeneaology(nsIFrame* aFrame, const char* gap)
|
||||
#include "nsHTMLImage.h"
|
||||
class BulletFrame : public nsFrame {
|
||||
public:
|
||||
BulletFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
virtual ~BulletFrame();
|
||||
|
||||
// nsIFrame
|
||||
@ -244,11 +243,6 @@ public:
|
||||
nsHTMLImageLoader mImageLoader;
|
||||
};
|
||||
|
||||
BulletFrame::BulletFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
BulletFrame::~BulletFrame()
|
||||
{
|
||||
}
|
||||
@ -1225,20 +1219,19 @@ nsIAtom* nsBlockFrame::gFloaterAtom;
|
||||
nsIAtom* nsBlockFrame::gBulletAtom;
|
||||
|
||||
nsresult
|
||||
NS_NewBlockFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame, PRUint32 aFlags)
|
||||
NS_NewBlockFrame(nsIFrame*& aNewFrame, PRUint32 aFlags)
|
||||
{
|
||||
nsBlockFrame* it = new nsBlockFrame(aContent, aParentFrame);
|
||||
nsBlockFrame* it = new nsBlockFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
aNewFrame = it;
|
||||
it->SetFlags(aFlags);
|
||||
aNewFrame = it;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsBlockFrame::nsBlockFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsBlockFrameSuper(aContent, aParent)
|
||||
nsBlockFrame::nsBlockFrame()
|
||||
: nsBlockFrameSuper()
|
||||
{
|
||||
// XXX for now these are a memory leak
|
||||
if (nsnull == gFloaterAtom) {
|
||||
@ -1362,18 +1355,18 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
if ((nsnull == mPrevInFlow) &&
|
||||
(NS_STYLE_DISPLAY_LIST_ITEM == styleDisplay->mDisplay) &&
|
||||
(nsnull == mBullet)) {
|
||||
// Create bullet frame
|
||||
mBullet = new BulletFrame(mContent, this);
|
||||
if (nsnull == mBullet) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
// Resolve style for the bullet frame
|
||||
nsIStyleContext* kidSC;
|
||||
kidSC = aPresContext.ResolvePseudoStyleContextFor(mContent,
|
||||
nsHTMLAtoms::bulletPseudo,
|
||||
mStyleContext);
|
||||
mBullet->SetStyleContext(&aPresContext, kidSC);
|
||||
// Create bullet frame
|
||||
mBullet = new BulletFrame;
|
||||
if (nsnull == mBullet) {
|
||||
NS_RELEASE(kidSC);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mBullet->Init(aPresContext, mContent, this, kidSC);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
// If the list bullet frame should be positioned inside then add
|
||||
@ -1434,15 +1427,17 @@ nsBlockFrame::IsSplittable(nsSplittableType& aIsSplittable) const
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::CreateContinuingFrame(nsIPresContext& aCX,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsBlockFrame* cf = new nsBlockFrame(mContent, aParent);
|
||||
nsBlockFrame* cf = new nsBlockFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
PrepareContinuingFrame(aCX, aParent, aStyleContext, cf);
|
||||
cf->Init(aCX, mContent, aParent, aStyleContext);
|
||||
cf->SetFlags(mFlags);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||
("nsBlockFrame::CreateContinuingFrame: newFrame=%p", cf));
|
||||
|
||||
@ -212,7 +212,6 @@ DumpStyleGeneaology(nsIFrame* aFrame, const char* gap)
|
||||
#include "nsHTMLImage.h"
|
||||
class BulletFrame : public nsFrame {
|
||||
public:
|
||||
BulletFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
virtual ~BulletFrame();
|
||||
|
||||
// nsIFrame
|
||||
@ -244,11 +243,6 @@ public:
|
||||
nsHTMLImageLoader mImageLoader;
|
||||
};
|
||||
|
||||
BulletFrame::BulletFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
BulletFrame::~BulletFrame()
|
||||
{
|
||||
}
|
||||
@ -1225,20 +1219,19 @@ nsIAtom* nsBlockFrame::gFloaterAtom;
|
||||
nsIAtom* nsBlockFrame::gBulletAtom;
|
||||
|
||||
nsresult
|
||||
NS_NewBlockFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame, PRUint32 aFlags)
|
||||
NS_NewBlockFrame(nsIFrame*& aNewFrame, PRUint32 aFlags)
|
||||
{
|
||||
nsBlockFrame* it = new nsBlockFrame(aContent, aParentFrame);
|
||||
nsBlockFrame* it = new nsBlockFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
aNewFrame = it;
|
||||
it->SetFlags(aFlags);
|
||||
aNewFrame = it;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsBlockFrame::nsBlockFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsBlockFrameSuper(aContent, aParent)
|
||||
nsBlockFrame::nsBlockFrame()
|
||||
: nsBlockFrameSuper()
|
||||
{
|
||||
// XXX for now these are a memory leak
|
||||
if (nsnull == gFloaterAtom) {
|
||||
@ -1362,18 +1355,18 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
if ((nsnull == mPrevInFlow) &&
|
||||
(NS_STYLE_DISPLAY_LIST_ITEM == styleDisplay->mDisplay) &&
|
||||
(nsnull == mBullet)) {
|
||||
// Create bullet frame
|
||||
mBullet = new BulletFrame(mContent, this);
|
||||
if (nsnull == mBullet) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
// Resolve style for the bullet frame
|
||||
nsIStyleContext* kidSC;
|
||||
kidSC = aPresContext.ResolvePseudoStyleContextFor(mContent,
|
||||
nsHTMLAtoms::bulletPseudo,
|
||||
mStyleContext);
|
||||
mBullet->SetStyleContext(&aPresContext, kidSC);
|
||||
// Create bullet frame
|
||||
mBullet = new BulletFrame;
|
||||
if (nsnull == mBullet) {
|
||||
NS_RELEASE(kidSC);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mBullet->Init(aPresContext, mContent, this, kidSC);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
// If the list bullet frame should be positioned inside then add
|
||||
@ -1434,15 +1427,17 @@ nsBlockFrame::IsSplittable(nsSplittableType& aIsSplittable) const
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::CreateContinuingFrame(nsIPresContext& aCX,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsBlockFrame* cf = new nsBlockFrame(mContent, aParent);
|
||||
nsBlockFrame* cf = new nsBlockFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
PrepareContinuingFrame(aCX, aParent, aStyleContext, cf);
|
||||
cf->Init(aCX, mContent, aParent, aStyleContext);
|
||||
cf->SetFlags(mFlags);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||
("nsBlockFrame::CreateContinuingFrame: newFrame=%p", cf));
|
||||
|
||||
@ -36,15 +36,6 @@
|
||||
#undef NOISY
|
||||
#endif
|
||||
|
||||
nsContainerFrame::nsContainerFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsSplittableFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
nsContainerFrame::~nsContainerFrame()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsContainerFrame::SizeOf(nsISizeOfHandler* aHandler) const
|
||||
{
|
||||
@ -121,17 +112,6 @@ nsContainerFrame::SizeOfWithoutThis(nsISizeOfHandler* aHandler) const
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsContainerFrame::PrepareContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsContainerFrame* aContFrame)
|
||||
{
|
||||
// Append the continuing frame to the flow
|
||||
aContFrame->AppendToFlow(this);
|
||||
aContFrame->SetStyleContext(&aPresContext, aStyleContext);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsContainerFrame::DidReflow(nsIPresContext& aPresContext,
|
||||
nsDidReflowStatus aStatus)
|
||||
|
||||
@ -83,12 +83,6 @@ public:
|
||||
nsIFrame* aChild);
|
||||
|
||||
protected:
|
||||
// Constructor. Takes as arguments the content object, the index in parent,
|
||||
// and the Frame for the content parent
|
||||
nsContainerFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
virtual ~nsContainerFrame();
|
||||
|
||||
void DeleteFrameList(nsIPresContext& aPresContext,
|
||||
nsIFrame** aListP);
|
||||
|
||||
@ -98,18 +92,6 @@ protected:
|
||||
nsIAtom* aList,
|
||||
nsIFrame** aFrame);
|
||||
|
||||
/**
|
||||
* Prepare a continuation frame of this frame for reflow. Appends
|
||||
* it to the flow, sets its content offsets, mLastContentIsComplete,
|
||||
* and style context. Subclasses should invoke this method after
|
||||
* construction of a continuing frame.
|
||||
*/
|
||||
void PrepareContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsContainerFrame* aContFrame);
|
||||
|
||||
|
||||
virtual void PaintChildren(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
|
||||
@ -209,15 +209,13 @@ nsIFrame::GetLogModuleInfo()
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
|
||||
nsresult
|
||||
NS_NewEmptyFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent)
|
||||
NS_NewEmptyFrame(nsIFrame** aInstancePtrResult)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsFrame(aContent, aParent);
|
||||
nsIFrame* it = new nsFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -233,10 +231,8 @@ void* nsFrame::operator new(size_t size)
|
||||
return result;
|
||||
}
|
||||
|
||||
nsFrame::nsFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: mContent(aContent), mContentParent(aParent), mGeometricParent(aParent)
|
||||
nsFrame::nsFrame()
|
||||
{
|
||||
NS_IF_ADDREF(mContent);
|
||||
mState = NS_FRAME_FIRST_REFLOW | NS_FRAME_SYNC_FRAME_AND_VIEW;
|
||||
}
|
||||
|
||||
@ -295,6 +291,18 @@ nsrefcnt nsFrame::Release(void)
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// nsIFrame
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFrame::Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext)
|
||||
{
|
||||
mContent = aContent;
|
||||
NS_IF_ADDREF(mContent);
|
||||
mGeometricParent = mContentParent = aParent;
|
||||
return SetStyleContext(&aPresContext, aContext);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList)
|
||||
|
||||
@ -102,9 +102,7 @@ public:
|
||||
* Create a new "empty" frame that maps a given piece of content into a
|
||||
* 0,0 area.
|
||||
*/
|
||||
friend nsresult NS_NewEmptyFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent);
|
||||
friend nsresult NS_NewEmptyFrame(nsIFrame** aInstancePtrResult);
|
||||
|
||||
// Overloaded new operator. Initializes the memory to 0
|
||||
void* operator new(size_t size);
|
||||
@ -113,6 +111,10 @@ public:
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
// nsIFrame
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext);
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList);
|
||||
@ -307,12 +309,8 @@ protected:
|
||||
// Style post processing hook
|
||||
NS_IMETHOD DidSetStyleContext(nsIPresContext* aPresContext);
|
||||
|
||||
|
||||
|
||||
// Constructor. Takes as arguments the content object, the index in parent,
|
||||
// and the Frame for the content parent
|
||||
nsFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
// Protected constructor and destructor
|
||||
nsFrame();
|
||||
virtual ~nsFrame();
|
||||
|
||||
void SizeOfWithoutThis(nsISizeOfHandler* aHandler) const;
|
||||
|
||||
@ -103,7 +103,7 @@ public:
|
||||
class nsHTMLFrameOuterFrame : public nsHTMLContainerFrame {
|
||||
|
||||
public:
|
||||
nsHTMLFrameOuterFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
nsHTMLFrameOuterFrame();
|
||||
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
|
||||
@ -139,7 +139,7 @@ class nsHTMLFrameInnerFrame : public nsLeafFrame {
|
||||
|
||||
public:
|
||||
|
||||
nsHTMLFrameInnerFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
nsHTMLFrameInnerFrame();
|
||||
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
|
||||
@ -191,8 +191,8 @@ protected:
|
||||
/*******************************************************************************
|
||||
* nsHTMLFrameOuterFrame
|
||||
******************************************************************************/
|
||||
nsHTMLFrameOuterFrame::nsHTMLFrameOuterFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aParent)
|
||||
nsHTMLFrameOuterFrame::nsHTMLFrameOuterFrame()
|
||||
: nsHTMLContainerFrame()
|
||||
{
|
||||
mIsInline = nsnull;
|
||||
}
|
||||
@ -314,9 +314,9 @@ nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext,
|
||||
}
|
||||
|
||||
if (nsnull == mFirstChild) {
|
||||
mFirstChild = new nsHTMLFrameInnerFrame(mContent, this);
|
||||
mFirstChild = new nsHTMLFrameInnerFrame;
|
||||
// XXX temporary! use style system to get correct style!
|
||||
mFirstChild->SetStyleContext(&aPresContext, mStyleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, mStyleContext);
|
||||
}
|
||||
|
||||
// nsContainerFrame::PaintBorder has some problems, kludge it here
|
||||
@ -379,10 +379,9 @@ nsHTMLFrameOuterFrame::AttributeChanged(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLFrameOuterFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewHTMLFrameOuterFrame(nsIFrame*& aResult)
|
||||
{
|
||||
nsIFrame* frame = new nsHTMLFrameOuterFrame(aContent, aParentFrame);
|
||||
nsIFrame* frame = new nsHTMLFrameOuterFrame;
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -393,9 +392,8 @@ NS_NewHTMLFrameOuterFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
/*******************************************************************************
|
||||
* nsHTMLFrameInnerFrame
|
||||
******************************************************************************/
|
||||
nsHTMLFrameInnerFrame::nsHTMLFrameInnerFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsLeafFrame(aContent, aParentFrame)
|
||||
nsHTMLFrameInnerFrame::nsHTMLFrameInnerFrame()
|
||||
: nsLeafFrame()
|
||||
{
|
||||
mWebShell = nsnull;
|
||||
mCreatingViewer = PR_FALSE;
|
||||
|
||||
@ -89,8 +89,7 @@ public:
|
||||
void SetColor(nscolor aColor);
|
||||
|
||||
protected:
|
||||
nsHTMLFramesetBorderFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
PRInt32 aWidth, PRBool aVertical, PRBool aVisible);
|
||||
nsHTMLFramesetBorderFrame(PRInt32 aWidth, PRBool aVertical, PRBool aVisible);
|
||||
virtual ~nsHTMLFramesetBorderFrame();
|
||||
virtual void GetDesiredSize(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
@ -124,7 +123,6 @@ public:
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
protected:
|
||||
nsHTMLFramesetBlankFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
virtual ~nsHTMLFramesetBlankFrame();
|
||||
virtual void GetDesiredSize(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
@ -139,8 +137,8 @@ protected:
|
||||
PRInt32 nsHTMLFramesetFrame::gMaxNumRowColSpecs = 25;
|
||||
PRBool nsHTMLFramesetFrame::gDragInProgress = PR_FALSE;
|
||||
|
||||
nsHTMLFramesetFrame::nsHTMLFramesetFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aParent)
|
||||
nsHTMLFramesetFrame::nsHTMLFramesetFrame()
|
||||
: nsHTMLContainerFrame()
|
||||
{
|
||||
mNumRows = 0;
|
||||
mRowSpecs = nsnull;
|
||||
@ -929,7 +927,8 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsresult result;
|
||||
|
||||
if (nsHTMLAtoms::frameset == tag) {
|
||||
result = NS_NewHTMLFramesetFrame(child, this, frame);
|
||||
result = NS_NewHTMLFramesetFrame(frame);
|
||||
frame->Init(aPresContext, child, this, kidSC);
|
||||
|
||||
childTypes[mChildCount] = FRAMESET;
|
||||
nsHTMLFramesetFrame* childFrame = (nsHTMLFramesetFrame*)frame;
|
||||
@ -938,25 +937,22 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||
childFrame->SetParentBorderColor(borderColor);
|
||||
childBorderColors[mChildCount].Set(childFrame->GetBorderColor());
|
||||
} else { // frame
|
||||
result = NS_NewHTMLFrameOuterFrame(child, this, frame);
|
||||
result = NS_NewHTMLFrameOuterFrame(frame);
|
||||
frame->Init(aPresContext, child, this, kidSC);
|
||||
|
||||
childTypes[mChildCount] = FRAME;
|
||||
//
|
||||
childFrameborder[mChildCount] = GetFrameBorder(child, PR_FALSE);
|
||||
childBorderColors[mChildCount].Set(GetBorderColor(child));
|
||||
}
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
if (NS_OK != result) {
|
||||
NS_RELEASE(tag);
|
||||
NS_RELEASE(child);
|
||||
NS_RELEASE(kidSC);
|
||||
return result;
|
||||
}
|
||||
|
||||
// Set the style context
|
||||
frame->SetStyleContext(&aPresContext, kidSC);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
if (nsnull == lastChild) {
|
||||
mFirstChild = frame;
|
||||
} else {
|
||||
@ -972,10 +968,10 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||
// add blank frames for frameset cells that had no content provided
|
||||
for (int blankX = mChildCount; blankX < numCells; blankX++) {
|
||||
// XXX the blank frame is using the content of its parent - at some point it should just have null content
|
||||
nsHTMLFramesetBlankFrame* blankFrame = new nsHTMLFramesetBlankFrame(mContent, this);
|
||||
nsHTMLFramesetBlankFrame* blankFrame = new nsHTMLFramesetBlankFrame;
|
||||
nsIStyleContext* pseudoStyleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::framesetBlankPseudo, mStyleContext);
|
||||
blankFrame->SetStyleContext(&aPresContext, pseudoStyleContext);
|
||||
blankFrame->Init(aPresContext, mContent, this, pseudoStyleContext);
|
||||
NS_RELEASE(pseudoStyleContext);
|
||||
|
||||
if (nsnull == lastChild) {
|
||||
@ -1010,10 +1006,10 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||
offset.y += lastSize.height;
|
||||
if ((borderWidth > 0) && (eFrameborder_No != frameborder)) {
|
||||
if (firstTime) { // create horizontal border
|
||||
borderFrame = new nsHTMLFramesetBorderFrame(mContent, this, borderWidth, PR_FALSE, PR_FALSE);
|
||||
borderFrame = new nsHTMLFramesetBorderFrame(borderWidth, PR_FALSE, PR_FALSE);
|
||||
nsIStyleContext* pseudoStyleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::horizontalFramesetBorderPseudo, mStyleContext);
|
||||
borderFrame->SetStyleContext(&aPresContext, pseudoStyleContext);
|
||||
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext);
|
||||
NS_RELEASE(pseudoStyleContext);
|
||||
|
||||
mChildCount++;
|
||||
@ -1035,10 +1031,10 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||
if ((cellIndex.x > 0) && (borderWidth > 0)) { // moved to next col in same row
|
||||
if (0 == cellIndex.y) { // in 1st row
|
||||
if (firstTime) { // create vertical border
|
||||
borderFrame = new nsHTMLFramesetBorderFrame(mContent, this, borderWidth, PR_TRUE, PR_FALSE);
|
||||
borderFrame = new nsHTMLFramesetBorderFrame(borderWidth, PR_TRUE, PR_FALSE);
|
||||
nsIStyleContext* pseudoStyleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::verticalFramesetBorderPseudo, mStyleContext);
|
||||
borderFrame->SetStyleContext(&aPresContext, pseudoStyleContext);
|
||||
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext);
|
||||
NS_RELEASE(pseudoStyleContext);
|
||||
|
||||
mChildCount++;
|
||||
@ -1425,10 +1421,9 @@ nsHTMLFramesetFrame::EndMouseDrag()
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLFramesetFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewHTMLFramesetFrame(nsIFrame*& aResult)
|
||||
{
|
||||
nsIFrame* frame = new nsHTMLFramesetFrame(aContent, aParentFrame);
|
||||
nsIFrame* frame = new nsHTMLFramesetFrame;
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -1439,9 +1434,8 @@ NS_NewHTMLFramesetFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
/*******************************************************************************
|
||||
* nsHTMLFramesetBorderFrame
|
||||
******************************************************************************/
|
||||
nsHTMLFramesetBorderFrame::nsHTMLFramesetBorderFrame(nsIContent* aContent, nsIFrame* aParent,
|
||||
PRInt32 aWidth, PRBool aVertical, PRBool aVisibility)
|
||||
: nsLeafFrame(aContent, aParent), mWidth(aWidth), mVertical(aVertical), mVisibility(aVisibility)
|
||||
nsHTMLFramesetBorderFrame::nsHTMLFramesetBorderFrame(PRInt32 aWidth, PRBool aVertical, PRBool aVisibility)
|
||||
: nsLeafFrame(), mWidth(aWidth), mVertical(aVertical), mVisibility(aVisibility)
|
||||
{
|
||||
mCanResize = PR_TRUE;
|
||||
mColor = NO_COLOR;
|
||||
@ -1612,10 +1606,6 @@ NS_IMETHODIMP nsHTMLFramesetBorderFrame::GetFrameName(nsString& aResult) const
|
||||
/*******************************************************************************
|
||||
* nsHTMLFramesetBlankFrame
|
||||
******************************************************************************/
|
||||
nsHTMLFramesetBlankFrame::nsHTMLFramesetBlankFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsLeafFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
nsHTMLFramesetBlankFrame::~nsHTMLFramesetBlankFrame()
|
||||
{
|
||||
|
||||
@ -93,7 +93,7 @@ struct nsFramesetDrag {
|
||||
class nsHTMLFramesetFrame : public nsHTMLContainerFrame {
|
||||
|
||||
public:
|
||||
nsHTMLFramesetFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
nsHTMLFramesetFrame();
|
||||
|
||||
virtual ~nsHTMLFramesetFrame();
|
||||
|
||||
|
||||
@ -44,15 +44,6 @@
|
||||
|
||||
NS_DEF_PTR(nsIStyleContext);
|
||||
|
||||
nsHTMLContainerFrame::nsHTMLContainerFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsContainerFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
nsHTMLContainerFrame::~nsHTMLContainerFrame()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLContainerFrame::Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
@ -118,15 +109,15 @@ nsHTMLContainerFrame::CreatePlaceholderFrame(nsIPresContext& aPresContext,
|
||||
nsIContent* content;
|
||||
aFloatedFrame->GetContent(content);
|
||||
|
||||
nsPlaceholderFrame* placeholder;
|
||||
NS_NewPlaceholderFrame((nsIFrame**)&placeholder, content, this,
|
||||
aFloatedFrame);
|
||||
NS_IF_RELEASE(content);
|
||||
|
||||
// Let the placeholder share the same style context as the floated element
|
||||
nsIStyleContext* kidSC;
|
||||
aFloatedFrame->GetStyleContext(kidSC);
|
||||
placeholder->SetStyleContext(&aPresContext, kidSC);
|
||||
|
||||
nsPlaceholderFrame* placeholder;
|
||||
NS_NewPlaceholderFrame((nsIFrame**)&placeholder);
|
||||
placeholder->Init(aPresContext, content, this, kidSC);
|
||||
placeholder->SetAnchoredItem(aFloatedFrame);
|
||||
NS_IF_RELEASE(content);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
return placeholder;
|
||||
@ -139,14 +130,15 @@ nsHTMLContainerFrame::CreateAbsolutePlaceholderFrame(nsIPresContext& aPresContex
|
||||
nsIContent* content;
|
||||
aAbsoluteFrame->GetContent(content);
|
||||
|
||||
nsAbsoluteFrame* placeholder;
|
||||
NS_NewAbsoluteFrame((nsIFrame**)&placeholder, content, this, aAbsoluteFrame);
|
||||
NS_IF_RELEASE(content);
|
||||
|
||||
// Let the placeholder share the same style context as the floated element
|
||||
nsIStyleContext* kidSC;
|
||||
aAbsoluteFrame->GetStyleContext(kidSC);
|
||||
placeholder->SetStyleContext(&aPresContext, kidSC);
|
||||
|
||||
nsAbsoluteFrame* placeholder;
|
||||
NS_NewAbsoluteFrame((nsIFrame**)&placeholder);
|
||||
placeholder->Init(aPresContext, content, this, kidSC);
|
||||
placeholder->SetAbsoluteFrame(aAbsoluteFrame);
|
||||
NS_IF_RELEASE(content);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
return placeholder;
|
||||
@ -164,15 +156,15 @@ nsHTMLContainerFrame::CreateWrapperFrame(nsIPresContext& aPresContext,
|
||||
aFrame->GetContent(content);
|
||||
content->CanContainChildren(isContainer);
|
||||
if (isContainer) {
|
||||
// Wrap the frame in a BODY frame.
|
||||
NS_NewBodyFrame(content, this, aWrapperFrame, NS_BODY_SHRINK_WRAP);/* XXX auto margins? */
|
||||
|
||||
// The body wrapper frame gets the original style context, and the wrapped
|
||||
// frame gets a pseudo style context
|
||||
// Wrap the frame in a BODY frame. The body wrapper frame gets the
|
||||
// original style context
|
||||
nsIStyleContext* kidStyle;
|
||||
aFrame->GetStyleContext(kidStyle);
|
||||
aWrapperFrame->SetStyleContext(&aPresContext, kidStyle);
|
||||
|
||||
NS_NewBodyFrame(aWrapperFrame, NS_BODY_SHRINK_WRAP); // XXX auto margins?
|
||||
aWrapperFrame->Init(aPresContext, content, this, kidStyle);
|
||||
|
||||
// The wrapped frame gets a pseudo style context
|
||||
nsIStyleContext* pseudoStyle;
|
||||
pseudoStyle = aPresContext.ResolvePseudoStyleContextFor(content,
|
||||
nsHTMLAtoms::columnPseudo,
|
||||
|
||||
@ -29,9 +29,6 @@ struct nsStylePosition;
|
||||
// functionality.
|
||||
class nsHTMLContainerFrame : public nsContainerFrame {
|
||||
public:
|
||||
nsHTMLContainerFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
@ -81,8 +78,6 @@ public:
|
||||
nsIFrame* aNewParent);
|
||||
|
||||
protected:
|
||||
virtual ~nsHTMLContainerFrame();
|
||||
|
||||
virtual PRIntn GetSkipSides() const = 0;
|
||||
};
|
||||
|
||||
|
||||
@ -44,8 +44,6 @@ static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
|
||||
class RootFrame : public nsHTMLContainerFrame {
|
||||
public:
|
||||
RootFrame(nsIContent* aContent);
|
||||
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList);
|
||||
@ -70,10 +68,9 @@ protected:
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewHTMLFrame(nsIFrame*& aResult)
|
||||
{
|
||||
RootFrame* frame = new RootFrame(aContent);
|
||||
RootFrame* frame = new RootFrame;
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -81,11 +78,6 @@ NS_NewHTMLFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
RootFrame::RootFrame(nsIContent* aContent)
|
||||
: nsHTMLContainerFrame(aContent, nsnull)
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
RootFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
|
||||
@ -241,158 +241,56 @@ NS_CreateHTMLElement(nsIHTMLContent** aResult,
|
||||
|
||||
// Factory methods for creating html layout objects
|
||||
|
||||
extern nsresult
|
||||
NS_NewBRFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame);
|
||||
|
||||
extern nsresult
|
||||
NS_NewBodyFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame, PRUint32 aFlags);
|
||||
|
||||
extern nsresult
|
||||
NS_NewBlockFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame, PRUint32 aFlags);
|
||||
extern nsresult NS_NewBRFrame(nsIFrame*& aNewFrame);
|
||||
extern nsresult NS_NewBodyFrame(nsIFrame*& aNewFrame, PRUint32 aFlags);
|
||||
extern nsresult NS_NewBlockFrame(nsIFrame*& aNewFrame, PRUint32 aFlags);
|
||||
|
||||
// Flags for body and block frames
|
||||
#define NS_BODY_SHRINK_WRAP 0x1
|
||||
#define NS_BODY_NO_AUTO_MARGINS 0x2
|
||||
#define NS_BODY_THE_BODY 0x4
|
||||
|
||||
extern nsresult
|
||||
NS_NewCommentFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aFrameResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewHRFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame);
|
||||
extern nsresult NS_NewCommentFrame(nsIFrame*& aFrameResult);
|
||||
extern nsresult NS_NewHRFrame(nsIFrame*& aNewFrame);
|
||||
|
||||
// <frame> and <iframe>
|
||||
extern nsresult
|
||||
NS_NewHTMLFrameOuterFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame);
|
||||
extern nsresult NS_NewHTMLFrameOuterFrame(nsIFrame*& aNewFrame);
|
||||
// <frameset>
|
||||
extern nsresult
|
||||
NS_NewHTMLFramesetFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame);
|
||||
extern nsresult NS_NewHTMLFramesetFrame(nsIFrame*& aNewFrame);
|
||||
|
||||
extern nsresult
|
||||
NS_NewHTMLFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame);
|
||||
|
||||
extern nsresult
|
||||
NS_NewImageFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aFrameResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewInlineFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame);
|
||||
|
||||
extern nsresult
|
||||
NS_NewObjectFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aFrameResult);
|
||||
|
||||
nsresult
|
||||
NS_NewSpacerFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
nsresult
|
||||
NS_NewTextFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
nsresult
|
||||
NS_NewWBRFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewScrollFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewSimplePageSequenceFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
extern nsresult NS_NewHTMLFrame(nsIFrame*& aNewFrame);
|
||||
extern nsresult NS_NewImageFrame(nsIFrame*& aFrameResult);
|
||||
extern nsresult NS_NewInlineFrame(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);
|
||||
|
||||
// forms
|
||||
extern nsresult
|
||||
NS_NewFormFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewButtonControlFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewImageControlFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewHTMLButtonControlFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewCheckboxControlFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewFieldSetFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewFileControlFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewLabelFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewLegendFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewTextControlFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewRadioControlFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewSelectControlFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
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);
|
||||
|
||||
// table frame factories
|
||||
|
||||
extern nsresult
|
||||
NS_NewTableOuterFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewTableFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewTableCaptionFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewTableColFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewTableColGroupFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewTableRowFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewTableRowGroupFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewTableCellFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
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);
|
||||
|
||||
// Everything below this line is obsolete...
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
@ -129,9 +129,22 @@ typedef PRUint32 nsFrameState;
|
||||
class nsIFrame : public nsISupports
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Called to initialize the frame. This is the first thing that happens
|
||||
* after creating the frame.
|
||||
*
|
||||
* @param aContent the content object associated with the frame
|
||||
* @param aParent the parent frame
|
||||
* @param aContext the style context associated with the frame
|
||||
*/
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext) = 0;
|
||||
|
||||
/**
|
||||
* Called to set the initial list of frames. This happens after the frame
|
||||
* has been initialized and had its style context set.
|
||||
* has been initialized.
|
||||
*
|
||||
* This is only called once for a given child list, and won't be called
|
||||
* at all for child lists with no initial list of frames.
|
||||
@ -144,6 +157,7 @@ public:
|
||||
* NS_ERROR_UNEXPECTED if the frame is an atomic frame or if the
|
||||
* initial list of frames has already been set for that child list,
|
||||
* NS_OK otherwise
|
||||
* @see #Init()
|
||||
*/
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
@ -198,7 +212,7 @@ public:
|
||||
/**
|
||||
* Accessor functions for geometric and content parent.
|
||||
*/
|
||||
NS_IMETHOD GetContentParent(nsIFrame*& aParent) const = 0;
|
||||
NS_IMETHOD GetContentParent(nsIFrame*& aParent) const = 0;
|
||||
NS_IMETHOD SetContentParent(const nsIFrame* aParent) = 0;
|
||||
NS_IMETHOD GetGeometricParent(nsIFrame*& aParent) const = 0;
|
||||
NS_IMETHOD SetGeometricParent(const nsIFrame* aParent) = 0;
|
||||
|
||||
@ -314,11 +314,9 @@ nsHTMLImageLoader::GetLoadImageFailed() const
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsresult
|
||||
NS_NewImageFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewImageFrame(nsIFrame*& aResult)
|
||||
{
|
||||
nsImageFrame* frame = new nsImageFrame(aContent, aParentFrame);
|
||||
nsImageFrame* frame = new nsImageFrame;
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -326,11 +324,6 @@ NS_NewImageFrame(nsIContent* aContent,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsImageFrame::nsImageFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsLeafFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
nsImageFrame::~nsImageFrame()
|
||||
{
|
||||
}
|
||||
|
||||
@ -56,9 +56,6 @@ nsInlineReflowState::~nsInlineReflowState()
|
||||
class nsInlineFrame : public nsHTMLContainerFrame
|
||||
{
|
||||
public:
|
||||
nsInlineFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
virtual ~nsInlineFrame();
|
||||
|
||||
// nsIFrame
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
@ -142,9 +139,7 @@ public:
|
||||
|
||||
PRBool SafeToPull(nsIFrame* aFrame);
|
||||
|
||||
friend nsresult NS_NewInlineFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame);
|
||||
friend nsresult NS_NewInlineFrame(nsIFrame*& aNewFrame);
|
||||
|
||||
struct AdjustData {
|
||||
nsIFrame* frame;
|
||||
@ -156,25 +151,15 @@ public:
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsresult NS_NewInlineFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame)
|
||||
nsresult NS_NewInlineFrame(nsIFrame*& aNewFrame)
|
||||
{
|
||||
aNewFrame = new nsInlineFrame(aContent, aParentFrame);
|
||||
aNewFrame = new nsInlineFrame;
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsInlineFrame::nsInlineFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
nsInlineFrame::~nsInlineFrame()
|
||||
{
|
||||
}
|
||||
|
||||
PRIntn
|
||||
nsInlineFrame::GetSkipSides() const
|
||||
{
|
||||
@ -257,11 +242,12 @@ nsInlineFrame::CreateContinuingFrame(nsIPresContext& aCX,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsInlineFrame* cf = new nsInlineFrame(mContent, aParent);
|
||||
nsInlineFrame* cf = new nsInlineFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
PrepareContinuingFrame(aCX, aParent, aStyleContext, cf);
|
||||
cf->Init(aCX, mContent, aParent, aStyleContext);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||
("nsInlineFrame::CreateContinuingFrame: newFrame=%p", cf));
|
||||
|
||||
@ -24,11 +24,6 @@
|
||||
#include "nsIPresContext.h"
|
||||
#include "nsIStyleContext.h"
|
||||
|
||||
nsLeafFrame::nsLeafFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
nsLeafFrame::~nsLeafFrame()
|
||||
{
|
||||
}
|
||||
|
||||
@ -42,7 +42,6 @@ public:
|
||||
nsISupports* aSubContent);
|
||||
|
||||
protected:
|
||||
nsLeafFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
virtual ~nsLeafFrame();
|
||||
|
||||
/**
|
||||
|
||||
@ -139,10 +139,6 @@ private:
|
||||
|
||||
class nsObjectFrame : public nsObjectFrameSuper {
|
||||
public:
|
||||
nsObjectFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
// NS_IMETHOD Init(nsIPresContext& aPresContext, nsIFrame *aChildList);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
@ -178,11 +174,6 @@ private:
|
||||
nsIFrame *mFirstChild;
|
||||
};
|
||||
|
||||
nsObjectFrame::nsObjectFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsObjectFrameSuper(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
nsObjectFrame::~nsObjectFrame()
|
||||
{
|
||||
NS_IF_RELEASE(mInstanceOwner);
|
||||
@ -210,13 +201,6 @@ static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
|
||||
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
||||
static NS_DEFINE_IID(kWidgetCID, NS_CHILD_CID);
|
||||
|
||||
//NS_IMETHODIMP
|
||||
//nsObjectFrame::Init(nsIPresContext& aPresContext, nsIFrame *aChildList)
|
||||
//{
|
||||
// mFirstChild = aChildList;
|
||||
// return NS_OK;
|
||||
//}
|
||||
|
||||
nsresult
|
||||
nsObjectFrame::CreateWidget(nscoord aWidth, nscoord aHeight, PRBool aViewOnly)
|
||||
{
|
||||
@ -645,10 +629,9 @@ nsresult nsObjectFrame :: GetFullURL(nsString& aFullURL)
|
||||
|
||||
|
||||
nsresult
|
||||
NS_NewObjectFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aFrameResult)
|
||||
NS_NewObjectFrame(nsIFrame*& aFrameResult)
|
||||
{
|
||||
aFrameResult = new nsObjectFrame(aContent, aParentFrame);
|
||||
aFrameResult = new nsObjectFrame;
|
||||
if (nsnull == aFrameResult) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
@ -24,11 +24,6 @@
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
|
||||
nsPageFrame::nsPageFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsContainerFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
@ -131,11 +126,12 @@ nsPageFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsPageFrame* cf = new nsPageFrame(mContent, aParent);
|
||||
nsPageFrame* cf = new nsPageFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
PrepareContinuingFrame(aPresContext, aParent, aStyleContext, cf);
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -23,8 +23,6 @@
|
||||
// Page frame class used by the simple page sequence frame
|
||||
class nsPageFrame : public nsContainerFrame {
|
||||
public:
|
||||
nsPageFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aMaxSize,
|
||||
|
||||
@ -25,16 +25,13 @@
|
||||
#include "nsIStyleContext.h"
|
||||
|
||||
nsresult
|
||||
NS_NewPlaceholderFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aAnchoredItem)
|
||||
NS_NewPlaceholderFrame(nsIFrame** aInstancePtrResult)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsPlaceholderFrame(aContent, aParent, aAnchoredItem);
|
||||
nsIFrame* it = new nsPlaceholderFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -42,18 +39,6 @@ NS_NewPlaceholderFrame(nsIFrame** aInstancePtrResult,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsPlaceholderFrame::nsPlaceholderFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aAnchoredItem)
|
||||
: nsFrame(aContent, aParent)
|
||||
{
|
||||
mAnchoredItem = aAnchoredItem;
|
||||
}
|
||||
|
||||
nsPlaceholderFrame::~nsPlaceholderFrame()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPlaceholderFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
|
||||
@ -28,18 +28,11 @@ public:
|
||||
/**
|
||||
* Create a new placeholder frame
|
||||
*/
|
||||
friend nsresult NS_NewPlaceholderFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aAnchoredItem = nsnull);
|
||||
friend nsresult NS_NewPlaceholderFrame(nsIFrame** aInstancePtrResult);
|
||||
|
||||
// Get/Set the associated anchored item
|
||||
nsIFrame* GetAnchoredItem() const {
|
||||
return mAnchoredItem;
|
||||
}
|
||||
void SetAnchoredItem(nsIFrame* aAnchoredItem) {
|
||||
mAnchoredItem = aAnchoredItem;
|
||||
}
|
||||
nsIFrame* GetAnchoredItem() const {return mAnchoredItem;}
|
||||
void SetAnchoredItem(nsIFrame* aAnchoredItem) {mAnchoredItem = aAnchoredItem;}
|
||||
|
||||
// nsIHTMLReflow overrides
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
@ -64,13 +57,6 @@ public:
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
|
||||
protected:
|
||||
// Constructor. Takes as arguments the content object and the Frame for
|
||||
// the content parent
|
||||
nsPlaceholderFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aAnchoredItem);
|
||||
virtual ~nsPlaceholderFrame();
|
||||
|
||||
nsIFrame* mAnchoredItem;
|
||||
};
|
||||
|
||||
|
||||
@ -24,23 +24,18 @@
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
|
||||
nsSimplePageSequenceFrame::nsSimplePageSequenceFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsContainerFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSimplePageSequenceFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList)
|
||||
{
|
||||
// Create a page frame and set its style context
|
||||
mFirstChild = new nsPageFrame(mContent, this);
|
||||
// Create a page frame and initialize it
|
||||
mFirstChild = new nsPageFrame;
|
||||
|
||||
// XXX This is all wrong...
|
||||
nsIStyleContext* pseudoStyleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::columnPseudo, mStyleContext);
|
||||
mFirstChild->SetStyleContext(&aPresContext, pseudoStyleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, pseudoStyleContext);
|
||||
NS_RELEASE(pseudoStyleContext);
|
||||
|
||||
// Set the geometric and content parent for each of the child frames to be the
|
||||
@ -212,10 +207,9 @@ nsSimplePageSequenceFrame::Paint(nsIPresContext& aPresContext,
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsresult
|
||||
NS_NewSimplePageSequenceFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewSimplePageSequenceFrame(nsIFrame*& aResult)
|
||||
{
|
||||
nsSimplePageSequenceFrame* it = new nsSimplePageSequenceFrame(aContent, aParentFrame);
|
||||
nsSimplePageSequenceFrame* it = new nsSimplePageSequenceFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
@ -23,8 +23,6 @@
|
||||
// Simple page sequence frame class. Used when we're in paginated mode
|
||||
class nsSimplePageSequenceFrame : public nsContainerFrame {
|
||||
public:
|
||||
nsSimplePageSequenceFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList);
|
||||
|
||||
@ -34,8 +34,6 @@
|
||||
|
||||
class SpacerFrame : public nsFrame {
|
||||
public:
|
||||
SpacerFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
// nsIHTMLReflow
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
@ -49,11 +47,9 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewSpacerFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewSpacerFrame(nsIFrame*& aResult)
|
||||
{
|
||||
nsIFrame* frame = new SpacerFrame(aContent, aParentFrame);
|
||||
nsIFrame* frame = new SpacerFrame;
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -61,11 +57,6 @@ NS_NewSpacerFrame(nsIContent* aContent,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
SpacerFrame::SpacerFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
SpacerFrame::~SpacerFrame()
|
||||
{
|
||||
}
|
||||
|
||||
@ -21,16 +21,6 @@
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsISizeOfHandler.h"
|
||||
|
||||
nsSplittableFrame::nsSplittableFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent)
|
||||
: nsFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
nsSplittableFrame::~nsSplittableFrame()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSplittableFrame::SizeOf(nsISizeOfHandler* aHandler) const
|
||||
{
|
||||
|
||||
@ -54,14 +54,7 @@ public:
|
||||
nsIFrame* GetPrevInFlow();
|
||||
nsIFrame* GetNextInFlow();
|
||||
|
||||
|
||||
protected:
|
||||
// Constructor. Takes as arguments the content object, the index in parent,
|
||||
// and the Frame for the content parent
|
||||
nsSplittableFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
virtual ~nsSplittableFrame();
|
||||
|
||||
void SizeOfWithoutThis(nsISizeOfHandler* aHandler) const;
|
||||
|
||||
virtual void DumpBaseRegressionData(FILE* out, PRInt32 aIndent);
|
||||
|
||||
@ -101,7 +101,7 @@ public:
|
||||
|
||||
class TextFrame : public nsSplittableFrame {
|
||||
public:
|
||||
TextFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
TextFrame();
|
||||
|
||||
// nsIFrame
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
@ -417,10 +417,9 @@ void BlinkTimer::Notify(nsITimer *timer)
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsresult
|
||||
NS_NewTextFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewTextFrame(nsIFrame*& aResult)
|
||||
{
|
||||
nsIFrame* frame = new TextFrame(aContent, aParentFrame);
|
||||
nsIFrame* frame = new TextFrame;
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -428,8 +427,8 @@ NS_NewTextFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
TextFrame::TextFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsSplittableFrame(aContent, aParentFrame)
|
||||
TextFrame::TextFrame()
|
||||
: nsSplittableFrame()
|
||||
{
|
||||
if (nsnull == gTextBlinker) {
|
||||
// Create text timer the first time out
|
||||
@ -474,11 +473,11 @@ TextFrame::CreateContinuingFrame(nsIPresContext& aCX,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
TextFrame* cf = new TextFrame(mContent, aParent);
|
||||
TextFrame* cf = new TextFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->SetStyleContext(&aCX, aStyleContext);
|
||||
cf->Init(aCX, mContent, aParent, aStyleContext);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
|
||||
@ -23,16 +23,13 @@
|
||||
#include "nsHTMLIIDs.h"
|
||||
|
||||
nsresult
|
||||
NS_NewAbsoluteFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aAbsoluteFrame)
|
||||
NS_NewAbsoluteFrame(nsIFrame** aInstancePtrResult)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsAbsoluteFrame(aContent, aParent, aAbsoluteFrame);
|
||||
nsIFrame* it = new nsAbsoluteFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -40,14 +37,6 @@ NS_NewAbsoluteFrame(nsIFrame** aInstancePtrResult,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsAbsoluteFrame::nsAbsoluteFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aAbsoluteFrame)
|
||||
: nsFrame(aContent, aParent)
|
||||
{
|
||||
mFrame = aAbsoluteFrame;
|
||||
}
|
||||
|
||||
nsAbsoluteFrame::~nsAbsoluteFrame()
|
||||
{
|
||||
}
|
||||
|
||||
@ -25,15 +25,11 @@
|
||||
class nsAbsoluteFrame : public nsFrame {
|
||||
public:
|
||||
/**
|
||||
* Create a placeholder for an absolutely positioned frame. Also creates
|
||||
* the absolutely positioned frame itself
|
||||
* Create a placeholder for an absolutely positioned frame.
|
||||
*
|
||||
* @see #GetAbsoluteFrame()
|
||||
*/
|
||||
friend nsresult NS_NewAbsoluteFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aAbsoluteFrame = nsnull);
|
||||
friend nsresult NS_NewAbsoluteFrame(nsIFrame** aInstancePtrResult);
|
||||
|
||||
// Returns the associated anchored item
|
||||
nsIFrame* GetAbsoluteFrame() const {return mFrame;}
|
||||
@ -59,10 +55,6 @@ public:
|
||||
protected:
|
||||
nsIFrame* mFrame; // the absolutely positioned frame
|
||||
|
||||
// Constructor. Takes as arguments the content object, the index in parent,
|
||||
// and the Frame for the content parent
|
||||
nsAbsoluteFrame(nsIContent* aContent, nsIFrame* aParent, nsIFrame* aAbsoluteFrame);
|
||||
|
||||
virtual ~nsAbsoluteFrame();
|
||||
|
||||
nsIFrame* GetContainingBlock() const;
|
||||
|
||||
@ -28,8 +28,6 @@
|
||||
|
||||
class BRFrame : public nsFrame {
|
||||
public:
|
||||
BRFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
// nsIFrame
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
@ -46,10 +44,9 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewBRFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewBRFrame(nsIFrame*& aResult)
|
||||
{
|
||||
nsIFrame* frame = new BRFrame(aContent, aParentFrame);
|
||||
nsIFrame* frame = new BRFrame;
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -57,12 +54,6 @@ NS_NewBRFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
BRFrame::BRFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
BRFrame::~BRFrame()
|
||||
{
|
||||
}
|
||||
|
||||
@ -212,7 +212,6 @@ DumpStyleGeneaology(nsIFrame* aFrame, const char* gap)
|
||||
#include "nsHTMLImage.h"
|
||||
class BulletFrame : public nsFrame {
|
||||
public:
|
||||
BulletFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
virtual ~BulletFrame();
|
||||
|
||||
// nsIFrame
|
||||
@ -244,11 +243,6 @@ public:
|
||||
nsHTMLImageLoader mImageLoader;
|
||||
};
|
||||
|
||||
BulletFrame::BulletFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
BulletFrame::~BulletFrame()
|
||||
{
|
||||
}
|
||||
@ -1225,20 +1219,19 @@ nsIAtom* nsBlockFrame::gFloaterAtom;
|
||||
nsIAtom* nsBlockFrame::gBulletAtom;
|
||||
|
||||
nsresult
|
||||
NS_NewBlockFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame, PRUint32 aFlags)
|
||||
NS_NewBlockFrame(nsIFrame*& aNewFrame, PRUint32 aFlags)
|
||||
{
|
||||
nsBlockFrame* it = new nsBlockFrame(aContent, aParentFrame);
|
||||
nsBlockFrame* it = new nsBlockFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
aNewFrame = it;
|
||||
it->SetFlags(aFlags);
|
||||
aNewFrame = it;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsBlockFrame::nsBlockFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsBlockFrameSuper(aContent, aParent)
|
||||
nsBlockFrame::nsBlockFrame()
|
||||
: nsBlockFrameSuper()
|
||||
{
|
||||
// XXX for now these are a memory leak
|
||||
if (nsnull == gFloaterAtom) {
|
||||
@ -1362,18 +1355,18 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
if ((nsnull == mPrevInFlow) &&
|
||||
(NS_STYLE_DISPLAY_LIST_ITEM == styleDisplay->mDisplay) &&
|
||||
(nsnull == mBullet)) {
|
||||
// Create bullet frame
|
||||
mBullet = new BulletFrame(mContent, this);
|
||||
if (nsnull == mBullet) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
// Resolve style for the bullet frame
|
||||
nsIStyleContext* kidSC;
|
||||
kidSC = aPresContext.ResolvePseudoStyleContextFor(mContent,
|
||||
nsHTMLAtoms::bulletPseudo,
|
||||
mStyleContext);
|
||||
mBullet->SetStyleContext(&aPresContext, kidSC);
|
||||
// Create bullet frame
|
||||
mBullet = new BulletFrame;
|
||||
if (nsnull == mBullet) {
|
||||
NS_RELEASE(kidSC);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mBullet->Init(aPresContext, mContent, this, kidSC);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
// If the list bullet frame should be positioned inside then add
|
||||
@ -1434,15 +1427,17 @@ nsBlockFrame::IsSplittable(nsSplittableType& aIsSplittable) const
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::CreateContinuingFrame(nsIPresContext& aCX,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsBlockFrame* cf = new nsBlockFrame(mContent, aParent);
|
||||
nsBlockFrame* cf = new nsBlockFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
PrepareContinuingFrame(aCX, aParent, aStyleContext, cf);
|
||||
cf->Init(aCX, mContent, aParent, aStyleContext);
|
||||
cf->SetFlags(mFlags);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||
("nsBlockFrame::CreateContinuingFrame: newFrame=%p", cf));
|
||||
|
||||
@ -39,7 +39,7 @@ struct nsBlockReflowState;
|
||||
class nsBlockFrame : public nsBlockFrameSuper
|
||||
{
|
||||
public:
|
||||
nsBlockFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
nsBlockFrame();
|
||||
~nsBlockFrame();
|
||||
|
||||
// nsISupports
|
||||
|
||||
@ -212,7 +212,6 @@ DumpStyleGeneaology(nsIFrame* aFrame, const char* gap)
|
||||
#include "nsHTMLImage.h"
|
||||
class BulletFrame : public nsFrame {
|
||||
public:
|
||||
BulletFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
virtual ~BulletFrame();
|
||||
|
||||
// nsIFrame
|
||||
@ -244,11 +243,6 @@ public:
|
||||
nsHTMLImageLoader mImageLoader;
|
||||
};
|
||||
|
||||
BulletFrame::BulletFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
BulletFrame::~BulletFrame()
|
||||
{
|
||||
}
|
||||
@ -1225,20 +1219,19 @@ nsIAtom* nsBlockFrame::gFloaterAtom;
|
||||
nsIAtom* nsBlockFrame::gBulletAtom;
|
||||
|
||||
nsresult
|
||||
NS_NewBlockFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame, PRUint32 aFlags)
|
||||
NS_NewBlockFrame(nsIFrame*& aNewFrame, PRUint32 aFlags)
|
||||
{
|
||||
nsBlockFrame* it = new nsBlockFrame(aContent, aParentFrame);
|
||||
nsBlockFrame* it = new nsBlockFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
aNewFrame = it;
|
||||
it->SetFlags(aFlags);
|
||||
aNewFrame = it;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsBlockFrame::nsBlockFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsBlockFrameSuper(aContent, aParent)
|
||||
nsBlockFrame::nsBlockFrame()
|
||||
: nsBlockFrameSuper()
|
||||
{
|
||||
// XXX for now these are a memory leak
|
||||
if (nsnull == gFloaterAtom) {
|
||||
@ -1362,18 +1355,18 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
if ((nsnull == mPrevInFlow) &&
|
||||
(NS_STYLE_DISPLAY_LIST_ITEM == styleDisplay->mDisplay) &&
|
||||
(nsnull == mBullet)) {
|
||||
// Create bullet frame
|
||||
mBullet = new BulletFrame(mContent, this);
|
||||
if (nsnull == mBullet) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
// Resolve style for the bullet frame
|
||||
nsIStyleContext* kidSC;
|
||||
kidSC = aPresContext.ResolvePseudoStyleContextFor(mContent,
|
||||
nsHTMLAtoms::bulletPseudo,
|
||||
mStyleContext);
|
||||
mBullet->SetStyleContext(&aPresContext, kidSC);
|
||||
// Create bullet frame
|
||||
mBullet = new BulletFrame;
|
||||
if (nsnull == mBullet) {
|
||||
NS_RELEASE(kidSC);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mBullet->Init(aPresContext, mContent, this, kidSC);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
// If the list bullet frame should be positioned inside then add
|
||||
@ -1434,15 +1427,17 @@ nsBlockFrame::IsSplittable(nsSplittableType& aIsSplittable) const
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::CreateContinuingFrame(nsIPresContext& aCX,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsBlockFrame* cf = new nsBlockFrame(mContent, aParent);
|
||||
nsBlockFrame* cf = new nsBlockFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
PrepareContinuingFrame(aCX, aParent, aStyleContext, cf);
|
||||
cf->Init(aCX, mContent, aParent, aStyleContext);
|
||||
cf->SetFlags(mFlags);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||
("nsBlockFrame::CreateContinuingFrame: newFrame=%p", cf));
|
||||
|
||||
@ -212,7 +212,6 @@ DumpStyleGeneaology(nsIFrame* aFrame, const char* gap)
|
||||
#include "nsHTMLImage.h"
|
||||
class BulletFrame : public nsFrame {
|
||||
public:
|
||||
BulletFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
virtual ~BulletFrame();
|
||||
|
||||
// nsIFrame
|
||||
@ -244,11 +243,6 @@ public:
|
||||
nsHTMLImageLoader mImageLoader;
|
||||
};
|
||||
|
||||
BulletFrame::BulletFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
BulletFrame::~BulletFrame()
|
||||
{
|
||||
}
|
||||
@ -1225,20 +1219,19 @@ nsIAtom* nsBlockFrame::gFloaterAtom;
|
||||
nsIAtom* nsBlockFrame::gBulletAtom;
|
||||
|
||||
nsresult
|
||||
NS_NewBlockFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame, PRUint32 aFlags)
|
||||
NS_NewBlockFrame(nsIFrame*& aNewFrame, PRUint32 aFlags)
|
||||
{
|
||||
nsBlockFrame* it = new nsBlockFrame(aContent, aParentFrame);
|
||||
nsBlockFrame* it = new nsBlockFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
aNewFrame = it;
|
||||
it->SetFlags(aFlags);
|
||||
aNewFrame = it;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsBlockFrame::nsBlockFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsBlockFrameSuper(aContent, aParent)
|
||||
nsBlockFrame::nsBlockFrame()
|
||||
: nsBlockFrameSuper()
|
||||
{
|
||||
// XXX for now these are a memory leak
|
||||
if (nsnull == gFloaterAtom) {
|
||||
@ -1362,18 +1355,18 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
if ((nsnull == mPrevInFlow) &&
|
||||
(NS_STYLE_DISPLAY_LIST_ITEM == styleDisplay->mDisplay) &&
|
||||
(nsnull == mBullet)) {
|
||||
// Create bullet frame
|
||||
mBullet = new BulletFrame(mContent, this);
|
||||
if (nsnull == mBullet) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
// Resolve style for the bullet frame
|
||||
nsIStyleContext* kidSC;
|
||||
kidSC = aPresContext.ResolvePseudoStyleContextFor(mContent,
|
||||
nsHTMLAtoms::bulletPseudo,
|
||||
mStyleContext);
|
||||
mBullet->SetStyleContext(&aPresContext, kidSC);
|
||||
// Create bullet frame
|
||||
mBullet = new BulletFrame;
|
||||
if (nsnull == mBullet) {
|
||||
NS_RELEASE(kidSC);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mBullet->Init(aPresContext, mContent, this, kidSC);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
// If the list bullet frame should be positioned inside then add
|
||||
@ -1434,15 +1427,17 @@ nsBlockFrame::IsSplittable(nsSplittableType& aIsSplittable) const
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::CreateContinuingFrame(nsIPresContext& aCX,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsBlockFrame* cf = new nsBlockFrame(mContent, aParent);
|
||||
nsBlockFrame* cf = new nsBlockFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
PrepareContinuingFrame(aCX, aParent, aStyleContext, cf);
|
||||
cf->Init(aCX, mContent, aParent, aStyleContext);
|
||||
cf->SetFlags(mFlags);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||
("nsBlockFrame::CreateContinuingFrame: newFrame=%p", cf));
|
||||
|
||||
@ -40,10 +40,9 @@ static NS_DEFINE_IID(kIWebShellIID, NS_IWEB_SHELL_IID);
|
||||
nsIAtom* nsBodyFrame::gAbsoluteAtom;
|
||||
|
||||
nsresult
|
||||
NS_NewBodyFrame(nsIContent* aContent, nsIFrame* aParent, nsIFrame*& aResult,
|
||||
PRUint32 aFlags)
|
||||
NS_NewBodyFrame(nsIFrame*& aResult, PRUint32 aFlags)
|
||||
{
|
||||
nsBodyFrame* it = new nsBodyFrame(aContent, aParent);
|
||||
nsBodyFrame* it = new nsBodyFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -52,8 +51,8 @@ NS_NewBodyFrame(nsIContent* aContent, nsIFrame* aParent, nsIFrame*& aResult,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsBodyFrame::nsBodyFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsBlockFrame(aContent, aParentFrame)
|
||||
nsBodyFrame::nsBodyFrame()
|
||||
: nsBlockFrame()
|
||||
{
|
||||
mSpaceManager = new nsSpaceManager(this);
|
||||
NS_ADDREF(mSpaceManager);
|
||||
@ -353,11 +352,13 @@ nsBodyFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsBodyFrame* cf = new nsBodyFrame(mContent, aParent);
|
||||
nsBodyFrame* cf = new nsBodyFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
PrepareContinuingFrame(aPresContext, aParent, aStyleContext, cf);
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->SetFlags(mFlags);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -38,8 +38,7 @@ class nsBodyFrame : public nsBlockFrame,
|
||||
public nsIAbsoluteItems
|
||||
{
|
||||
public:
|
||||
friend nsresult NS_NewBodyFrame(nsIContent* aContent, nsIFrame* aParent,
|
||||
nsIFrame*& aResult, PRUint32 aFlags);
|
||||
friend nsresult NS_NewBodyFrame(nsIFrame*& aResult, PRUint32 aFlags);
|
||||
|
||||
// nsISupports
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
@ -79,8 +78,7 @@ public:
|
||||
protected:
|
||||
static nsIAtom* gAbsoluteAtom;
|
||||
|
||||
nsBodyFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
nsBodyFrame();
|
||||
~nsBodyFrame();
|
||||
|
||||
void ReflowAbsoluteItems(nsIPresContext& aPresContext,
|
||||
|
||||
@ -36,15 +36,6 @@
|
||||
#undef NOISY
|
||||
#endif
|
||||
|
||||
nsContainerFrame::nsContainerFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsSplittableFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
nsContainerFrame::~nsContainerFrame()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsContainerFrame::SizeOf(nsISizeOfHandler* aHandler) const
|
||||
{
|
||||
@ -121,17 +112,6 @@ nsContainerFrame::SizeOfWithoutThis(nsISizeOfHandler* aHandler) const
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsContainerFrame::PrepareContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsContainerFrame* aContFrame)
|
||||
{
|
||||
// Append the continuing frame to the flow
|
||||
aContFrame->AppendToFlow(this);
|
||||
aContFrame->SetStyleContext(&aPresContext, aStyleContext);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsContainerFrame::DidReflow(nsIPresContext& aPresContext,
|
||||
nsDidReflowStatus aStatus)
|
||||
|
||||
@ -83,12 +83,6 @@ public:
|
||||
nsIFrame* aChild);
|
||||
|
||||
protected:
|
||||
// Constructor. Takes as arguments the content object, the index in parent,
|
||||
// and the Frame for the content parent
|
||||
nsContainerFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
virtual ~nsContainerFrame();
|
||||
|
||||
void DeleteFrameList(nsIPresContext& aPresContext,
|
||||
nsIFrame** aListP);
|
||||
|
||||
@ -98,18 +92,6 @@ protected:
|
||||
nsIAtom* aList,
|
||||
nsIFrame** aFrame);
|
||||
|
||||
/**
|
||||
* Prepare a continuation frame of this frame for reflow. Appends
|
||||
* it to the flow, sets its content offsets, mLastContentIsComplete,
|
||||
* and style context. Subclasses should invoke this method after
|
||||
* construction of a continuing frame.
|
||||
*/
|
||||
void PrepareContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsContainerFrame* aContFrame);
|
||||
|
||||
|
||||
virtual void PaintChildren(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
|
||||
@ -209,15 +209,13 @@ nsIFrame::GetLogModuleInfo()
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
|
||||
nsresult
|
||||
NS_NewEmptyFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent)
|
||||
NS_NewEmptyFrame(nsIFrame** aInstancePtrResult)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsFrame(aContent, aParent);
|
||||
nsIFrame* it = new nsFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -233,10 +231,8 @@ void* nsFrame::operator new(size_t size)
|
||||
return result;
|
||||
}
|
||||
|
||||
nsFrame::nsFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: mContent(aContent), mContentParent(aParent), mGeometricParent(aParent)
|
||||
nsFrame::nsFrame()
|
||||
{
|
||||
NS_IF_ADDREF(mContent);
|
||||
mState = NS_FRAME_FIRST_REFLOW | NS_FRAME_SYNC_FRAME_AND_VIEW;
|
||||
}
|
||||
|
||||
@ -295,6 +291,18 @@ nsrefcnt nsFrame::Release(void)
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// nsIFrame
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFrame::Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext)
|
||||
{
|
||||
mContent = aContent;
|
||||
NS_IF_ADDREF(mContent);
|
||||
mGeometricParent = mContentParent = aParent;
|
||||
return SetStyleContext(&aPresContext, aContext);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList)
|
||||
|
||||
@ -102,9 +102,7 @@ public:
|
||||
* Create a new "empty" frame that maps a given piece of content into a
|
||||
* 0,0 area.
|
||||
*/
|
||||
friend nsresult NS_NewEmptyFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent);
|
||||
friend nsresult NS_NewEmptyFrame(nsIFrame** aInstancePtrResult);
|
||||
|
||||
// Overloaded new operator. Initializes the memory to 0
|
||||
void* operator new(size_t size);
|
||||
@ -113,6 +111,10 @@ public:
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
// nsIFrame
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext);
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList);
|
||||
@ -307,12 +309,8 @@ protected:
|
||||
// Style post processing hook
|
||||
NS_IMETHOD DidSetStyleContext(nsIPresContext* aPresContext);
|
||||
|
||||
|
||||
|
||||
// Constructor. Takes as arguments the content object, the index in parent,
|
||||
// and the Frame for the content parent
|
||||
nsFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
// Protected constructor and destructor
|
||||
nsFrame();
|
||||
virtual ~nsFrame();
|
||||
|
||||
void SizeOfWithoutThis(nsISizeOfHandler* aHandler) const;
|
||||
|
||||
@ -40,9 +40,6 @@ static NS_DEFINE_IID(kIDOMHTMLHRElementIID, NS_IDOMHTMLHRELEMENT_IID);
|
||||
|
||||
class HRuleFrame : public nsLeafFrame {
|
||||
public:
|
||||
HRuleFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
@ -66,10 +63,9 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHRFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewHRFrame(nsIFrame*& aResult)
|
||||
{
|
||||
nsIFrame* frame = new HRuleFrame(aContent, aParentFrame);
|
||||
nsIFrame* frame = new HRuleFrame;
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -77,12 +73,6 @@ NS_NewHRFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
HRuleFrame::HRuleFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsLeafFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
HRuleFrame::~HRuleFrame()
|
||||
{
|
||||
}
|
||||
|
||||
@ -44,15 +44,6 @@
|
||||
|
||||
NS_DEF_PTR(nsIStyleContext);
|
||||
|
||||
nsHTMLContainerFrame::nsHTMLContainerFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsContainerFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
nsHTMLContainerFrame::~nsHTMLContainerFrame()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLContainerFrame::Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
@ -118,15 +109,15 @@ nsHTMLContainerFrame::CreatePlaceholderFrame(nsIPresContext& aPresContext,
|
||||
nsIContent* content;
|
||||
aFloatedFrame->GetContent(content);
|
||||
|
||||
nsPlaceholderFrame* placeholder;
|
||||
NS_NewPlaceholderFrame((nsIFrame**)&placeholder, content, this,
|
||||
aFloatedFrame);
|
||||
NS_IF_RELEASE(content);
|
||||
|
||||
// Let the placeholder share the same style context as the floated element
|
||||
nsIStyleContext* kidSC;
|
||||
aFloatedFrame->GetStyleContext(kidSC);
|
||||
placeholder->SetStyleContext(&aPresContext, kidSC);
|
||||
|
||||
nsPlaceholderFrame* placeholder;
|
||||
NS_NewPlaceholderFrame((nsIFrame**)&placeholder);
|
||||
placeholder->Init(aPresContext, content, this, kidSC);
|
||||
placeholder->SetAnchoredItem(aFloatedFrame);
|
||||
NS_IF_RELEASE(content);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
return placeholder;
|
||||
@ -139,14 +130,15 @@ nsHTMLContainerFrame::CreateAbsolutePlaceholderFrame(nsIPresContext& aPresContex
|
||||
nsIContent* content;
|
||||
aAbsoluteFrame->GetContent(content);
|
||||
|
||||
nsAbsoluteFrame* placeholder;
|
||||
NS_NewAbsoluteFrame((nsIFrame**)&placeholder, content, this, aAbsoluteFrame);
|
||||
NS_IF_RELEASE(content);
|
||||
|
||||
// Let the placeholder share the same style context as the floated element
|
||||
nsIStyleContext* kidSC;
|
||||
aAbsoluteFrame->GetStyleContext(kidSC);
|
||||
placeholder->SetStyleContext(&aPresContext, kidSC);
|
||||
|
||||
nsAbsoluteFrame* placeholder;
|
||||
NS_NewAbsoluteFrame((nsIFrame**)&placeholder);
|
||||
placeholder->Init(aPresContext, content, this, kidSC);
|
||||
placeholder->SetAbsoluteFrame(aAbsoluteFrame);
|
||||
NS_IF_RELEASE(content);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
return placeholder;
|
||||
@ -164,15 +156,15 @@ nsHTMLContainerFrame::CreateWrapperFrame(nsIPresContext& aPresContext,
|
||||
aFrame->GetContent(content);
|
||||
content->CanContainChildren(isContainer);
|
||||
if (isContainer) {
|
||||
// Wrap the frame in a BODY frame.
|
||||
NS_NewBodyFrame(content, this, aWrapperFrame, NS_BODY_SHRINK_WRAP);/* XXX auto margins? */
|
||||
|
||||
// The body wrapper frame gets the original style context, and the wrapped
|
||||
// frame gets a pseudo style context
|
||||
// Wrap the frame in a BODY frame. The body wrapper frame gets the
|
||||
// original style context
|
||||
nsIStyleContext* kidStyle;
|
||||
aFrame->GetStyleContext(kidStyle);
|
||||
aWrapperFrame->SetStyleContext(&aPresContext, kidStyle);
|
||||
|
||||
NS_NewBodyFrame(aWrapperFrame, NS_BODY_SHRINK_WRAP); // XXX auto margins?
|
||||
aWrapperFrame->Init(aPresContext, content, this, kidStyle);
|
||||
|
||||
// The wrapped frame gets a pseudo style context
|
||||
nsIStyleContext* pseudoStyle;
|
||||
pseudoStyle = aPresContext.ResolvePseudoStyleContextFor(content,
|
||||
nsHTMLAtoms::columnPseudo,
|
||||
|
||||
@ -29,9 +29,6 @@ struct nsStylePosition;
|
||||
// functionality.
|
||||
class nsHTMLContainerFrame : public nsContainerFrame {
|
||||
public:
|
||||
nsHTMLContainerFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
@ -81,8 +78,6 @@ public:
|
||||
nsIFrame* aNewParent);
|
||||
|
||||
protected:
|
||||
virtual ~nsHTMLContainerFrame();
|
||||
|
||||
virtual PRIntn GetSkipSides() const = 0;
|
||||
};
|
||||
|
||||
|
||||
@ -44,8 +44,6 @@ static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
|
||||
class RootFrame : public nsHTMLContainerFrame {
|
||||
public:
|
||||
RootFrame(nsIContent* aContent);
|
||||
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList);
|
||||
@ -70,10 +68,9 @@ protected:
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewHTMLFrame(nsIFrame*& aResult)
|
||||
{
|
||||
RootFrame* frame = new RootFrame(aContent);
|
||||
RootFrame* frame = new RootFrame;
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -81,11 +78,6 @@ NS_NewHTMLFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
RootFrame::RootFrame(nsIContent* aContent)
|
||||
: nsHTMLContainerFrame(aContent, nsnull)
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
RootFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
|
||||
@ -99,8 +99,6 @@ protected:
|
||||
#define ImageFrameSuper nsLeafFrame
|
||||
class nsImageFrame : public ImageFrameSuper {
|
||||
public:
|
||||
nsImageFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext);
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler) const;
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
|
||||
@ -241,158 +241,56 @@ NS_CreateHTMLElement(nsIHTMLContent** aResult,
|
||||
|
||||
// Factory methods for creating html layout objects
|
||||
|
||||
extern nsresult
|
||||
NS_NewBRFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame);
|
||||
|
||||
extern nsresult
|
||||
NS_NewBodyFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame, PRUint32 aFlags);
|
||||
|
||||
extern nsresult
|
||||
NS_NewBlockFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame, PRUint32 aFlags);
|
||||
extern nsresult NS_NewBRFrame(nsIFrame*& aNewFrame);
|
||||
extern nsresult NS_NewBodyFrame(nsIFrame*& aNewFrame, PRUint32 aFlags);
|
||||
extern nsresult NS_NewBlockFrame(nsIFrame*& aNewFrame, PRUint32 aFlags);
|
||||
|
||||
// Flags for body and block frames
|
||||
#define NS_BODY_SHRINK_WRAP 0x1
|
||||
#define NS_BODY_NO_AUTO_MARGINS 0x2
|
||||
#define NS_BODY_THE_BODY 0x4
|
||||
|
||||
extern nsresult
|
||||
NS_NewCommentFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aFrameResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewHRFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame);
|
||||
extern nsresult NS_NewCommentFrame(nsIFrame*& aFrameResult);
|
||||
extern nsresult NS_NewHRFrame(nsIFrame*& aNewFrame);
|
||||
|
||||
// <frame> and <iframe>
|
||||
extern nsresult
|
||||
NS_NewHTMLFrameOuterFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame);
|
||||
extern nsresult NS_NewHTMLFrameOuterFrame(nsIFrame*& aNewFrame);
|
||||
// <frameset>
|
||||
extern nsresult
|
||||
NS_NewHTMLFramesetFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame);
|
||||
extern nsresult NS_NewHTMLFramesetFrame(nsIFrame*& aNewFrame);
|
||||
|
||||
extern nsresult
|
||||
NS_NewHTMLFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame);
|
||||
|
||||
extern nsresult
|
||||
NS_NewImageFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aFrameResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewInlineFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame);
|
||||
|
||||
extern nsresult
|
||||
NS_NewObjectFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aFrameResult);
|
||||
|
||||
nsresult
|
||||
NS_NewSpacerFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
nsresult
|
||||
NS_NewTextFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
nsresult
|
||||
NS_NewWBRFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewScrollFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewSimplePageSequenceFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
extern nsresult NS_NewHTMLFrame(nsIFrame*& aNewFrame);
|
||||
extern nsresult NS_NewImageFrame(nsIFrame*& aFrameResult);
|
||||
extern nsresult NS_NewInlineFrame(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);
|
||||
|
||||
// forms
|
||||
extern nsresult
|
||||
NS_NewFormFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewButtonControlFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewImageControlFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewHTMLButtonControlFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewCheckboxControlFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewFieldSetFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewFileControlFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewLabelFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewLegendFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewTextControlFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewRadioControlFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewSelectControlFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
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);
|
||||
|
||||
// table frame factories
|
||||
|
||||
extern nsresult
|
||||
NS_NewTableOuterFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewTableFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewTableCaptionFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewTableColFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewTableColGroupFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewTableRowFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewTableRowGroupFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
extern nsresult
|
||||
NS_NewTableCellFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult);
|
||||
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);
|
||||
|
||||
// Everything below this line is obsolete...
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
@ -314,11 +314,9 @@ nsHTMLImageLoader::GetLoadImageFailed() const
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsresult
|
||||
NS_NewImageFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewImageFrame(nsIFrame*& aResult)
|
||||
{
|
||||
nsImageFrame* frame = new nsImageFrame(aContent, aParentFrame);
|
||||
nsImageFrame* frame = new nsImageFrame;
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -326,11 +324,6 @@ NS_NewImageFrame(nsIContent* aContent,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsImageFrame::nsImageFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsLeafFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
nsImageFrame::~nsImageFrame()
|
||||
{
|
||||
}
|
||||
|
||||
@ -56,9 +56,6 @@ nsInlineReflowState::~nsInlineReflowState()
|
||||
class nsInlineFrame : public nsHTMLContainerFrame
|
||||
{
|
||||
public:
|
||||
nsInlineFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
virtual ~nsInlineFrame();
|
||||
|
||||
// nsIFrame
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
@ -142,9 +139,7 @@ public:
|
||||
|
||||
PRBool SafeToPull(nsIFrame* aFrame);
|
||||
|
||||
friend nsresult NS_NewInlineFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame);
|
||||
friend nsresult NS_NewInlineFrame(nsIFrame*& aNewFrame);
|
||||
|
||||
struct AdjustData {
|
||||
nsIFrame* frame;
|
||||
@ -156,25 +151,15 @@ public:
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsresult NS_NewInlineFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aNewFrame)
|
||||
nsresult NS_NewInlineFrame(nsIFrame*& aNewFrame)
|
||||
{
|
||||
aNewFrame = new nsInlineFrame(aContent, aParentFrame);
|
||||
aNewFrame = new nsInlineFrame;
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsInlineFrame::nsInlineFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
nsInlineFrame::~nsInlineFrame()
|
||||
{
|
||||
}
|
||||
|
||||
PRIntn
|
||||
nsInlineFrame::GetSkipSides() const
|
||||
{
|
||||
@ -257,11 +242,12 @@ nsInlineFrame::CreateContinuingFrame(nsIPresContext& aCX,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsInlineFrame* cf = new nsInlineFrame(mContent, aParent);
|
||||
nsInlineFrame* cf = new nsInlineFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
PrepareContinuingFrame(aCX, aParent, aStyleContext, cf);
|
||||
cf->Init(aCX, mContent, aParent, aStyleContext);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||
("nsInlineFrame::CreateContinuingFrame: newFrame=%p", cf));
|
||||
|
||||
@ -24,11 +24,6 @@
|
||||
#include "nsIPresContext.h"
|
||||
#include "nsIStyleContext.h"
|
||||
|
||||
nsLeafFrame::nsLeafFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
nsLeafFrame::~nsLeafFrame()
|
||||
{
|
||||
}
|
||||
|
||||
@ -42,7 +42,6 @@ public:
|
||||
nsISupports* aSubContent);
|
||||
|
||||
protected:
|
||||
nsLeafFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
virtual ~nsLeafFrame();
|
||||
|
||||
/**
|
||||
|
||||
@ -139,10 +139,6 @@ private:
|
||||
|
||||
class nsObjectFrame : public nsObjectFrameSuper {
|
||||
public:
|
||||
nsObjectFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
// NS_IMETHOD Init(nsIPresContext& aPresContext, nsIFrame *aChildList);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
@ -178,11 +174,6 @@ private:
|
||||
nsIFrame *mFirstChild;
|
||||
};
|
||||
|
||||
nsObjectFrame::nsObjectFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsObjectFrameSuper(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
nsObjectFrame::~nsObjectFrame()
|
||||
{
|
||||
NS_IF_RELEASE(mInstanceOwner);
|
||||
@ -210,13 +201,6 @@ static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
|
||||
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
||||
static NS_DEFINE_IID(kWidgetCID, NS_CHILD_CID);
|
||||
|
||||
//NS_IMETHODIMP
|
||||
//nsObjectFrame::Init(nsIPresContext& aPresContext, nsIFrame *aChildList)
|
||||
//{
|
||||
// mFirstChild = aChildList;
|
||||
// return NS_OK;
|
||||
//}
|
||||
|
||||
nsresult
|
||||
nsObjectFrame::CreateWidget(nscoord aWidth, nscoord aHeight, PRBool aViewOnly)
|
||||
{
|
||||
@ -645,10 +629,9 @@ nsresult nsObjectFrame :: GetFullURL(nsString& aFullURL)
|
||||
|
||||
|
||||
nsresult
|
||||
NS_NewObjectFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aFrameResult)
|
||||
NS_NewObjectFrame(nsIFrame*& aFrameResult)
|
||||
{
|
||||
aFrameResult = new nsObjectFrame(aContent, aParentFrame);
|
||||
aFrameResult = new nsObjectFrame;
|
||||
if (nsnull == aFrameResult) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
@ -24,11 +24,6 @@
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
|
||||
nsPageFrame::nsPageFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsContainerFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
@ -131,11 +126,12 @@ nsPageFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsPageFrame* cf = new nsPageFrame(mContent, aParent);
|
||||
nsPageFrame* cf = new nsPageFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
PrepareContinuingFrame(aPresContext, aParent, aStyleContext, cf);
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -23,8 +23,6 @@
|
||||
// Page frame class used by the simple page sequence frame
|
||||
class nsPageFrame : public nsContainerFrame {
|
||||
public:
|
||||
nsPageFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aMaxSize,
|
||||
|
||||
@ -25,16 +25,13 @@
|
||||
#include "nsIStyleContext.h"
|
||||
|
||||
nsresult
|
||||
NS_NewPlaceholderFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aAnchoredItem)
|
||||
NS_NewPlaceholderFrame(nsIFrame** aInstancePtrResult)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsPlaceholderFrame(aContent, aParent, aAnchoredItem);
|
||||
nsIFrame* it = new nsPlaceholderFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -42,18 +39,6 @@ NS_NewPlaceholderFrame(nsIFrame** aInstancePtrResult,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsPlaceholderFrame::nsPlaceholderFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aAnchoredItem)
|
||||
: nsFrame(aContent, aParent)
|
||||
{
|
||||
mAnchoredItem = aAnchoredItem;
|
||||
}
|
||||
|
||||
nsPlaceholderFrame::~nsPlaceholderFrame()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPlaceholderFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
|
||||
@ -28,18 +28,11 @@ public:
|
||||
/**
|
||||
* Create a new placeholder frame
|
||||
*/
|
||||
friend nsresult NS_NewPlaceholderFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aAnchoredItem = nsnull);
|
||||
friend nsresult NS_NewPlaceholderFrame(nsIFrame** aInstancePtrResult);
|
||||
|
||||
// Get/Set the associated anchored item
|
||||
nsIFrame* GetAnchoredItem() const {
|
||||
return mAnchoredItem;
|
||||
}
|
||||
void SetAnchoredItem(nsIFrame* aAnchoredItem) {
|
||||
mAnchoredItem = aAnchoredItem;
|
||||
}
|
||||
nsIFrame* GetAnchoredItem() const {return mAnchoredItem;}
|
||||
void SetAnchoredItem(nsIFrame* aAnchoredItem) {mAnchoredItem = aAnchoredItem;}
|
||||
|
||||
// nsIHTMLReflow overrides
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
@ -64,13 +57,6 @@ public:
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
|
||||
protected:
|
||||
// Constructor. Takes as arguments the content object and the Frame for
|
||||
// the content parent
|
||||
nsPlaceholderFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aAnchoredItem);
|
||||
virtual ~nsPlaceholderFrame();
|
||||
|
||||
nsIFrame* mAnchoredItem;
|
||||
};
|
||||
|
||||
|
||||
@ -46,8 +46,6 @@ static NS_DEFINE_IID(kScrollViewIID, NS_ISCROLLABLEVIEW_IID);
|
||||
*/
|
||||
class nsScrollFrame : public nsHTMLContainerFrame {
|
||||
public:
|
||||
nsScrollFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
|
||||
nsDidReflowStatus aStatus);
|
||||
|
||||
@ -69,11 +67,6 @@ private:
|
||||
nsresult CreateScrollingView();
|
||||
};
|
||||
|
||||
nsScrollFrame::nsScrollFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScrollFrame::DidReflow(nsIPresContext& aPresContext,
|
||||
nsDidReflowStatus aStatus)
|
||||
@ -467,11 +460,9 @@ nsScrollFrame::GetFrameName(nsString& aResult) const
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsresult
|
||||
NS_NewScrollFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewScrollFrame(nsIFrame*& aResult)
|
||||
{
|
||||
aResult = new nsScrollFrame(aContent, aParentFrame);
|
||||
aResult = new nsScrollFrame;
|
||||
if (nsnull == aResult) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
@ -24,23 +24,18 @@
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
|
||||
nsSimplePageSequenceFrame::nsSimplePageSequenceFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsContainerFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSimplePageSequenceFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList)
|
||||
{
|
||||
// Create a page frame and set its style context
|
||||
mFirstChild = new nsPageFrame(mContent, this);
|
||||
// Create a page frame and initialize it
|
||||
mFirstChild = new nsPageFrame;
|
||||
|
||||
// XXX This is all wrong...
|
||||
nsIStyleContext* pseudoStyleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::columnPseudo, mStyleContext);
|
||||
mFirstChild->SetStyleContext(&aPresContext, pseudoStyleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, pseudoStyleContext);
|
||||
NS_RELEASE(pseudoStyleContext);
|
||||
|
||||
// Set the geometric and content parent for each of the child frames to be the
|
||||
@ -212,10 +207,9 @@ nsSimplePageSequenceFrame::Paint(nsIPresContext& aPresContext,
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsresult
|
||||
NS_NewSimplePageSequenceFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewSimplePageSequenceFrame(nsIFrame*& aResult)
|
||||
{
|
||||
nsSimplePageSequenceFrame* it = new nsSimplePageSequenceFrame(aContent, aParentFrame);
|
||||
nsSimplePageSequenceFrame* it = new nsSimplePageSequenceFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
@ -23,8 +23,6 @@
|
||||
// Simple page sequence frame class. Used when we're in paginated mode
|
||||
class nsSimplePageSequenceFrame : public nsContainerFrame {
|
||||
public:
|
||||
nsSimplePageSequenceFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList);
|
||||
|
||||
@ -34,8 +34,6 @@
|
||||
|
||||
class SpacerFrame : public nsFrame {
|
||||
public:
|
||||
SpacerFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
// nsIHTMLReflow
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
@ -49,11 +47,9 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewSpacerFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewSpacerFrame(nsIFrame*& aResult)
|
||||
{
|
||||
nsIFrame* frame = new SpacerFrame(aContent, aParentFrame);
|
||||
nsIFrame* frame = new SpacerFrame;
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -61,11 +57,6 @@ NS_NewSpacerFrame(nsIContent* aContent,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
SpacerFrame::SpacerFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
SpacerFrame::~SpacerFrame()
|
||||
{
|
||||
}
|
||||
|
||||
@ -21,16 +21,6 @@
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsISizeOfHandler.h"
|
||||
|
||||
nsSplittableFrame::nsSplittableFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent)
|
||||
: nsFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
nsSplittableFrame::~nsSplittableFrame()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSplittableFrame::SizeOf(nsISizeOfHandler* aHandler) const
|
||||
{
|
||||
|
||||
@ -54,14 +54,7 @@ public:
|
||||
nsIFrame* GetPrevInFlow();
|
||||
nsIFrame* GetNextInFlow();
|
||||
|
||||
|
||||
protected:
|
||||
// Constructor. Takes as arguments the content object, the index in parent,
|
||||
// and the Frame for the content parent
|
||||
nsSplittableFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
virtual ~nsSplittableFrame();
|
||||
|
||||
void SizeOfWithoutThis(nsISizeOfHandler* aHandler) const;
|
||||
|
||||
virtual void DumpBaseRegressionData(FILE* out, PRInt32 aIndent);
|
||||
|
||||
@ -101,7 +101,7 @@ public:
|
||||
|
||||
class TextFrame : public nsSplittableFrame {
|
||||
public:
|
||||
TextFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
TextFrame();
|
||||
|
||||
// nsIFrame
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
@ -417,10 +417,9 @@ void BlinkTimer::Notify(nsITimer *timer)
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsresult
|
||||
NS_NewTextFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewTextFrame(nsIFrame*& aResult)
|
||||
{
|
||||
nsIFrame* frame = new TextFrame(aContent, aParentFrame);
|
||||
nsIFrame* frame = new TextFrame;
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -428,8 +427,8 @@ NS_NewTextFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
TextFrame::TextFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsSplittableFrame(aContent, aParentFrame)
|
||||
TextFrame::TextFrame()
|
||||
: nsSplittableFrame()
|
||||
{
|
||||
if (nsnull == gTextBlinker) {
|
||||
// Create text timer the first time out
|
||||
@ -474,11 +473,11 @@ TextFrame::CreateContinuingFrame(nsIPresContext& aCX,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
TextFrame* cf = new TextFrame(mContent, aParent);
|
||||
TextFrame* cf = new TextFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->SetStyleContext(&aCX, aStyleContext);
|
||||
cf->Init(aCX, mContent, aParent, aStyleContext);
|
||||
cf->AppendToFlow(this);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
|
||||
@ -20,12 +20,10 @@
|
||||
#include "nsHTMLIIDs.h"
|
||||
|
||||
nsresult
|
||||
NS_NewWBRFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewWBRFrame(nsIFrame*& aResult)
|
||||
{
|
||||
nsIFrame* frame = nsnull;
|
||||
nsresult rv = NS_NewEmptyFrame(&frame, aContent, aParentFrame);
|
||||
nsresult rv = NS_NewEmptyFrame(&frame);
|
||||
if (NS_OK != rv) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -171,12 +171,10 @@ nsCommentNode::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewCommentFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewCommentFrame(nsIFrame*& aResult)
|
||||
{
|
||||
nsIFrame* frame;
|
||||
NS_NewEmptyFrame(&frame, aContent, aParentFrame);
|
||||
NS_NewEmptyFrame(&frame);
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ public:
|
||||
class nsHTMLFrameOuterFrame : public nsHTMLContainerFrame {
|
||||
|
||||
public:
|
||||
nsHTMLFrameOuterFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
nsHTMLFrameOuterFrame();
|
||||
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
|
||||
@ -139,7 +139,7 @@ class nsHTMLFrameInnerFrame : public nsLeafFrame {
|
||||
|
||||
public:
|
||||
|
||||
nsHTMLFrameInnerFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
nsHTMLFrameInnerFrame();
|
||||
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
|
||||
@ -191,8 +191,8 @@ protected:
|
||||
/*******************************************************************************
|
||||
* nsHTMLFrameOuterFrame
|
||||
******************************************************************************/
|
||||
nsHTMLFrameOuterFrame::nsHTMLFrameOuterFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aParent)
|
||||
nsHTMLFrameOuterFrame::nsHTMLFrameOuterFrame()
|
||||
: nsHTMLContainerFrame()
|
||||
{
|
||||
mIsInline = nsnull;
|
||||
}
|
||||
@ -314,9 +314,9 @@ nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext,
|
||||
}
|
||||
|
||||
if (nsnull == mFirstChild) {
|
||||
mFirstChild = new nsHTMLFrameInnerFrame(mContent, this);
|
||||
mFirstChild = new nsHTMLFrameInnerFrame;
|
||||
// XXX temporary! use style system to get correct style!
|
||||
mFirstChild->SetStyleContext(&aPresContext, mStyleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, mStyleContext);
|
||||
}
|
||||
|
||||
// nsContainerFrame::PaintBorder has some problems, kludge it here
|
||||
@ -379,10 +379,9 @@ nsHTMLFrameOuterFrame::AttributeChanged(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLFrameOuterFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewHTMLFrameOuterFrame(nsIFrame*& aResult)
|
||||
{
|
||||
nsIFrame* frame = new nsHTMLFrameOuterFrame(aContent, aParentFrame);
|
||||
nsIFrame* frame = new nsHTMLFrameOuterFrame;
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -393,9 +392,8 @@ NS_NewHTMLFrameOuterFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
/*******************************************************************************
|
||||
* nsHTMLFrameInnerFrame
|
||||
******************************************************************************/
|
||||
nsHTMLFrameInnerFrame::nsHTMLFrameInnerFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsLeafFrame(aContent, aParentFrame)
|
||||
nsHTMLFrameInnerFrame::nsHTMLFrameInnerFrame()
|
||||
: nsLeafFrame()
|
||||
{
|
||||
mWebShell = nsnull;
|
||||
mCreatingViewer = PR_FALSE;
|
||||
|
||||
@ -89,8 +89,7 @@ public:
|
||||
void SetColor(nscolor aColor);
|
||||
|
||||
protected:
|
||||
nsHTMLFramesetBorderFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
PRInt32 aWidth, PRBool aVertical, PRBool aVisible);
|
||||
nsHTMLFramesetBorderFrame(PRInt32 aWidth, PRBool aVertical, PRBool aVisible);
|
||||
virtual ~nsHTMLFramesetBorderFrame();
|
||||
virtual void GetDesiredSize(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
@ -124,7 +123,6 @@ public:
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
protected:
|
||||
nsHTMLFramesetBlankFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
virtual ~nsHTMLFramesetBlankFrame();
|
||||
virtual void GetDesiredSize(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
@ -139,8 +137,8 @@ protected:
|
||||
PRInt32 nsHTMLFramesetFrame::gMaxNumRowColSpecs = 25;
|
||||
PRBool nsHTMLFramesetFrame::gDragInProgress = PR_FALSE;
|
||||
|
||||
nsHTMLFramesetFrame::nsHTMLFramesetFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aParent)
|
||||
nsHTMLFramesetFrame::nsHTMLFramesetFrame()
|
||||
: nsHTMLContainerFrame()
|
||||
{
|
||||
mNumRows = 0;
|
||||
mRowSpecs = nsnull;
|
||||
@ -929,7 +927,8 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsresult result;
|
||||
|
||||
if (nsHTMLAtoms::frameset == tag) {
|
||||
result = NS_NewHTMLFramesetFrame(child, this, frame);
|
||||
result = NS_NewHTMLFramesetFrame(frame);
|
||||
frame->Init(aPresContext, child, this, kidSC);
|
||||
|
||||
childTypes[mChildCount] = FRAMESET;
|
||||
nsHTMLFramesetFrame* childFrame = (nsHTMLFramesetFrame*)frame;
|
||||
@ -938,25 +937,22 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||
childFrame->SetParentBorderColor(borderColor);
|
||||
childBorderColors[mChildCount].Set(childFrame->GetBorderColor());
|
||||
} else { // frame
|
||||
result = NS_NewHTMLFrameOuterFrame(child, this, frame);
|
||||
result = NS_NewHTMLFrameOuterFrame(frame);
|
||||
frame->Init(aPresContext, child, this, kidSC);
|
||||
|
||||
childTypes[mChildCount] = FRAME;
|
||||
//
|
||||
childFrameborder[mChildCount] = GetFrameBorder(child, PR_FALSE);
|
||||
childBorderColors[mChildCount].Set(GetBorderColor(child));
|
||||
}
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
if (NS_OK != result) {
|
||||
NS_RELEASE(tag);
|
||||
NS_RELEASE(child);
|
||||
NS_RELEASE(kidSC);
|
||||
return result;
|
||||
}
|
||||
|
||||
// Set the style context
|
||||
frame->SetStyleContext(&aPresContext, kidSC);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
if (nsnull == lastChild) {
|
||||
mFirstChild = frame;
|
||||
} else {
|
||||
@ -972,10 +968,10 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||
// add blank frames for frameset cells that had no content provided
|
||||
for (int blankX = mChildCount; blankX < numCells; blankX++) {
|
||||
// XXX the blank frame is using the content of its parent - at some point it should just have null content
|
||||
nsHTMLFramesetBlankFrame* blankFrame = new nsHTMLFramesetBlankFrame(mContent, this);
|
||||
nsHTMLFramesetBlankFrame* blankFrame = new nsHTMLFramesetBlankFrame;
|
||||
nsIStyleContext* pseudoStyleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::framesetBlankPseudo, mStyleContext);
|
||||
blankFrame->SetStyleContext(&aPresContext, pseudoStyleContext);
|
||||
blankFrame->Init(aPresContext, mContent, this, pseudoStyleContext);
|
||||
NS_RELEASE(pseudoStyleContext);
|
||||
|
||||
if (nsnull == lastChild) {
|
||||
@ -1010,10 +1006,10 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||
offset.y += lastSize.height;
|
||||
if ((borderWidth > 0) && (eFrameborder_No != frameborder)) {
|
||||
if (firstTime) { // create horizontal border
|
||||
borderFrame = new nsHTMLFramesetBorderFrame(mContent, this, borderWidth, PR_FALSE, PR_FALSE);
|
||||
borderFrame = new nsHTMLFramesetBorderFrame(borderWidth, PR_FALSE, PR_FALSE);
|
||||
nsIStyleContext* pseudoStyleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::horizontalFramesetBorderPseudo, mStyleContext);
|
||||
borderFrame->SetStyleContext(&aPresContext, pseudoStyleContext);
|
||||
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext);
|
||||
NS_RELEASE(pseudoStyleContext);
|
||||
|
||||
mChildCount++;
|
||||
@ -1035,10 +1031,10 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||
if ((cellIndex.x > 0) && (borderWidth > 0)) { // moved to next col in same row
|
||||
if (0 == cellIndex.y) { // in 1st row
|
||||
if (firstTime) { // create vertical border
|
||||
borderFrame = new nsHTMLFramesetBorderFrame(mContent, this, borderWidth, PR_TRUE, PR_FALSE);
|
||||
borderFrame = new nsHTMLFramesetBorderFrame(borderWidth, PR_TRUE, PR_FALSE);
|
||||
nsIStyleContext* pseudoStyleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::verticalFramesetBorderPseudo, mStyleContext);
|
||||
borderFrame->SetStyleContext(&aPresContext, pseudoStyleContext);
|
||||
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext);
|
||||
NS_RELEASE(pseudoStyleContext);
|
||||
|
||||
mChildCount++;
|
||||
@ -1425,10 +1421,9 @@ nsHTMLFramesetFrame::EndMouseDrag()
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLFramesetFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewHTMLFramesetFrame(nsIFrame*& aResult)
|
||||
{
|
||||
nsIFrame* frame = new nsHTMLFramesetFrame(aContent, aParentFrame);
|
||||
nsIFrame* frame = new nsHTMLFramesetFrame;
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -1439,9 +1434,8 @@ NS_NewHTMLFramesetFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
/*******************************************************************************
|
||||
* nsHTMLFramesetBorderFrame
|
||||
******************************************************************************/
|
||||
nsHTMLFramesetBorderFrame::nsHTMLFramesetBorderFrame(nsIContent* aContent, nsIFrame* aParent,
|
||||
PRInt32 aWidth, PRBool aVertical, PRBool aVisibility)
|
||||
: nsLeafFrame(aContent, aParent), mWidth(aWidth), mVertical(aVertical), mVisibility(aVisibility)
|
||||
nsHTMLFramesetBorderFrame::nsHTMLFramesetBorderFrame(PRInt32 aWidth, PRBool aVertical, PRBool aVisibility)
|
||||
: nsLeafFrame(), mWidth(aWidth), mVertical(aVertical), mVisibility(aVisibility)
|
||||
{
|
||||
mCanResize = PR_TRUE;
|
||||
mColor = NO_COLOR;
|
||||
@ -1612,10 +1606,6 @@ NS_IMETHODIMP nsHTMLFramesetBorderFrame::GetFrameName(nsString& aResult) const
|
||||
/*******************************************************************************
|
||||
* nsHTMLFramesetBlankFrame
|
||||
******************************************************************************/
|
||||
nsHTMLFramesetBlankFrame::nsHTMLFramesetBlankFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsLeafFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
nsHTMLFramesetBlankFrame::~nsHTMLFramesetBlankFrame()
|
||||
{
|
||||
|
||||
@ -93,7 +93,7 @@ struct nsFramesetDrag {
|
||||
class nsHTMLFramesetFrame : public nsHTMLContainerFrame {
|
||||
|
||||
public:
|
||||
nsHTMLFramesetFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
nsHTMLFramesetFrame();
|
||||
|
||||
virtual ~nsHTMLFramesetFrame();
|
||||
|
||||
|
||||
@ -119,27 +119,15 @@ nsButtonControlFrame::GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,
|
||||
|
||||
|
||||
nsresult
|
||||
NS_NewButtonControlFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewButtonControlFrame(nsIFrame*& aResult)
|
||||
{
|
||||
aResult = new nsButtonControlFrame(aContent, aParent);
|
||||
aResult = new nsButtonControlFrame;
|
||||
if (nsnull == aResult) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsButtonControlFrame::nsButtonControlFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsFormControlFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
nsButtonControlFrame::~nsButtonControlFrame()
|
||||
{
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsButtonControlFrame::GetVerticalBorderWidth(float aPixToTwip) const
|
||||
{
|
||||
|
||||
@ -24,8 +24,6 @@ class nsFileControlFrame;
|
||||
|
||||
class nsButtonControlFrame : public nsFormControlFrame {
|
||||
public:
|
||||
nsButtonControlFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
@ -71,8 +69,6 @@ public:
|
||||
nsString* aValues, nsString* aNames);
|
||||
|
||||
protected:
|
||||
virtual ~nsButtonControlFrame();
|
||||
|
||||
virtual void GetDesiredSize(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsHTMLReflowMetrics& aDesiredLayoutSize,
|
||||
|
||||
@ -38,8 +38,6 @@ static NS_DEFINE_IID(kICheckButtonIID, NS_ICHECKBUTTON_IID);
|
||||
|
||||
class nsCheckboxControlFrame : public nsFormControlFrame {
|
||||
public:
|
||||
nsCheckboxControlFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
virtual void PostCreateWidget(nsIPresContext* aPresContext,
|
||||
nscoord& aWidth,
|
||||
nscoord& aHeight);
|
||||
@ -69,7 +67,6 @@ public:
|
||||
NS_IMETHOD GetChecked(PRBool* aResult);
|
||||
|
||||
protected:
|
||||
virtual ~nsCheckboxControlFrame();
|
||||
virtual void GetDesiredSize(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsHTMLReflowMetrics& aDesiredLayoutSize,
|
||||
@ -77,26 +74,15 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewCheckboxControlFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewCheckboxControlFrame(nsIFrame*& aResult)
|
||||
{
|
||||
aResult = new nsCheckboxControlFrame(aContent, aParent);
|
||||
aResult = new nsCheckboxControlFrame;
|
||||
if (nsnull == aResult) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCheckboxControlFrame::nsCheckboxControlFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsFormControlFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
nsCheckboxControlFrame::~nsCheckboxControlFrame()
|
||||
{
|
||||
}
|
||||
|
||||
const nsIID&
|
||||
nsCheckboxControlFrame::GetIID()
|
||||
{
|
||||
|
||||
@ -57,7 +57,7 @@ class nsLegendFrame;
|
||||
class nsFieldSetFrame : public nsHTMLContainerFrame {
|
||||
public:
|
||||
|
||||
nsFieldSetFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
nsFieldSetFrame();
|
||||
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
@ -78,8 +78,6 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~nsFieldSetFrame();
|
||||
|
||||
void SetMaxElementSize(nsSize& maxSize, nsSize* aSize);
|
||||
virtual PRIntn GetSkipSides() const;
|
||||
//virtual void GetDesiredSize(nsIPresContext* aPresContext,
|
||||
@ -95,20 +93,17 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewFieldSetFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewFieldSetFrame(nsIFrame*& aResult)
|
||||
{
|
||||
aResult = new nsFieldSetFrame(aContent, aParent);
|
||||
aResult = new nsFieldSetFrame;
|
||||
if (nsnull == aResult) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsFieldSetFrame::nsFieldSetFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsHTMLContainerFrame(aContent, aParentFrame)
|
||||
nsFieldSetFrame::nsFieldSetFrame()
|
||||
: nsHTMLContainerFrame()
|
||||
{
|
||||
mContentFrame = nsnull;
|
||||
mLegendFrame = nsnull;
|
||||
@ -117,10 +112,6 @@ nsFieldSetFrame::nsFieldSetFrame(nsIContent* aContent,
|
||||
mInline = PR_TRUE;
|
||||
}
|
||||
|
||||
nsFieldSetFrame::~nsFieldSetFrame()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
@ -132,14 +123,14 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
|
||||
|
||||
PRUint8 flags = (mInline) ? NS_BODY_SHRINK_WRAP : 0;
|
||||
NS_NewBodyFrame(mContent, this, mFirstChild, flags);
|
||||
NS_NewBodyFrame(mFirstChild, flags);
|
||||
mContentFrame = mFirstChild;
|
||||
|
||||
// Resolve style and set the style context
|
||||
// Resolve style and initialize the frame
|
||||
nsIStyleContext* styleContext = aPresContext.ResolvePseudoStyleContextFor(mContent,
|
||||
nsHTMLAtoms::fieldsetContentPseudo,
|
||||
mStyleContext);
|
||||
mFirstChild->SetStyleContext(&aPresContext, styleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, styleContext);
|
||||
NS_RELEASE(styleContext);
|
||||
|
||||
nsIFrame* newChildList = aChildList;
|
||||
|
||||
@ -46,29 +46,23 @@ static NS_DEFINE_IID(kITextWidgetIID, NS_ITEXTWIDGET_IID);
|
||||
static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID);
|
||||
|
||||
nsresult
|
||||
NS_NewFileControlFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewFileControlFrame(nsIFrame*& aResult)
|
||||
{
|
||||
aResult = new nsFileControlFrame(aContent, aParent);
|
||||
aResult = new nsFileControlFrame;
|
||||
if (nsnull == aResult) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsFileControlFrame::nsFileControlFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsHTMLContainerFrame(aContent, aParentFrame)
|
||||
nsFileControlFrame::nsFileControlFrame()
|
||||
: nsHTMLContainerFrame()
|
||||
{
|
||||
mTextFrame = nsnull;
|
||||
mBrowseFrame = nsnull;
|
||||
mFormFrame = nsnull;
|
||||
}
|
||||
|
||||
nsFileControlFrame::~nsFileControlFrame()
|
||||
{
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsFileControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
@ -211,8 +205,8 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
|
||||
if (disabled) {
|
||||
text->SetAttribute("disabled", "1", PR_FALSE);
|
||||
}
|
||||
NS_NewTextControlFrame(text, this, childFrame);
|
||||
childFrame->SetStyleContext(&aPresContext, mStyleContext);
|
||||
NS_NewTextControlFrame(childFrame);
|
||||
childFrame->Init(aPresContext, text, this, mStyleContext);
|
||||
mTextFrame = (nsTextControlFrame*)childFrame;
|
||||
mFirstChild = childFrame;
|
||||
|
||||
@ -223,10 +217,10 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
|
||||
if (disabled) {
|
||||
browse->SetAttribute("disabled", "1", PR_FALSE);
|
||||
}
|
||||
NS_NewButtonControlFrame(browse, this, childFrame);
|
||||
NS_NewButtonControlFrame(childFrame);
|
||||
((nsButtonControlFrame*)childFrame)->SetFileControlFrame(this);
|
||||
mBrowseFrame = (nsButtonControlFrame*)childFrame;
|
||||
childFrame->SetStyleContext(&aPresContext, mStyleContext);
|
||||
childFrame->Init(aPresContext, browse, this, mStyleContext);
|
||||
|
||||
mFirstChild->SetNextSibling(childFrame);
|
||||
|
||||
|
||||
@ -29,8 +29,7 @@ class nsFileControlFrame : public nsHTMLContainerFrame,
|
||||
public nsIFormControlFrame
|
||||
{
|
||||
public:
|
||||
nsFileControlFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame);
|
||||
nsFileControlFrame();
|
||||
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
@ -64,7 +63,6 @@ public:
|
||||
//static PRInt32 gSpacing;
|
||||
|
||||
protected:
|
||||
virtual ~nsFileControlFrame();
|
||||
virtual PRIntn GetSkipSides() const;
|
||||
|
||||
nsTextControlFrame* mTextFrame;
|
||||
|
||||
@ -56,8 +56,8 @@ static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
|
||||
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
||||
|
||||
|
||||
nsFormControlFrame::nsFormControlFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsLeafFrame(aContent, aParentFrame)
|
||||
nsFormControlFrame::nsFormControlFrame()
|
||||
: nsLeafFrame()
|
||||
{
|
||||
mLastMouseState = eMouseNone;
|
||||
mDidInit = PR_FALSE;
|
||||
|
||||
@ -86,7 +86,7 @@ public:
|
||||
* @param aContent the content representing this frame
|
||||
* @param aParentFrame the parent frame
|
||||
*/
|
||||
nsFormControlFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
nsFormControlFrame();
|
||||
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
|
||||
@ -166,8 +166,8 @@ nsrefcnt nsFormFrame::Release(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
nsFormFrame::nsFormFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsLeafFrame(aContent, aParentFrame)
|
||||
nsFormFrame::nsFormFrame()
|
||||
: nsLeafFrame()
|
||||
{
|
||||
mTextSubmitter = nsnull;
|
||||
}
|
||||
@ -443,10 +443,9 @@ nsFormFrame::OnRadioChecked(nsRadioControlFrame& aControl, PRBool aChecked)
|
||||
|
||||
|
||||
nsresult
|
||||
NS_NewFormFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewFormFrame(nsIFrame*& aResult)
|
||||
{
|
||||
nsIFrame* frame = new nsFormFrame(aContent, aParentFrame);
|
||||
nsIFrame* frame = new nsFormFrame;
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ class nsFormFrame : public nsLeafFrame,
|
||||
public nsIFormManager
|
||||
{
|
||||
public:
|
||||
nsFormFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
nsFormFrame();
|
||||
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
|
||||
@ -63,7 +63,7 @@ class nsHTMLButtonControlFrame : public nsHTMLContainerFrame,
|
||||
public nsIFormControlFrame
|
||||
{
|
||||
public:
|
||||
nsHTMLButtonControlFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
nsHTMLButtonControlFrame();
|
||||
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
@ -106,7 +106,6 @@ public:
|
||||
void GetDefaultLabel(nsString& aLabel);
|
||||
|
||||
protected:
|
||||
virtual ~nsHTMLButtonControlFrame();
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void);
|
||||
NS_IMETHOD_(nsrefcnt) Release(void);
|
||||
void AddToPadding(nsIPresContext& aPresContext, nsStyleUnit aStyleUnit,
|
||||
@ -125,20 +124,17 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLButtonControlFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewHTMLButtonControlFrame(nsIFrame*& aResult)
|
||||
{
|
||||
aResult = new nsHTMLButtonControlFrame(aContent, aParent);
|
||||
aResult = new nsHTMLButtonControlFrame;
|
||||
if (nsnull == aResult) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsHTMLButtonControlFrame::nsHTMLButtonControlFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsHTMLContainerFrame(aContent, aParentFrame)
|
||||
nsHTMLButtonControlFrame::nsHTMLButtonControlFrame()
|
||||
: nsHTMLContainerFrame()
|
||||
{
|
||||
mInline = PR_TRUE;
|
||||
mLastMouseState = eMouseNone;
|
||||
@ -148,10 +144,6 @@ nsHTMLButtonControlFrame::nsHTMLButtonControlFrame(nsIContent* aContent,
|
||||
mDidInit = PR_FALSE;
|
||||
}
|
||||
|
||||
nsHTMLButtonControlFrame::~nsHTMLButtonControlFrame()
|
||||
{
|
||||
}
|
||||
|
||||
nsrefcnt nsHTMLButtonControlFrame::AddRef(void)
|
||||
{
|
||||
NS_WARNING("not supported");
|
||||
@ -512,12 +504,12 @@ nsHTMLButtonControlFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
|
||||
|
||||
PRUint8 flags = (mInline) ? NS_BODY_SHRINK_WRAP : 0;
|
||||
NS_NewBodyFrame(mContent, this, mFirstChild, flags);
|
||||
NS_NewBodyFrame(mFirstChild, flags);
|
||||
|
||||
// Resolve style and set the style context
|
||||
// Resolve style and initialize the frame
|
||||
nsIStyleContext* styleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::buttonContentPseudo, mStyleContext);
|
||||
mFirstChild->SetStyleContext(&aPresContext, styleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, styleContext);
|
||||
NS_RELEASE(styleContext);
|
||||
|
||||
// Set the geometric and content parent for each of the child frames
|
||||
|
||||
@ -60,7 +60,7 @@ class nsImageControlFrame : public nsImageControlFrameSuper,
|
||||
public nsIFormControlFrame
|
||||
{
|
||||
public:
|
||||
nsImageControlFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
nsImageControlFrame();
|
||||
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
@ -95,7 +95,6 @@ public:
|
||||
|
||||
void SetFocus(PRBool aOn, PRBool aRepaint);
|
||||
protected:
|
||||
virtual ~nsImageControlFrame();
|
||||
void GetTranslatedRect(nsRect& aRect); // XXX this implementation is a copy of nsHTMLButtonControlFrame
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void);
|
||||
NS_IMETHOD_(nsrefcnt) Release(void);
|
||||
@ -109,9 +108,8 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
nsImageControlFrame::nsImageControlFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsImageControlFrameSuper(aContent, aParentFrame)
|
||||
nsImageControlFrame::nsImageControlFrame()
|
||||
: nsImageControlFrameSuper()
|
||||
{
|
||||
mLastMouseState = eMouseNone;
|
||||
mLastClickPoint = nsPoint(0,0);
|
||||
@ -120,16 +118,10 @@ nsImageControlFrame::nsImageControlFrame(nsIContent* aContent,
|
||||
mGotFocus = PR_FALSE;
|
||||
}
|
||||
|
||||
nsImageControlFrame::~nsImageControlFrame()
|
||||
{
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewImageControlFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewImageControlFrame(nsIFrame*& aResult)
|
||||
{
|
||||
aResult = new nsImageControlFrame(aContent, aParent);
|
||||
aResult = new nsImageControlFrame;
|
||||
if (nsnull == aResult) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ static NS_DEFINE_IID(kIFormIID, NS_IFORM_IID);
|
||||
class nsLabelFrame : public nsHTMLContainerFrame
|
||||
{
|
||||
public:
|
||||
nsLabelFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
nsLabelFrame();
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
@ -100,7 +100,6 @@ protected:
|
||||
PRBool FindForControl(nsIFormControlFrame*& aResultFrame);
|
||||
void GetTranslatedRect(nsRect& aRect);
|
||||
|
||||
virtual ~nsLabelFrame();
|
||||
PRIntn GetSkipSides() const;
|
||||
PRBool mInline;
|
||||
nsCursor mPreviousCursor;
|
||||
@ -112,20 +111,17 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewLabelFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewLabelFrame(nsIFrame*& aResult)
|
||||
{
|
||||
aResult = new nsLabelFrame(aContent, aParent);
|
||||
aResult = new nsLabelFrame;
|
||||
if (nsnull == aResult) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsLabelFrame::nsLabelFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsHTMLContainerFrame(aContent, aParentFrame)
|
||||
nsLabelFrame::nsLabelFrame()
|
||||
: nsHTMLContainerFrame()
|
||||
{
|
||||
mInline = PR_TRUE;
|
||||
mLastMouseState = eMouseNone;
|
||||
@ -136,11 +132,6 @@ nsLabelFrame::nsLabelFrame(nsIContent* aContent,
|
||||
mDidInit = PR_FALSE;
|
||||
}
|
||||
|
||||
nsLabelFrame::~nsLabelFrame()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsLabelFrame::GetTranslatedRect(nsRect& aRect)
|
||||
{
|
||||
@ -362,12 +353,12 @@ nsLabelFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
|
||||
|
||||
PRUint8 flags = (mInline) ? NS_BODY_SHRINK_WRAP : 0;
|
||||
NS_NewBodyFrame(mContent, this, mFirstChild, flags);
|
||||
NS_NewBodyFrame(mFirstChild, flags);
|
||||
|
||||
// Resolve style and set the style context
|
||||
// Resolve style and initialize the frame
|
||||
nsIStyleContext* styleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::labelContentPseudo, mStyleContext);
|
||||
mFirstChild->SetStyleContext(&aPresContext, styleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, styleContext);
|
||||
NS_RELEASE(styleContext);
|
||||
|
||||
// Set the geometric and content parent for each of the child frames
|
||||
|
||||
@ -50,28 +50,21 @@ static NS_DEFINE_IID(kLegendFrameCID, NS_LEGEND_FRAME_CID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLLegendElementIID, NS_IDOMHTMLLEGENDELEMENT_IID);
|
||||
|
||||
nsresult
|
||||
NS_NewLegendFrame(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aResult)
|
||||
NS_NewLegendFrame(nsIFrame*& aResult)
|
||||
{
|
||||
aResult = new nsLegendFrame(aContent, aParent);
|
||||
aResult = new nsLegendFrame;
|
||||
if (nsnull == aResult) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsLegendFrame::nsLegendFrame(nsIContent* aContent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsHTMLContainerFrame(aContent, aParentFrame)
|
||||
nsLegendFrame::nsLegendFrame()
|
||||
: nsHTMLContainerFrame()
|
||||
{
|
||||
mInline = PR_FALSE;
|
||||
}
|
||||
|
||||
nsLegendFrame::~nsLegendFrame()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLegendFrame::QueryInterface(REFNSIID aIID, void** aInstancePtrResult)
|
||||
{
|
||||
@ -97,12 +90,12 @@ nsLegendFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
|
||||
|
||||
PRUint8 flags = (mInline) ? NS_BODY_SHRINK_WRAP : 0;
|
||||
NS_NewBodyFrame(mContent, this, mFirstChild, flags);
|
||||
NS_NewBodyFrame(mFirstChild, flags);
|
||||
|
||||
// Resolve style and set the style context
|
||||
// Resolve style and initialize the frame
|
||||
nsIStyleContext* styleContext =
|
||||
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::legendContentPseudo, mStyleContext);
|
||||
mFirstChild->SetStyleContext(&aPresContext, styleContext);
|
||||
mFirstChild->Init(aPresContext, mContent, this, styleContext);
|
||||
NS_RELEASE(styleContext);
|
||||
|
||||
// Set the geometric and content parent for each of the child frames
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user