mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-27 07:34:20 +00:00
fixed bug #1070
This commit is contained in:
parent
0b267cb551
commit
a48e2c18f1
@ -17,8 +17,8 @@
|
||||
*/
|
||||
|
||||
#include "nsDebug.h"
|
||||
#include "nsIDTDDebug.h"
|
||||
#include "CNavDTD.h"
|
||||
#include "nsIDTDDebug.h"
|
||||
#include "CNavDTD.h"
|
||||
#include "nsHTMLTokens.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsParser.h"
|
||||
|
@ -33,7 +33,7 @@ static CTokenDeallocator gTokenKiller;
|
||||
* @update gess9/10/98
|
||||
*/
|
||||
nsTagStack::nsTagStack(int aDefaultSize) {
|
||||
#ifdef _dynstack
|
||||
#ifndef rickgdebug
|
||||
mSize=aDefaultSize;
|
||||
mTags =new eHTMLTags[mSize];
|
||||
mBits =new PRBool[mSize];
|
||||
@ -51,13 +51,13 @@ nsTagStack::nsTagStack(int aDefaultSize) {
|
||||
* @update gess7/9/98
|
||||
*/
|
||||
nsTagStack::~nsTagStack() {
|
||||
#ifdef _dynstack
|
||||
#ifndef rickgdebug
|
||||
delete mTags;
|
||||
delete mBits;
|
||||
mTags=0;
|
||||
mBits=0;
|
||||
#endif
|
||||
mSize=mCount=0;
|
||||
mSize=mCount=0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -70,12 +70,12 @@ void nsTagStack::Empty(void) {
|
||||
|
||||
/**
|
||||
*
|
||||
* @update gess7/9/98
|
||||
* @update gess7/9/98
|
||||
*/
|
||||
void nsTagStack::Push(eHTMLTags aTag) {
|
||||
|
||||
if(mCount>=mSize) {
|
||||
#ifdef _dynstack
|
||||
#ifndef rickgdebug
|
||||
//regrow the dynamic stack...
|
||||
eHTMLTags* tmp=new eHTMLTags[2*mSize];
|
||||
nsCRT::zero(tmp,2*mSize*sizeof(eHTMLTag_html));
|
||||
|
@ -40,22 +40,27 @@
|
||||
|
||||
Simply put, we've built ourselves a little data structure that
|
||||
serves as a stack for htmltags (and associated bits).
|
||||
What's special is that if you #define _dynstack 1, the stack
|
||||
What's special is that if you #define rickgdebug 1, the stack
|
||||
size can grow dynamically (like you'ld want in a release build.)
|
||||
If you don't #define _dynstack 1, then the stack is a fixed size,
|
||||
If you don't #define rickgdebug 1, then the stack is a fixed size,
|
||||
equal to the eStackSize enum. This makes debugging easier, because
|
||||
you can see the htmltags on the stack if its not dynamic.
|
||||
***************************************************************/
|
||||
|
||||
void DebugDumpContainmentRules(nsIDTD& theDTD,const char* aFilename,const char* aTitle);
|
||||
|
||||
//#define _dynstack 1
|
||||
class nsTagStack {
|
||||
enum {eStackSize=200};
|
||||
//#define rickgdebug 1
|
||||
|
||||
class nsTagStack {
|
||||
public:
|
||||
|
||||
nsTagStack(int aDefaultSize=50);
|
||||
#ifdef rickgdebug
|
||||
enum {eStackSize=200};
|
||||
#else
|
||||
enum {eStackSize=30};
|
||||
#endif
|
||||
|
||||
nsTagStack(int aDefaultSize=eStackSize);
|
||||
~nsTagStack();
|
||||
void Push(eHTMLTags aTag);
|
||||
eHTMLTags Pop();
|
||||
@ -67,7 +72,7 @@ public:
|
||||
int mSize;
|
||||
int mCount;
|
||||
|
||||
#ifdef _dynstack
|
||||
#ifndef rickgdebug
|
||||
eHTMLTags* mTags;
|
||||
PRBool* mBits;
|
||||
#else
|
||||
@ -86,7 +91,7 @@ public:
|
||||
|
||||
class nsDTDContext {
|
||||
public:
|
||||
nsDTDContext(int aDefaultSize=50);
|
||||
nsDTDContext(int aDefaultSize=nsTagStack::eStackSize);
|
||||
~nsDTDContext();
|
||||
void pushStyleStack(nsTagStack* aStack=0);
|
||||
nsTagStack* popStyleStack();
|
||||
|
@ -17,8 +17,8 @@
|
||||
*/
|
||||
|
||||
#include "nsDebug.h"
|
||||
#include "nsIDTDDebug.h"
|
||||
#include "CNavDTD.h"
|
||||
#include "nsIDTDDebug.h"
|
||||
#include "CNavDTD.h"
|
||||
#include "nsHTMLTokens.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsParser.h"
|
||||
|
@ -33,7 +33,7 @@ static CTokenDeallocator gTokenKiller;
|
||||
* @update gess9/10/98
|
||||
*/
|
||||
nsTagStack::nsTagStack(int aDefaultSize) {
|
||||
#ifdef _dynstack
|
||||
#ifndef rickgdebug
|
||||
mSize=aDefaultSize;
|
||||
mTags =new eHTMLTags[mSize];
|
||||
mBits =new PRBool[mSize];
|
||||
@ -51,13 +51,13 @@ nsTagStack::nsTagStack(int aDefaultSize) {
|
||||
* @update gess7/9/98
|
||||
*/
|
||||
nsTagStack::~nsTagStack() {
|
||||
#ifdef _dynstack
|
||||
#ifndef rickgdebug
|
||||
delete mTags;
|
||||
delete mBits;
|
||||
mTags=0;
|
||||
mBits=0;
|
||||
#endif
|
||||
mSize=mCount=0;
|
||||
mSize=mCount=0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -70,12 +70,12 @@ void nsTagStack::Empty(void) {
|
||||
|
||||
/**
|
||||
*
|
||||
* @update gess7/9/98
|
||||
* @update gess7/9/98
|
||||
*/
|
||||
void nsTagStack::Push(eHTMLTags aTag) {
|
||||
|
||||
if(mCount>=mSize) {
|
||||
#ifdef _dynstack
|
||||
#ifndef rickgdebug
|
||||
//regrow the dynamic stack...
|
||||
eHTMLTags* tmp=new eHTMLTags[2*mSize];
|
||||
nsCRT::zero(tmp,2*mSize*sizeof(eHTMLTag_html));
|
||||
|
@ -40,22 +40,27 @@
|
||||
|
||||
Simply put, we've built ourselves a little data structure that
|
||||
serves as a stack for htmltags (and associated bits).
|
||||
What's special is that if you #define _dynstack 1, the stack
|
||||
What's special is that if you #define rickgdebug 1, the stack
|
||||
size can grow dynamically (like you'ld want in a release build.)
|
||||
If you don't #define _dynstack 1, then the stack is a fixed size,
|
||||
If you don't #define rickgdebug 1, then the stack is a fixed size,
|
||||
equal to the eStackSize enum. This makes debugging easier, because
|
||||
you can see the htmltags on the stack if its not dynamic.
|
||||
***************************************************************/
|
||||
|
||||
void DebugDumpContainmentRules(nsIDTD& theDTD,const char* aFilename,const char* aTitle);
|
||||
|
||||
//#define _dynstack 1
|
||||
class nsTagStack {
|
||||
enum {eStackSize=200};
|
||||
//#define rickgdebug 1
|
||||
|
||||
class nsTagStack {
|
||||
public:
|
||||
|
||||
nsTagStack(int aDefaultSize=50);
|
||||
#ifdef rickgdebug
|
||||
enum {eStackSize=200};
|
||||
#else
|
||||
enum {eStackSize=30};
|
||||
#endif
|
||||
|
||||
nsTagStack(int aDefaultSize=eStackSize);
|
||||
~nsTagStack();
|
||||
void Push(eHTMLTags aTag);
|
||||
eHTMLTags Pop();
|
||||
@ -67,7 +72,7 @@ public:
|
||||
int mSize;
|
||||
int mCount;
|
||||
|
||||
#ifdef _dynstack
|
||||
#ifndef rickgdebug
|
||||
eHTMLTags* mTags;
|
||||
PRBool* mBits;
|
||||
#else
|
||||
@ -86,7 +91,7 @@ public:
|
||||
|
||||
class nsDTDContext {
|
||||
public:
|
||||
nsDTDContext(int aDefaultSize=50);
|
||||
nsDTDContext(int aDefaultSize=nsTagStack::eStackSize);
|
||||
~nsDTDContext();
|
||||
void pushStyleStack(nsTagStack* aStack=0);
|
||||
nsTagStack* popStyleStack();
|
||||
|
Loading…
x
Reference in New Issue
Block a user