Added frame-type atoms for area,scroll,viewport,root,page frame classes

This commit is contained in:
troy%netscape.com 1999-02-14 03:47:33 +00:00
parent 96bd46f6c9
commit bf53f99087
20 changed files with 240 additions and 5 deletions

View File

@ -61,6 +61,13 @@ public:
static nsIAtom* commentTagName;
static nsIAtom* textTagName;
static nsIAtom* viewportPseudo;
// Alphabetical list of frame types
static nsIAtom* areaFrame;
static nsIAtom* pageFrame;
static nsIAtom* rootFrame;
static nsIAtom* scrollFrame;
static nsIAtom* viewportFrame;
};
#endif /* nsLayoutAtoms_h___ */

View File

@ -43,10 +43,18 @@ nsIAtom* nsLayoutAtoms::colGroupList;
nsIAtom* nsLayoutAtoms::fixedList;
nsIAtom* nsLayoutAtoms::floaterList;
// pseudo tag names for non-element content
nsIAtom* nsLayoutAtoms::commentTagName;
nsIAtom* nsLayoutAtoms::textTagName;
nsIAtom* nsLayoutAtoms::viewportPseudo;
// frame types
nsIAtom* nsLayoutAtoms::areaFrame;
nsIAtom* nsLayoutAtoms::pageFrame;
nsIAtom* nsLayoutAtoms::rootFrame;
nsIAtom* nsLayoutAtoms::scrollFrame;
nsIAtom* nsLayoutAtoms::viewportFrame;
static nsrefcnt gRefCnt;
void nsLayoutAtoms::AddrefAtoms()
@ -76,6 +84,12 @@ void nsLayoutAtoms::AddrefAtoms()
commentTagName = NS_NewAtom("__moz_comment");
textTagName = NS_NewAtom("__moz_text");
viewportPseudo = NS_NewAtom(":-moz-viewport");
areaFrame = NS_NewAtom("AreaFrame");
pageFrame = NS_NewAtom("PageFrame");
rootFrame = NS_NewAtom("RootFrame");
scrollFrame = NS_NewAtom("ScrollFrame");
viewportFrame = NS_NewAtom("ViewportFrame");
}
++gRefCnt;
}
@ -108,6 +122,12 @@ void nsLayoutAtoms::ReleaseAtoms()
NS_RELEASE(commentTagName);
NS_RELEASE(textTagName);
NS_RELEASE(viewportPseudo);
NS_RELEASE(areaFrame);
NS_RELEASE(pageFrame);
NS_RELEASE(rootFrame);
NS_RELEASE(scrollFrame);
NS_RELEASE(viewportFrame);
}
}

View File

@ -43,10 +43,18 @@ nsIAtom* nsLayoutAtoms::colGroupList;
nsIAtom* nsLayoutAtoms::fixedList;
nsIAtom* nsLayoutAtoms::floaterList;
// pseudo tag names for non-element content
nsIAtom* nsLayoutAtoms::commentTagName;
nsIAtom* nsLayoutAtoms::textTagName;
nsIAtom* nsLayoutAtoms::viewportPseudo;
// frame types
nsIAtom* nsLayoutAtoms::areaFrame;
nsIAtom* nsLayoutAtoms::pageFrame;
nsIAtom* nsLayoutAtoms::rootFrame;
nsIAtom* nsLayoutAtoms::scrollFrame;
nsIAtom* nsLayoutAtoms::viewportFrame;
static nsrefcnt gRefCnt;
void nsLayoutAtoms::AddrefAtoms()
@ -76,6 +84,12 @@ void nsLayoutAtoms::AddrefAtoms()
commentTagName = NS_NewAtom("__moz_comment");
textTagName = NS_NewAtom("__moz_text");
viewportPseudo = NS_NewAtom(":-moz-viewport");
areaFrame = NS_NewAtom("AreaFrame");
pageFrame = NS_NewAtom("PageFrame");
rootFrame = NS_NewAtom("RootFrame");
scrollFrame = NS_NewAtom("ScrollFrame");
viewportFrame = NS_NewAtom("ViewportFrame");
}
++gRefCnt;
}
@ -108,6 +122,12 @@ void nsLayoutAtoms::ReleaseAtoms()
NS_RELEASE(commentTagName);
NS_RELEASE(textTagName);
NS_RELEASE(viewportPseudo);
NS_RELEASE(areaFrame);
NS_RELEASE(pageFrame);
NS_RELEASE(rootFrame);
NS_RELEASE(scrollFrame);
NS_RELEASE(viewportFrame);
}
}

