Added new atoms to nsLayoutAtoms for additional named frame child lists

This commit is contained in:
troy%netscape.com 1998-12-09 05:30:17 +00:00
Родитель 64ac3c15be
Коммит 7ec6a2c281
20 изменённых файлов: 141 добавлений и 143 удалений

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

@ -33,23 +33,23 @@ public:
static void AddrefAtoms();
static void ReleaseAtoms();
// Alphabetical list of atoms
// Alphabetical list of media type atoms
static nsIAtom* all;
static nsIAtom* aural;
static nsIAtom* braille;
static nsIAtom* embossed;
static nsIAtom* handheld;
static nsIAtom* print;
static nsIAtom* projection;
static nsIAtom* screen;
static nsIAtom* tty;
static nsIAtom* tv;
// Alphabetical list of frame additional child list names
static nsIAtom* absoluteList;
static nsIAtom* colGroupList;
static nsIAtom* floaterList;
static nsIAtom* bulletList;
};
#endif /* nsLayoutAtoms_h___ */

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

@ -30,6 +30,11 @@ nsIAtom* nsLayoutAtoms::screen;
nsIAtom* nsLayoutAtoms::tty;
nsIAtom* nsLayoutAtoms::tv;
nsIAtom* nsLayoutAtoms::absoluteList;
nsIAtom* nsLayoutAtoms::colGroupList;
nsIAtom* nsLayoutAtoms::floaterList;
nsIAtom* nsLayoutAtoms::bulletList;
static nsrefcnt gRefCnt;
void nsLayoutAtoms::AddrefAtoms()
@ -45,6 +50,11 @@ void nsLayoutAtoms::AddrefAtoms()
screen = NS_NewAtom("SCREEN");
tty = NS_NewAtom("TTY");
tv = NS_NewAtom("TV");
absoluteList = NS_NewAtom("Absolute-list");
colGroupList = NS_NewAtom("ColGroup-list");
floaterList = NS_NewAtom("Floater-list");
bulletList = NS_NewAtom("Bullet-list");
}
++gRefCnt;
}
@ -63,6 +73,11 @@ void nsLayoutAtoms::ReleaseAtoms()
NS_RELEASE(screen);
NS_RELEASE(tty);
NS_RELEASE(tv);
NS_RELEASE(absoluteList);
NS_RELEASE(colGroupList);
NS_RELEASE(floaterList);
NS_RELEASE(bulletList);
}
}

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

@ -30,6 +30,11 @@ nsIAtom* nsLayoutAtoms::screen;
nsIAtom* nsLayoutAtoms::tty;
nsIAtom* nsLayoutAtoms::tv;
nsIAtom* nsLayoutAtoms::absoluteList;
nsIAtom* nsLayoutAtoms::colGroupList;
nsIAtom* nsLayoutAtoms::floaterList;
nsIAtom* nsLayoutAtoms::bulletList;
static nsrefcnt gRefCnt;
void nsLayoutAtoms::AddrefAtoms()
@ -45,6 +50,11 @@ void nsLayoutAtoms::AddrefAtoms()
screen = NS_NewAtom("SCREEN");
tty = NS_NewAtom("TTY");
tv = NS_NewAtom("TV");
absoluteList = NS_NewAtom("Absolute-list");
colGroupList = NS_NewAtom("ColGroup-list");
floaterList = NS_NewAtom("Floater-list");
bulletList = NS_NewAtom("Bullet-list");
}
++gRefCnt;
}
@ -63,6 +73,11 @@ void nsLayoutAtoms::ReleaseAtoms()
NS_RELEASE(screen);
NS_RELEASE(tty);
NS_RELEASE(tv);
NS_RELEASE(absoluteList);
NS_RELEASE(colGroupList);
NS_RELEASE(floaterList);
NS_RELEASE(bulletList);
}
}

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

