PRBool nsHTMLElement::CanContain(eHTMLTags aChild) const{  if(IsContainer(mTagID)){  if(gHTMLElements[aChild].HasSpecialProperty(kLegalOpen)) {  return PR_TRUE; }  if(mTagID==aChild) { return CanContainSelf(); }  TagList* theCloseTags=gHTMLElements[aChild].GetAutoCloseStartTags(); if(theCloseTags){ if(FindTagInSet(mTagID,theCloseTags->mTags,theCloseTags->mCount)) return PR_FALSE; }   #if 0  if(gHTMLElements[aChild].IsBlockEntity()){ if(nsHTMLElement::IsBlockParent(mTagID)){ return PR_TRUE; } } #else if(gHTMLElements[aChild].IsBlockCloser(aChild)){ if(nsHTMLElement::IsBlockParent(mTagID)){ return PR_TRUE; } } #endif  if(nsHTMLElement::IsInlineEntity(aChild)){ if(nsHTMLElement::IsInlineParent(mTagID)){ return PR_TRUE; } }  if(nsHTMLElement::IsFlowEntity(aChild)) { if(nsHTMLElement::IsFlowParent(mTagID)){ return PR_TRUE; } }  if(nsHTMLElement::IsTextTag(aChild)) { if(nsHTMLElement::IsInlineParent(mTagID)){ return PR_TRUE; } }  if(CanContainType(gHTMLElements[aChild].mParentBits)) { return PR_TRUE; }  if(mSpecialKids) { if(FindTagInSet(aChild,mSpecialKids->mTags,mSpecialKids->mCount)) { return PR_TRUE; } }  }  return PR_FALSE;
PRBool nsHTMLElement::CanContain(eHTMLTags aParent,eHTMLTags aChild){ PRBool result=PR_FALSE; if((aParent>=eHTMLTag_unknown) & (aParent<=eHTMLTag_userdefined)){ result=gHTMLElements[aChild].CanContain(aChild); } return result;
PRBool nsHTMLElement::CanContain(eHTMLTags aChild) const{  if(IsContainer(mTagID)){    if(gHTMLElements[aChild].HasSpecialProperty(kLegalOpen)) {      // Some tags could be opened anywhere, in the document, as they please.      return PR_TRUE;    }    if(mTagID==aChild) {      return CanContainSelf();  //not many tags can contain themselves...    }    TagList* theCloseTags=gHTMLElements[aChild].GetAutoCloseStartTags();    if(theCloseTags){      if(FindTagInSet(mTagID,theCloseTags->mTags,theCloseTags->mCount))        return PR_FALSE;    }#if 0      //the older version; replaced in december by rickg    if(gHTMLElements[aChild].IsBlockEntity()){      if(nsHTMLElement::IsBlockParent(mTagID)){        return PR_TRUE;      }    }#else    if(gHTMLElements[aChild].IsBlockCloser(aChild)){      if(nsHTMLElement::IsBlockParent(mTagID)){        return PR_TRUE;      }    }#endif    if(nsHTMLElement::IsInlineEntity(aChild)){      if(nsHTMLElement::IsInlineParent(mTagID)){        return PR_TRUE;      }    }    if(nsHTMLElement::IsFlowEntity(aChild)) {      if(nsHTMLElement::IsFlowParent(mTagID)){        return PR_TRUE;      }    }    if(nsHTMLElement::IsTextTag(aChild)) {      if(nsHTMLElement::IsInlineParent(mTagID)){        return PR_TRUE;      }    }    if(CanContainType(gHTMLElements[aChild].mParentBits)) {      return PR_TRUE;    }     if(mSpecialKids) {      if(FindTagInSet(aChild,mSpecialKids->mTags,mSpecialKids->mCount)) {        return PR_TRUE;      }    }  }    return PR_FALSE;}