View File

@ -61,6 +61,13 @@ public:
static nsIAtom* commentTagName;
static nsIAtom* textTagName;
static nsIAtom* viewportPseudo;
// Alphabetical list of frame types
static nsIAtom* areaFrame;
static nsIAtom* pageFrame;
static nsIAtom* rootFrame;
static nsIAtom* scrollFrame;
static nsIAtom* viewportFrame;
};
#endif /* nsLayoutAtoms_h___ */

View File

@ -61,6 +61,13 @@ public:
static nsIAtom* commentTagName;
static nsIAtom* textTagName;
static nsIAtom* viewportPseudo;
// Alphabetical list of frame types
static nsIAtom* areaFrame;
static nsIAtom* pageFrame;
static nsIAtom* rootFrame;
static nsIAtom* scrollFrame;
static nsIAtom* viewportFrame;
};
#endif /* nsLayoutAtoms_h___ */

View File

@ -43,10 +43,18 @@ nsIAtom* nsLayoutAtoms::colGroupList;
nsIAtom* nsLayoutAtoms::fixedList;
nsIAtom* nsLayoutAtoms::floaterList;
// pseudo tag names for non-element content
nsIAtom* nsLayoutAtoms::commentTagName;
nsIAtom* nsLayoutAtoms::textTagName;
nsIAtom* nsLayoutAtoms::viewportPseudo;
// frame types
nsIAtom* nsLayoutAtoms::areaFrame;
nsIAtom* nsLayoutAtoms::pageFrame;
nsIAtom* nsLayoutAtoms::rootFrame;
nsIAtom* nsLayoutAtoms::scrollFrame;
nsIAtom* nsLayoutAtoms::viewportFrame;
static nsrefcnt gRefCnt;
void nsLayoutAtoms::AddrefAtoms()
@ -76,6 +84,12 @@ void nsLayoutAtoms::AddrefAtoms()
commentTagName = NS_NewAtom("__moz_comment");
textTagName = NS_NewAtom("__moz_text");
viewportPseudo = NS_NewAtom(":-moz-viewport");
areaFrame = NS_NewAtom("AreaFrame");
pageFrame = NS_NewAtom("PageFrame");
rootFrame = NS_NewAtom("RootFrame");
scrollFrame = NS_NewAtom("ScrollFrame");
viewportFrame = NS_NewAtom("ViewportFrame");
}
++gRefCnt;
}
@ -108,6 +122,12 @@ void nsLayoutAtoms::ReleaseAtoms()
NS_RELEASE(commentTagName);
NS_RELEASE(textTagName);
NS_RELEASE(viewportPseudo);
NS_RELEASE(areaFrame);
NS_RELEASE(pageFrame);
NS_RELEASE(rootFrame);
NS_RELEASE(scrollFrame);
NS_RELEASE(viewportFrame);
}
}

View File

@ -679,6 +679,15 @@ nsAreaFrame::ReflowAbsoluteFrames(nsIPresContext& aPresContext,
}
}
NS_IMETHODIMP
nsAreaFrame::GetFrameType(nsIAtom** aType) const
{
NS_PRECONDITION(nsnull != aType, "null OUT parameter pointer");
*aType = nsLayoutAtoms::areaFrame;
NS_ADDREF(*aType);
return NS_OK;
}
/////////////////////////////////////////////////////////////////////////////
// Diagnostics

View File

@ -84,6 +84,13 @@ public:
nsIFrame* aParent,
nsIStyleContext* aStyleContext,
nsIFrame*& aContinuingFrame);
/**
* Get the "type" of the frame
*
* @see nsLayoutAtoms::areaFrame
*/
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
// nsIAreaFrame

View File

