diff --git a/mozilla/content/base/src/nsRuleNode.cpp b/mozilla/content/base/src/nsRuleNode.cpp index 612034e79d6..fbf4dc04579 100644 --- a/mozilla/content/base/src/nsRuleNode.cpp +++ b/mozilla/content/base/src/nsRuleNode.cpp @@ -2497,7 +2497,7 @@ nsRuleNode::ComputeDisplayData(nsStyleStruct* aStartStruct, display = new (mPresContext) nsStyleDisplay(); const nsStyleDisplay* parentDisplay = display; - nsCOMPtr pseudoTag = aContext->GetPseudoType(); + nsIAtom* pseudoTag = aContext->GetPseudoType(); PRBool generatedContent = (pseudoTag == nsCSSPseudoElements::before || pseudoTag == nsCSSPseudoElements::after); diff --git a/mozilla/content/base/src/nsStyleContext.cpp b/mozilla/content/base/src/nsStyleContext.cpp index 0ffb82d1141..13728180b0f 100644 --- a/mozilla/content/base/src/nsStyleContext.cpp +++ b/mozilla/content/base/src/nsStyleContext.cpp @@ -172,14 +172,6 @@ void nsStyleContext::RemoveChild(nsStyleContext* aChild) aChild->mPrevSibling = aChild; } -already_AddRefed -nsStyleContext::GetPseudoType() const -{ - nsIAtom* pseudoTag = mPseudoTag; - NS_IF_ADDREF(pseudoTag); - return pseudoTag; -} - already_AddRefed nsStyleContext::FindChildWithRules(const nsIAtom* aPseudoTag, nsRuleNode* aRuleNode) diff --git a/mozilla/content/base/src/nsStyleSet.cpp b/mozilla/content/base/src/nsStyleSet.cpp index 574c18128ed..6ee28039168 100644 --- a/mozilla/content/base/src/nsStyleSet.cpp +++ b/mozilla/content/base/src/nsStyleSet.cpp @@ -1478,7 +1478,7 @@ StyleSetImpl::ReParentStyleContext(nsIPresContext* aPresContext, return aStyleContext; } else { // really a new parent - nsCOMPtr pseudoTag = aStyleContext->GetPseudoType(); + nsIAtom* pseudoTag = aStyleContext->GetPseudoType(); nsRuleNode* ruleNode = aStyleContext->GetRuleNode(); EnsureRuleWalker(aPresContext); diff --git a/mozilla/content/shared/public/nsStyleContext.h b/mozilla/content/shared/public/nsStyleContext.h index 3b1c654a1e8..6b63c0298ad 100644 --- a/mozilla/content/shared/public/nsStyleContext.h +++ b/mozilla/content/shared/public/nsStyleContext.h @@ -76,7 +76,7 @@ public: nsStyleContext* GetFirstChild() const { return mChild; } - already_AddRefed GetPseudoType() const; + nsIAtom* GetPseudoType() const { return mPseudoTag; } already_AddRefed FindChildWithRules(const nsIAtom* aPseudoTag, nsRuleNode* aRules); diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index 291358ce15c..3615a494eab 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -1615,8 +1615,7 @@ nsCSSFrameConstructor::CreateGeneratedContentFrame(nsIPresShell* aPresShe InitAndRestoreFrame(aPresContext, aState, aContent, aFrame, pseudoStyleContext, nsnull, containerFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, containerFrame, - pseudoStyleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(containerFrame, nsnull, PR_FALSE); // Mark the frame as being associated with generated content containerFrame->AddStateBits(NS_FRAME_GENERATED_CONTENT); @@ -2534,8 +2533,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresShell* aPresShell, // the frame is absolutely positioned InitAndRestoreFrame(aPresContext, aState, aContent, parentFrame, outerStyleContext, nsnull, aNewOuterFrame); - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewOuterFrame, - outerStyleContext, aContentParent, + nsHTMLContainerFrame::CreateViewForFrame(aNewOuterFrame, aContentParent, PR_FALSE); // Create the inner table frame @@ -2602,8 +2600,7 @@ nsCSSFrameConstructor::ConstructTableCaptionFrame(nsIPresShell* aPres InitAndRestoreFrame(aPresContext, aState, aContent, parentFrame, aStyleContext, nsnull, aNewFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, - aStyleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, nsnull, PR_FALSE); nsFrameItems childItems; // pass in aTableCreator so ProcessChildren will call TableProcessChildren @@ -2665,8 +2662,7 @@ nsCSSFrameConstructor::ConstructTableRowGroupFrame(nsIPresShell* aPre InitAndRestoreFrame(aPresContext, aState, aContent, parentFrame, aStyleContext, nsnull, aNewFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, - aStyleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, nsnull, PR_FALSE); } if (!aIsPseudo) { @@ -2779,8 +2775,7 @@ nsCSSFrameConstructor::ConstructTableRowFrame(nsIPresShell* aPresShel InitAndRestoreFrame(aPresContext, aState, aContent, parentFrame, aStyleContext, nsnull, aNewFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, - aStyleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, nsnull, PR_FALSE); if (!aIsPseudo) { nsFrameItems childItems; nsIFrame* captionFrame; @@ -2910,8 +2905,7 @@ nsCSSFrameConstructor::ConstructTableCellFrame(nsIPresShell* aPresShe InitAndRestoreFrame(aPresContext, aState, aContent, parentFrame, aStyleContext, nsnull, aNewCellOuterFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewCellOuterFrame, - aStyleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(aNewCellOuterFrame, nsnull, PR_FALSE); // Create a block frame that will format the cell's content rv = aTableCreator.CreateTableCellInnerFrame(&aNewCellInnerFrame); @@ -3937,8 +3931,7 @@ nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell* aPresShell, // the pages easier and faster. aPageFrame->Init(aPresContext, nsnull, aParentFrame, pagePseudoStyle, aPrevPageFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - rv = nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aPageFrame, - pagePseudoStyle, nsnull, PR_TRUE); + rv = nsHTMLContainerFrame::CreateViewForFrame(aPageFrame, nsnull, PR_TRUE); if (NS_FAILED(rv)) return NS_ERROR_NULL_POINTER; @@ -3952,8 +3945,7 @@ nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell* aPresShell, // containing block for fixed elements which are repeated on every page. aPageContentFrame->Init(aPresContext, nsnull, aPageFrame, pageContentPseudoStyle, nsnull); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aPageContentFrame, - pageContentPseudoStyle, nsnull, PR_TRUE); + nsHTMLContainerFrame::CreateViewForFrame(aPageContentFrame, nsnull, PR_TRUE); if (NS_FAILED(rv)) return NS_ERROR_NULL_POINTER; mFixedContainingBlock = aPageContentFrame; @@ -4119,8 +4111,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell, InitAndRestoreFrame(aPresContext, aState, aContent, geometricParent, aStyleContext, nsnull, comboboxFrame); - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, comboboxFrame, - aStyleContext, aParentFrame, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(comboboxFrame, aParentFrame, PR_FALSE); /////////////////////////////////////////////////////////////////// // Combobox - Old Native Implementation /////////////////////////////////////////////////////////////////// @@ -4268,8 +4259,8 @@ nsCSSFrameConstructor::InitializeSelectFrame(nsIPresShell* aPresShell, // Initialize the frame scrollFrame->Init(aPresContext, aContent, geometricParent, aStyleContext, nsnull); - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, scrollFrame, - aStyleContext, aParentFrame, aBuildCombobox); + nsHTMLContainerFrame::CreateViewForFrame(scrollFrame, aParentFrame, + aBuildCombobox); if (aBuildCombobox) { // Give the drop-down list a popup widget nsIView* view = scrollFrame->GetView(); @@ -4394,8 +4385,7 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsIPresShell* aPresShel // See if we need to create a view, e.g. the frame is absolutely // positioned - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, aParentFrame, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, aParentFrame, PR_FALSE); nsIFrame* areaFrame; NS_NewAreaFrame(shell, &areaFrame, NS_BLOCK_SPACE_MGR | NS_BLOCK_SHRINK_WRAP); @@ -4825,8 +4815,7 @@ nsCSSFrameConstructor::ConstructHTMLFrame(nsIPresShell* aPresShell, NS_ASSERTION(NS_SUCCEEDED(rv), "InitAndRestoreFrame failed"); // See if we need to create a view, e.g. the frame is absolutely // positioned - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, aParentFrame, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, aParentFrame, PR_FALSE); // Process the child content if requested nsFrameItems childItems; @@ -5720,8 +5709,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell, (frameType.get() == nsLayoutAtoms::areaFrame)) { */ // See if we need to create a view, e.g. the frame is absolutely positioned - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, aParentFrame, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, aParentFrame, PR_FALSE); /* } else { @@ -5878,8 +5866,8 @@ nsCSSFrameConstructor::BeginBuildingScrollFrame(nsIPresShell* aPresSh aParentFrame, contentStyle, nsnull, gfxScrollFrame); // Create a view - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, gfxScrollFrame, - contentStyle, aContentParentFrame, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(gfxScrollFrame, + aContentParentFrame, PR_FALSE); } InitGfxScrollFrame(aPresShell, aPresContext, aState, aContent, aDocument, @@ -5931,8 +5919,7 @@ nsCSSFrameConstructor::FinishBuildingScrollFrame(nsIPresContext* aPresConte { // create a view // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aScrolledFrame, - aScrolledContentStyle, nsnull, PR_TRUE); + nsHTMLContainerFrame::CreateViewForFrame(aScrolledFrame, nsnull, PR_TRUE); // the the scroll frames child list aScrollFrame->SetInitialChildList(aPresContext, nsnull, aScrolledFrame); @@ -6256,8 +6243,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresShell* aPre aStyleContext, nsnull, newFrame); // Create a view - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, adjParentFrame, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, adjParentFrame, PR_FALSE); // Process the child content. The area frame becomes a container for child // frames that are absolutely positioned @@ -6620,8 +6606,7 @@ nsCSSFrameConstructor::ResolveStyleContext(nsIPresContext* aPresContext, // skip past any parents that are scrolled-content. We want to inherit directly // from the outer scroll frame. - nsCOMPtr pseudo; - while (parentStyleContext && (pseudo = parentStyleContext->GetPseudoType()) == + while (parentStyleContext && parentStyleContext->GetPseudoType() == nsCSSAnonBoxes::scrolledContent) { parentStyleContext = parentStyleContext->GetParent(); } @@ -6819,8 +6804,7 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsIPresShell* aPresShell, geometricParent, aStyleContext, nsnull, newFrame); // See if we need to create a view, e.g. the frame is absolutely positioned - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, aParentFrame, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, aParentFrame, PR_FALSE); // Process the child content if requested nsFrameItems childItems; @@ -6958,9 +6942,7 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsIPresShell* aPresShell, InitAndRestoreFrame(aPresContext, aState, aContent, geometricParent, aStyleContext, nsnull, newFrame); - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, aParentFrame, - forceView); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, aParentFrame, forceView); // Add the new frame to our list of frame items. aFrameItems.AddChild(newFrame); @@ -10425,8 +10407,7 @@ nsCSSFrameConstructor::ConstructAlternateFrame(nsIPresShell* aPresShell, NS_NewInlineFrame(aPresShell, &containerFrame); } containerFrame->Init(aPresContext, aContent, aGeometricParent, aStyleContext, nsnull); - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, containerFrame, - aStyleContext, aContentParent, + nsHTMLContainerFrame::CreateViewForFrame(containerFrame, aContentParent, PR_FALSE); // If the frame is out-of-flow, then mark it as such @@ -10746,8 +10727,7 @@ nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, aContent, aParentFrame, aStyleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); // Create a continuing inner table frame, and if there's a caption then // replicate the caption @@ -10826,8 +10806,7 @@ nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, aContent, aParentFrame, aStyleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); // Replicate any header/footer frames nsIFrame* rowGroupFrame; @@ -10908,8 +10887,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::inlineFrame == frameType) { @@ -10917,8 +10895,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::blockFrame == frameType) { @@ -10926,8 +10903,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::areaFrame == frameType) { @@ -10936,8 +10912,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::positionedInlineFrame == frameType) { @@ -10945,8 +10920,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::pageFrame == frameType) { @@ -10966,8 +10940,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::tableRowFrame == frameType) { @@ -10975,8 +10948,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); // Create a continuing frame for each table cell frame nsIFrame* cellFrame; @@ -11008,8 +10980,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); // Create a continuing area frame nsIFrame* areaFrame; @@ -11026,8 +10997,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::letterFrame == frameType) { @@ -11035,8 +11005,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::imageFrame == frameType) { @@ -12781,8 +12750,7 @@ nsCSSFrameConstructor::ConstructBlock(nsIPresShell* aPresShell, aParentFrame, aStyleContext, nsnull, aNewFrame); // See if we need to create a view, e.g. the frame is absolutely positioned - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, - aStyleContext, aContentParentFrame, + nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, aContentParentFrame, PR_FALSE); // If we're the first block to be created (e.g., because we're @@ -12872,8 +12840,7 @@ nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell, // Any inline frame might need a view (because of opacity, or fixed background) // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, - aStyleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, nsnull, PR_FALSE); if (aIsPositioned) { // Relatively positioned frames becomes a container for child @@ -12983,8 +12950,7 @@ nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell, // Any inline frame could have a view (e.g., opacity) // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, blockFrame, - aStyleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(blockFrame, nsnull, PR_FALSE); if (blockFrame->HasView() || aNewFrame->HasView()) { // Move list2's frames into the new view @@ -13016,8 +12982,7 @@ nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell, // Any frame might need a view // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, inlineFrame, - aStyleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(inlineFrame, nsnull, PR_FALSE); if (inlineFrame->HasView() || aNewFrame->HasView()) { // Move list3's frames into the new view @@ -13408,11 +13373,11 @@ nsCSSFrameConstructor::SplitToContainingBlock(nsIPresContext* aPresContext, // If aLeftInlineChild has a view... if (aLeftInlineChildFrame && aLeftInlineChildFrame->HasView()) { // ...create a new view for the block child, and reparent views - nsStyleContext* sc = aLeftInlineChildFrame->GetStyleContext(); - // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aBlockChildFrame, - sc, nsnull, PR_FALSE); + // force creation of a view; it'll probably need one anyway since it + // has the same style context, and it's easier to think about if we can + // be sure the left inlines, the block and the right inlines all have a view + nsHTMLContainerFrame::CreateViewForFrame(aBlockChildFrame, nsnull, PR_TRUE); nsIFrame* frame; aBlockChildFrame->FirstChild(aPresContext, nsnull, &frame); @@ -13421,8 +13386,7 @@ nsCSSFrameConstructor::SplitToContainingBlock(nsIPresContext* aPresContext, if (aRightInlineChildFrame) { // Same for the right inline children // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aRightInlineChildFrame, - sc, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(aRightInlineChildFrame, nsnull, PR_TRUE); aRightInlineChildFrame->FirstChild(aPresContext, nsnull, &frame); nsHTMLContainerFrame::ReparentFrameViewList(aPresContext, frame, aLeftInlineChildFrame, aRightInlineChildFrame); diff --git a/mozilla/layout/base/nsFrameManager.cpp b/mozilla/layout/base/nsFrameManager.cpp index c74f9f30bf8..fc190e59679 100644 --- a/mozilla/layout/base/nsFrameManager.cpp +++ b/mozilla/layout/base/nsFrameManager.cpp @@ -1297,7 +1297,7 @@ DumpContext(nsIFrame* aFrame, nsStyleContext* aContext) if (aContext) { fprintf(stdout, " style: %p ", NS_STATIC_CAST(void*, aContext)); - nsCOMPtr pseudoTag = aContext->GetPseudoType(); + nsIAtom* pseudoTag = aContext->GetPseudoType(); if (pseudoTag) { nsAutoString buffer; pseudoTag->ToString(buffer); @@ -1636,7 +1636,7 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext, if (oldContext) { oldContext->AddRef(); - nsCOMPtr pseudoTag = oldContext->GetPseudoType(); + nsIAtom* pseudoTag = oldContext->GetPseudoType(); nsIContent* localContent = aFrame->GetContent(); nsIContent* content = localContent ? localContent : aParentContent; diff --git a/mozilla/layout/base/nsLayoutUtils.cpp b/mozilla/layout/base/nsLayoutUtils.cpp index ff445a28866..0887594c4fe 100644 --- a/mozilla/layout/base/nsLayoutUtils.cpp +++ b/mozilla/layout/base/nsLayoutUtils.cpp @@ -195,9 +195,7 @@ nsLayoutUtils::IsGeneratedContentFor(nsIContent* aContent, return PR_FALSE; } - nsStyleContext* styleContext = aFrame->GetStyleContext(); - nsCOMPtr pseudoType = styleContext->GetPseudoType(); - return pseudoType == aPseudoElement; + return aFrame->GetStyleContext()->GetPseudoType() == aPseudoElement; } // static diff --git a/mozilla/layout/base/src/nsLayoutUtils.cpp b/mozilla/layout/base/src/nsLayoutUtils.cpp index ff445a28866..0887594c4fe 100644 --- a/mozilla/layout/base/src/nsLayoutUtils.cpp +++ b/mozilla/layout/base/src/nsLayoutUtils.cpp @@ -195,9 +195,7 @@ nsLayoutUtils::IsGeneratedContentFor(nsIContent* aContent, return PR_FALSE; } - nsStyleContext* styleContext = aFrame->GetStyleContext(); - nsCOMPtr pseudoType = styleContext->GetPseudoType(); - return pseudoType == aPseudoElement; + return aFrame->GetStyleContext()->GetPseudoType() == aPseudoElement; } // static diff --git a/mozilla/layout/generic/nsContainerFrame.cpp b/mozilla/layout/generic/nsContainerFrame.cpp index 63edc97b5b9..034df75ae2e 100644 --- a/mozilla/layout/generic/nsContainerFrame.cpp +++ b/mozilla/layout/generic/nsContainerFrame.cpp @@ -548,8 +548,6 @@ SyncFrameViewGeometryDependentProperties(nsIPresContext* aPresContext, // view's contents should be repainted and not bitblt'd vm->SetViewBitBltEnabled(aView, !fixedBackground); - nsCOMPtr pseudo = aFrame->GetStyleContext()->GetPseudoType(); - // If the frame has a solid background color, 'background-clip:border', // and it's a kind of frame that paints its background, and rounded borders aren't // clipping the background, then it's opaque. @@ -560,15 +558,14 @@ SyncFrameViewGeometryDependentProperties(nsIPresContext* aPresContext, !HasNonZeroBorderRadius(aStyleContext)); PRBool drawnOnUniformField = PR_FALSE; - if (pseudo == nsCSSAnonBoxes::scrolledContent) { + if (aStyleContext->GetPseudoType() == nsCSSAnonBoxes::scrolledContent) { // If the nsGfxScrollFrame draws a solid unclipped background // color, and nothing else, then tell the view system that we're // drawn on a uniform field. Note that it's OK if the background // is clipped to the padding area, since the scrollport is within // the borders. nsIFrame* scrollFrame = aFrame->GetParent(); - nsCOMPtr parentPseudo; - while ((parentPseudo = scrollFrame->GetStyleContext()->GetPseudoType()) + while (scrollFrame->GetStyleContext()->GetPseudoType() == nsCSSAnonBoxes::scrolledContent) { scrollFrame = scrollFrame->GetParent(); } @@ -769,6 +766,9 @@ nsContainerFrame::SyncFrameViewAfterSizeChange(nsIPresContext* aPresContext, nsIView* aView, PRUint32 aFlags) { + NS_ASSERTION(!aStyleContext || aFrame->GetStyleContext() == aStyleContext, + "Wrong style context for frame?"); + if (!aView) { return; } @@ -787,6 +787,9 @@ nsContainerFrame::SyncFrameViewProperties(nsIPresContext* aPresContext, nsIView* aView, PRUint32 aFlags) { + NS_ASSERTION(!aStyleContext || aFrame->GetStyleContext() == aStyleContext, + "Wrong style context for frame?"); + if (!aView) { return; } @@ -856,11 +859,10 @@ nsContainerFrame::SyncFrameViewProperties(nsIPresContext* aPresContext, } PRBool -nsContainerFrame::FrameNeedsView(nsIPresContext* aPresContext, - nsIFrame* aFrame, - nsStyleContext* aStyleContext) +nsContainerFrame::FrameNeedsView(nsIFrame* aFrame) { - const nsStyleVisibility* vis = aStyleContext->GetStyleVisibility(); + nsStyleContext* sc = aFrame->GetStyleContext(); + const nsStyleVisibility* vis = sc->GetStyleVisibility(); if (vis->mOpacity != 1.0f) { return PR_TRUE; @@ -870,13 +872,14 @@ nsContainerFrame::FrameNeedsView(nsIPresContext* aPresContext, const nsStyleBackground *color; PRBool isCanvas; PRBool hasBackground = - nsCSSRendering::FindBackground(aPresContext, aFrame, &color, &isCanvas); + nsCSSRendering::FindBackground(aFrame->GetPresContext(), + aFrame, &color, &isCanvas); if (hasBackground && NS_STYLE_BG_ATTACHMENT_FIXED == color->mBackgroundAttachment) { return PR_TRUE; } - const nsStyleDisplay* display = aStyleContext->GetStyleDisplay(); + const nsStyleDisplay* display = sc->GetStyleDisplay(); if (NS_STYLE_POSITION_RELATIVE == display->mPosition) { return PR_TRUE; @@ -884,8 +887,7 @@ nsContainerFrame::FrameNeedsView(nsIPresContext* aPresContext, return PR_TRUE; } - nsCOMPtr pseudoTag = aStyleContext->GetPseudoType(); - if (pseudoTag == nsCSSAnonBoxes::scrolledContent) { + if (sc->GetPseudoType() == nsCSSAnonBoxes::scrolledContent) { return PR_TRUE; } diff --git a/mozilla/layout/generic/nsContainerFrame.h b/mozilla/layout/generic/nsContainerFrame.h index 3a7d09a6cba..0324bf18380 100644 --- a/mozilla/layout/generic/nsContainerFrame.h +++ b/mozilla/layout/generic/nsContainerFrame.h @@ -138,8 +138,7 @@ public: PRUint32 aFlags = 0); // Returns PR_TRUE if the frame requires a view - static PRBool FrameNeedsView(nsIPresContext* aPresContext, - nsIFrame* aFrame, nsStyleContext* aStyleContext); + static PRBool FrameNeedsView(nsIFrame* aFrame); /** * Invokes the WillReflow() function, positions the frame and its view (if diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index 5d03661ddd3..d661ecdffc2 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -4448,10 +4448,10 @@ GetCorrectedParent(nsIPresContext* aPresContext, nsIFrame* aFrame, nsIFrame *parent = aFrame->GetParent(); *aSpecialParent = parent; if (parent) { - nsCOMPtr parentPseudo = parent->GetStyleContext()->GetPseudoType(); + nsIAtom* parentPseudo = parent->GetStyleContext()->GetPseudoType(); if (parentPseudo == nsCSSAnonBoxes::mozGCWrapperBlock || parentPseudo == nsCSSAnonBoxes::mozGCWrapperInline) { - nsCOMPtr pseudo = aFrame->GetStyleContext()->GetPseudoType(); + nsIAtom* pseudo = aFrame->GetStyleContext()->GetPseudoType(); if (pseudo == nsCSSPseudoElements::before) { // Use the wrapped frame, which is after the |:before|. parent = GetNextSiblingAcrossLines(aPresContext, aFrame); @@ -4459,7 +4459,7 @@ GetCorrectedParent(nsIPresContext* aPresContext, nsIFrame* aFrame, parent->GetFirstInFlow()->FirstChild(aPresContext, nsnull, &parent); // Now we have either the wrapped frame or the :before, but we // want the wrapped frame. - if (nsCOMPtr(parent->GetStyleContext()->GetPseudoType()) == + if (parent->GetStyleContext()->GetPseudoType() == nsCSSPseudoElements::before) parent = GetNextSiblingAcrossLines(aPresContext, parent); } else { @@ -4471,7 +4471,7 @@ GetCorrectedParent(nsIPresContext* aPresContext, nsIFrame* aFrame, // if this frame itself is not scrolled-content, then skip any scrolled-content // parents since they're basically anonymous as far as the style system goes if (parentPseudo == nsCSSAnonBoxes::scrolledContent) { - nsCOMPtr pseudo = aFrame->GetStyleContext()->GetPseudoType(); + nsIAtom* pseudo = aFrame->GetStyleContext()->GetPseudoType(); if (pseudo != nsCSSAnonBoxes::scrolledContent) { do { parent = parent->GetParent(); diff --git a/mozilla/layout/generic/nsFrameFrame.cpp b/mozilla/layout/generic/nsFrameFrame.cpp index 3d194fabf1a..f7b44b5abfd 100644 --- a/mozilla/layout/generic/nsFrameFrame.cpp +++ b/mozilla/layout/generic/nsFrameFrame.cpp @@ -394,7 +394,7 @@ nsHTMLFrameOuterFrame::Init(nsIPresContext* aPresContext, } } - nsHTMLContainerFrame::CreateViewForFrame(aPresContext,this,mStyleContext,contentParent,PR_TRUE); + nsHTMLContainerFrame::CreateViewForFrame(this, contentParent, PR_TRUE); } nsIView* view = GetView(); diff --git a/mozilla/layout/generic/nsHTMLContainerFrame.cpp b/mozilla/layout/generic/nsHTMLContainerFrame.cpp index c8cb88396af..c13a4136923 100644 --- a/mozilla/layout/generic/nsHTMLContainerFrame.cpp +++ b/mozilla/layout/generic/nsHTMLContainerFrame.cpp @@ -538,9 +538,7 @@ nsHTMLContainerFrame::ReparentFrameViewList(nsIPresContext* aPresContext, } nsresult -nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, - nsIFrame* aFrame, - nsStyleContext* aStyleContext, +nsHTMLContainerFrame::CreateViewForFrame(nsIFrame* aFrame, nsIFrame* aContentParentFrame, PRBool aForce) { @@ -549,7 +547,7 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, } // If we don't yet have a view, see if we need a view - if (!(aForce || FrameNeedsView(aPresContext, aFrame, aStyleContext))) { + if (!(aForce || FrameNeedsView(aFrame))) { // don't need a view return NS_OK; } @@ -575,7 +573,7 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, // Initialize the view view->Init(viewManager, aFrame->GetRect(), parentView); - SyncFrameViewProperties(aPresContext, aFrame, aStyleContext, view); + SyncFrameViewProperties(aFrame->GetPresContext(), aFrame, nsnull, view); // Insert the view into the view hierarchy. If the parent view is a // scrolling view we need to do this differently @@ -600,7 +598,7 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, // XXX If it's fixed positioned, then create a widget so it floats // above the scrolling area - const nsStyleDisplay* display = aStyleContext->GetStyleDisplay(); + const nsStyleDisplay* display = aFrame->GetStyleContext()->GetStyleDisplay(); if (NS_STYLE_POSITION_FIXED == display->mPosition) { view->CreateWidget(kCChildCID); } diff --git a/mozilla/layout/generic/nsHTMLContainerFrame.h b/mozilla/layout/generic/nsHTMLContainerFrame.h index 5f56b776196..0e5a2636b1b 100644 --- a/mozilla/layout/generic/nsHTMLContainerFrame.h +++ b/mozilla/layout/generic/nsHTMLContainerFrame.h @@ -92,9 +92,7 @@ public: * so that aFrame can remember to get its Z-order from * aContentParentFrame. */ - static nsresult CreateViewForFrame(nsIPresContext* aPresContext, - nsIFrame* aFrame, - nsStyleContext* aStyleContext, + static nsresult CreateViewForFrame(nsIFrame* aFrame, nsIFrame* aContentParentFrame, PRBool aForce); diff --git a/mozilla/layout/generic/nsHTMLReflowState.cpp b/mozilla/layout/generic/nsHTMLReflowState.cpp index 6df44ae3619..cf35680e6f7 100644 --- a/mozilla/layout/generic/nsHTMLReflowState.cpp +++ b/mozilla/layout/generic/nsHTMLReflowState.cpp @@ -1392,8 +1392,8 @@ CalcQuirkContainingBlockHeight(const nsHTMLReflowState& aReflowState, nsLayoutAtoms::areaFrame == frameType || nsLayoutAtoms::scrollFrame == frameType) { if (nsLayoutAtoms::areaFrame == frameType) { - nsCOMPtr pseudo = rs->frame->GetStyleContext()->GetPseudoType(); - if (pseudo == nsCSSAnonBoxes::scrolledContent) { + if (rs->frame->GetStyleContext()->GetPseudoType() == + nsCSSAnonBoxes::scrolledContent) { continue; } } diff --git a/mozilla/layout/generic/nsObjectFrame.cpp b/mozilla/layout/generic/nsObjectFrame.cpp index 44e1d03bfe2..1fe6fdf9b6b 100644 --- a/mozilla/layout/generic/nsObjectFrame.cpp +++ b/mozilla/layout/generic/nsObjectFrame.cpp @@ -660,7 +660,7 @@ nsObjectFrame::Init(nsIPresContext* aPresContext, rv = aNewFrame->Init(aPresContext, aContent, this, aContext, aPrevInFlow); if (NS_SUCCEEDED(rv)) { - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, aContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, nsnull, PR_FALSE); mFrames.AppendFrame(this, aNewFrame); } else @@ -694,7 +694,7 @@ nsObjectFrame::Init(nsIPresContext* aPresContext, rv = aNewFrame->Init(aPresContext, aContent, this, aContext, aPrevInFlow); if(NS_SUCCEEDED(rv)) { - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, aContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, nsnull, PR_FALSE); mFrames.AppendFrame(this, aNewFrame); } else diff --git a/mozilla/layout/html/base/src/nsContainerFrame.cpp b/mozilla/layout/html/base/src/nsContainerFrame.cpp index 63edc97b5b9..034df75ae2e 100644 --- a/mozilla/layout/html/base/src/nsContainerFrame.cpp +++ b/mozilla/layout/html/base/src/nsContainerFrame.cpp @@ -548,8 +548,6 @@ SyncFrameViewGeometryDependentProperties(nsIPresContext* aPresContext, // view's contents should be repainted and not bitblt'd vm->SetViewBitBltEnabled(aView, !fixedBackground); - nsCOMPtr pseudo = aFrame->GetStyleContext()->GetPseudoType(); - // If the frame has a solid background color, 'background-clip:border', // and it's a kind of frame that paints its background, and rounded borders aren't // clipping the background, then it's opaque. @@ -560,15 +558,14 @@ SyncFrameViewGeometryDependentProperties(nsIPresContext* aPresContext, !HasNonZeroBorderRadius(aStyleContext)); PRBool drawnOnUniformField = PR_FALSE; - if (pseudo == nsCSSAnonBoxes::scrolledContent) { + if (aStyleContext->GetPseudoType() == nsCSSAnonBoxes::scrolledContent) { // If the nsGfxScrollFrame draws a solid unclipped background // color, and nothing else, then tell the view system that we're // drawn on a uniform field. Note that it's OK if the background // is clipped to the padding area, since the scrollport is within // the borders. nsIFrame* scrollFrame = aFrame->GetParent(); - nsCOMPtr parentPseudo; - while ((parentPseudo = scrollFrame->GetStyleContext()->GetPseudoType()) + while (scrollFrame->GetStyleContext()->GetPseudoType() == nsCSSAnonBoxes::scrolledContent) { scrollFrame = scrollFrame->GetParent(); } @@ -769,6 +766,9 @@ nsContainerFrame::SyncFrameViewAfterSizeChange(nsIPresContext* aPresContext, nsIView* aView, PRUint32 aFlags) { + NS_ASSERTION(!aStyleContext || aFrame->GetStyleContext() == aStyleContext, + "Wrong style context for frame?"); + if (!aView) { return; } @@ -787,6 +787,9 @@ nsContainerFrame::SyncFrameViewProperties(nsIPresContext* aPresContext, nsIView* aView, PRUint32 aFlags) { + NS_ASSERTION(!aStyleContext || aFrame->GetStyleContext() == aStyleContext, + "Wrong style context for frame?"); + if (!aView) { return; } @@ -856,11 +859,10 @@ nsContainerFrame::SyncFrameViewProperties(nsIPresContext* aPresContext, } PRBool -nsContainerFrame::FrameNeedsView(nsIPresContext* aPresContext, - nsIFrame* aFrame, - nsStyleContext* aStyleContext) +nsContainerFrame::FrameNeedsView(nsIFrame* aFrame) { - const nsStyleVisibility* vis = aStyleContext->GetStyleVisibility(); + nsStyleContext* sc = aFrame->GetStyleContext(); + const nsStyleVisibility* vis = sc->GetStyleVisibility(); if (vis->mOpacity != 1.0f) { return PR_TRUE; @@ -870,13 +872,14 @@ nsContainerFrame::FrameNeedsView(nsIPresContext* aPresContext, const nsStyleBackground *color; PRBool isCanvas; PRBool hasBackground = - nsCSSRendering::FindBackground(aPresContext, aFrame, &color, &isCanvas); + nsCSSRendering::FindBackground(aFrame->GetPresContext(), + aFrame, &color, &isCanvas); if (hasBackground && NS_STYLE_BG_ATTACHMENT_FIXED == color->mBackgroundAttachment) { return PR_TRUE; } - const nsStyleDisplay* display = aStyleContext->GetStyleDisplay(); + const nsStyleDisplay* display = sc->GetStyleDisplay(); if (NS_STYLE_POSITION_RELATIVE == display->mPosition) { return PR_TRUE; @@ -884,8 +887,7 @@ nsContainerFrame::FrameNeedsView(nsIPresContext* aPresContext, return PR_TRUE; } - nsCOMPtr pseudoTag = aStyleContext->GetPseudoType(); - if (pseudoTag == nsCSSAnonBoxes::scrolledContent) { + if (sc->GetPseudoType() == nsCSSAnonBoxes::scrolledContent) { return PR_TRUE; } diff --git a/mozilla/layout/html/base/src/nsContainerFrame.h b/mozilla/layout/html/base/src/nsContainerFrame.h index 3a7d09a6cba..0324bf18380 100644 --- a/mozilla/layout/html/base/src/nsContainerFrame.h +++ b/mozilla/layout/html/base/src/nsContainerFrame.h @@ -138,8 +138,7 @@ public: PRUint32 aFlags = 0); // Returns PR_TRUE if the frame requires a view - static PRBool FrameNeedsView(nsIPresContext* aPresContext, - nsIFrame* aFrame, nsStyleContext* aStyleContext); + static PRBool FrameNeedsView(nsIFrame* aFrame); /** * Invokes the WillReflow() function, positions the frame and its view (if diff --git a/mozilla/layout/html/base/src/nsFrame.cpp b/mozilla/layout/html/base/src/nsFrame.cpp index 5d03661ddd3..d661ecdffc2 100644 --- a/mozilla/layout/html/base/src/nsFrame.cpp +++ b/mozilla/layout/html/base/src/nsFrame.cpp @@ -4448,10 +4448,10 @@ GetCorrectedParent(nsIPresContext* aPresContext, nsIFrame* aFrame, nsIFrame *parent = aFrame->GetParent(); *aSpecialParent = parent; if (parent) { - nsCOMPtr parentPseudo = parent->GetStyleContext()->GetPseudoType(); + nsIAtom* parentPseudo = parent->GetStyleContext()->GetPseudoType(); if (parentPseudo == nsCSSAnonBoxes::mozGCWrapperBlock || parentPseudo == nsCSSAnonBoxes::mozGCWrapperInline) { - nsCOMPtr pseudo = aFrame->GetStyleContext()->GetPseudoType(); + nsIAtom* pseudo = aFrame->GetStyleContext()->GetPseudoType(); if (pseudo == nsCSSPseudoElements::before) { // Use the wrapped frame, which is after the |:before|. parent = GetNextSiblingAcrossLines(aPresContext, aFrame); @@ -4459,7 +4459,7 @@ GetCorrectedParent(nsIPresContext* aPresContext, nsIFrame* aFrame, parent->GetFirstInFlow()->FirstChild(aPresContext, nsnull, &parent); // Now we have either the wrapped frame or the :before, but we // want the wrapped frame. - if (nsCOMPtr(parent->GetStyleContext()->GetPseudoType()) == + if (parent->GetStyleContext()->GetPseudoType() == nsCSSPseudoElements::before) parent = GetNextSiblingAcrossLines(aPresContext, parent); } else { @@ -4471,7 +4471,7 @@ GetCorrectedParent(nsIPresContext* aPresContext, nsIFrame* aFrame, // if this frame itself is not scrolled-content, then skip any scrolled-content // parents since they're basically anonymous as far as the style system goes if (parentPseudo == nsCSSAnonBoxes::scrolledContent) { - nsCOMPtr pseudo = aFrame->GetStyleContext()->GetPseudoType(); + nsIAtom* pseudo = aFrame->GetStyleContext()->GetPseudoType(); if (pseudo != nsCSSAnonBoxes::scrolledContent) { do { parent = parent->GetParent(); diff --git a/mozilla/layout/html/base/src/nsFrameManager.cpp b/mozilla/layout/html/base/src/nsFrameManager.cpp index c74f9f30bf8..fc190e59679 100644 --- a/mozilla/layout/html/base/src/nsFrameManager.cpp +++ b/mozilla/layout/html/base/src/nsFrameManager.cpp @@ -1297,7 +1297,7 @@ DumpContext(nsIFrame* aFrame, nsStyleContext* aContext) if (aContext) { fprintf(stdout, " style: %p ", NS_STATIC_CAST(void*, aContext)); - nsCOMPtr pseudoTag = aContext->GetPseudoType(); + nsIAtom* pseudoTag = aContext->GetPseudoType(); if (pseudoTag) { nsAutoString buffer; pseudoTag->ToString(buffer); @@ -1636,7 +1636,7 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext, if (oldContext) { oldContext->AddRef(); - nsCOMPtr pseudoTag = oldContext->GetPseudoType(); + nsIAtom* pseudoTag = oldContext->GetPseudoType(); nsIContent* localContent = aFrame->GetContent(); nsIContent* content = localContent ? localContent : aParentContent; diff --git a/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp b/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp index c8cb88396af..c13a4136923 100644 --- a/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp +++ b/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp @@ -538,9 +538,7 @@ nsHTMLContainerFrame::ReparentFrameViewList(nsIPresContext* aPresContext, } nsresult -nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, - nsIFrame* aFrame, - nsStyleContext* aStyleContext, +nsHTMLContainerFrame::CreateViewForFrame(nsIFrame* aFrame, nsIFrame* aContentParentFrame, PRBool aForce) { @@ -549,7 +547,7 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, } // If we don't yet have a view, see if we need a view - if (!(aForce || FrameNeedsView(aPresContext, aFrame, aStyleContext))) { + if (!(aForce || FrameNeedsView(aFrame))) { // don't need a view return NS_OK; } @@ -575,7 +573,7 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, // Initialize the view view->Init(viewManager, aFrame->GetRect(), parentView); - SyncFrameViewProperties(aPresContext, aFrame, aStyleContext, view); + SyncFrameViewProperties(aFrame->GetPresContext(), aFrame, nsnull, view); // Insert the view into the view hierarchy. If the parent view is a // scrolling view we need to do this differently @@ -600,7 +598,7 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext* aPresContext, // XXX If it's fixed positioned, then create a widget so it floats // above the scrolling area - const nsStyleDisplay* display = aStyleContext->GetStyleDisplay(); + const nsStyleDisplay* display = aFrame->GetStyleContext()->GetStyleDisplay(); if (NS_STYLE_POSITION_FIXED == display->mPosition) { view->CreateWidget(kCChildCID); } diff --git a/mozilla/layout/html/base/src/nsHTMLContainerFrame.h b/mozilla/layout/html/base/src/nsHTMLContainerFrame.h index 5f56b776196..0e5a2636b1b 100644 --- a/mozilla/layout/html/base/src/nsHTMLContainerFrame.h +++ b/mozilla/layout/html/base/src/nsHTMLContainerFrame.h @@ -92,9 +92,7 @@ public: * so that aFrame can remember to get its Z-order from * aContentParentFrame. */ - static nsresult CreateViewForFrame(nsIPresContext* aPresContext, - nsIFrame* aFrame, - nsStyleContext* aStyleContext, + static nsresult CreateViewForFrame(nsIFrame* aFrame, nsIFrame* aContentParentFrame, PRBool aForce); diff --git a/mozilla/layout/html/base/src/nsHTMLReflowState.cpp b/mozilla/layout/html/base/src/nsHTMLReflowState.cpp index 6df44ae3619..cf35680e6f7 100644 --- a/mozilla/layout/html/base/src/nsHTMLReflowState.cpp +++ b/mozilla/layout/html/base/src/nsHTMLReflowState.cpp @@ -1392,8 +1392,8 @@ CalcQuirkContainingBlockHeight(const nsHTMLReflowState& aReflowState, nsLayoutAtoms::areaFrame == frameType || nsLayoutAtoms::scrollFrame == frameType) { if (nsLayoutAtoms::areaFrame == frameType) { - nsCOMPtr pseudo = rs->frame->GetStyleContext()->GetPseudoType(); - if (pseudo == nsCSSAnonBoxes::scrolledContent) { + if (rs->frame->GetStyleContext()->GetPseudoType() == + nsCSSAnonBoxes::scrolledContent) { continue; } } diff --git a/mozilla/layout/html/base/src/nsObjectFrame.cpp b/mozilla/layout/html/base/src/nsObjectFrame.cpp index 44e1d03bfe2..1fe6fdf9b6b 100644 --- a/mozilla/layout/html/base/src/nsObjectFrame.cpp +++ b/mozilla/layout/html/base/src/nsObjectFrame.cpp @@ -660,7 +660,7 @@ nsObjectFrame::Init(nsIPresContext* aPresContext, rv = aNewFrame->Init(aPresContext, aContent, this, aContext, aPrevInFlow); if (NS_SUCCEEDED(rv)) { - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, aContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, nsnull, PR_FALSE); mFrames.AppendFrame(this, aNewFrame); } else @@ -694,7 +694,7 @@ nsObjectFrame::Init(nsIPresContext* aPresContext, rv = aNewFrame->Init(aPresContext, aContent, this, aContext, aPrevInFlow); if(NS_SUCCEEDED(rv)) { - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, aContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, nsnull, PR_FALSE); mFrames.AppendFrame(this, aNewFrame); } else diff --git a/mozilla/layout/html/document/src/nsFrameFrame.cpp b/mozilla/layout/html/document/src/nsFrameFrame.cpp index 3d194fabf1a..f7b44b5abfd 100644 --- a/mozilla/layout/html/document/src/nsFrameFrame.cpp +++ b/mozilla/layout/html/document/src/nsFrameFrame.cpp @@ -394,7 +394,7 @@ nsHTMLFrameOuterFrame::Init(nsIPresContext* aPresContext, } } - nsHTMLContainerFrame::CreateViewForFrame(aPresContext,this,mStyleContext,contentParent,PR_TRUE); + nsHTMLContainerFrame::CreateViewForFrame(this, contentParent, PR_TRUE); } nsIView* view = GetView(); diff --git a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp index 291358ce15c..3615a494eab 100644 --- a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -1615,8 +1615,7 @@ nsCSSFrameConstructor::CreateGeneratedContentFrame(nsIPresShell* aPresShe InitAndRestoreFrame(aPresContext, aState, aContent, aFrame, pseudoStyleContext, nsnull, containerFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, containerFrame, - pseudoStyleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(containerFrame, nsnull, PR_FALSE); // Mark the frame as being associated with generated content containerFrame->AddStateBits(NS_FRAME_GENERATED_CONTENT); @@ -2534,8 +2533,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresShell* aPresShell, // the frame is absolutely positioned InitAndRestoreFrame(aPresContext, aState, aContent, parentFrame, outerStyleContext, nsnull, aNewOuterFrame); - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewOuterFrame, - outerStyleContext, aContentParent, + nsHTMLContainerFrame::CreateViewForFrame(aNewOuterFrame, aContentParent, PR_FALSE); // Create the inner table frame @@ -2602,8 +2600,7 @@ nsCSSFrameConstructor::ConstructTableCaptionFrame(nsIPresShell* aPres InitAndRestoreFrame(aPresContext, aState, aContent, parentFrame, aStyleContext, nsnull, aNewFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, - aStyleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, nsnull, PR_FALSE); nsFrameItems childItems; // pass in aTableCreator so ProcessChildren will call TableProcessChildren @@ -2665,8 +2662,7 @@ nsCSSFrameConstructor::ConstructTableRowGroupFrame(nsIPresShell* aPre InitAndRestoreFrame(aPresContext, aState, aContent, parentFrame, aStyleContext, nsnull, aNewFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, - aStyleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, nsnull, PR_FALSE); } if (!aIsPseudo) { @@ -2779,8 +2775,7 @@ nsCSSFrameConstructor::ConstructTableRowFrame(nsIPresShell* aPresShel InitAndRestoreFrame(aPresContext, aState, aContent, parentFrame, aStyleContext, nsnull, aNewFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, - aStyleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, nsnull, PR_FALSE); if (!aIsPseudo) { nsFrameItems childItems; nsIFrame* captionFrame; @@ -2910,8 +2905,7 @@ nsCSSFrameConstructor::ConstructTableCellFrame(nsIPresShell* aPresShe InitAndRestoreFrame(aPresContext, aState, aContent, parentFrame, aStyleContext, nsnull, aNewCellOuterFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewCellOuterFrame, - aStyleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(aNewCellOuterFrame, nsnull, PR_FALSE); // Create a block frame that will format the cell's content rv = aTableCreator.CreateTableCellInnerFrame(&aNewCellInnerFrame); @@ -3937,8 +3931,7 @@ nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell* aPresShell, // the pages easier and faster. aPageFrame->Init(aPresContext, nsnull, aParentFrame, pagePseudoStyle, aPrevPageFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - rv = nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aPageFrame, - pagePseudoStyle, nsnull, PR_TRUE); + rv = nsHTMLContainerFrame::CreateViewForFrame(aPageFrame, nsnull, PR_TRUE); if (NS_FAILED(rv)) return NS_ERROR_NULL_POINTER; @@ -3952,8 +3945,7 @@ nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell* aPresShell, // containing block for fixed elements which are repeated on every page. aPageContentFrame->Init(aPresContext, nsnull, aPageFrame, pageContentPseudoStyle, nsnull); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aPageContentFrame, - pageContentPseudoStyle, nsnull, PR_TRUE); + nsHTMLContainerFrame::CreateViewForFrame(aPageContentFrame, nsnull, PR_TRUE); if (NS_FAILED(rv)) return NS_ERROR_NULL_POINTER; mFixedContainingBlock = aPageContentFrame; @@ -4119,8 +4111,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell, InitAndRestoreFrame(aPresContext, aState, aContent, geometricParent, aStyleContext, nsnull, comboboxFrame); - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, comboboxFrame, - aStyleContext, aParentFrame, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(comboboxFrame, aParentFrame, PR_FALSE); /////////////////////////////////////////////////////////////////// // Combobox - Old Native Implementation /////////////////////////////////////////////////////////////////// @@ -4268,8 +4259,8 @@ nsCSSFrameConstructor::InitializeSelectFrame(nsIPresShell* aPresShell, // Initialize the frame scrollFrame->Init(aPresContext, aContent, geometricParent, aStyleContext, nsnull); - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, scrollFrame, - aStyleContext, aParentFrame, aBuildCombobox); + nsHTMLContainerFrame::CreateViewForFrame(scrollFrame, aParentFrame, + aBuildCombobox); if (aBuildCombobox) { // Give the drop-down list a popup widget nsIView* view = scrollFrame->GetView(); @@ -4394,8 +4385,7 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsIPresShell* aPresShel // See if we need to create a view, e.g. the frame is absolutely // positioned - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, aParentFrame, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, aParentFrame, PR_FALSE); nsIFrame* areaFrame; NS_NewAreaFrame(shell, &areaFrame, NS_BLOCK_SPACE_MGR | NS_BLOCK_SHRINK_WRAP); @@ -4825,8 +4815,7 @@ nsCSSFrameConstructor::ConstructHTMLFrame(nsIPresShell* aPresShell, NS_ASSERTION(NS_SUCCEEDED(rv), "InitAndRestoreFrame failed"); // See if we need to create a view, e.g. the frame is absolutely // positioned - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, aParentFrame, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, aParentFrame, PR_FALSE); // Process the child content if requested nsFrameItems childItems; @@ -5720,8 +5709,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell, (frameType.get() == nsLayoutAtoms::areaFrame)) { */ // See if we need to create a view, e.g. the frame is absolutely positioned - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, aParentFrame, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, aParentFrame, PR_FALSE); /* } else { @@ -5878,8 +5866,8 @@ nsCSSFrameConstructor::BeginBuildingScrollFrame(nsIPresShell* aPresSh aParentFrame, contentStyle, nsnull, gfxScrollFrame); // Create a view - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, gfxScrollFrame, - contentStyle, aContentParentFrame, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(gfxScrollFrame, + aContentParentFrame, PR_FALSE); } InitGfxScrollFrame(aPresShell, aPresContext, aState, aContent, aDocument, @@ -5931,8 +5919,7 @@ nsCSSFrameConstructor::FinishBuildingScrollFrame(nsIPresContext* aPresConte { // create a view // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aScrolledFrame, - aScrolledContentStyle, nsnull, PR_TRUE); + nsHTMLContainerFrame::CreateViewForFrame(aScrolledFrame, nsnull, PR_TRUE); // the the scroll frames child list aScrollFrame->SetInitialChildList(aPresContext, nsnull, aScrolledFrame); @@ -6256,8 +6243,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresShell* aPre aStyleContext, nsnull, newFrame); // Create a view - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, adjParentFrame, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, adjParentFrame, PR_FALSE); // Process the child content. The area frame becomes a container for child // frames that are absolutely positioned @@ -6620,8 +6606,7 @@ nsCSSFrameConstructor::ResolveStyleContext(nsIPresContext* aPresContext, // skip past any parents that are scrolled-content. We want to inherit directly // from the outer scroll frame. - nsCOMPtr pseudo; - while (parentStyleContext && (pseudo = parentStyleContext->GetPseudoType()) == + while (parentStyleContext && parentStyleContext->GetPseudoType() == nsCSSAnonBoxes::scrolledContent) { parentStyleContext = parentStyleContext->GetParent(); } @@ -6819,8 +6804,7 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsIPresShell* aPresShell, geometricParent, aStyleContext, nsnull, newFrame); // See if we need to create a view, e.g. the frame is absolutely positioned - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, aParentFrame, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, aParentFrame, PR_FALSE); // Process the child content if requested nsFrameItems childItems; @@ -6958,9 +6942,7 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsIPresShell* aPresShell, InitAndRestoreFrame(aPresContext, aState, aContent, geometricParent, aStyleContext, nsnull, newFrame); - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, aParentFrame, - forceView); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, aParentFrame, forceView); // Add the new frame to our list of frame items. aFrameItems.AddChild(newFrame); @@ -10425,8 +10407,7 @@ nsCSSFrameConstructor::ConstructAlternateFrame(nsIPresShell* aPresShell, NS_NewInlineFrame(aPresShell, &containerFrame); } containerFrame->Init(aPresContext, aContent, aGeometricParent, aStyleContext, nsnull); - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, containerFrame, - aStyleContext, aContentParent, + nsHTMLContainerFrame::CreateViewForFrame(containerFrame, aContentParent, PR_FALSE); // If the frame is out-of-flow, then mark it as such @@ -10746,8 +10727,7 @@ nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, aContent, aParentFrame, aStyleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); // Create a continuing inner table frame, and if there's a caption then // replicate the caption @@ -10826,8 +10806,7 @@ nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, aContent, aParentFrame, aStyleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - aStyleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); // Replicate any header/footer frames nsIFrame* rowGroupFrame; @@ -10908,8 +10887,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::inlineFrame == frameType) { @@ -10917,8 +10895,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::blockFrame == frameType) { @@ -10926,8 +10903,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::areaFrame == frameType) { @@ -10936,8 +10912,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::positionedInlineFrame == frameType) { @@ -10945,8 +10920,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::pageFrame == frameType) { @@ -10966,8 +10940,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::tableRowFrame == frameType) { @@ -10975,8 +10948,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); // Create a continuing frame for each table cell frame nsIFrame* cellFrame; @@ -11008,8 +10980,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); // Create a continuing area frame nsIFrame* areaFrame; @@ -11026,8 +10997,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::letterFrame == frameType) { @@ -11035,8 +11005,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell, if (NS_SUCCEEDED(rv)) { newFrame->Init(aPresContext, content, aParentFrame, styleContext, aFrame); // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, newFrame, - styleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); } } else if (nsLayoutAtoms::imageFrame == frameType) { @@ -12781,8 +12750,7 @@ nsCSSFrameConstructor::ConstructBlock(nsIPresShell* aPresShell, aParentFrame, aStyleContext, nsnull, aNewFrame); // See if we need to create a view, e.g. the frame is absolutely positioned - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, - aStyleContext, aContentParentFrame, + nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, aContentParentFrame, PR_FALSE); // If we're the first block to be created (e.g., because we're @@ -12872,8 +12840,7 @@ nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell, // Any inline frame might need a view (because of opacity, or fixed background) // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aNewFrame, - aStyleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(aNewFrame, nsnull, PR_FALSE); if (aIsPositioned) { // Relatively positioned frames becomes a container for child @@ -12983,8 +12950,7 @@ nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell, // Any inline frame could have a view (e.g., opacity) // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, blockFrame, - aStyleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(blockFrame, nsnull, PR_FALSE); if (blockFrame->HasView() || aNewFrame->HasView()) { // Move list2's frames into the new view @@ -13016,8 +12982,7 @@ nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell, // Any frame might need a view // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, inlineFrame, - aStyleContext, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(inlineFrame, nsnull, PR_FALSE); if (inlineFrame->HasView() || aNewFrame->HasView()) { // Move list3's frames into the new view @@ -13408,11 +13373,11 @@ nsCSSFrameConstructor::SplitToContainingBlock(nsIPresContext* aPresContext, // If aLeftInlineChild has a view... if (aLeftInlineChildFrame && aLeftInlineChildFrame->HasView()) { // ...create a new view for the block child, and reparent views - nsStyleContext* sc = aLeftInlineChildFrame->GetStyleContext(); - // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aBlockChildFrame, - sc, nsnull, PR_FALSE); + // force creation of a view; it'll probably need one anyway since it + // has the same style context, and it's easier to think about if we can + // be sure the left inlines, the block and the right inlines all have a view + nsHTMLContainerFrame::CreateViewForFrame(aBlockChildFrame, nsnull, PR_TRUE); nsIFrame* frame; aBlockChildFrame->FirstChild(aPresContext, nsnull, &frame); @@ -13421,8 +13386,7 @@ nsCSSFrameConstructor::SplitToContainingBlock(nsIPresContext* aPresContext, if (aRightInlineChildFrame) { // Same for the right inline children // XXXbz should we be passing in a non-null aContentParentFrame? - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, aRightInlineChildFrame, - sc, nsnull, PR_FALSE); + nsHTMLContainerFrame::CreateViewForFrame(aRightInlineChildFrame, nsnull, PR_TRUE); aRightInlineChildFrame->FirstChild(aPresContext, nsnull, &frame); nsHTMLContainerFrame::ReparentFrameViewList(aPresContext, frame, aLeftInlineChildFrame, aRightInlineChildFrame); diff --git a/mozilla/layout/style/nsRuleNode.cpp b/mozilla/layout/style/nsRuleNode.cpp index 612034e79d6..fbf4dc04579 100644 --- a/mozilla/layout/style/nsRuleNode.cpp +++ b/mozilla/layout/style/nsRuleNode.cpp @@ -2497,7 +2497,7 @@ nsRuleNode::ComputeDisplayData(nsStyleStruct* aStartStruct, display = new (mPresContext) nsStyleDisplay(); const nsStyleDisplay* parentDisplay = display; - nsCOMPtr pseudoTag = aContext->GetPseudoType(); + nsIAtom* pseudoTag = aContext->GetPseudoType(); PRBool generatedContent = (pseudoTag == nsCSSPseudoElements::before || pseudoTag == nsCSSPseudoElements::after); diff --git a/mozilla/layout/style/nsStyleContext.cpp b/mozilla/layout/style/nsStyleContext.cpp index 0ffb82d1141..13728180b0f 100644 --- a/mozilla/layout/style/nsStyleContext.cpp +++ b/mozilla/layout/style/nsStyleContext.cpp @@ -172,14 +172,6 @@ void nsStyleContext::RemoveChild(nsStyleContext* aChild) aChild->mPrevSibling = aChild; } -already_AddRefed -nsStyleContext::GetPseudoType() const -{ - nsIAtom* pseudoTag = mPseudoTag; - NS_IF_ADDREF(pseudoTag); - return pseudoTag; -} - already_AddRefed nsStyleContext::FindChildWithRules(const nsIAtom* aPseudoTag, nsRuleNode* aRuleNode) diff --git a/mozilla/layout/style/nsStyleContext.h b/mozilla/layout/style/nsStyleContext.h index 3b1c654a1e8..6b63c0298ad 100644 --- a/mozilla/layout/style/nsStyleContext.h +++ b/mozilla/layout/style/nsStyleContext.h @@ -76,7 +76,7 @@ public: nsStyleContext* GetFirstChild() const { return mChild; } - already_AddRefed GetPseudoType() const; + nsIAtom* GetPseudoType() const { return mPseudoTag; } already_AddRefed FindChildWithRules(const nsIAtom* aPseudoTag, nsRuleNode* aRules); diff --git a/mozilla/layout/style/nsStyleSet.cpp b/mozilla/layout/style/nsStyleSet.cpp index 574c18128ed..6ee28039168 100644 --- a/mozilla/layout/style/nsStyleSet.cpp +++ b/mozilla/layout/style/nsStyleSet.cpp @@ -1478,7 +1478,7 @@ StyleSetImpl::ReParentStyleContext(nsIPresContext* aPresContext, return aStyleContext; } else { // really a new parent - nsCOMPtr pseudoTag = aStyleContext->GetPseudoType(); + nsIAtom* pseudoTag = aStyleContext->GetPseudoType(); nsRuleNode* ruleNode = aStyleContext->GetRuleNode(); EnsureRuleWalker(aPresContext); diff --git a/mozilla/layout/xul/base/src/nsBoxFrame.cpp b/mozilla/layout/xul/base/src/nsBoxFrame.cpp index 4f53d408e15..0563c4746d8 100644 --- a/mozilla/layout/xul/base/src/nsBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsBoxFrame.cpp @@ -269,10 +269,7 @@ nsBoxFrame::Init(nsIPresContext* aPresContext, PRBool needsWidget = PR_FALSE; parent->ChildrenMustHaveWidgets(needsWidget); if (needsWidget) { - - if (!HasView()) { - nsHTMLContainerFrame::CreateViewForFrame(aPresContext,this,mStyleContext,nsnull,PR_TRUE); - } + nsHTMLContainerFrame::CreateViewForFrame(this, nsnull, PR_TRUE); nsIView* view = GetView(); if (!view->HasWidget()) @@ -2477,8 +2474,7 @@ nsBoxFrame::CreateViewForFrame(nsIPresContext* aPresContext, // See if the frame is a scrolled frame if (!aForce) { - nsCOMPtr pseudoTag = aStyleContext->GetPseudoType(); - if (pseudoTag == nsCSSAnonBoxes::scrolledContent) { + if (aStyleContext->GetPseudoType() == nsCSSAnonBoxes::scrolledContent) { NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, ("nsBoxFrame::CreateViewForFrame: scrolled frame=%p", aFrame)); aForce = PR_TRUE; diff --git a/mozilla/layout/xul/base/src/nsBoxToBlockAdaptor.cpp b/mozilla/layout/xul/base/src/nsBoxToBlockAdaptor.cpp index 5ec885b5aa0..071db44581d 100644 --- a/mozilla/layout/xul/base/src/nsBoxToBlockAdaptor.cpp +++ b/mozilla/layout/xul/base/src/nsBoxToBlockAdaptor.cpp @@ -171,13 +171,7 @@ nsBoxToBlockAdaptor::SetParentBox(nsIBox* aParent) PRBool needsWidget = PR_FALSE; parent->ChildrenMustHaveWidgets(needsWidget); if (needsWidget) { - nsCOMPtr context; - mPresShell->GetPresContext(getter_AddRefs(context)); - - if (!mFrame->HasView()) { - nsStyleContext* style = mFrame->GetStyleContext(); - nsHTMLContainerFrame::CreateViewForFrame(context,mFrame,style,nsnull,PR_TRUE); - } + nsHTMLContainerFrame::CreateViewForFrame(mFrame, nsnull, PR_TRUE); nsIView* view = mFrame->GetView(); if (!view->HasWidget()) diff --git a/mozilla/layout/xul/base/src/nsLeafBoxFrame.cpp b/mozilla/layout/xul/base/src/nsLeafBoxFrame.cpp index f661a8af02d..e3a3e27cdb0 100644 --- a/mozilla/layout/xul/base/src/nsLeafBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsLeafBoxFrame.cpp @@ -114,9 +114,7 @@ nsLeafBoxFrame::Init(nsIPresContext* aPresContext, PRBool needsWidget = PR_FALSE; parent->ChildrenMustHaveWidgets(needsWidget); if (needsWidget) { - if (!HasView()) { - nsHTMLContainerFrame::CreateViewForFrame(aPresContext,this,mStyleContext,nsnull,PR_TRUE); - } + nsHTMLContainerFrame::CreateViewForFrame(this, nsnull, PR_TRUE); nsIView* view = GetView(); if (!view->HasWidget()) diff --git a/mozilla/layout/xul/base/src/nsScrollBoxFrame.cpp b/mozilla/layout/xul/base/src/nsScrollBoxFrame.cpp index 87d3168f702..4b85d14977f 100644 --- a/mozilla/layout/xul/base/src/nsScrollBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsScrollBoxFrame.cpp @@ -138,9 +138,7 @@ nsScrollBoxFrame::SetUpScrolledFrame(nsIPresContext* aPresContext) return; // create a view if we don't already have one. - nsStyleContext* context = frame->GetStyleContext(); - nsHTMLContainerFrame::CreateViewForFrame(aPresContext, frame, - context, nsnull, PR_TRUE); + nsHTMLContainerFrame::CreateViewForFrame(frame, nsnull, PR_TRUE); } NS_IMETHODIMP diff --git a/mozilla/layout/xul/base/src/nsSplitterFrame.cpp b/mozilla/layout/xul/base/src/nsSplitterFrame.cpp index 36bde3368b8..952607b6e04 100644 --- a/mozilla/layout/xul/base/src/nsSplitterFrame.cpp +++ b/mozilla/layout/xul/base/src/nsSplitterFrame.cpp @@ -360,7 +360,7 @@ nsSplitterFrame::Init(nsIPresContext* aPresContext, // XXX Hack because we need the pres context in some of the event handling functions... mPresContext = aPresContext; - nsHTMLContainerFrame::CreateViewForFrame(aPresContext,this,aContext,nsnull,PR_TRUE); + nsHTMLContainerFrame::CreateViewForFrame(this, nsnull, PR_TRUE); nsIView* view = GetView(); nsIViewManager* viewManager = view->GetViewManager();