Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Member Functions | Static Public Member Functions | Public Attributes
nsDTDContext Class Reference

#include <nsDTDUtils.h>

Collaboration diagram for nsDTDContext:
Collaboration graph
[legend]

List of all members.

Classes

struct  CFlags

Public Member Functions

 nsDTDContext ()
 gess 04.21.2000
 ~nsDTDContext ()
 gess9/10/98
nsTagEntryPopEntry ()
void PushEntry (nsTagEntry *aEntry, PRBool aRefCntNode=PR_TRUE)
void MoveEntries (nsDTDContext &aDest, PRInt32 aCount)
void Push (nsCParserNode *aNode, nsEntryStack *aStyleStack=0, PRBool aRefCntNode=PR_TRUE)
 gess7/9/98
nsCParserNodePop (nsEntryStack *&aChildStack)
 gess 11/11/99, harishd 04/04/99
nsCParserNodePop ()
 harishd 04/07/00
nsCParserNodePeekNode ()
eHTMLTags First (void) const
 gess7/9/98
eHTMLTags Last (void) const
 gess7/9/98
nsTagEntryLastEntry (void) const
 gess7/9/98
eHTMLTags TagAt (PRInt32 anIndex) const
 gess7/9/98
eHTMLTags operator[] (PRInt32 anIndex) const
PRBool HasOpenContainer (eHTMLTags aTag) const
 gess7/9/98
PRInt32 FirstOf (eHTMLTags aTag) const
PRInt32 LastOf (eHTMLTags aTag) const
void Empty (void)
PRInt32 GetCount (void) const
PRInt32 GetResidualStyleCount (void)
nsEntryStackGetStylesAt (PRInt32 anIndex) const
 gess7/9/98
void PushStyle (nsCParserNode *aNode)
 gess 04/28/99
void PushStyles (nsEntryStack *aStyles)
 Call this when you have an EntryStack full of styles that you want to push at this level.
nsCParserNodePopStyle (void)
 gess 04/28/99
nsCParserNodePopStyle (eHTMLTags aTag)
 gess 04/28/99
void RemoveStyle (eHTMLTags aTag)
 This is similar to popstyle, except that it removes the style tag given from anywhere in the style stack, and not just at the top.
void SetTokenAllocator (nsTokenAllocator *aTokenAllocator)
void SetNodeAllocator (nsNodeAllocator *aNodeAllocator)

Static Public Member Functions

static void ReleaseGlobalObjects (void)
 This gets called when the parser module is getting unloaded.

Public Attributes

nsEntryStack mStack
PRInt32 mResidualStyleCount
PRInt32 mContextTopIndex
union nsDTDContext.__unnamed__ 
nsTokenAllocatormTokenAllocator
nsNodeAllocatormNodeAllocator
CTableStatemTableStates
nsDeque mEntities

Detailed Description

Definition at line 300 of file nsDTDUtils.h.


Class Documentation

struct nsDTDContext::CFlags

Definition at line 342 of file nsDTDUtils.h.

Class Members
PRUint8 mHadBody:1
PRUint8 mHadFrameset:1
PRUint8 mHasOpenHead:1
PRUint8 mTransitional:1

Constructor & Destructor Documentation

gess 04.21.2000

Definition at line 430 of file nsDTDUtils.cpp.

                           : mStack(), mEntities(0){

  MOZ_COUNT_CTOR(nsDTDContext);
  mResidualStyleCount=0;
  mContextTopIndex=-1;
  mTableStates=0;
  mTokenAllocator=0;
  mNodeAllocator=0;
  mAllBits=0;

#ifdef DEBUG
  memset(mXTags,0,sizeof(mXTags));
#endif
} 

Here is the call graph for this function:

gess9/10/98

Definition at line 449 of file nsDTDUtils.cpp.

                            {
  MOZ_COUNT_DTOR(nsDTDContext);

  while(mTableStates) {
    //pop the current state and restore it's predecessor, if any...
    CTableState *theState=mTableStates;      
    mTableStates=theState->mPrevious;
    delete theState;
  }
}

Member Function Documentation

gess7/9/98

Definition at line 576 of file nsDTDUtils.cpp.

                                        {
  return mStack.First();
}

Here is the call graph for this function:

PRInt32 nsDTDContext::FirstOf ( eHTMLTags  aTag) const [inline]

Definition at line 318 of file nsDTDUtils.h.

{return mStack.FirstOf(aTag);}

Here is the call graph for this function:

PRInt32 nsDTDContext::GetCount ( void  ) const [inline]

Definition at line 322 of file nsDTDUtils.h.

{return mStack.mCount;}

Here is the caller graph for this function:

Definition at line 323 of file nsDTDUtils.h.

