Remove nsIStyleContext (bug 114713), r/sr=dbaron. Changed lots of methods to use nsStyleContext* or already_AddRefed<nsStyleContext> as return values, depending on whether a reference is returned. Turn on nsRefPtr (bug 104346), and change nsDerivedSafe to not declare AddRef and Release explicitly virtual, r=jag, sr=dbaron.
git-svn-id: svn://10.0.0.236/trunk@138129 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -65,7 +65,7 @@
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsIScrollableView.h"
|
||||
#include "nsStyleCoord.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIDocumentLoader.h"
|
||||
#include "nsFrameSetFrame.h"
|
||||
@@ -94,6 +94,7 @@
|
||||
#include "nsIRenderingContext.h"
|
||||
#include "nsIFrameFrame.h"
|
||||
#include "nsIPluginViewer.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
// For Accessibility
|
||||
#ifdef ACCESSIBILITY
|
||||
@@ -156,7 +157,7 @@ public:
|
||||
NS_IMETHOD Init(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
|
||||
@@ -240,7 +241,7 @@ public:
|
||||
NS_IMETHOD Init(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow);
|
||||
|
||||
void GetParentContent(nsIContent** aContent);
|
||||
@@ -338,7 +339,7 @@ NS_IMETHODIMP
|
||||
nsHTMLFrameOuterFrame::Init(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
mPresContext = aPresContext;
|
||||
@@ -412,16 +413,10 @@ nsHTMLFrameOuterFrame::Init(nsIPresContext* aPresContext,
|
||||
mFrames.SetFrames(firstChild);
|
||||
// Resolve the style context for the inner frame
|
||||
nsresult rv = NS_OK;
|
||||
nsIStyleContext *innerStyleContext = nsnull;
|
||||
rv = aPresContext->ResolveStyleContextFor(mContent, mStyleContext,
|
||||
&innerStyleContext);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = firstChild->Init(aPresContext, mContent, this, innerStyleContext, nsnull);
|
||||
// have to release the context: Init does its own AddRef...
|
||||
NS_RELEASE(innerStyleContext);
|
||||
} else {
|
||||
NS_WARNING( "Error resolving style for InnerFrame in nsHTMLFrameOuterFrame");
|
||||
}
|
||||
nsRefPtr<nsStyleContext> innerStyleContext;
|
||||
innerStyleContext = aPresContext->ResolveStyleContextFor(mContent,
|
||||
mStyleContext);
|
||||
rv = firstChild->Init(aPresContext, mContent, this, innerStyleContext, nsnull);
|
||||
if (NS_FAILED(rv)){
|
||||
NS_WARNING( "Error initializing InnerFrame in nsHTMLFrameOuterFrame");
|
||||
return rv;
|
||||
@@ -1192,7 +1187,7 @@ NS_IMETHODIMP
|
||||
nsHTMLFrameInnerFrame::Init(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aParent, aContext,
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "nsIScrollableView.h"
|
||||
#include "nsStyleCoord.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsIDocumentLoader.h"
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsILookAndFeel.h"
|
||||
@@ -54,6 +54,7 @@
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsCSSPseudoElements.h"
|
||||
#include "nsCSSAnonBoxes.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
// masks for mEdgeVisibility
|
||||
#define LEFT_VIS 0x0001
|
||||
@@ -317,7 +318,7 @@ NS_IMETHODIMP
|
||||
nsHTMLFramesetFrame::Init(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
nsHTMLContainerFrame::Init(aPresContext, aContent, aParent,
|
||||
@@ -408,11 +409,10 @@ nsHTMLFramesetFrame::Init(nsIPresContext* aPresContext,
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
child->GetTag(*getter_AddRefs(tag));
|
||||
if (tag == nsHTMLAtoms::frameset || tag == nsHTMLAtoms::frame) {
|
||||
nsCOMPtr<nsIStyleContext> kidSC;
|
||||
nsRefPtr<nsStyleContext> kidSC;
|
||||
nsresult result;
|
||||
|
||||
aPresContext->ResolveStyleContextFor(child, mStyleContext,
|
||||
getter_AddRefs(kidSC));
|
||||
kidSC = aPresContext->ResolveStyleContextFor(child, mStyleContext);
|
||||
if (tag == nsHTMLAtoms::frameset) {
|
||||
result = NS_NewHTMLFramesetFrame(shell, &frame);
|
||||
|
||||
@@ -453,10 +453,10 @@ nsHTMLFramesetFrame::Init(nsIPresContext* aPresContext,
|
||||
// XXX the blank frame is using the content of its parent - at some point it
|
||||
// should just have null content, if we support that
|
||||
nsHTMLFramesetBlankFrame* blankFrame = new (shell.get()) nsHTMLFramesetBlankFrame;
|
||||
nsCOMPtr<nsIStyleContext> pseudoStyleContext;
|
||||
aPresContext->ResolvePseudoStyleContextFor(nsnull,
|
||||
nsCSSAnonBoxes::framesetBlank, mStyleContext,
|
||||
getter_AddRefs(pseudoStyleContext));
|
||||
nsRefPtr<nsStyleContext> pseudoStyleContext;
|
||||
pseudoStyleContext = aPresContext->ResolvePseudoStyleContextFor(nsnull,
|
||||
nsCSSAnonBoxes::framesetBlank,
|
||||
mStyleContext);
|
||||
if(blankFrame)
|
||||
blankFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull);
|
||||
|
||||
@@ -1080,12 +1080,11 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext* aPresContext,
|
||||
offset.y += lastSize.height;
|
||||
if (firstTime) { // create horizontal border
|
||||
borderFrame = new (shell.get()) nsHTMLFramesetBorderFrame(borderWidth, PR_FALSE, PR_FALSE);
|
||||
nsIStyleContext* pseudoStyleContext;
|
||||
aPresContext->ResolvePseudoStyleContextFor(mContent, nsCSSPseudoElements::horizontalFramesetBorder,
|
||||
mStyleContext,
|
||||
&pseudoStyleContext);
|
||||
nsRefPtr<nsStyleContext> pseudoStyleContext;
|
||||
pseudoStyleContext = aPresContext->ResolvePseudoStyleContextFor(mContent,
|
||||
nsCSSPseudoElements::horizontalFramesetBorder,
|
||||
mStyleContext);
|
||||
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull);
|
||||
NS_RELEASE(pseudoStyleContext);
|
||||
|
||||
mChildCount++;
|
||||
lastChild->SetNextSibling(borderFrame);
|
||||
@@ -1108,12 +1107,11 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext* aPresContext,
|
||||
if (0 == cellIndex.y) { // in 1st row
|
||||
if (firstTime) { // create vertical border
|
||||
borderFrame = new (shell.get()) nsHTMLFramesetBorderFrame(borderWidth, PR_TRUE, PR_FALSE);
|
||||
nsIStyleContext* pseudoStyleContext;
|
||||
aPresContext->ResolvePseudoStyleContextFor(mContent, nsCSSPseudoElements::verticalFramesetBorder,
|
||||
mStyleContext,
|
||||
&pseudoStyleContext);
|
||||
nsRefPtr<nsStyleContext> pseudoStyleContext;
|
||||
pseudoStyleContext = aPresContext->ResolvePseudoStyleContextFor(mContent,
|
||||
nsCSSPseudoElements::verticalFramesetBorder,
|
||||
mStyleContext);
|
||||
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull);
|
||||
NS_RELEASE(pseudoStyleContext);
|
||||
|
||||
mChildCount++;
|
||||
lastChild->SetNextSibling(borderFrame);
|
||||
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
NS_IMETHOD Init(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow);
|
||||
|
||||
static PRBool gDragInProgress;
|
||||
|
||||
Reference in New Issue
Block a user