Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
nsElementTable.cpp File Reference
#include "nsIAtom.h"
#include "nsElementTable.h"

Go to the source code of this file.

Defines

#define DECL_TAG_LIST(name_, list_)
#define COMMA   ,

Functions

 DECL_TAG_LIST (gBodyKids,{eHTMLTag_dd COMMA eHTMLTag_del COMMA eHTMLTag_dt COMMA eHTMLTag_ins COMMA eHTMLTag_noscript COMMA eHTMLTag_script COMMA eHTMLTag_li COMMA eHTMLTag_param}) DECL_TAG_LIST(gFontKids
eHTMLTag_legend COMMA
eHTMLTag_table COMMA
eHTMLTag_text COMMA
eHTMLTag_li 
DECL_TAG_LIST (gPreKids,{eHTMLTag_hr COMMA eHTMLTag_center}) DECL_TAG_LIST(gTableKids
PRBool CanBeContainedLI (eHTMLTags aChildTag, nsDTDContext &aContext)
 This is called to answer the CanBeContained question when LI is the parent gess 10/13/00.

Variables

const int kDefaultPropRange = 1
const int kBodyPropRange = 2
const nsHTMLElement gHTMLElements []

Define Documentation

#define COMMA   ,

Definition at line 52 of file nsElementTable.cpp.

#define DECL_TAG_LIST (   name_,
  list_ 
)
Value:
static const eHTMLTags name_##list[] = list_;                               \
  static const TagList name_ = { NS_ARRAY_LENGTH(name_##list), name_##list };

Definition at line 48 of file nsElementTable.cpp.


Function Documentation

PRBool CanBeContainedLI ( eHTMLTags  aChildTag,
nsDTDContext aContext 
)

This is called to answer the CanBeContained question when LI is the parent gess 10/13/00.

Parameters:
@return

Definition at line 1415 of file nsElementTable.cpp.

                                                                    {
  PRBool result=PR_TRUE;

  //walk the parent hierarchy, to see if the LI is in a block or an inline.
  PRInt32 anIndex=aContext.GetCount();
  PRBool  theLIHasABlockParent=PR_FALSE;

  PRBool theChildIsBlock=PR_FALSE;
  
  if((aChildTag>eHTMLTag_unknown) && (aChildTag<eHTMLTag_userdefined)) {
    theChildIsBlock=  (eHTMLTag_dt==aChildTag) || 
                      (eHTMLTag_dd==aChildTag) ||
                      (gHTMLElements[aChildTag].IsMemberOf(kBlock))       || 
                      (gHTMLElements[aChildTag].IsMemberOf(kBlockEntity)) || 
                      (gHTMLElements[aChildTag].IsMemberOf(kHeading))     || 
                      (gHTMLElements[aChildTag].IsMemberOf(kPreformatted))|| 
                      (gHTMLElements[aChildTag].IsMemberOf(kList)); 
  }

  if(theChildIsBlock) {

    while(--anIndex>0) {
      eHTMLTags aParent=aContext.TagAt(anIndex);
      if((eHTMLTag_ul==aParent) ||
         (eHTMLTag_ol==aParent) || 
         (eHTMLTag_table==aParent) ||
         (eHTMLTag_dir==aParent)) {
        theLIHasABlockParent=PR_TRUE;
        break;
      }
    }
    result=theLIHasABlockParent;
  }    
  else {
    result=PR_TRUE;
  }
  return result;
}

Here is the call graph for this function:

eHTMLTag_legend COMMA eHTMLTag_table COMMA eHTMLTag_text COMMA eHTMLTag_li DECL_TAG_LIST ( gPreKids  )

Variable Documentation

Definition at line 185 of file nsElementTable.cpp.

Definition at line 174 of file nsElementTable.cpp.

Definition at line 173 of file nsElementTable.cpp.