gess7/9/98

Definition at line 609 of file nsDTDUtils.cpp.

                                                             {
  nsEntryStack* result=0;

  if(anIndex<mStack.mCount){
    nsTagEntry* theEntry=mStack.EntryAt(anIndex);
    if(theEntry) {
      result=theEntry->mStyles;
    }
  }
  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gess7/9/98

Definition at line 465 of file nsDTDUtils.cpp.

                                                          {
  PRInt32 theIndex=mStack.LastOf(aTag);
  return PRBool(-1<theIndex);
}

Here is the call graph for this function:

Here is the caller graph for this function:

gess7/9/98

Definition at line 600 of file nsDTDUtils.cpp.

                                   {
  return mStack.Last();
}

Here is the call graph for this function:

Here is the caller graph for this function:

gess7/9/98

Definition at line 592 of file nsDTDUtils.cpp.

                                              {
  return mStack.EntryAt(mStack.mCount-1);
}

Here is the call graph for this function:

PRInt32 nsDTDContext::LastOf ( eHTMLTags  aTag) const [inline]

Definition at line 319 of file nsDTDUtils.h.

{return mStack.LastOf(aTag);}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 518 of file nsDTDUtils.cpp.

{
  NS_ASSERTION(aCount > 0 && mStack.mCount >= aCount, "cannot move entries");
  if (aCount > 0 && mStack.mCount >= aCount) {
    while (aCount) {
      aDest.PushEntry(&mStack.mEntries[--mStack.mCount], PR_FALSE);
#ifdef  NS_DEBUG
      mXTags[mStack.mCount] = eHTMLTag_unknown;
#endif
      --aCount;
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

eHTMLTags nsDTDContext::operator[] ( PRInt32  anIndex) const [inline]

Definition at line 316 of file nsDTDUtils.h.

{return TagAt(anIndex);}

Here is the call graph for this function:

Definition at line 311 of file nsDTDUtils.h.

{ return mStack.NodeAt(mStack.mCount-1); }

Here is the call graph for this function:

Here is the caller graph for this function:

gess 11/11/99, harishd 04/04/99

Definition at line 537 of file nsDTDUtils.cpp.

                                                                {

  PRInt32         theSize=mStack.mCount;
  nsCParserNode*  result=0;

  if(0<theSize) {

#ifdef  NS_DEBUG
    if ((theSize>0) && (theSize <= eMaxTags))
      mXTags[theSize-1]=eHTMLTag_unknown;
#endif


    nsTagEntry* theEntry=mStack.EntryAt(mStack.mCount-1);
    if(theEntry) {
      aChildStyleStack=theEntry->mStyles;
    }

    result=mStack.Pop();
    theEntry->mParent=0;
  }

  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

harishd 04/07/00

Definition at line 567 of file nsDTDUtils.cpp.

                                 {
  nsEntryStack   *theTempStyleStack=0; // This has no use here...
  return Pop(theTempStyleStack);
}

Definition at line 489 of file nsDTDUtils.cpp.

{
  PRInt32 theSize = mStack.mCount;
  if(0<theSize) {
#ifdef  NS_DEBUG
    if (theSize <= eMaxTags)
      mXTags[theSize-1]=eHTMLTag_unknown;
#endif
    return mStack.PopEntry();
  }
  return 0;
}

Here is the call graph for this function:

gess 04/28/99

Definition at line 689 of file nsDTDUtils.cpp.

                                         {
  nsCParserNode *result=0;

  nsTagEntry *theEntry=mStack.EntryAt(mStack.mCount-1);
  if(theEntry && (theEntry->mNode)) {
    nsEntryStack* theStyleStack=theEntry->mParent;
    if(theStyleStack){
      result=theStyleStack->Pop();
      mResidualStyleCount--;
    }
  } //if
  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gess 04/28/99

Definition at line 707 of file nsDTDUtils.cpp.

                                                   {

  PRInt32 theLevel=0;
  nsCParserNode* result=0;

  for(theLevel=mStack.mCount-1;theLevel>0;theLevel--) {
    nsEntryStack *theStack=mStack.mEntries[theLevel].mStyles;
    if(theStack) {
      if(aTag==theStack->Last()) {
        result=theStack->Pop();
        mResidualStyleCount--;
        break; // Fix bug 50710 - Stop after finding a style.
      } else {
        // NS_ERROR("bad residual style entry");
      }
    } 
  }

  return result;
}

Here is the call graph for this function:

void nsDTDContext::Push ( nsCParserNode aNode,
nsEntryStack aStyleStack = 0,
PRBool  aRefCntNode = PR_TRUE 
)

gess7/9/98

Definition at line 474 of file nsDTDUtils.cpp.

                                            {
  if(aNode) {
#ifdef  NS_DEBUG
    eHTMLTags theTag = (eHTMLTags)aNode->GetNodeType();
    int size = mStack.mCount;
    if (size < eMaxTags)
      mXTags[size] = theTag;
#endif
    mStack.Push(aNode, aStyleStack, aRefCntNode);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsDTDContext::PushEntry ( nsTagEntry aEntry,
PRBool  aRefCntNode = PR_TRUE 
)

Definition at line 502 of file nsDTDUtils.cpp.

{
#ifdef  NS_DEBUG
    int size=mStack.mCount;
    if(size< eMaxTags && aEntry)
      mXTags[size]=aEntry->mTag;
#endif
    mStack.PushEntry(aEntry, aRefCntNode);
}

Here is the call graph for this function:

Here is the caller graph for this function:

gess 04/28/99

Definition at line 626 of file nsDTDUtils.cpp.

                                                {

  nsTagEntry* theEntry=mStack.EntryAt(mStack.mCount-1);
  if(theEntry ) {
    nsEntryStack* theStack=theEntry->mStyles;
    if(!theStack) {
      theStack=theEntry->mStyles=new nsEntryStack();
    }
    if(theStack) {
      theStack->Push(aNode);
      ++mResidualStyleCount;
    }
  } //if
}

Here is the call graph for this function:

Here is the caller graph for this function:

Call this when you have an EntryStack full of styles that you want to push at this level.

gess 04/28/99

Definition at line 648 of file nsDTDUtils.cpp.

                                                  {

  if(aStyles) {
    nsTagEntry* theEntry=mStack.EntryAt(mStack.mCount-1);
    if(theEntry ) {
      nsEntryStack* theStyles=theEntry->mStyles;
      if(!theStyles) {
        theEntry->mStyles=aStyles;

        PRUint32 scount=aStyles->mCount;
        PRUint32 sindex=0;

        theEntry=aStyles->mEntries;
        for(sindex=0;sindex<scount;++sindex){            
          theEntry->mParent=0;  //this tells us that the style is not open at any level
          ++theEntry;
          ++mResidualStyleCount;
        } //for

      }
      else {
        theStyles->Append(aStyles);
        //  Delete aStyles since it has been copied to theStyles...
        delete aStyles;
        aStyles=0;
      }
    } //if(theEntry )
    else if(mStack.mCount==0) {
      // If you're here it means that we have hit the rock bottom
      // ,of the stack, and there's no need to handle anymore styles.
      // Fix for bug 29048
      IF_DELETE(aStyles,mNodeAllocator);
    }
  }//if(aStyles)
}

Here is the call graph for this function:

Here is the caller graph for this function:

This gets called when the parser module is getting unloaded.

Returns:
nada

Definition at line 762 of file nsDTDUtils.cpp.

                                           {
}

Here is the caller graph for this function:

This is similar to popstyle, except that it removes the style tag given from anywhere in the style stack, and not just at the top.

gess 01/26/00

Definition at line 736 of file nsDTDUtils.cpp.

                                            {
  
  PRInt32 theLevel=mStack.mCount;
  
  while (theLevel) {
    nsEntryStack *theStack=GetStylesAt(--theLevel);
    if (theStack) {
      PRInt32 index=theStack->mCount;
      while (index){
        nsTagEntry *theEntry=theStack->EntryAt(--index);
        if (aTag==(eHTMLTags)theEntry->mNode->GetNodeType()) {
          mResidualStyleCount--;
          nsCParserNode* result=theStack->Remove(index,aTag);
          IF_FREE(result, mNodeAllocator);  
          return;
        } 
      }
    } 
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsDTDContext::SetNodeAllocator ( nsNodeAllocator aNodeAllocator) [inline]

Definition at line 334 of file nsDTDUtils.h.

{ mNodeAllocator=aNodeAllocator; }
void nsDTDContext::SetTokenAllocator ( nsTokenAllocator aTokenAllocator) [inline]

Definition at line 333 of file nsDTDUtils.h.

{ mTokenAllocator=aTokenAllocator; }

gess7/9/98

Definition at line 584 of file nsDTDUtils.cpp.

                                                   {
  return mStack.TagAt(anIndex);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

union { ... }

Definition at line 338 of file nsDTDUtils.h.

Definition at line 357 of file nsDTDUtils.h.

Definition at line 355 of file nsDTDUtils.h.

Definition at line 337 of file nsDTDUtils.h.

Definition at line 336 of file nsDTDUtils.h.

Definition at line 356 of file nsDTDUtils.h.

Definition at line 354 of file nsDTDUtils.h.


The documentation for this class was generated from the following files: