diff --git a/mozilla/content/html/content/public/nsIHTMLContent.h b/mozilla/content/html/content/public/nsIHTMLContent.h index 11893e69f62..4aaa3a61915 100644 --- a/mozilla/content/html/content/public/nsIHTMLContent.h +++ b/mozilla/content/html/content/public/nsIHTMLContent.h @@ -96,15 +96,6 @@ public: NS_IMETHOD ToHTMLString(nsString& aResult) const = 0; NS_IMETHOD ToHTML(FILE* out) const = 0; - - /** - * Used by the html content's delegate to create a frame - * for the content. - */ - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult) = 0; }; #endif /* nsIHTMLContent_h___ */ diff --git a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp index f429a6d96e5..29aad160a6e 100644 --- a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp +++ b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp @@ -1710,127 +1710,6 @@ nsGenericHTMLElement::RenderFrame() //---------------------------------------------------------------------- -// XXX this is REALLY temporary code - -nsresult -nsGenericHTMLElement::CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult) -{ - nsIFrame* frame = nsnull; - nsresult rv = NS_OK; - - // Handle specific frame types - if (mTag == nsHTMLAtoms::applet) { - rv = NS_NewObjectFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::body) { - rv = NS_NewBodyFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::br) { - rv = NS_NewBRFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::embed) { - rv = NS_NewObjectFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::frame) { - rv = NS_NewHTMLFrameOuterFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::frameset) { - rv = NS_NewHTMLFramesetFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::hr) { - rv = NS_NewHRFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::html) { - rv = NS_NewHTMLFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::iframe) { - rv = NS_NewHTMLFrameOuterFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::img) { - rv = NS_NewImageFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::object) { - rv = NS_NewObjectFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::spacer) { - rv = NS_NewSpacerFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::wbr) { - rv = NS_NewWBRFrame(mContent, aParentFrame, frame); - } - - // the table content frames... - else if (mTag == nsHTMLAtoms::caption) { - rv = NS_NewBodyFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::table) { - rv = NS_NewTableFrame(mContent, aParentFrame, frame); - } - else if ((mTag == nsHTMLAtoms::tbody) || - (mTag == nsHTMLAtoms::thead) || - (mTag == nsHTMLAtoms::tfoot)) { - rv = NS_NewTableRowGroupFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::tr) { - rv = NS_NewTableRowFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::colgroup) { - rv = NS_NewTableColGroupFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::col) { - rv = NS_NewTableColFrame(mContent, aParentFrame, frame); - } - else if ((mTag == nsHTMLAtoms::td) || - (mTag == nsHTMLAtoms::th)) { - rv = NS_NewTableCellFrame(mContent, aParentFrame, frame); - } - - if (NS_OK != rv) { - return rv; - } - - // XXX add code in here to force the odd ones into the empty frame? - // AREA, HEAD, META, MAP, etc... - - if (nsnull == frame) { - // When there is no explicit frame to create, assume it's a - // container and let style dictate the rest. - const nsStyleDisplay* styleDisplay = (const nsStyleDisplay*) - aStyleContext->GetStyleData(eStyleStruct_Display); - - // Use style to choose what kind of frame to create - nsresult rv; - switch (styleDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - rv = NS_NewBlockFrame(mContent, aParentFrame, frame); - break; - - case NS_STYLE_DISPLAY_INLINE: - rv = NS_NewInlineFrame(mContent, aParentFrame, frame); - break; - - default: - // Create an empty frame for holding content that is not being - // reflowed. - rv = nsFrame::NewFrame(&frame, mContent, aParentFrame); - break; - } - if (NS_OK != rv) { - return rv; - } - } - - frame->SetStyleContext(aPresContext, aStyleContext); - aResult = frame; - return NS_OK; -} - -//---------------------------------------------------------------------- - // nsIScriptObjectOwner implementation nsresult diff --git a/mozilla/content/html/content/src/nsGenericHTMLElement.h b/mozilla/content/html/content/src/nsGenericHTMLElement.h index ef3e81572d7..096b13aaeb2 100644 --- a/mozilla/content/html/content/src/nsGenericHTMLElement.h +++ b/mozilla/content/html/content/src/nsGenericHTMLElement.h @@ -147,10 +147,6 @@ public: nsresult GetStyleRule(nsIStyleRule*& aResult); nsresult ToHTMLString(nsString& aResult) const; nsresult ToHTML(FILE* out) const; - nsresult CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult); // Implementation for nsIJSScriptObject virtual PRBool AddProperty(JSContext *aContext, jsval aID, jsval *aVp); @@ -738,13 +734,6 @@ public: NS_IMETHOD ToHTML(FILE* out) const { \ return _g.ToHTML(out); \ } \ - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, \ - nsIFrame* aParentFrame, \ - nsIStyleContext* aStyleContext, \ - nsIFrame*& aResult) { \ - return _g.CreateFrame(aPresContext, aParentFrame, aStyleContext, \ - aResult); \ - } \ NS_IMETHOD StringToAttribute(nsIAtom* aAttribute, \ const nsString& aValue, \ nsHTMLValue& aResult); \ @@ -802,13 +791,6 @@ public: NS_IMETHOD ToHTML(FILE* out) const { \ return _g.ToHTML(out); \ } \ - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, \ - nsIFrame* aParentFrame, \ - nsIStyleContext* aStyleContext, \ - nsIFrame*& aResult) { \ - return _g.CreateFrame(aPresContext, aParentFrame, aStyleContext, \ - aResult); \ - } \ NS_IMETHOD StringToAttribute(nsIAtom* aAttribute, \ const nsString& aValue, \ nsHTMLValue& aResult); \ diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index 23486174ded..2cd43bd681f 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -1746,6 +1746,26 @@ nsBlockFrame::AppendNewFrames(nsIPresContext* aPresContext, nsIFrame* aNewFrame) isBlock = PR_FALSE; } + // XXX CONSTRUCTION See if it wants to be absolutely positioned or scrolled + // if overflows... +#if 0 + nsIFrame* kidFrame = nsnull; + nsresult rv; + if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) { + rv = nsAbsoluteFrame::NewFrame(&kidFrame, aKid, aParentFrame); + if (NS_OK == rv) { + kidFrame->SetStyleContext(aPresContext, kidSC); + } + } + else if ((NS_STYLE_OVERFLOW_SCROLL == kidDisplay->mOverflow) || + (NS_STYLE_OVERFLOW_AUTO == kidDisplay->mOverflow)) { + rv = NS_NewScrollFrame(&kidFrame, aKid, aParentFrame); + if (NS_OK == rv) { + kidFrame->SetStyleContext(aPresContext, kidSC); + } + } +#endif + // If the child is an inline then add it to the lastLine (if it's // an inline line, otherwise make a new line). If the child is a // block then make a new line and put the child in that line. @@ -1796,6 +1816,14 @@ nsBlockFrame::AppendNewFrames(nsIPresContext* aPresContext, nsIFrame* aNewFrame) // Remember the previous frame prevFrame = frame; + + // XXX CONSTRUCTION This needs to go somewhere... +#if 0 + if (NS_OK == rv) { + // Wrap the frame in a view if necessary + rv = CreateViewForFrame(aPresContext, kidFrame, kidSC, PR_FALSE); + } +#endif } if (0 != pendingInlines) { diff --git a/mozilla/layout/generic/nsBlockReflowState.cpp b/mozilla/layout/generic/nsBlockReflowState.cpp index 23486174ded..2cd43bd681f 100644 --- a/mozilla/layout/generic/nsBlockReflowState.cpp +++ b/mozilla/layout/generic/nsBlockReflowState.cpp @@ -1746,6 +1746,26 @@ nsBlockFrame::AppendNewFrames(nsIPresContext* aPresContext, nsIFrame* aNewFrame) isBlock = PR_FALSE; } + // XXX CONSTRUCTION See if it wants to be absolutely positioned or scrolled + // if overflows... +#if 0 + nsIFrame* kidFrame = nsnull; + nsresult rv; + if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) { + rv = nsAbsoluteFrame::NewFrame(&kidFrame, aKid, aParentFrame); + if (NS_OK == rv) { + kidFrame->SetStyleContext(aPresContext, kidSC); + } + } + else if ((NS_STYLE_OVERFLOW_SCROLL == kidDisplay->mOverflow) || + (NS_STYLE_OVERFLOW_AUTO == kidDisplay->mOverflow)) { + rv = NS_NewScrollFrame(&kidFrame, aKid, aParentFrame); + if (NS_OK == rv) { + kidFrame->SetStyleContext(aPresContext, kidSC); + } + } +#endif + // If the child is an inline then add it to the lastLine (if it's // an inline line, otherwise make a new line). If the child is a // block then make a new line and put the child in that line. @@ -1796,6 +1816,14 @@ nsBlockFrame::AppendNewFrames(nsIPresContext* aPresContext, nsIFrame* aNewFrame) // Remember the previous frame prevFrame = frame; + + // XXX CONSTRUCTION This needs to go somewhere... +#if 0 + if (NS_OK == rv) { + // Wrap the frame in a view if necessary + rv = CreateViewForFrame(aPresContext, kidFrame, kidSC, PR_FALSE); + } +#endif } if (0 != pendingInlines) { diff --git a/mozilla/layout/generic/nsBlockReflowState.h b/mozilla/layout/generic/nsBlockReflowState.h index 23486174ded..2cd43bd681f 100644 --- a/mozilla/layout/generic/nsBlockReflowState.h +++ b/mozilla/layout/generic/nsBlockReflowState.h @@ -1746,6 +1746,26 @@ nsBlockFrame::AppendNewFrames(nsIPresContext* aPresContext, nsIFrame* aNewFrame) isBlock = PR_FALSE; } + // XXX CONSTRUCTION See if it wants to be absolutely positioned or scrolled + // if overflows... +#if 0 + nsIFrame* kidFrame = nsnull; + nsresult rv; + if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) { + rv = nsAbsoluteFrame::NewFrame(&kidFrame, aKid, aParentFrame); + if (NS_OK == rv) { + kidFrame->SetStyleContext(aPresContext, kidSC); + } + } + else if ((NS_STYLE_OVERFLOW_SCROLL == kidDisplay->mOverflow) || + (NS_STYLE_OVERFLOW_AUTO == kidDisplay->mOverflow)) { + rv = NS_NewScrollFrame(&kidFrame, aKid, aParentFrame); + if (NS_OK == rv) { + kidFrame->SetStyleContext(aPresContext, kidSC); + } + } +#endif + // If the child is an inline then add it to the lastLine (if it's // an inline line, otherwise make a new line). If the child is a // block then make a new line and put the child in that line. @@ -1796,6 +1816,14 @@ nsBlockFrame::AppendNewFrames(nsIPresContext* aPresContext, nsIFrame* aNewFrame) // Remember the previous frame prevFrame = frame; + + // XXX CONSTRUCTION This needs to go somewhere... +#if 0 + if (NS_OK == rv) { + // Wrap the frame in a view if necessary + rv = CreateViewForFrame(aPresContext, kidFrame, kidSC, PR_FALSE); + } +#endif } if (0 != pendingInlines) { diff --git a/mozilla/layout/generic/nsFrameSetFrame.cpp b/mozilla/layout/generic/nsFrameSetFrame.cpp index e54f5b89352..bdc17f52de8 100644 --- a/mozilla/layout/generic/nsFrameSetFrame.cpp +++ b/mozilla/layout/generic/nsFrameSetFrame.cpp @@ -996,7 +996,6 @@ 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 - // XXX bypassing nsHTMLBase::CreateFrame; all we need is a simple blank frame. nsHTMLFramesetBlankFrame* blankFrame = new nsHTMLFramesetBlankFrame(mContent, this); //GetStyleContext(&aPresContext, blankFrame->mStyleContext); // set the blank frame's style context if (nsnull == lastChild) { diff --git a/mozilla/layout/generic/nsFrameSetFrame.h b/mozilla/layout/generic/nsFrameSetFrame.h index cd3267c6132..1725eae0045 100644 --- a/mozilla/layout/generic/nsFrameSetFrame.h +++ b/mozilla/layout/generic/nsFrameSetFrame.h @@ -204,11 +204,6 @@ protected: class nsHTMLFrameset : public nsHTMLContainer { public: - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult); - NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; NS_IMETHOD GetAttributeMappingFunction(nsMapAttributesFunc& aMapFunc) const; NS_IMETHOD SetAttribute(nsIAtom* aAttribute, const nsString& aValue, diff --git a/mozilla/layout/generic/nsHTMLContainerFrame.cpp b/mozilla/layout/generic/nsHTMLContainerFrame.cpp index d40684e0464..baa4c35ce33 100644 --- a/mozilla/layout/generic/nsHTMLContainerFrame.cpp +++ b/mozilla/layout/generic/nsHTMLContainerFrame.cpp @@ -139,89 +139,6 @@ NS_METHOD nsHTMLContainerFrame::GetCursorAndContentAt(nsIPresContext& aPresConte return NS_OK; } -// XXX CONSTRUCTION -#if 0 -NS_IMETHODIMP -nsHTMLContainerFrame::ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent) -{ - NS_ASSERTION(!IsPseudoFrame(), "pseudos not supported here"); - - // Find the frame that precedes the insertion point - nsIFrame* prevSibling = nsnull; - if (aIndexInParent > 0) { - nsIContent* precedingContent; - aContainer->ChildAt(aIndexInParent - 1, precedingContent); - prevSibling = aShell->FindFrameWithContent(precedingContent); - NS_RELEASE(precedingContent); - - // The frame may have a next-in-flow. Get the last-in-flow - nsIFrame* nextInFlow; - do { - prevSibling->GetNextInFlow(nextInFlow); - if (nsnull != nextInFlow) { - prevSibling = nextInFlow; - } - } while (nsnull != nextInFlow); - } - - // Get the geometric parent for the prevSibling. We expect it to be - // this frame or one of its next-in-flow(s). - nsHTMLContainerFrame* flow = this; - if (nsnull != prevSibling) { - prevSibling->GetGeometricParent((nsIFrame*&)flow); - } - - // Create the new frame as a child of the same parent as prevSibling - nsIFrame* newFrame; - nsresult rv = nsHTMLBase::CreateFrame(aPresContext, flow, aChild, nsnull, - newFrame); - if (NS_OK != rv) { - return rv; - } - flow->mChildCount++; - - // Place the new frame into the parents sibling list - if (nsnull == prevSibling) { - newFrame->SetNextSibling(flow->mFirstChild); - flow->mFirstChild = newFrame; - } - else { - nsIFrame* nextSibling; - prevSibling->GetNextSibling(nextSibling); - newFrame->SetNextSibling(nextSibling); - prevSibling->SetNextSibling(newFrame); - if (nsnull == nextSibling) { - // newFrame ended up being flow's last child - flow->mLastContentIsComplete = PR_TRUE; - } - } - flow->mLastContentOffset++; - - // Generate a reflow command - nsIReflowCommand* cmd; - rv = NS_NewHTMLReflowCommand(&cmd, flow, - nsIReflowCommand::FrameInserted, - newFrame); - if (NS_OK != rv) { - return rv; - } - aShell->AppendReflowCommand(cmd); - NS_RELEASE(cmd); - - // Fix up the next-in-flows of parent now that it has a new child - flow = (nsHTMLContainerFrame*) flow->mNextInFlow; - while (nsnull != flow) { - flow->mFirstContentOffset++; - flow->mLastContentOffset++; - } - return rv; -} -#endif - NS_IMETHODIMP nsHTMLContainerFrame::ContentDeleted(nsIPresShell* aShell, nsIPresContext* aPresContext, diff --git a/mozilla/layout/generic/nsImageFrame.cpp b/mozilla/layout/generic/nsImageFrame.cpp index 3c6450acfa2..78b9932b80a 100644 --- a/mozilla/layout/generic/nsImageFrame.cpp +++ b/mozilla/layout/generic/nsImageFrame.cpp @@ -65,10 +65,6 @@ public: NS_DECL_ISUPPORTS NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler) const; - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult); NS_IMETHOD SetAttribute(nsIAtom* aAttribute, const nsString& aValue, PRBool aNotify); diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index 23486174ded..2cd43bd681f 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -1746,6 +1746,26 @@ nsBlockFrame::AppendNewFrames(nsIPresContext* aPresContext, nsIFrame* aNewFrame) isBlock = PR_FALSE; } + // XXX CONSTRUCTION See if it wants to be absolutely positioned or scrolled + // if overflows... +#if 0 + nsIFrame* kidFrame = nsnull; + nsresult rv; + if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) { + rv = nsAbsoluteFrame::NewFrame(&kidFrame, aKid, aParentFrame); + if (NS_OK == rv) { + kidFrame->SetStyleContext(aPresContext, kidSC); + } + } + else if ((NS_STYLE_OVERFLOW_SCROLL == kidDisplay->mOverflow) || + (NS_STYLE_OVERFLOW_AUTO == kidDisplay->mOverflow)) { + rv = NS_NewScrollFrame(&kidFrame, aKid, aParentFrame); + if (NS_OK == rv) { + kidFrame->SetStyleContext(aPresContext, kidSC); + } + } +#endif + // If the child is an inline then add it to the lastLine (if it's // an inline line, otherwise make a new line). If the child is a // block then make a new line and put the child in that line. @@ -1796,6 +1816,14 @@ nsBlockFrame::AppendNewFrames(nsIPresContext* aPresContext, nsIFrame* aNewFrame) // Remember the previous frame prevFrame = frame; + + // XXX CONSTRUCTION This needs to go somewhere... +#if 0 + if (NS_OK == rv) { + // Wrap the frame in a view if necessary + rv = CreateViewForFrame(aPresContext, kidFrame, kidSC, PR_FALSE); + } +#endif } if (0 != pendingInlines) { diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.cpp b/mozilla/layout/html/base/src/nsBlockReflowState.cpp index 23486174ded..2cd43bd681f 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowState.cpp @@ -1746,6 +1746,26 @@ nsBlockFrame::AppendNewFrames(nsIPresContext* aPresContext, nsIFrame* aNewFrame) isBlock = PR_FALSE; } + // XXX CONSTRUCTION See if it wants to be absolutely positioned or scrolled + // if overflows... +#if 0 + nsIFrame* kidFrame = nsnull; + nsresult rv; + if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) { + rv = nsAbsoluteFrame::NewFrame(&kidFrame, aKid, aParentFrame); + if (NS_OK == rv) { + kidFrame->SetStyleContext(aPresContext, kidSC); + } + } + else if ((NS_STYLE_OVERFLOW_SCROLL == kidDisplay->mOverflow) || + (NS_STYLE_OVERFLOW_AUTO == kidDisplay->mOverflow)) { + rv = NS_NewScrollFrame(&kidFrame, aKid, aParentFrame); + if (NS_OK == rv) { + kidFrame->SetStyleContext(aPresContext, kidSC); + } + } +#endif + // If the child is an inline then add it to the lastLine (if it's // an inline line, otherwise make a new line). If the child is a // block then make a new line and put the child in that line. @@ -1796,6 +1816,14 @@ nsBlockFrame::AppendNewFrames(nsIPresContext* aPresContext, nsIFrame* aNewFrame) // Remember the previous frame prevFrame = frame; + + // XXX CONSTRUCTION This needs to go somewhere... +#if 0 + if (NS_OK == rv) { + // Wrap the frame in a view if necessary + rv = CreateViewForFrame(aPresContext, kidFrame, kidSC, PR_FALSE); + } +#endif } if (0 != pendingInlines) { diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.h b/mozilla/layout/html/base/src/nsBlockReflowState.h index 23486174ded..2cd43bd681f 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.h +++ b/mozilla/layout/html/base/src/nsBlockReflowState.h @@ -1746,6 +1746,26 @@ nsBlockFrame::AppendNewFrames(nsIPresContext* aPresContext, nsIFrame* aNewFrame) isBlock = PR_FALSE; } + // XXX CONSTRUCTION See if it wants to be absolutely positioned or scrolled + // if overflows... +#if 0 + nsIFrame* kidFrame = nsnull; + nsresult rv; + if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) { + rv = nsAbsoluteFrame::NewFrame(&kidFrame, aKid, aParentFrame); + if (NS_OK == rv) { + kidFrame->SetStyleContext(aPresContext, kidSC); + } + } + else if ((NS_STYLE_OVERFLOW_SCROLL == kidDisplay->mOverflow) || + (NS_STYLE_OVERFLOW_AUTO == kidDisplay->mOverflow)) { + rv = NS_NewScrollFrame(&kidFrame, aKid, aParentFrame); + if (NS_OK == rv) { + kidFrame->SetStyleContext(aPresContext, kidSC); + } + } +#endif + // If the child is an inline then add it to the lastLine (if it's // an inline line, otherwise make a new line). If the child is a // block then make a new line and put the child in that line. @@ -1796,6 +1816,14 @@ nsBlockFrame::AppendNewFrames(nsIPresContext* aPresContext, nsIFrame* aNewFrame) // Remember the previous frame prevFrame = frame; + + // XXX CONSTRUCTION This needs to go somewhere... +#if 0 + if (NS_OK == rv) { + // Wrap the frame in a view if necessary + rv = CreateViewForFrame(aPresContext, kidFrame, kidSC, PR_FALSE); + } +#endif } if (0 != pendingInlines) { diff --git a/mozilla/layout/html/base/src/nsHTMLBase.cpp b/mozilla/layout/html/base/src/nsHTMLBase.cpp index 3272054b50a..d4778deb95f 100644 --- a/mozilla/layout/html/base/src/nsHTMLBase.cpp +++ b/mozilla/layout/html/base/src/nsHTMLBase.cpp @@ -124,87 +124,3 @@ nsHTMLBase::CreateViewForFrame(nsIPresContext* aPresContext, return NS_OK; } -// XXX CONSTRUCTION -#if 0 -nsresult -nsHTMLBase::CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIContent* aKid, - nsIFrame* aKidPrevInFlow, - nsIFrame*& aResult) -{ - nsIStyleContext* kidSC; - // XXX Cheesy hack for text - nsIAtom* tag; - aKid->GetTag(tag); - if (nsnull == tag) { - kidSC = aPresContext->ResolvePseudoStyleContextFor(nsHTMLAtoms::text, aParentFrame); - } else { - NS_RELEASE(tag); - kidSC = aPresContext->ResolveStyleContextFor(aKid, aParentFrame); - } - if (nsnull == kidSC) { - return NS_ERROR_OUT_OF_MEMORY; - } - const nsStylePosition* kidPosition = (const nsStylePosition*) - kidSC->GetStyleData(eStyleStruct_Position); - const nsStyleDisplay* kidDisplay = (const nsStyleDisplay*) - kidSC->GetStyleData(eStyleStruct_Display); - - // Check whether it wants to floated or absolutely positioned - nsIFrame* kidFrame = nsnull; - nsresult rv; - if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) { - rv = nsAbsoluteFrame::NewFrame(&kidFrame, aKid, aParentFrame); - if (NS_OK == rv) { - kidFrame->SetStyleContext(aPresContext, kidSC); - } - } - else if (NS_STYLE_FLOAT_NONE != kidDisplay->mFloats) { - rv = nsPlaceholderFrame::NewFrame(&kidFrame, aKid, aParentFrame); - if (NS_OK == rv) { - kidFrame->SetStyleContext(aPresContext, kidSC); - } - } - else if ((NS_STYLE_OVERFLOW_SCROLL == kidDisplay->mOverflow) || - (NS_STYLE_OVERFLOW_AUTO == kidDisplay->mOverflow)) { - rv = NS_NewScrollFrame(&kidFrame, aKid, aParentFrame); - if (NS_OK == rv) { - kidFrame->SetStyleContext(aPresContext, kidSC); - } - } - else if (nsnull == aKidPrevInFlow) { - // Create initial frame for the child - nsIContentDelegate* kidDel; - switch (kidDisplay->mDisplay) { - case NS_STYLE_DISPLAY_NONE: - rv = nsFrame::NewFrame(&kidFrame, aKid, aParentFrame); - if (NS_OK == rv) { - kidFrame->SetStyleContext(aPresContext, kidSC); - } - break; - - default: - kidDel = aKid->GetDelegate(aPresContext); - rv = kidDel->CreateFrame(aPresContext, aKid, aParentFrame, - kidSC, kidFrame); - NS_RELEASE(kidDel); - break; - } - } else { - // Since kid has a prev-in-flow, use that to create the next - // frame. - rv = aKidPrevInFlow->CreateContinuingFrame(*aPresContext, aParentFrame, - kidSC, kidFrame); - } - - if (NS_OK == rv) { - // Wrap the frame in a view if necessary - rv = CreateViewForFrame(aPresContext, kidFrame, kidSC, PR_FALSE); - } - - aResult = kidFrame; - NS_RELEASE(kidSC); - return rv; -} -#endif diff --git a/mozilla/layout/html/base/src/nsHTMLBase.h b/mozilla/layout/html/base/src/nsHTMLBase.h index a07066f74c2..68b2f4decc2 100644 --- a/mozilla/layout/html/base/src/nsHTMLBase.h +++ b/mozilla/layout/html/base/src/nsHTMLBase.h @@ -33,19 +33,6 @@ public: nsIFrame* aFrame, nsIStyleContext* aStyleContext, PRBool aForce); - - /** - * Create a frame for a given piece of content using the style - * as a guide for determining which frame to create. - */ - // XXX CONSTRUCTION -#if 0 - static nsresult CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIContent* aKid, - nsIFrame* aKidPrevInFlow, - nsIFrame*& aResult); -#endif }; #endif /* nsHTMLBase_h___ */ diff --git a/mozilla/layout/html/base/src/nsHTMLBullet.cpp b/mozilla/layout/html/base/src/nsHTMLBullet.cpp index a96a43d722c..f2238569580 100644 --- a/mozilla/layout/html/base/src/nsHTMLBullet.cpp +++ b/mozilla/layout/html/base/src/nsHTMLBullet.cpp @@ -58,11 +58,6 @@ public: NS_IMETHOD GetAttributeMappingFunction(nsMapAttributesFunc& aMapFunc) const; NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; - - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult); }; class BulletFrame : public nsFrame, private nsIInlineReflow { @@ -151,21 +146,6 @@ Bullet::List(FILE* out, PRInt32 aIndent) const return NS_OK; } -NS_IMETHODIMP -Bullet::CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult) -{ - BulletFrame* frame = new BulletFrame(this, aParentFrame); - if (nsnull == frame) { - return NS_ERROR_OUT_OF_MEMORY; - } - aResult = frame; - frame->SetStyleContext(aPresContext, aStyleContext); - return NS_OK; -} - nsresult NS_NewHTMLBullet(nsIHTMLContent** aInstancePtrResult) { diff --git a/mozilla/layout/html/base/src/nsHTMLContainer.cpp b/mozilla/layout/html/base/src/nsHTMLContainer.cpp index 42d85878e9e..da7c8946b29 100644 --- a/mozilla/layout/html/base/src/nsHTMLContainer.cpp +++ b/mozilla/layout/html/base/src/nsHTMLContainer.cpp @@ -242,41 +242,6 @@ nsHTMLContainer::Compact() return NS_OK; } -NS_IMETHODIMP -nsHTMLContainer::CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult) -{ - const nsStyleDisplay* styleDisplay = - (const nsStyleDisplay*) aStyleContext->GetStyleData(eStyleStruct_Display); - - // Use style to choose what kind of frame to create - nsIFrame* frame = nsnull; - nsresult rv; - switch (styleDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - rv = NS_NewBlockFrame(this, aParentFrame, frame); - break; - - case NS_STYLE_DISPLAY_INLINE: - rv = NS_NewInlineFrame(this, aParentFrame, frame); - break; - - default: - // Create an empty frame for holding content that is not being - // reflowed. - rv = nsFrame::NewFrame(&frame, this, aParentFrame); - break; - } - if (NS_OK == rv) { - frame->SetStyleContext(aPresContext, aStyleContext); - } - aResult = frame; - return rv; -} - //---------------------------------------------------------------------- NS_IMETHODIMP diff --git a/mozilla/layout/html/base/src/nsHTMLContainer.h b/mozilla/layout/html/base/src/nsHTMLContainer.h index 4dcbb8459a1..39c3d761fe3 100644 --- a/mozilla/layout/html/base/src/nsHTMLContainer.h +++ b/mozilla/layout/html/base/src/nsHTMLContainer.h @@ -45,11 +45,6 @@ public: NS_IMETHOD Compact(); - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult); - NS_IMETHOD SetAttribute(nsIAtom* aAttribute, const nsString& aValue, PRBool aNotify); NS_IMETHOD GetAttributeMappingFunction(nsMapAttributesFunc& aMapFunc) const; diff --git a/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp b/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp index d40684e0464..baa4c35ce33 100644 --- a/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp +++ b/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp @@ -139,89 +139,6 @@ NS_METHOD nsHTMLContainerFrame::GetCursorAndContentAt(nsIPresContext& aPresConte return NS_OK; } -// XXX CONSTRUCTION -#if 0 -NS_IMETHODIMP -nsHTMLContainerFrame::ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent) -{ - NS_ASSERTION(!IsPseudoFrame(), "pseudos not supported here"); - - // Find the frame that precedes the insertion point - nsIFrame* prevSibling = nsnull; - if (aIndexInParent > 0) { - nsIContent* precedingContent; - aContainer->ChildAt(aIndexInParent - 1, precedingContent); - prevSibling = aShell->FindFrameWithContent(precedingContent); - NS_RELEASE(precedingContent); - - // The frame may have a next-in-flow. Get the last-in-flow - nsIFrame* nextInFlow; - do { - prevSibling->GetNextInFlow(nextInFlow); - if (nsnull != nextInFlow) { - prevSibling = nextInFlow; - } - } while (nsnull != nextInFlow); - } - - // Get the geometric parent for the prevSibling. We expect it to be - // this frame or one of its next-in-flow(s). - nsHTMLContainerFrame* flow = this; - if (nsnull != prevSibling) { - prevSibling->GetGeometricParent((nsIFrame*&)flow); - } - - // Create the new frame as a child of the same parent as prevSibling - nsIFrame* newFrame; - nsresult rv = nsHTMLBase::CreateFrame(aPresContext, flow, aChild, nsnull, - newFrame); - if (NS_OK != rv) { - return rv; - } - flow->mChildCount++; - - // Place the new frame into the parents sibling list - if (nsnull == prevSibling) { - newFrame->SetNextSibling(flow->mFirstChild); - flow->mFirstChild = newFrame; - } - else { - nsIFrame* nextSibling; - prevSibling->GetNextSibling(nextSibling); - newFrame->SetNextSibling(nextSibling); - prevSibling->SetNextSibling(newFrame); - if (nsnull == nextSibling) { - // newFrame ended up being flow's last child - flow->mLastContentIsComplete = PR_TRUE; - } - } - flow->mLastContentOffset++; - - // Generate a reflow command - nsIReflowCommand* cmd; - rv = NS_NewHTMLReflowCommand(&cmd, flow, - nsIReflowCommand::FrameInserted, - newFrame); - if (NS_OK != rv) { - return rv; - } - aShell->AppendReflowCommand(cmd); - NS_RELEASE(cmd); - - // Fix up the next-in-flows of parent now that it has a new child - flow = (nsHTMLContainerFrame*) flow->mNextInFlow; - while (nsnull != flow) { - flow->mFirstContentOffset++; - flow->mLastContentOffset++; - } - return rv; -} -#endif - NS_IMETHODIMP nsHTMLContainerFrame::ContentDeleted(nsIPresShell* aShell, nsIPresContext* aPresContext, diff --git a/mozilla/layout/html/base/src/nsIHTMLContent.h b/mozilla/layout/html/base/src/nsIHTMLContent.h index 11893e69f62..4aaa3a61915 100644 --- a/mozilla/layout/html/base/src/nsIHTMLContent.h +++ b/mozilla/layout/html/base/src/nsIHTMLContent.h @@ -96,15 +96,6 @@ public: NS_IMETHOD ToHTMLString(nsString& aResult) const = 0; NS_IMETHOD ToHTML(FILE* out) const = 0; - - /** - * Used by the html content's delegate to create a frame - * for the content. - */ - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult) = 0; }; #endif /* nsIHTMLContent_h___ */ diff --git a/mozilla/layout/html/base/src/nsImageFrame.cpp b/mozilla/layout/html/base/src/nsImageFrame.cpp index 3c6450acfa2..78b9932b80a 100644 --- a/mozilla/layout/html/base/src/nsImageFrame.cpp +++ b/mozilla/layout/html/base/src/nsImageFrame.cpp @@ -65,10 +65,6 @@ public: NS_DECL_ISUPPORTS NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler) const; - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult); NS_IMETHOD SetAttribute(nsIAtom* aAttribute, const nsString& aValue, PRBool aNotify); diff --git a/mozilla/layout/html/content/src/nsGenericDOMDataNode.h b/mozilla/layout/html/content/src/nsGenericDOMDataNode.h index 1c9f22d5f68..ede805cea43 100644 --- a/mozilla/layout/html/content/src/nsGenericDOMDataNode.h +++ b/mozilla/layout/html/content/src/nsGenericDOMDataNode.h @@ -495,13 +495,6 @@ struct nsGenericDOMDataNode { } \ NS_IMETHOD ToHTMLString(nsString& aResult) const; \ NS_IMETHOD ToHTML(FILE* out) const; \ - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, \ - nsIFrame* aParentFrame, \ - nsIStyleContext* aStyleContext, \ - nsIFrame*& aResult) { \ - NS_NOTREACHED("whoops"); \ - return NS_ERROR_FAILURE; \ - } \ NS_IMETHOD StringToAttribute(nsIAtom* aAttribute, \ const nsString& aValue, \ nsHTMLValue& aResult) { \ diff --git a/mozilla/layout/html/content/src/nsGenericHTMLElement.cpp b/mozilla/layout/html/content/src/nsGenericHTMLElement.cpp index f429a6d96e5..29aad160a6e 100644 --- a/mozilla/layout/html/content/src/nsGenericHTMLElement.cpp +++ b/mozilla/layout/html/content/src/nsGenericHTMLElement.cpp @@ -1710,127 +1710,6 @@ nsGenericHTMLElement::RenderFrame() //---------------------------------------------------------------------- -// XXX this is REALLY temporary code - -nsresult -nsGenericHTMLElement::CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult) -{ - nsIFrame* frame = nsnull; - nsresult rv = NS_OK; - - // Handle specific frame types - if (mTag == nsHTMLAtoms::applet) { - rv = NS_NewObjectFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::body) { - rv = NS_NewBodyFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::br) { - rv = NS_NewBRFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::embed) { - rv = NS_NewObjectFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::frame) { - rv = NS_NewHTMLFrameOuterFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::frameset) { - rv = NS_NewHTMLFramesetFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::hr) { - rv = NS_NewHRFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::html) { - rv = NS_NewHTMLFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::iframe) { - rv = NS_NewHTMLFrameOuterFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::img) { - rv = NS_NewImageFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::object) { - rv = NS_NewObjectFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::spacer) { - rv = NS_NewSpacerFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::wbr) { - rv = NS_NewWBRFrame(mContent, aParentFrame, frame); - } - - // the table content frames... - else if (mTag == nsHTMLAtoms::caption) { - rv = NS_NewBodyFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::table) { - rv = NS_NewTableFrame(mContent, aParentFrame, frame); - } - else if ((mTag == nsHTMLAtoms::tbody) || - (mTag == nsHTMLAtoms::thead) || - (mTag == nsHTMLAtoms::tfoot)) { - rv = NS_NewTableRowGroupFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::tr) { - rv = NS_NewTableRowFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::colgroup) { - rv = NS_NewTableColGroupFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::col) { - rv = NS_NewTableColFrame(mContent, aParentFrame, frame); - } - else if ((mTag == nsHTMLAtoms::td) || - (mTag == nsHTMLAtoms::th)) { - rv = NS_NewTableCellFrame(mContent, aParentFrame, frame); - } - - if (NS_OK != rv) { - return rv; - } - - // XXX add code in here to force the odd ones into the empty frame? - // AREA, HEAD, META, MAP, etc... - - if (nsnull == frame) { - // When there is no explicit frame to create, assume it's a - // container and let style dictate the rest. - const nsStyleDisplay* styleDisplay = (const nsStyleDisplay*) - aStyleContext->GetStyleData(eStyleStruct_Display); - - // Use style to choose what kind of frame to create - nsresult rv; - switch (styleDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - rv = NS_NewBlockFrame(mContent, aParentFrame, frame); - break; - - case NS_STYLE_DISPLAY_INLINE: - rv = NS_NewInlineFrame(mContent, aParentFrame, frame); - break; - - default: - // Create an empty frame for holding content that is not being - // reflowed. - rv = nsFrame::NewFrame(&frame, mContent, aParentFrame); - break; - } - if (NS_OK != rv) { - return rv; - } - } - - frame->SetStyleContext(aPresContext, aStyleContext); - aResult = frame; - return NS_OK; -} - -//---------------------------------------------------------------------- - // nsIScriptObjectOwner implementation nsresult diff --git a/mozilla/layout/html/content/src/nsGenericHTMLElement.h b/mozilla/layout/html/content/src/nsGenericHTMLElement.h index ef3e81572d7..096b13aaeb2 100644 --- a/mozilla/layout/html/content/src/nsGenericHTMLElement.h +++ b/mozilla/layout/html/content/src/nsGenericHTMLElement.h @@ -147,10 +147,6 @@ public: nsresult GetStyleRule(nsIStyleRule*& aResult); nsresult ToHTMLString(nsString& aResult) const; nsresult ToHTML(FILE* out) const; - nsresult CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult); // Implementation for nsIJSScriptObject virtual PRBool AddProperty(JSContext *aContext, jsval aID, jsval *aVp); @@ -738,13 +734,6 @@ public: NS_IMETHOD ToHTML(FILE* out) const { \ return _g.ToHTML(out); \ } \ - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, \ - nsIFrame* aParentFrame, \ - nsIStyleContext* aStyleContext, \ - nsIFrame*& aResult) { \ - return _g.CreateFrame(aPresContext, aParentFrame, aStyleContext, \ - aResult); \ - } \ NS_IMETHOD StringToAttribute(nsIAtom* aAttribute, \ const nsString& aValue, \ nsHTMLValue& aResult); \ @@ -802,13 +791,6 @@ public: NS_IMETHOD ToHTML(FILE* out) const { \ return _g.ToHTML(out); \ } \ - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, \ - nsIFrame* aParentFrame, \ - nsIStyleContext* aStyleContext, \ - nsIFrame*& aResult) { \ - return _g.CreateFrame(aPresContext, aParentFrame, aStyleContext, \ - aResult); \ - } \ NS_IMETHOD StringToAttribute(nsIAtom* aAttribute, \ const nsString& aValue, \ nsHTMLValue& aResult); \ diff --git a/mozilla/layout/html/content/src/nsHTMLGenericContent.cpp b/mozilla/layout/html/content/src/nsHTMLGenericContent.cpp index 3a36696782b..7c7a3ac55a5 100644 --- a/mozilla/layout/html/content/src/nsHTMLGenericContent.cpp +++ b/mozilla/layout/html/content/src/nsHTMLGenericContent.cpp @@ -1470,66 +1470,6 @@ extern nsresult NS_NewHRFrame(nsIContent* aContent, nsIFrame* aParentFrame, extern nsresult NS_NewObjectFrame(nsIContent* aContent, nsIFrame* aParentFrame, nsIFrame*& aNewFrame); -nsresult -nsHTMLGenericContent::CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult) -{ - nsIFrame* frame = nsnull; - nsresult rv = NS_OK; - - // Handle specific frame types - if (mTag == nsHTMLAtoms::applet) { - rv = NS_NewObjectFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::br) { - rv = NS_NewBRFrame(mContent, aParentFrame, frame); - } - else if (mTag == nsHTMLAtoms::hr) { - rv = NS_NewHRFrame(mContent, aParentFrame, frame); - } - if (NS_OK != rv) { - return rv; - } - - // XXX add code in here to force the odd ones into the empty frame? - // AREA, HEAD, META, MAP, etc... - - if (nsnull == frame) { - // When there is no explicit frame to create, assume it's a - // container and let style dictate the rest. - const nsStyleDisplay* styleDisplay = (const nsStyleDisplay*) - aStyleContext->GetStyleData(eStyleStruct_Display); - - // Use style to choose what kind of frame to create - nsresult rv; - switch (styleDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - rv = NS_NewCSSBlockFrame(&frame, mContent, aParentFrame); - break; - - case NS_STYLE_DISPLAY_INLINE: - rv = NS_NewCSSInlineFrame(&frame, mContent, aParentFrame); - break; - - default: - // Create an empty frame for holding content that is not being - // reflowed. - rv = nsFrame::NewFrame(&frame, mContent, aParentFrame); - break; - } - if (NS_OK != rv) { - return rv; - } - } - - frame->SetStyleContext(aPresContext, aStyleContext); - aResult = frame; - return NS_OK; -} - //---------------------------------------------------------------------- // nsIScriptObjectOwner implementation diff --git a/mozilla/layout/html/document/src/nsFrameSetFrame.cpp b/mozilla/layout/html/document/src/nsFrameSetFrame.cpp index e54f5b89352..bdc17f52de8 100644 --- a/mozilla/layout/html/document/src/nsFrameSetFrame.cpp +++ b/mozilla/layout/html/document/src/nsFrameSetFrame.cpp @@ -996,7 +996,6 @@ 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 - // XXX bypassing nsHTMLBase::CreateFrame; all we need is a simple blank frame. nsHTMLFramesetBlankFrame* blankFrame = new nsHTMLFramesetBlankFrame(mContent, this); //GetStyleContext(&aPresContext, blankFrame->mStyleContext); // set the blank frame's style context if (nsnull == lastChild) { diff --git a/mozilla/layout/html/document/src/nsFrameSetFrame.h b/mozilla/layout/html/document/src/nsFrameSetFrame.h index cd3267c6132..1725eae0045 100644 --- a/mozilla/layout/html/document/src/nsFrameSetFrame.h +++ b/mozilla/layout/html/document/src/nsFrameSetFrame.h @@ -204,11 +204,6 @@ protected: class nsHTMLFrameset : public nsHTMLContainer { public: - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult); - NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; NS_IMETHOD GetAttributeMappingFunction(nsMapAttributesFunc& aMapFunc) const; NS_IMETHOD SetAttribute(nsIAtom* aAttribute, const nsString& aValue, diff --git a/mozilla/layout/html/forms/src/nsInput.h b/mozilla/layout/html/forms/src/nsInput.h index 829442dd375..f81c19d6c08 100644 --- a/mozilla/layout/html/forms/src/nsInput.h +++ b/mozilla/layout/html/forms/src/nsInput.h @@ -44,14 +44,6 @@ public: */ nsInput(nsIAtom* aTag, nsIFormManager* aManager); - /** - * @see nsIContentDelegate CreateFrame - */ - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult) = 0; - NS_IMETHOD GetAttributeMappingFunction(nsMapAttributesFunc& aMapFunc) const; static void MapAttributesInto(nsIHTMLAttributes* aAttributes, nsIStyleContext* aContext, diff --git a/mozilla/layout/html/forms/src/nsInputButton.cpp b/mozilla/layout/html/forms/src/nsInputButton.cpp index dce07d36960..32e34aa26df 100644 --- a/mozilla/layout/html/forms/src/nsInputButton.cpp +++ b/mozilla/layout/html/forms/src/nsInputButton.cpp @@ -72,11 +72,6 @@ public: nsInputButton (nsIAtom* aTag, nsIFormManager* aManager, nsButtonType aType); - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult); - NS_IMETHOD SetAttribute(nsIAtom* aAttribute, const nsString& aValue, PRBool aNotify); NS_IMETHOD GetAttributeMappingFunction(nsMapAttributesFunc& aMapFunc) const; @@ -230,30 +225,6 @@ nsInputButton::GetDefaultLabel(nsString& aString) } } -nsresult -nsInputButton::CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult) -{ - nsIFrame* frame = nsnull; - if (kButton_Hidden == mType) { - nsresult rv = nsFrame::NewFrame(&frame, this, aParentFrame); - if (NS_OK != rv) { - return rv; - } - } - else { - frame = new nsInputButtonFrame(this, aParentFrame); - if (nsnull == frame) { - return NS_ERROR_OUT_OF_MEMORY; - } - } - frame->SetStyleContext(aPresContext, aStyleContext); - aResult = frame; - return NS_OK; -} - PRInt32 nsInputButton::GetMaxNumValues() { diff --git a/mozilla/layout/html/forms/src/nsInputCheckbox.cpp b/mozilla/layout/html/forms/src/nsInputCheckbox.cpp index e54a39ac72d..7d700a0885f 100644 --- a/mozilla/layout/html/forms/src/nsInputCheckbox.cpp +++ b/mozilla/layout/html/forms/src/nsInputCheckbox.cpp @@ -273,21 +273,6 @@ nsInputCheckbox::Reset() } } -nsresult -nsInputCheckbox::CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult) -{ - nsIFrame* frame = new nsInputCheckboxFrame(this, aParentFrame); - if (nsnull == frame) { - return NS_ERROR_OUT_OF_MEMORY; - } - frame->SetStyleContext(aPresContext, aStyleContext); - aResult = frame; - return NS_OK; -} - void nsInputCheckbox::GetType(nsString& aResult) const { aResult = "checkbox"; diff --git a/mozilla/layout/html/forms/src/nsInputCheckbox.h b/mozilla/layout/html/forms/src/nsInputCheckbox.h index d6dc155965b..cfa642a4d6b 100644 --- a/mozilla/layout/html/forms/src/nsInputCheckbox.h +++ b/mozilla/layout/html/forms/src/nsInputCheckbox.h @@ -28,11 +28,6 @@ public: typedef nsInput nsInputCheckboxSuper; nsInputCheckbox (nsIAtom* aTag, nsIFormManager* aManager); - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult); - NS_IMETHOD SetAttribute(nsIAtom* aAttribute, const nsString& aValue, PRBool aNotify); diff --git a/mozilla/layout/html/forms/src/nsInputFile.cpp b/mozilla/layout/html/forms/src/nsInputFile.cpp index 4cf0088b206..c9f6ffa8af6 100644 --- a/mozilla/layout/html/forms/src/nsInputFile.cpp +++ b/mozilla/layout/html/forms/src/nsInputFile.cpp @@ -231,28 +231,11 @@ void nsInputFile::SetBrowseButton(nsInput* aBrowseButton) mBrowseButton = aBrowseButton; } - -nsresult -nsInputFile::CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult) -{ - nsIFrame* frame = new nsInputFileFrame(this, aParentFrame); - if (nsnull == frame) { - return NS_ERROR_OUT_OF_MEMORY; - } - frame->SetStyleContext(aPresContext, aStyleContext); - aResult = frame; - return NS_OK; -} - void nsInputFile::GetType(nsString& aResult) const { aResult = "file"; } - PRInt32 nsInputFile::GetMaxNumValues() { diff --git a/mozilla/layout/html/forms/src/nsInputFile.h b/mozilla/layout/html/forms/src/nsInputFile.h index 449f47ed57a..0d7a18e29e0 100644 --- a/mozilla/layout/html/forms/src/nsInputFile.h +++ b/mozilla/layout/html/forms/src/nsInputFile.h @@ -51,11 +51,6 @@ public: nsInputFile (nsIAtom* aTag, nsIFormManager* aManager); - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult); - NS_IMETHOD SetAttribute(nsIAtom* aAttribute, const nsString& aValue, PRBool aNotify); virtual PRInt32 GetMaxNumValues(); diff --git a/mozilla/layout/html/forms/src/nsInputRadio.cpp b/mozilla/layout/html/forms/src/nsInputRadio.cpp index 790db15b9d2..3992b8b2e3c 100644 --- a/mozilla/layout/html/forms/src/nsInputRadio.cpp +++ b/mozilla/layout/html/forms/src/nsInputRadio.cpp @@ -265,21 +265,6 @@ nsInputRadio::SetChecked(PRBool aValue, PRBool aSetInitialValue) } } -nsresult -nsInputRadio::CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult) -{ - nsIFrame* frame = new nsInputRadioFrame(this, aParentFrame); - if (nsnull == frame) { - return NS_ERROR_OUT_OF_MEMORY; - } - frame->SetStyleContext(aPresContext, aStyleContext); - aResult = frame; - return NS_OK; -} - void nsInputRadio::GetType(nsString& aResult) const { aResult = "radio"; diff --git a/mozilla/layout/html/forms/src/nsInputRadio.h b/mozilla/layout/html/forms/src/nsInputRadio.h index 7c692223453..8a278259b45 100644 --- a/mozilla/layout/html/forms/src/nsInputRadio.h +++ b/mozilla/layout/html/forms/src/nsInputRadio.h @@ -32,11 +32,6 @@ public: typedef nsInput nsInputRadioSuper; nsInputRadio (nsIAtom* aTag, nsIFormManager* aManager); - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult); - NS_IMETHOD SetAttribute(nsIAtom* aAttribute, const nsString& aValue, PRBool aNotify); diff --git a/mozilla/layout/html/forms/src/nsInputText.cpp b/mozilla/layout/html/forms/src/nsInputText.cpp index 25e15c2dd74..f5ea8191519 100644 --- a/mozilla/layout/html/forms/src/nsInputText.cpp +++ b/mozilla/layout/html/forms/src/nsInputText.cpp @@ -360,21 +360,6 @@ nsInputText::GetTextType() const return mType; } -nsresult -nsInputText::CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult) -{ - nsIFrame* frame = new nsInputTextFrame(this, aParentFrame); - if (nsnull == frame) { - return NS_ERROR_OUT_OF_MEMORY; - } - frame->SetStyleContext(aPresContext, aStyleContext); - aResult = frame; - return NS_OK; -} - PRInt32 nsInputText::GetMaxNumValues() { diff --git a/mozilla/layout/html/forms/src/nsInputText.h b/mozilla/layout/html/forms/src/nsInputText.h index c412ad20f17..8e2c45fd02a 100644 --- a/mozilla/layout/html/forms/src/nsInputText.h +++ b/mozilla/layout/html/forms/src/nsInputText.h @@ -39,11 +39,6 @@ public: typedef nsInput nsInputTextSuper; nsInputText (nsIAtom* aTag, nsIFormManager* aManager, nsInputTextType aType); - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult); - NS_IMETHOD SetAttribute(nsIAtom* aAttribute, const nsString& aValue, PRBool aNotify); diff --git a/mozilla/layout/html/forms/src/nsSelect.cpp b/mozilla/layout/html/forms/src/nsSelect.cpp index 2a8a7445631..8869bf4be14 100644 --- a/mozilla/layout/html/forms/src/nsSelect.cpp +++ b/mozilla/layout/html/forms/src/nsSelect.cpp @@ -89,11 +89,6 @@ public: typedef nsInput nsSelectSuper; nsSelect (nsIAtom* aTag, nsIFormManager* aFormMan); - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult); - nsOption* GetNthOption(PRInt32 aIndex); NS_IMETHOD SetAttribute(nsIAtom* aAttribute, const nsString& aValue, @@ -130,11 +125,6 @@ public: nsOption (nsIAtom* aTag); - NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult); - NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr); NS_IMETHOD SetAttribute(nsIAtom* aAttribute, const nsString& aValue, @@ -437,21 +427,6 @@ void nsSelect::GetType(nsString& aResult) const aResult = "select"; } -nsresult -nsSelect::CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult) -{ - nsIFrame* frame = new nsSelectFrame(this, aParentFrame); - if (nsnull == frame) { - return NS_ERROR_OUT_OF_MEMORY; - } - frame->SetStyleContext(aPresContext, aStyleContext); - aResult = frame; - return NS_OK; -} - NS_IMETHODIMP nsSelect::SetAttribute(nsIAtom* aAttribute, const nsString& aValue, @@ -644,22 +619,6 @@ void nsOption::GetType(nsString& aResult) const aResult = "select"; } -nsresult -nsOption::CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIStyleContext* aStyleContext, - nsIFrame*& aResult) -{ - nsIFrame* frame; - nsresult rv = nsFrame::NewFrame(&frame, this, aParentFrame); - if (NS_OK != rv) { - return rv; - } - frame->SetStyleContext(aPresContext, aStyleContext); - aResult = frame; - return NS_OK; -} - nsresult nsOption::QueryInterface(REFNSIID aIID, void** aInstancePtr) { if (aIID.Equals(kOptionIID)) { diff --git a/mozilla/layout/html/tests/TestInlineFrame.cpp b/mozilla/layout/html/tests/TestInlineFrame.cpp index 7db5ff47bc7..9ed0970edba 100644 --- a/mozilla/layout/html/tests/TestInlineFrame.cpp +++ b/mozilla/layout/html/tests/TestInlineFrame.cpp @@ -82,9 +82,6 @@ public: nscoord aHeight, PRBool aIsSplittable = PR_FALSE); - nsIFrame* CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame); - // Accessors nscoord GetWidth() {return mWidth;} void SetWidth(nscoord aWidth); @@ -162,12 +159,6 @@ FixedSizeContent::FixedSizeContent(nscoord aWidth, mIsSplittable = aIsSplittable; } -nsIFrame* FixedSizeContent::CreateFrame(nsIPresContext* aPresContext, - nsIFrame* aParentFrame) -{ - return new FixedSizeFrame(this, aParentFrame); -} - // Change the width of the content triggering an incremental reflow void FixedSizeContent::SetWidth(nscoord aWidth) {