Bug 500882 part 7. Remove the old GetPrimaryFrameFor API. r=roc, sr=dbaron

This commit is contained in:
Boris Zbarsky 2009-12-24 16:20:06 -05:00
Родитель ba3d909010
Коммит 21ee053fb3
5 изменённых файлов: 4 добавлений и 53 удалений

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

@ -247,8 +247,6 @@ nsFrameManager::Destroy()
// Destroy the frame hierarchy.
mPresShell->SetIgnoreFrameDestruction(PR_TRUE);
mIsDestroying = PR_TRUE; // This flag prevents GetPrimaryFrameFor from returning pointers to destroyed frames
// Unregister all placeholders before tearing down the frame tree
nsFrameManager::ClearPlaceholderFrameMap();
@ -290,27 +288,6 @@ nsFrameManager::GetCanvasFrame()
//----------------------------------------------------------------------
// Primary frame functions
nsIFrame*
nsFrameManager::GetPrimaryFrameFor(nsIContent* aContent,
PRInt32 aIndexHint)
{
NS_ASSERTION(!mIsDestroyingFrames,
"GetPrimaryFrameFor() called while frames are being destroyed!");
NS_ENSURE_TRUE(aContent, nsnull);
if (mIsDestroying) {
NS_ERROR("GetPrimaryFrameFor() called while nsFrameManager is being destroyed!");
return nsnull;
}
if (aContent->GetCurrentDoc() != mPresShell->GetDocument()) {
return nsnull;
}
return aContent->GetPrimaryFrame();
}
void
nsFrameManager::RemoveAsPrimaryFrame(nsIContent* aContent,
nsIFrame* aPrimaryFrame)

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

@ -110,8 +110,6 @@ public:
NS_HIDDEN_(nsIFrame*) GetCanvasFrame();
// Primary frame functions
NS_HIDDEN_(nsIFrame*) GetPrimaryFrameFor(nsIContent* aContent,
PRInt32 aIndexHint);
// If aPrimaryFrame is the current primary frame for aContent, set its
// primary frame to null. aPrimaryFrame must not be null.
NS_HIDDEN_(void) RemoveAsPrimaryFrame(nsIContent* aContent,

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

@ -78,10 +78,8 @@ protected:
// the pres shell owns the style set
nsStyleSet* mStyleSet;
nsIFrame* mRootFrame;
PLDHashTable mPrimaryFrameMap;
PLDHashTable mPlaceholderMap;
UndisplayedMap* mUndisplayedMap;
PRPackedBool mIsDestroying; // The frame manager is being destroyed.
PRPackedBool mIsDestroyingFrames; // The frame manager is destroying some frame(s).
};

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

@ -122,10 +122,10 @@ typedef struct CapturingContentInfo {
mAllowed(PR_FALSE), mRetargetToElement(PR_FALSE), mContent(nsnull) { }
} CapturingContentInfo;
// 4e8724b5-14f9-4bb0-b5a0-24041d653c9f
#define NS_IPRESSHELL_IID \
{ 0x4e8724b5, 0x14f9, 0x4bb0, \
{ 0xb5, 0xa0, 0x24, 0x04, 0x1d, 0x65, 0x3c, 0x9f } }
// 06AA90C2-5234-4F1C-81D7-773B5E4CBB8B
#define NS_IPRESSHELL_IID \
{ 0x06aa90c2, 0x5234, 0x4f1c, \
{ 0x81, 0xd7, 0x77, 0x3b, 0x5e, 0x4c, 0xbb, 0x8b } }
// Constants for ScrollContentIntoView() function
#define NS_PRESSHELL_SCROLL_TOP 0
@ -357,21 +357,6 @@ public:
*/
NS_IMETHOD GetPageSequenceFrame(nsIPageSequenceFrame** aResult) const = 0;
/**
* Gets the primary frame associated with the content object. This is a
* helper function that just forwards the request to the frame manager.
*
* The primary frame is the frame that is most closely associated with the
* content. A frame is more closely associated with the content that another
* frame if the one frame contains directly or indirectly the other frame (e.g.,
* when a frame is scrolled there is a scroll frame that contains the frame
* being scrolled). The primary frame is always the first-in-flow.
*
* In the case of absolutely positioned elements and floated elements,
* the primary frame is the placeholder frame.
*/
virtual NS_HIDDEN_(nsIFrame*) GetPrimaryFrameFor(nsIContent* aContent) const = 0;
/**
* Gets the real primary frame associated with the content object.
*

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

@ -687,7 +687,6 @@ public:
NS_IMETHOD ResizeReflow(nscoord aWidth, nscoord aHeight);
NS_IMETHOD StyleChangeReflow();
NS_IMETHOD GetPageSequenceFrame(nsIPageSequenceFrame** aResult) const;
virtual NS_HIDDEN_(nsIFrame*) GetPrimaryFrameFor(nsIContent* aContent) const;
virtual NS_HIDDEN_(nsIFrame*) GetRealPrimaryFrameFor(nsIContent* aContent) const;
NS_IMETHOD GetPlaceholderFrameFor(nsIFrame* aFrame,
@ -5143,12 +5142,6 @@ PresShell::StyleRuleRemoved(nsIDocument *aDocument,
mStylesHaveChanged = PR_TRUE;
}
nsIFrame*
PresShell::GetPrimaryFrameFor(nsIContent* aContent) const
{
return FrameManager()->GetPrimaryFrameFor(aContent, -1);
}
nsIFrame*
PresShell::GetRealPrimaryFrameFor(nsIContent* aContent) const
{