@ -38,6 +38,7 @@
#include "nsIDeviceContext.h"
#include "nsIScrollableView.h"
#include "nsIAreaFrame.h"
#include "nsLayoutAtoms.h"
// Interface IDs
static NS_DEFINE_IID(kAreaFrameIID, NS_IAREAFRAME_IID);
@ -71,6 +72,13 @@ public:
return NS_OK;
}
/**
* Get the "type" of the frame
*
* @see nsLayoutAtoms::rootFrame
*/
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
// XXX Temporary hack...
@ -342,6 +350,15 @@ RootFrame::HandleEvent(nsIPresContext& aPresContext,
return NS_OK;
}
NS_IMETHODIMP
RootFrame::GetFrameType(nsIAtom** aType) const
{
NS_PRECONDITION(nsnull != aType, "null OUT parameter pointer");
*aType = nsLayoutAtoms::rootFrame;
NS_ADDREF(*aType);
return NS_OK;
}
NS_IMETHODIMP
RootFrame::GetFrameName(nsString& aResult) const
{

View File

@ -24,6 +24,7 @@
#include "nsIRenderingContext.h"
#include "nsHTMLAtoms.h"
#include "nsHTMLIIDs.h"
#include "nsLayoutAtoms.h"
NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
@ -145,6 +146,15 @@ nsPageFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
return NS_OK;
}
NS_IMETHODIMP
nsPageFrame::GetFrameType(nsIAtom** aType) const
{
NS_PRECONDITION(nsnull != aType, "null OUT parameter pointer");
*aType = nsLayoutAtoms::pageFrame;
NS_ADDREF(*aType);
return NS_OK;
}
NS_IMETHODIMP
nsPageFrame::GetFrameName(nsString& aResult) const
{

View File

@ -33,6 +33,13 @@ public:
nsIStyleContext* aStyleContext,
nsIFrame*& aContinuingFrame);
/**
* Get the "type" of the frame
*
* @see nsLayoutAtoms::pageFrame
*/
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
// Debugging
NS_IMETHOD GetFrameName(nsString& aResult) const;
};

View File

@ -37,8 +37,10 @@ static NS_DEFINE_IID(kScrollViewIID, NS_ISCROLLABLEVIEW_IID);
* - scroll frame
* - root frame
*
* It has an additional named child list:
* The viewport frame has an additional named child list:
* - "Fixed-list" which contains the fixed positioned frames
*
* @see nsLayoutAtoms::fixedList
*/
class ViewportFrame : public nsContainerFrame {
public:
@ -58,6 +60,13 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
/**
* Get the "type" of the frame
*
* @see nsLayoutAtoms::viewportFrame
*/
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
protected:
@ -453,6 +462,15 @@ ViewportFrame::Reflow(nsIPresContext& aPresContext,
return NS_OK;
}
NS_IMETHODIMP
ViewportFrame::GetFrameType(nsIAtom** aType) const
{
NS_PRECONDITION(nsnull != aType, "null OUT parameter pointer");
*aType = nsLayoutAtoms::viewportFrame;
NS_ADDREF(*aType);
return NS_OK;
}
NS_IMETHODIMP
ViewportFrame::GetFrameName(nsString& aResult) const
{

View File

@ -679,6 +679,15 @@ nsAreaFrame::ReflowAbsoluteFrames(nsIPresContext& aPresContext,
}
}
NS_IMETHODIMP
nsAreaFrame::GetFrameType(nsIAtom** aType) const
{
NS_PRECONDITION(nsnull != aType, "null OUT parameter pointer");
*aType = nsLayoutAtoms::areaFrame;
NS_ADDREF(*aType);
return NS_OK;
}
/////////////////////////////////////////////////////////////////////////////
// Diagnostics

View File

@ -84,6 +84,13 @@ public:
nsIFrame* aParent,
nsIStyleContext* aStyleContext,
nsIFrame*& aContinuingFrame);
/**
* Get the "type" of the frame
*
* @see nsLayoutAtoms::areaFrame
*/
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
// nsIAreaFrame

View File

@ -38,6 +38,7 @@
#include "nsIDeviceContext.h"
#include "nsIScrollableView.h"
#include "nsIAreaFrame.h"
#include "nsLayoutAtoms.h"
// Interface IDs
static NS_DEFINE_IID(kAreaFrameIID, NS_IAREAFRAME_IID);
@ -71,6 +72,13 @@ public:
return NS_OK;
}
/**
* Get the "type" of the frame
*
* @see nsLayoutAtoms::rootFrame
*/
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
// XXX Temporary hack...
@ -342,6 +350,15 @@ RootFrame::HandleEvent(nsIPresContext& aPresContext,
return NS_OK;
}
NS_IMETHODIMP
RootFrame::GetFrameType(nsIAtom** aType) const
{
NS_PRECONDITION(nsnull != aType, "null OUT parameter pointer");
*aType = nsLayoutAtoms::rootFrame;
NS_ADDREF(*aType);
return NS_OK;
}
NS_IMETHODIMP
RootFrame::GetFrameName(nsString& aResult) const
{

View File

@ -24,6 +24,7 @@
#include "nsIRenderingContext.h"
#include "nsHTMLAtoms.h"
#include "nsHTMLIIDs.h"
#include "nsLayoutAtoms.h"
NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
@ -145,6 +146,15 @@ nsPageFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
return NS_OK;
}
NS_IMETHODIMP
nsPageFrame::GetFrameType(nsIAtom** aType) const
{
NS_PRECONDITION(nsnull != aType, "null OUT parameter pointer");
*aType = nsLayoutAtoms::pageFrame;
NS_ADDREF(*aType);
return NS_OK;
}
NS_IMETHODIMP
nsPageFrame::GetFrameName(nsString& aResult) const
{

View File

@ -33,6 +33,13 @@ public:
nsIStyleContext* aStyleContext,
nsIFrame*& aContinuingFrame);
/**
* Get the "type" of the frame
*
* @see nsLayoutAtoms::pageFrame
*/
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
// Debugging
NS_IMETHOD GetFrameName(nsString& aResult) const;
};

View File

@ -32,6 +32,7 @@
#include "nsWidgetsCID.h"
#include "nsIAreaFrame.h"
#include "nsScrollFrame.h"
#include "nsLayoutAtoms.h"
static NS_DEFINE_IID(kWidgetCID, NS_CHILD_CID);
static NS_DEFINE_IID(kScrollingViewCID, NS_SCROLLING_VIEW_CID);
@ -524,6 +525,15 @@ nsScrollFrame::GetSkipSides() const
return 0;
}
NS_IMETHODIMP
nsScrollFrame::GetFrameType(nsIAtom** aType) const
{
NS_PRECONDITION(nsnull != aType, "null OUT parameter pointer");
*aType = nsLayoutAtoms::scrollFrame;
NS_ADDREF(*aType);
return NS_OK;
}
NS_IMETHODIMP
nsScrollFrame::GetFrameName(nsString& aResult) const
{

View File

@ -22,9 +22,10 @@
#include "nsHTMLContainerFrame.h"
/**
* The scroll frame creates and manages the scrolling view. It creates
* a nsScrollViewFrame which handles padding and rendering of the
* background.
* The scroll frame creates and manages the scrolling view
*
* It only supports having a single child frame that typically is an area
* frame, but doesn't have to be. The child frame must have a view, though
*/
class nsScrollFrame : public nsHTMLContainerFrame {
public:
@ -50,6 +51,13 @@ public:
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
/**
* Get the "type" of the frame
*
* @see nsLayoutAtoms::scrollFrame
*/
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD ReResolveStyleContext(nsIPresContext* aPresContext,

View File

@ -37,8 +37,10 @@ static NS_DEFINE_IID(kScrollViewIID, NS_ISCROLLABLEVIEW_IID);
* - scroll frame
* - root frame
*
* It has an additional named child list:
* The viewport frame has an additional named child list:
* - "Fixed-list" which contains the fixed positioned frames
*
* @see nsLayoutAtoms::fixedList
*/
class ViewportFrame : public nsContainerFrame {
public:
@ -58,6 +60,13 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
/**
* Get the "type" of the frame
*
* @see nsLayoutAtoms::viewportFrame
*/
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
protected:
@ -453,6 +462,15 @@ ViewportFrame::Reflow(nsIPresContext& aPresContext,
return NS_OK;
}
NS_IMETHODIMP
ViewportFrame::GetFrameType(nsIAtom** aType) const
{
NS_PRECONDITION(nsnull != aType, "null OUT parameter pointer");
*aType = nsLayoutAtoms::viewportFrame;
NS_ADDREF(*aType);
return NS_OK;
}
NS_IMETHODIMP
ViewportFrame::GetFrameName(nsString& aResult) const
{