@ -33,23 +33,23 @@ public:
static void AddrefAtoms();
static void ReleaseAtoms();
// Alphabetical list of atoms
// Alphabetical list of media type atoms
static nsIAtom* all;
static nsIAtom* aural;
static nsIAtom* braille;
static nsIAtom* embossed;
static nsIAtom* handheld;
static nsIAtom* print;
static nsIAtom* projection;
static nsIAtom* screen;
static nsIAtom* tty;
static nsIAtom* tv;
// Alphabetical list of frame additional child list names
static nsIAtom* absoluteList;
static nsIAtom* colGroupList;
static nsIAtom* floaterList;
static nsIAtom* bulletList;
};
#endif /* nsLayoutAtoms_h___ */

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

@ -33,23 +33,23 @@ public:
static void AddrefAtoms();
static void ReleaseAtoms();
// Alphabetical list of atoms
// Alphabetical list of media type atoms
static nsIAtom* all;
static nsIAtom* aural;
static nsIAtom* braille;
static nsIAtom* embossed;
static nsIAtom* handheld;
static nsIAtom* print;
static nsIAtom* projection;
static nsIAtom* screen;
static nsIAtom* tty;
static nsIAtom* tv;
// Alphabetical list of frame additional child list names
static nsIAtom* absoluteList;
static nsIAtom* colGroupList;
static nsIAtom* floaterList;
static nsIAtom* bulletList;
};
#endif /* nsLayoutAtoms_h___ */

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

@ -30,6 +30,11 @@ nsIAtom* nsLayoutAtoms::screen;
nsIAtom* nsLayoutAtoms::tty;
nsIAtom* nsLayoutAtoms::tv;
nsIAtom* nsLayoutAtoms::absoluteList;
nsIAtom* nsLayoutAtoms::colGroupList;
nsIAtom* nsLayoutAtoms::floaterList;
nsIAtom* nsLayoutAtoms::bulletList;
static nsrefcnt gRefCnt;
void nsLayoutAtoms::AddrefAtoms()
@ -45,6 +50,11 @@ void nsLayoutAtoms::AddrefAtoms()
screen = NS_NewAtom("SCREEN");
tty = NS_NewAtom("TTY");
tv = NS_NewAtom("TV");
absoluteList = NS_NewAtom("Absolute-list");
colGroupList = NS_NewAtom("ColGroup-list");
floaterList = NS_NewAtom("Floater-list");
bulletList = NS_NewAtom("Bullet-list");
}
++gRefCnt;
}
@ -63,6 +73,11 @@ void nsLayoutAtoms::ReleaseAtoms()
NS_RELEASE(screen);
NS_RELEASE(tty);
NS_RELEASE(tv);
NS_RELEASE(absoluteList);
NS_RELEASE(colGroupList);
NS_RELEASE(floaterList);
NS_RELEASE(bulletList);
}
}

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

@ -43,6 +43,7 @@
#include "nsDOMEvent.h"
#include "nsIHTMLContent.h"
#include "prprf.h"
#include "nsLayoutAtoms.h"
// XXX temporary for :first-letter support
#include "nsITextContent.h"
@ -395,9 +396,6 @@ nsBlockReflowState::GetAvailableSpace()
//----------------------------------------------------------------------
nsIAtom* nsBaseIBFrame::gFloaterAtom;
nsIAtom* nsBaseIBFrame::gBulletAtom;
/* 52b33130-0b99-11d2-932e-00805f8add32 */
#define NS_BLOCK_FRAME_CID \
{ 0x52b33130, 0x0b99, 0x11d2, {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
@ -406,13 +404,6 @@ static const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID;
nsBaseIBFrame::nsBaseIBFrame()
{
// XXX for now these are a memory leak
if (nsnull == gFloaterAtom) {
gFloaterAtom = NS_NewAtom("Floater-list");
}
if (nsnull == gBulletAtom) {
gBulletAtom = NS_NewAtom("Bullet-list");
}
}
nsBaseIBFrame::~nsBaseIBFrame()
@ -4208,11 +4199,11 @@ nsBlockFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const
aFirstChild = (nsnull != mLines) ? mLines->mFirstChild : nsnull;
return NS_OK;
}
else if (aListName == gFloaterAtom) {
else if (aListName == nsLayoutAtoms::floaterList) {
aFirstChild = mFloaters;
return NS_OK;
}
else if (aListName == gBulletAtom) {
else if (aListName == nsLayoutAtoms::bulletList) {
aFirstChild = mBullet;
return NS_OK;
}
@ -4230,11 +4221,11 @@ nsBlockFrame::GetAdditionalChildListName(PRInt32 aIndex,
nsIAtom* atom = nsnull;
switch (aIndex) {
case NS_BLOCK_FRAME_FLOATER_LIST_INDEX:
atom = gFloaterAtom;
atom = nsLayoutAtoms::floaterList;
NS_ADDREF(atom);
break;
case NS_BLOCK_FRAME_BULLET_LIST_INDEX:
atom = gBulletAtom;
atom = nsLayoutAtoms::bulletList;
NS_ADDREF(atom);
break;
}
@ -4701,13 +4692,13 @@ nsBlockFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
return NS_OK;
}
if (nsnull != mBullet) {
rv = GetFrameForPointUsing(aPoint, gBulletAtom, aFrame);
rv = GetFrameForPointUsing(aPoint, nsLayoutAtoms::bulletList, aFrame);
if (NS_OK == rv) {
return NS_OK;
}
}
if (nsnull != mFloaters) {
rv = GetFrameForPointUsing(aPoint, gFloaterAtom, aFrame);
rv = GetFrameForPointUsing(aPoint, nsLayoutAtoms::floaterList, aFrame);
if (NS_OK == rv) {
return NS_OK;
}

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

@ -274,6 +274,14 @@ protected:
#define nsBlockFrameSuper nsBaseIBFrame
/**
* The block frame has two additional named child lists:
* - "Floater-list" which contains the floated frames
* - "Bullet-list" which contains the bullet frame
*
* @see nsLayoutAtoms::bulletList
* @see nsLayoutAtoms::floaterList
*/
class nsBlockFrame : public nsBlockFrameSuper
{
public:

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

@ -43,6 +43,7 @@
#include "nsDOMEvent.h"
#include "nsIHTMLContent.h"
#include "prprf.h"
#include "nsLayoutAtoms.h"
// XXX temporary for :first-letter support
#include "nsITextContent.h"
@ -395,9 +396,6 @@ nsBlockReflowState::GetAvailableSpace()
//----------------------------------------------------------------------
nsIAtom* nsBaseIBFrame::gFloaterAtom;
nsIAtom* nsBaseIBFrame::gBulletAtom;
/* 52b33130-0b99-11d2-932e-00805f8add32 */
#define NS_BLOCK_FRAME_CID \
{ 0x52b33130, 0x0b99, 0x11d2, {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
@ -406,13 +404,6 @@ static const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID;
nsBaseIBFrame::nsBaseIBFrame()
{
// XXX for now these are a memory leak
if (nsnull == gFloaterAtom) {
gFloaterAtom = NS_NewAtom("Floater-list");
}
if (nsnull == gBulletAtom) {
gBulletAtom = NS_NewAtom("Bullet-list");
}
}
nsBaseIBFrame::~nsBaseIBFrame()
@ -4208,11 +4199,11 @@ nsBlockFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const
aFirstChild = (nsnull != mLines) ? mLines->mFirstChild : nsnull;
return NS_OK;
}
else if (aListName == gFloaterAtom) {
else if (aListName == nsLayoutAtoms::floaterList) {
aFirstChild = mFloaters;
return NS_OK;
}
else if (aListName == gBulletAtom) {
else if (aListName == nsLayoutAtoms::bulletList) {
aFirstChild = mBullet;
return NS_OK;
}
@ -4230,11 +4221,11 @@ nsBlockFrame::GetAdditionalChildListName(PRInt32 aIndex,
nsIAtom* atom = nsnull;
switch (aIndex) {
case NS_BLOCK_FRAME_FLOATER_LIST_INDEX:
atom = gFloaterAtom;
atom = nsLayoutAtoms::floaterList;
NS_ADDREF(atom);
break;
case NS_BLOCK_FRAME_BULLET_LIST_INDEX:
atom = gBulletAtom;
atom = nsLayoutAtoms::bulletList;
NS_ADDREF(atom);
break;
}
@ -4701,13 +4692,13 @@ nsBlockFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
return NS_OK;
}
if (nsnull != mBullet) {
rv = GetFrameForPointUsing(aPoint, gBulletAtom, aFrame);
rv = GetFrameForPointUsing(aPoint, nsLayoutAtoms::bulletList, aFrame);
if (NS_OK == rv) {
return NS_OK;
}
}
if (nsnull != mFloaters) {
rv = GetFrameForPointUsing(aPoint, gFloaterAtom, aFrame);
rv = GetFrameForPointUsing(aPoint, nsLayoutAtoms::floaterList, aFrame);
if (NS_OK == rv) {
return NS_OK;
}

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

@ -43,6 +43,7 @@
#include "nsDOMEvent.h"
#include "nsIHTMLContent.h"
#include "prprf.h"
#include "nsLayoutAtoms.h"
// XXX temporary for :first-letter support
#include "nsITextContent.h"
@ -395,9 +396,6 @@ nsBlockReflowState::GetAvailableSpace()
//----------------------------------------------------------------------
nsIAtom* nsBaseIBFrame::gFloaterAtom;
nsIAtom* nsBaseIBFrame::gBulletAtom;
/* 52b33130-0b99-11d2-932e-00805f8add32 */
#define NS_BLOCK_FRAME_CID \
{ 0x52b33130, 0x0b99, 0x11d2, {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
@ -406,13 +404,6 @@ static const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID;
nsBaseIBFrame::nsBaseIBFrame()
{
// XXX for now these are a memory leak
if (nsnull == gFloaterAtom) {
gFloaterAtom = NS_NewAtom("Floater-list");
}
if (nsnull == gBulletAtom) {
gBulletAtom = NS_NewAtom("Bullet-list");
}
}
nsBaseIBFrame::~nsBaseIBFrame()
@ -4208,11 +4199,11 @@ nsBlockFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const
aFirstChild = (nsnull != mLines) ? mLines->mFirstChild : nsnull;
return NS_OK;
}
else if (aListName == gFloaterAtom) {
else if (aListName == nsLayoutAtoms::floaterList) {
aFirstChild = mFloaters;
return NS_OK;
}
else if (aListName == gBulletAtom) {
else if (aListName == nsLayoutAtoms::bulletList) {
aFirstChild = mBullet;
return NS_OK;
}
@ -4230,11 +4221,11 @@ nsBlockFrame::GetAdditionalChildListName(PRInt32 aIndex,
nsIAtom* atom = nsnull;
switch (aIndex) {
case NS_BLOCK_FRAME_FLOATER_LIST_INDEX:
atom = gFloaterAtom;
atom = nsLayoutAtoms::floaterList;
NS_ADDREF(atom);
break;
case NS_BLOCK_FRAME_BULLET_LIST_INDEX:
atom = gBulletAtom;
atom = nsLayoutAtoms::bulletList;
NS_ADDREF(atom);
break;
}
@ -4701,13 +4692,13 @@ nsBlockFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
return NS_OK;
}
if (nsnull != mBullet) {
rv = GetFrameForPointUsing(aPoint, gBulletAtom, aFrame);
rv = GetFrameForPointUsing(aPoint, nsLayoutAtoms::bulletList, aFrame);
if (NS_OK == rv) {
return NS_OK;
}
}
if (nsnull != mFloaters) {
rv = GetFrameForPointUsing(aPoint, gFloaterAtom, aFrame);
rv = GetFrameForPointUsing(aPoint, nsLayoutAtoms::floaterList, aFrame);
if (NS_OK == rv) {
return NS_OK;
}

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

@ -43,6 +43,7 @@
#include "nsDOMEvent.h"
#include "nsIHTMLContent.h"
#include "prprf.h"
#include "nsLayoutAtoms.h"
// XXX temporary for :first-letter support
#include "nsITextContent.h"
@ -395,9 +396,6 @@ nsBlockReflowState::GetAvailableSpace()
//----------------------------------------------------------------------
nsIAtom* nsBaseIBFrame::gFloaterAtom;
nsIAtom* nsBaseIBFrame::gBulletAtom;
/* 52b33130-0b99-11d2-932e-00805f8add32 */
#define NS_BLOCK_FRAME_CID \
{ 0x52b33130, 0x0b99, 0x11d2, {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
@ -406,13 +404,6 @@ static const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID;
nsBaseIBFrame::nsBaseIBFrame()
{
// XXX for now these are a memory leak
if (nsnull == gFloaterAtom) {
gFloaterAtom = NS_NewAtom("Floater-list");
}
if (nsnull == gBulletAtom) {
gBulletAtom = NS_NewAtom("Bullet-list");
}
}
nsBaseIBFrame::~nsBaseIBFrame()
@ -4208,11 +4199,11 @@ nsBlockFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const
aFirstChild = (nsnull != mLines) ? mLines->mFirstChild : nsnull;
return NS_OK;
}
else if (aListName == gFloaterAtom) {
else if (aListName == nsLayoutAtoms::floaterList) {
aFirstChild = mFloaters;
return NS_OK;
}
else if (aListName == gBulletAtom) {
else if (aListName == nsLayoutAtoms::bulletList) {
aFirstChild = mBullet;
return NS_OK;
}
@ -4230,11 +4221,11 @@ nsBlockFrame::GetAdditionalChildListName(PRInt32 aIndex,
nsIAtom* atom = nsnull;
switch (aIndex) {
case NS_BLOCK_FRAME_FLOATER_LIST_INDEX:
atom = gFloaterAtom;
atom = nsLayoutAtoms::floaterList;
NS_ADDREF(atom);
break;
case NS_BLOCK_FRAME_BULLET_LIST_INDEX:
atom = gBulletAtom;
atom = nsLayoutAtoms::bulletList;
NS_ADDREF(atom);
break;
}
@ -4701,13 +4692,13 @@ nsBlockFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
return NS_OK;
}
if (nsnull != mBullet) {
rv = GetFrameForPointUsing(aPoint, gBulletAtom, aFrame);
rv = GetFrameForPointUsing(aPoint, nsLayoutAtoms::bulletList, aFrame);
if (NS_OK == rv) {
return NS_OK;
}
}
if (nsnull != mFloaters) {
rv = GetFrameForPointUsing(aPoint, gFloaterAtom, aFrame);
rv = GetFrameForPointUsing(aPoint, nsLayoutAtoms::floaterList, aFrame);
if (NS_OK == rv) {
return NS_OK;
}

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

@ -274,6 +274,14 @@ protected:
#define nsBlockFrameSuper nsBaseIBFrame
/**
* The block frame has two additional named child lists:
* - "Floater-list" which contains the floated frames
* - "Bullet-list" which contains the bullet frame
*
* @see nsLayoutAtoms::bulletList
* @see nsLayoutAtoms::floaterList
*/
class nsBlockFrame : public nsBlockFrameSuper
{
public:

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

@ -43,6 +43,7 @@
#include "nsDOMEvent.h"
#include "nsIHTMLContent.h"
#include "prprf.h"
#include "nsLayoutAtoms.h"
// XXX temporary for :first-letter support
#include "nsITextContent.h"
@ -395,9 +396,6 @@ nsBlockReflowState::GetAvailableSpace()
//----------------------------------------------------------------------
nsIAtom* nsBaseIBFrame::gFloaterAtom;
nsIAtom* nsBaseIBFrame::gBulletAtom;
/* 52b33130-0b99-11d2-932e-00805f8add32 */
#define NS_BLOCK_FRAME_CID \
{ 0x52b33130, 0x0b99, 0x11d2, {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
@ -406,13 +404,6 @@ static const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID;
nsBaseIBFrame::nsBaseIBFrame()
{
// XXX for now these are a memory leak
if (nsnull == gFloaterAtom) {
gFloaterAtom = NS_NewAtom("Floater-list");
}
if (nsnull == gBulletAtom) {
gBulletAtom = NS_NewAtom("Bullet-list");
}
}
nsBaseIBFrame::~nsBaseIBFrame()
@ -4208,11 +4199,11 @@ nsBlockFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const
aFirstChild = (nsnull != mLines) ? mLines->mFirstChild : nsnull;
return NS_OK;
}
else if (aListName == gFloaterAtom) {
else if (aListName == nsLayoutAtoms::floaterList) {
aFirstChild = mFloaters;
return NS_OK;
}
else if (aListName == gBulletAtom) {
else if (aListName == nsLayoutAtoms::bulletList) {
aFirstChild = mBullet;
return NS_OK;
}
@ -4230,11 +4221,11 @@ nsBlockFrame::GetAdditionalChildListName(PRInt32 aIndex,
nsIAtom* atom = nsnull;
switch (aIndex) {
case NS_BLOCK_FRAME_FLOATER_LIST_INDEX:
atom = gFloaterAtom;
atom = nsLayoutAtoms::floaterList;
NS_ADDREF(atom);
break;
case NS_BLOCK_FRAME_BULLET_LIST_INDEX:
atom = gBulletAtom;
atom = nsLayoutAtoms::bulletList;
NS_ADDREF(atom);
break;
}
@ -4701,13 +4692,13 @@ nsBlockFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
return NS_OK;
}
if (nsnull != mBullet) {
rv = GetFrameForPointUsing(aPoint, gBulletAtom, aFrame);
rv = GetFrameForPointUsing(aPoint, nsLayoutAtoms::bulletList, aFrame);
if (NS_OK == rv) {
return NS_OK;
}
}
if (nsnull != mFloaters) {
rv = GetFrameForPointUsing(aPoint, gFloaterAtom, aFrame);
rv = GetFrameForPointUsing(aPoint, nsLayoutAtoms::floaterList, aFrame);
if (NS_OK == rv) {
return NS_OK;
}

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

@ -43,6 +43,7 @@
#include "nsDOMEvent.h"
#include "nsIHTMLContent.h"
#include "prprf.h"
#include "nsLayoutAtoms.h"
// XXX temporary for :first-letter support
#include "nsITextContent.h"
@ -395,9 +396,6 @@ nsBlockReflowState::GetAvailableSpace()
//----------------------------------------------------------------------
nsIAtom* nsBaseIBFrame::gFloaterAtom;
nsIAtom* nsBaseIBFrame::gBulletAtom;
/* 52b33130-0b99-11d2-932e-00805f8add32 */
#define NS_BLOCK_FRAME_CID \
{ 0x52b33130, 0x0b99, 0x11d2, {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
@ -406,13 +404,6 @@ static const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID;
nsBaseIBFrame::nsBaseIBFrame()
{
// XXX for now these are a memory leak
if (nsnull == gFloaterAtom) {
gFloaterAtom = NS_NewAtom("Floater-list");
}
if (nsnull == gBulletAtom) {
gBulletAtom = NS_NewAtom("Bullet-list");
}
}
nsBaseIBFrame::~nsBaseIBFrame()
@ -4208,11 +4199,11 @@ nsBlockFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const
aFirstChild = (nsnull != mLines) ? mLines->mFirstChild : nsnull;
return NS_OK;
}
else if (aListName == gFloaterAtom) {
else if (aListName == nsLayoutAtoms::floaterList) {
aFirstChild = mFloaters;
return NS_OK;
}
else if (aListName == gBulletAtom) {
else if (aListName == nsLayoutAtoms::bulletList) {
aFirstChild = mBullet;
return NS_OK;
}
@ -4230,11 +4221,11 @@ nsBlockFrame::GetAdditionalChildListName(PRInt32 aIndex,
nsIAtom* atom = nsnull;
switch (aIndex) {
case NS_BLOCK_FRAME_FLOATER_LIST_INDEX:
atom = gFloaterAtom;
atom = nsLayoutAtoms::floaterList;
NS_ADDREF(atom);
break;
case NS_BLOCK_FRAME_BULLET_LIST_INDEX:
atom = gBulletAtom;
atom = nsLayoutAtoms::bulletList;
NS_ADDREF(atom);
break;
}
@ -4701,13 +4692,13 @@ nsBlockFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
return NS_OK;
}
if (nsnull != mBullet) {
rv = GetFrameForPointUsing(aPoint, gBulletAtom, aFrame);
rv = GetFrameForPointUsing(aPoint, nsLayoutAtoms::bulletList, aFrame);
if (NS_OK == rv) {
return NS_OK;
}
}
if (nsnull != mFloaters) {
rv = GetFrameForPointUsing(aPoint, gFloaterAtom, aFrame);
rv = GetFrameForPointUsing(aPoint, nsLayoutAtoms::floaterList, aFrame);
if (NS_OK == rv) {
return NS_OK;
}

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

@ -34,11 +34,10 @@
#include "nsIWebShell.h"
#include "nsHTMLValue.h"
#include "nsHTMLParts.h"
#include "nsLayoutAtoms.h"
static NS_DEFINE_IID(kIWebShellIID, NS_IWEB_SHELL_IID);
nsIAtom* nsBodyFrame::gAbsoluteAtom;
nsresult
NS_NewBodyFrame(nsIFrame*& aResult, PRUint32 aFlags)
{
@ -55,10 +54,6 @@ nsBodyFrame::nsBodyFrame()
{
mSpaceManager = new nsSpaceManager(this);
NS_ADDREF(mSpaceManager);
// XXX for now this is a memory leak
if (nsnull == gAbsoluteAtom) {
gAbsoluteAtom = NS_NewAtom("Absolute-list");
}
}
nsBodyFrame::~nsBodyFrame()
@ -104,7 +99,7 @@ nsBodyFrame::GetAdditionalChildListName(PRInt32 aIndex,
nsIAtom* atom = nsnull;
if (NS_BODY_FRAME_ABSOLUTE_LIST_INDEX == aIndex) {
atom = gAbsoluteAtom;
atom = nsLayoutAtoms::absoluteList;
NS_ADDREF(atom);
}
aListName = atom;
@ -114,7 +109,7 @@ nsBodyFrame::GetAdditionalChildListName(PRInt32 aIndex,
NS_IMETHODIMP
nsBodyFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const
{
if (aListName == gAbsoluteAtom) {
if (aListName == nsLayoutAtoms::absoluteList) {
aFirstChild = mAbsoluteFrames;
return NS_OK;
}

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

@ -34,6 +34,12 @@ struct nsStylePosition;
*/
#define NS_BODY_FRAME_ABSOLUTE_LIST_INDEX (NS_BLOCK_FRAME_LAST_LIST_INDEX + 1)
/**
* The body frame has an additional named child list:
* - "Absolute-list" which contains the absolutely positioned frames
*
* @see nsLayoutAtoms::absoluteList
*/
class nsBodyFrame : public nsBlockFrame,
public nsIAbsoluteItems
{

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

@ -41,6 +41,7 @@
#include "nsHTMLAtoms.h"
#include "nsHTMLIIDs.h"
#include "nsIReflowCommand.h"
#include "nsLayoutAtoms.h"
#ifdef NS_DEBUG
static PRBool gsDebug = PR_FALSE;
@ -266,8 +267,6 @@ void ColumnInfoCache::GetColumnsByType(const nsStyleUnit aType,
/* --------------------- nsTableFrame -------------------- */
nsIAtom* nsTableFrame::gColGroupAtom=nsnull;
nsTableFrame::nsTableFrame()
: nsHTMLContainerFrame(),
mCellMap(nsnull),
@ -288,10 +287,6 @@ nsTableFrame::nsTableFrame()
mColGroups=nsnull;
mDefaultCellSpacing=0;
mDefaultCellPadding=0;
// XXX for now these are a memory leak
if (nsnull == gColGroupAtom) {
gColGroupAtom = NS_NewAtom("ColGroup-list");
}
}
NS_IMETHODIMP
@ -1370,7 +1365,7 @@ nsTableFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const
aFirstChild = mFirstChild;
return NS_OK;
}
else if (aListName == gColGroupAtom) {
else if (aListName == nsLayoutAtoms::colGroupList) {
aFirstChild = mColGroups;
return NS_OK;
}
@ -1388,7 +1383,7 @@ nsTableFrame::GetAdditionalChildListName(PRInt32 aIndex,
nsIAtom* atom = nsnull;
switch (aIndex) {
case NS_TABLE_FRAME_COLGROUP_LIST_INDEX:
atom = gColGroupAtom;
atom = nsLayoutAtoms::colGroupList;
NS_ADDREF(atom);
break;
}

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

@ -56,7 +56,7 @@ struct nsStyleSpacing;
* named child list:
* - "ColGroup-list" which contains the col group frames
*
* @author sclark
* @see nsLayoutAtoms::colGroupList
*
* TODO: make methods virtual so nsTableFrame can be used as a base class in the future.
*/

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

@ -41,6 +41,7 @@
#include "nsHTMLAtoms.h"
#include "nsHTMLIIDs.h"
#include "nsIReflowCommand.h"
#include "nsLayoutAtoms.h"
#ifdef NS_DEBUG
static PRBool gsDebug = PR_FALSE;
@ -266,8 +267,6 @@ void ColumnInfoCache::GetColumnsByType(const nsStyleUnit aType,
/* --------------------- nsTableFrame -------------------- */
nsIAtom* nsTableFrame::gColGroupAtom=nsnull;
nsTableFrame::nsTableFrame()
: nsHTMLContainerFrame(),
mCellMap(nsnull),
@ -288,10 +287,6 @@ nsTableFrame::nsTableFrame()
mColGroups=nsnull;
mDefaultCellSpacing=0;
mDefaultCellPadding=0;
// XXX for now these are a memory leak
if (nsnull == gColGroupAtom) {
gColGroupAtom = NS_NewAtom("ColGroup-list");
}
}
NS_IMETHODIMP
@ -1370,7 +1365,7 @@ nsTableFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const
aFirstChild = mFirstChild;
return NS_OK;
}
else if (aListName == gColGroupAtom) {
else if (aListName == nsLayoutAtoms::colGroupList) {
aFirstChild = mColGroups;
return NS_OK;
}
@ -1388,7 +1383,7 @@ nsTableFrame::GetAdditionalChildListName(PRInt32 aIndex,
nsIAtom* atom = nsnull;
switch (aIndex) {
case NS_TABLE_FRAME_COLGROUP_LIST_INDEX:
atom = gColGroupAtom;
atom = nsLayoutAtoms::colGroupList;
NS_ADDREF(atom);
break;
}

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

@ -56,7 +56,7 @@ struct nsStyleSpacing;
* named child list:
* - "ColGroup-list" which contains the col group frames
*
* @author sclark
* @see nsLayoutAtoms::colGroupList
*
* TODO: make methods virtual so nsTableFrame can be used as a base class in the future.
*/