Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions
nsDTDUtils.h File Reference
#include "nsHTMLTags.h"
#include "nsHTMLTokens.h"
#include "nsIParser.h"
#include "nsCRT.h"
#include "nsDeque.h"
#include "nsIDTD.h"
#include "nsITokenizer.h"
#include "nsString.h"
#include "nsIParserNode.h"
#include "nsFixedSizeAllocator.h"
#include "nsVoidArray.h"
#include "nsIParserService.h"
#include "nsReadableUtils.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  nsTagEntry
class  nsEntryStack
class  CTableState
class  nsTokenAllocator
class  nsNodeAllocator
class  nsDTDContext
struct  nsDTDContext::CFlags
class  CTokenDeallocator
class  nsITagHandler
class  nsObserverEntry
struct  TagList
union  nsDTDContext.__unnamed__

Defines

#define IF_HOLD(_ptr)
 MODULE NOTES: gess 4/1/98.
#define IF_FREE(_ptr, _allocator)
#define IF_DELETE(_ptr, _allocator)

Functions

PRInt32 IndexOfTagInSet (PRInt32 aTag, const eHTMLTags *aTagSet, PRInt32 aCount)
 This method quickly scans the given set of tags, looking for the given tag.
PRBool FindTagInSet (PRInt32 aTag, const eHTMLTags *aTagSet, PRInt32 aCount)
 This method quickly scans the given set of tags, looking for the given tag.
PRInt32 LastOf (nsDTDContext &aContext, const TagList &aTagList)
 Find the last member of given taglist on the given context gess 12/14/99.
PRInt32 FirstOf (nsDTDContext &aContext, PRInt32 aStartOffset, TagList &aTagList)
 Find the first member of given taglist on the given context gess 12/14/99.
PRBool HasOptionalEndTag (eHTMLTags aTag)
 Call this to find out whether the DTD thinks the tag requires an END tag </xxx> gess 01/04/99.

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
struct TagList

Definition at line 465 of file nsDTDUtils.h.

Class Members
PRUint32 mCount
const eHTMLTags * mTags
union nsDTDContext.__unnamed__

Definition at line 349 of file nsDTDUtils.h.

Class Members
PRUint32 mAllBits
CFlags mFlags

Define Documentation

#define IF_DELETE (   _ptr,
  _allocator 
)
Value:
PR_BEGIN_MACRO                    \
  if(_ptr) {                        \
    _ptr->ReleaseAll(_allocator);   \
    delete(_ptr);                   \
    _ptr=0;                         \
  }                                 \
  PR_END_MACRO

Definition at line 81 of file nsDTDUtils.h.

#define IF_FREE (   _ptr,
  _allocator 
)
Value:
PR_BEGIN_MACRO                                 \
  if(_ptr && _allocator) {                       \
    _ptr->Release((_allocator)->GetArenaPool()); \
    _ptr=0;                                      \
  }                                              \
  PR_END_MACRO

Definition at line 72 of file nsDTDUtils.h.

#define IF_HOLD (   _ptr)
Value:
PR_BEGIN_MACRO       \
 if(_ptr) {           \
   _ptr->AddRef();    \
 }                    \
 PR_END_MACRO

MODULE NOTES: gess 4/1/98.

Definition at line 64 of file nsDTDUtils.h.


Function Documentation

PRBool FindTagInSet ( PRInt32  aTag,
const eHTMLTags aTagSet,
PRInt32  aCount 
) [inline]

This method quickly scans the given set of tags, looking for the given tag.

gess8/27/98

Parameters:
aTag-- tag to be search for in set
aTagSet-- set of tags to be searched
Returns:

Definition at line 431 of file nsDTDUtils.h.

                                                                                  {
  return PRBool(-1<IndexOfTagInSet(aTag,aTagSet,aCount));
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRInt32 FirstOf ( nsDTDContext aContext,
PRInt32  aStartOffset,
TagList aTagList 
) [inline]

Find the first member of given taglist on the given context gess 12/14/99.

Parameters:
aContext
aStartOffset
aTagList
Returns:
index of tag, or kNotFound if not found

Definition at line 497 of file nsDTDUtils.h.

                                                                                     {
  int max = aContext.GetCount();
  int index;
  for(index=aStartOffset;index<max;++index){
    PRBool result=FindTagInSet(aContext[index],aTagList.mTags,aTagList.mCount);
    if(result) {
      return index;
    }
  }
  return kNotFound;
}

Here is the call graph for this function:

PRBool HasOptionalEndTag ( eHTMLTags  aTag) [inline]

Call this to find out whether the DTD thinks the tag requires an END tag </xxx> gess 01/04/99.

Parameters:
idof tag
Returns:
TRUE of the element's end tag is optional

Definition at line 516 of file nsDTDUtils.h.

                                                {
  static eHTMLTags gHasOptionalEndTags[]={eHTMLTag_body,eHTMLTag_colgroup,eHTMLTag_dd,eHTMLTag_dt,
                                                    eHTMLTag_head,eHTMLTag_li,eHTMLTag_option,
                                                    eHTMLTag_p,eHTMLTag_tbody,eHTMLTag_td,eHTMLTag_tfoot,
                                                    eHTMLTag_th,eHTMLTag_thead,eHTMLTag_tr,
                                                    eHTMLTag_userdefined,eHTMLTag_unknown};
  return FindTagInSet(aTag,gHasOptionalEndTags,sizeof(gHasOptionalEndTags)/sizeof(eHTMLTag_body));
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRInt32 IndexOfTagInSet ( PRInt32  aTag,
const eHTMLTags aTagSet,
PRInt32  aCount 
) [inline]

This method quickly scans the given set of tags, looking for the given tag.

gess8/27/98

Parameters:
aTag-- tag to be search for in set
aTagSet-- set of tags to be searched
Returns:

Definition at line 408 of file nsDTDUtils.h.

                                                                                      {

  const eHTMLTags* theEnd=aTagSet+aCount;
  const eHTMLTags* theTag=aTagSet;

  while(theTag<theEnd) {
    if(aTag==*theTag) {
      return theTag-aTagSet;
    }
    ++theTag;
  }

  return kNotFound;
}

Here is the caller graph for this function:

PRInt32 LastOf ( nsDTDContext aContext,
const TagList aTagList 
) [inline]

Find the last member of given taglist on the given context gess 12/14/99.

Parameters:
aContext
aTagList
Returns:
index of tag, or kNotFound if not found

Definition at line 477 of file nsDTDUtils.h.

                                                                      {
  int max = aContext.GetCount();
  int index;
  for(index=max-1;index>=0;index--){
    PRBool result=FindTagInSet(aContext[index],aTagList.mTags,aTagList.mCount);
    if(result) {
      return index;
    }
  }
  return kNotFound;
}

Here is the call graph for this function:

Here is the caller graph for this function: