fix for bug 200330 - const the heck out of htmlparser!
sr=sfraser, r=jag git-svn-id: svn://10.0.0.236/trunk@140605 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
f3c978ebbf
commit
a06219c70d
@ -83,8 +83,8 @@ static NS_DEFINE_IID(kClassIID, NS_INAVHTML_DTD_IID);
|
||||
static NS_DEFINE_CID(kFormProcessorCID, NS_FORMPROCESSOR_CID);
|
||||
|
||||
#ifdef DEBUG
|
||||
static const char* kNullToken = "Error: Null token given";
|
||||
static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
||||
static const char kNullToken[] = "Error: Null token given";
|
||||
static const char kInvalidTagStackPos[] = "Error: invalid tag stack position";
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_CRC
|
||||
@ -1191,8 +1191,8 @@ PRBool CanBeContained(eHTMLTags aChildTag,nsDTDContext& aContext) {
|
||||
PRInt32 theCount=aContext.GetCount();
|
||||
|
||||
if(0<theCount){
|
||||
TagList* theRootTags=gHTMLElements[aChildTag].GetRootTags();
|
||||
TagList* theSpecialParents=gHTMLElements[aChildTag].GetSpecialParents();
|
||||
const TagList* theRootTags=gHTMLElements[aChildTag].GetRootTags();
|
||||
const TagList* theSpecialParents=gHTMLElements[aChildTag].GetSpecialParents();
|
||||
if(theRootTags) {
|
||||
PRInt32 theRootIndex=LastOf(aContext,*theRootTags);
|
||||
PRInt32 theSPIndex=(theSpecialParents) ? LastOf(aContext,*theSpecialParents) : kNotFound;
|
||||
@ -1784,9 +1784,9 @@ nsresult CNavDTD::HandleStartToken(CToken* aToken) {
|
||||
* @return PR_TRUE if given tag can contain other tags
|
||||
*/
|
||||
static
|
||||
PRBool HasCloseablePeerAboveRoot(TagList& aRootTagList,nsDTDContext& aContext,eHTMLTags aTag,PRBool anEndTag) {
|
||||
PRBool HasCloseablePeerAboveRoot(const TagList& aRootTagList,nsDTDContext& aContext,eHTMLTags aTag,PRBool anEndTag) {
|
||||
PRInt32 theRootIndex=LastOf(aContext,aRootTagList);
|
||||
TagList* theCloseTags=(anEndTag) ? gHTMLElements[aTag].GetAutoCloseEndTags() : gHTMLElements[aTag].GetAutoCloseStartTags();
|
||||
const TagList* theCloseTags=(anEndTag) ? gHTMLElements[aTag].GetAutoCloseEndTags() : gHTMLElements[aTag].GetAutoCloseStartTags();
|
||||
PRInt32 theChildIndex=-1;
|
||||
|
||||
if(theCloseTags) {
|
||||
@ -1839,8 +1839,8 @@ eHTMLTags FindAutoCloseTargetForEndTag(eHTMLTags aCurrentTag,nsDTDContext& aCont
|
||||
3. Otherwise its non-specified and we simply presume we can close it.
|
||||
*/
|
||||
|
||||
TagList* theCloseTags=gHTMLElements[aCurrentTag].GetAutoCloseEndTags();
|
||||
TagList* theRootTags=gHTMLElements[aCurrentTag].GetEndRootTags();
|
||||
const TagList* theCloseTags=gHTMLElements[aCurrentTag].GetAutoCloseEndTags();
|
||||
const TagList* theRootTags=gHTMLElements[aCurrentTag].GetEndRootTags();
|
||||
|
||||
if(theCloseTags){
|
||||
//at a min., this code is needed for H1..H6
|
||||
@ -2767,7 +2767,7 @@ PRBool CNavDTD::BackwardPropagate(nsString& aSequence,eHTMLTags aParentTag,eHTML
|
||||
eHTMLTags theParentTag=aParentTag; //just init to get past first condition...
|
||||
|
||||
do {
|
||||
TagList* theRootTags=gHTMLElements[aChildTag].GetRootTags();
|
||||
const TagList* theRootTags=gHTMLElements[aChildTag].GetRootTags();
|
||||
if(theRootTags) {
|
||||
theParentTag=theRootTags->mTags[0];
|
||||
if(CanContain(theParentTag,aChildTag)) {
|
||||
@ -3676,7 +3676,7 @@ nsresult CNavDTD::CloseContainersTo(eHTMLTags aTarget,PRBool aClosedByStartTag){
|
||||
}
|
||||
|
||||
nsresult result=NS_OK;
|
||||
TagList* theRootTags=gHTMLElements[aTarget].GetRootTags();
|
||||
const TagList* theRootTags=gHTMLElements[aTarget].GetRootTags();
|
||||
eHTMLTags theParentTag=(theRootTags) ? theRootTags->mTags[0] : eHTMLTag_unknown;
|
||||
pos=mBodyContext->LastOf(theParentTag);
|
||||
if(kNotFound!=pos) {
|
||||
|
||||
@ -97,9 +97,9 @@ inline PRBool ContainsGroup(CGroupMembers& aGroupSet,CGroupMembers& aGroup) {
|
||||
return result;
|
||||
}
|
||||
|
||||
inline PRBool ListContainsTag(eHTMLTags* aTagList,eHTMLTags aTag) {
|
||||
inline PRBool ListContainsTag(const eHTMLTags* aTagList,eHTMLTags aTag) {
|
||||
if(aTagList) {
|
||||
eHTMLTags *theNextTag=aTagList;
|
||||
const eHTMLTags *theNextTag=aTagList;
|
||||
while(eHTMLTag_unknown!=*theNextTag) {
|
||||
if(aTag==*theNextTag) {
|
||||
return PR_TRUE;
|
||||
@ -362,9 +362,9 @@ public:
|
||||
eHTMLTags mDelegate;
|
||||
CGroupMembers mGroup;
|
||||
CGroupMembers mContainsGroups;
|
||||
eHTMLTags *mIncludeKids;
|
||||
eHTMLTags *mExcludeKids;
|
||||
eHTMLTags *mAutoClose; //other start tags that close this container
|
||||
const eHTMLTags *mIncludeKids;
|
||||
const eHTMLTags *mExcludeKids;
|
||||
const eHTMLTags *mAutoClose; //other start tags that close this container
|
||||
};
|
||||
|
||||
|
||||
@ -1932,8 +1932,8 @@ public:
|
||||
/**********************************************************
|
||||
This is for the body element...
|
||||
**********************************************************/
|
||||
static eHTMLTags gBodyKids[] = {eHTMLTag_button, eHTMLTag_del, eHTMLTag_ins, eHTMLTag_map,eHTMLTag_script, eHTMLTag_unknown};
|
||||
static eHTMLTags gBodyExcludeKids[] = {eHTMLTag_applet, eHTMLTag_button, eHTMLTag_iframe, eHTMLTag_object, eHTMLTag_unknown};
|
||||
static const eHTMLTags gBodyKids[] = {eHTMLTag_button, eHTMLTag_del, eHTMLTag_ins, eHTMLTag_map,eHTMLTag_script, eHTMLTag_unknown};
|
||||
static const eHTMLTags gBodyExcludeKids[] = {eHTMLTag_applet, eHTMLTag_button, eHTMLTag_iframe, eHTMLTag_object, eHTMLTag_unknown};
|
||||
|
||||
class CBodyElement: public CElement {
|
||||
public:
|
||||
@ -2140,27 +2140,27 @@ public:
|
||||
|
||||
static CElementTable *gElementTable = 0;
|
||||
|
||||
static eHTMLTags kDLKids[]={eHTMLTag_dd,eHTMLTag_dt,eHTMLTag_unknown};
|
||||
static eHTMLTags kAutoCloseDD[]={eHTMLTag_dd,eHTMLTag_dt,eHTMLTag_dl,eHTMLTag_unknown};
|
||||
static eHTMLTags kButtonExcludeKids[]={ eHTMLTag_a,eHTMLTag_button,eHTMLTag_select,eHTMLTag_textarea,
|
||||
static const eHTMLTags kDLKids[]={eHTMLTag_dd,eHTMLTag_dt,eHTMLTag_unknown};
|
||||
static const eHTMLTags kAutoCloseDD[]={eHTMLTag_dd,eHTMLTag_dt,eHTMLTag_dl,eHTMLTag_unknown};
|
||||
static const eHTMLTags kButtonExcludeKids[]={ eHTMLTag_a,eHTMLTag_button,eHTMLTag_select,eHTMLTag_textarea,
|
||||
eHTMLTag_input,eHTMLTag_iframe,eHTMLTag_form,eHTMLTag_isindex,
|
||||
eHTMLTag_fieldset,eHTMLTag_unknown};
|
||||
static eHTMLTags kColgroupKids[]={eHTMLTag_col,eHTMLTag_unknown};
|
||||
static eHTMLTags kDirKids[]={eHTMLTag_li,eHTMLTag_unknown};
|
||||
static eHTMLTags kOptionGroupKids[]={eHTMLTag_option,eHTMLTag_unknown};
|
||||
static eHTMLTags kFieldsetKids[]={eHTMLTag_legend,eHTMLTag_unknown};
|
||||
static eHTMLTags kFormKids[]={eHTMLTag_script,eHTMLTag_unknown};
|
||||
static eHTMLTags kLIExcludeKids[]={eHTMLTag_dir,eHTMLTag_menu,eHTMLTag_unknown};
|
||||
static eHTMLTags kMapKids[]={eHTMLTag_area,eHTMLTag_unknown};
|
||||
static eHTMLTags kPreExcludeKids[]={eHTMLTag_image,eHTMLTag_object,eHTMLTag_applet,
|
||||
static const eHTMLTags kColgroupKids[]={eHTMLTag_col,eHTMLTag_unknown};
|
||||
static const eHTMLTags kDirKids[]={eHTMLTag_li,eHTMLTag_unknown};
|
||||
static const eHTMLTags kOptionGroupKids[]={eHTMLTag_option,eHTMLTag_unknown};
|
||||
static const eHTMLTags kFieldsetKids[]={eHTMLTag_legend,eHTMLTag_unknown};
|
||||
static const eHTMLTags kFormKids[]={eHTMLTag_script,eHTMLTag_unknown};
|
||||
static const eHTMLTags kLIExcludeKids[]={eHTMLTag_dir,eHTMLTag_menu,eHTMLTag_unknown};
|
||||
static const eHTMLTags kMapKids[]={eHTMLTag_area,eHTMLTag_unknown};
|
||||
static const eHTMLTags kPreExcludeKids[]={eHTMLTag_image,eHTMLTag_object,eHTMLTag_applet,
|
||||
eHTMLTag_big,eHTMLTag_small,eHTMLTag_sub,eHTMLTag_sup,
|
||||
eHTMLTag_font,eHTMLTag_basefont,eHTMLTag_unknown};
|
||||
static eHTMLTags kSelectKids[]={eHTMLTag_optgroup,eHTMLTag_option,eHTMLTag_unknown};
|
||||
static eHTMLTags kBlockQuoteKids[]={eHTMLTag_script,eHTMLTag_unknown};
|
||||
static eHTMLTags kFramesetKids[]={eHTMLTag_noframes,eHTMLTag_unknown};
|
||||
static eHTMLTags kObjectKids[]={eHTMLTag_param,eHTMLTag_unknown};
|
||||
static eHTMLTags kTBodyKids[]={eHTMLTag_tr,eHTMLTag_unknown};
|
||||
static eHTMLTags kUnknownKids[]={eHTMLTag_html,eHTMLTag_unknown};
|
||||
static const eHTMLTags kSelectKids[]={eHTMLTag_optgroup,eHTMLTag_option,eHTMLTag_unknown};
|
||||
static const eHTMLTags kBlockQuoteKids[]={eHTMLTag_script,eHTMLTag_unknown};
|
||||
static const eHTMLTags kFramesetKids[]={eHTMLTag_noframes,eHTMLTag_unknown};
|
||||
static const eHTMLTags kObjectKids[]={eHTMLTag_param,eHTMLTag_unknown};
|
||||
static const eHTMLTags kTBodyKids[]={eHTMLTag_tr,eHTMLTag_unknown};
|
||||
static const eHTMLTags kUnknownKids[]={eHTMLTag_html,eHTMLTag_unknown};
|
||||
|
||||
|
||||
inline CElement* CElement::GetElement(eHTMLTags aTag) {
|
||||
@ -2496,7 +2496,7 @@ void CElementTable::DebugDumpGroups(CElement* aTag){
|
||||
|
||||
if(aTag->mIncludeKids) {
|
||||
printf("\n%s",prefix);
|
||||
eHTMLTags *theKid=aTag->mIncludeKids;
|
||||
const eHTMLTags *theKid=aTag->mIncludeKids;
|
||||
printf("+ ");
|
||||
while(eHTMLTag_unknown!=*theKid){
|
||||
const PRUnichar *t = nsHTMLTags::GetStringValue(*theKid++);
|
||||
@ -2506,7 +2506,7 @@ void CElementTable::DebugDumpGroups(CElement* aTag){
|
||||
|
||||
if(aTag->mExcludeKids) {
|
||||
printf("\n%s",prefix);
|
||||
eHTMLTags *theKid=aTag->mExcludeKids;
|
||||
const eHTMLTags *theKid=aTag->mExcludeKids;
|
||||
printf("- ");
|
||||
while(eHTMLTag_unknown!=*theKid){
|
||||
const PRUnichar *t = nsHTMLTags::GetStringValue(*theKid++);
|
||||
|
||||
@ -607,7 +607,7 @@ struct TagList {
|
||||
* @param aTagList
|
||||
* @return index of tag, or kNotFound if not found
|
||||
*/
|
||||
inline PRInt32 LastOf(nsDTDContext& aContext,TagList& aTagList){
|
||||
inline PRInt32 LastOf(nsDTDContext& aContext, const TagList& aTagList){
|
||||
int max = aContext.GetCount();
|
||||
int index;
|
||||
for(index=max-1;index>=0;index--){
|
||||
|
||||
@ -52,109 +52,109 @@
|
||||
|
||||
|
||||
//First, define the set of taglists for tags with special parents...
|
||||
TagList gAParents={1,{eHTMLTag_map}};
|
||||
TagList gInAddress={1,{eHTMLTag_address}};
|
||||
TagList gInHead={1,{eHTMLTag_head}};
|
||||
TagList gInTable={1,{eHTMLTag_table}};
|
||||
TagList gInHTML={1,{eHTMLTag_html}};
|
||||
TagList gInBody={1,{eHTMLTag_body}};
|
||||
TagList gInForm={1,{eHTMLTag_form}};
|
||||
TagList gInFieldset={1,{eHTMLTag_fieldset}};
|
||||
TagList gInTR={1,{eHTMLTag_tr}};
|
||||
TagList gInDL={2,{eHTMLTag_dl,eHTMLTag_body}};
|
||||
TagList gInFrameset={1,{eHTMLTag_frameset}};
|
||||
TagList gInNoframes={1,{eHTMLTag_noframes}};
|
||||
static const TagList gAParents={1,{eHTMLTag_map}};
|
||||
static const TagList gInAddress={1,{eHTMLTag_address}};
|
||||
static const TagList gInHead={1,{eHTMLTag_head}};
|
||||
static const TagList gInTable={1,{eHTMLTag_table}};
|
||||
static const TagList gInHTML={1,{eHTMLTag_html}};
|
||||
static const TagList gInBody={1,{eHTMLTag_body}};
|
||||
static const TagList gInForm={1,{eHTMLTag_form}};
|
||||
static const TagList gInFieldset={1,{eHTMLTag_fieldset}};
|
||||
static const TagList gInTR={1,{eHTMLTag_tr}};
|
||||
static const TagList gInDL={2,{eHTMLTag_dl,eHTMLTag_body}};
|
||||
static const TagList gInFrameset={1,{eHTMLTag_frameset}};
|
||||
static const TagList gInNoframes={1,{eHTMLTag_noframes}};
|
||||
//Removed ADDRESS to solve 24885
|
||||
TagList gInP={2,{eHTMLTag_span,eHTMLTag_table}}; // added table for bug 43678, removed FORM bug 94269
|
||||
TagList gOptgroupParents={2,{eHTMLTag_select,eHTMLTag_optgroup}};
|
||||
TagList gBodyParents={2,{eHTMLTag_html,eHTMLTag_noframes}};
|
||||
TagList gColParents={2,{eHTMLTag_table,eHTMLTag_colgroup}};
|
||||
TagList gFramesetParents={2,{eHTMLTag_html,eHTMLTag_frameset}};
|
||||
TagList gLegendParents={1,{eHTMLTag_fieldset}};
|
||||
TagList gAreaParent={1,{eHTMLTag_map}};
|
||||
TagList gParamParents={2,{eHTMLTag_applet,eHTMLTag_object}};
|
||||
TagList gTRParents={4,{eHTMLTag_tbody,eHTMLTag_tfoot,eHTMLTag_thead,eHTMLTag_table}};
|
||||
TagList gTREndParents={5,{eHTMLTag_tbody,eHTMLTag_tfoot,eHTMLTag_thead,eHTMLTag_table,eHTMLTag_applet}};
|
||||
static const TagList gInP={2,{eHTMLTag_span,eHTMLTag_table}}; // added table for bug 43678, removed FORM bug 94269
|
||||
static const TagList gOptgroupParents={2,{eHTMLTag_select,eHTMLTag_optgroup}};
|
||||
static const TagList gBodyParents={2,{eHTMLTag_html,eHTMLTag_noframes}};
|
||||
static const TagList gColParents={2,{eHTMLTag_table,eHTMLTag_colgroup}};
|
||||
static const TagList gFramesetParents={2,{eHTMLTag_html,eHTMLTag_frameset}};
|
||||
static const TagList gLegendParents={1,{eHTMLTag_fieldset}};
|
||||
static const TagList gAreaParent={1,{eHTMLTag_map}};
|
||||
static const TagList gParamParents={2,{eHTMLTag_applet,eHTMLTag_object}};
|
||||
static const TagList gTRParents={4,{eHTMLTag_tbody,eHTMLTag_tfoot,eHTMLTag_thead,eHTMLTag_table}};
|
||||
static const TagList gTREndParents={5,{eHTMLTag_tbody,eHTMLTag_tfoot,eHTMLTag_thead,eHTMLTag_table,eHTMLTag_applet}};
|
||||
|
||||
//*********************************************************************************************
|
||||
// Next, define the set of taglists for tags with special kids...
|
||||
//*********************************************************************************************
|
||||
|
||||
TagList gContainsText={4,{eHTMLTag_text,eHTMLTag_newline,eHTMLTag_whitespace,eHTMLTag_entity}};
|
||||
TagList gUnknownKids={2,{eHTMLTag_html,eHTMLTag_frameset}};
|
||||
TagList gContainsOpts={3,{eHTMLTag_option,eHTMLTag_optgroup,eHTMLTag_script}};
|
||||
TagList gContainsParam={1,{eHTMLTag_param}};
|
||||
TagList gColgroupKids={1,{eHTMLTag_col}};
|
||||
TagList gAddressKids={1,{eHTMLTag_p}};
|
||||
TagList gBodyKids={8, {eHTMLTag_dd,eHTMLTag_del,eHTMLTag_dt,eHTMLTag_ins,
|
||||
static const TagList gContainsText={4,{eHTMLTag_text,eHTMLTag_newline,eHTMLTag_whitespace,eHTMLTag_entity}};
|
||||
static const TagList gUnknownKids={2,{eHTMLTag_html,eHTMLTag_frameset}};
|
||||
static const TagList gContainsOpts={3,{eHTMLTag_option,eHTMLTag_optgroup,eHTMLTag_script}};
|
||||
static const TagList gContainsParam={1,{eHTMLTag_param}};
|
||||
static const TagList gColgroupKids={1,{eHTMLTag_col}};
|
||||
static const TagList gAddressKids={1,{eHTMLTag_p}};
|
||||
static const TagList gBodyKids={8, {eHTMLTag_dd,eHTMLTag_del,eHTMLTag_dt,eHTMLTag_ins,
|
||||
eHTMLTag_noscript,eHTMLTag_script,eHTMLTag_li,eHTMLTag_param}}; // Added PARAM for bug 54448
|
||||
TagList gButtonKids={2,{eHTMLTag_caption,eHTMLTag_legend}};
|
||||
static const TagList gButtonKids={2,{eHTMLTag_caption,eHTMLTag_legend}};
|
||||
|
||||
TagList gDLRootTags={5,{eHTMLTag_body,eHTMLTag_td,eHTMLTag_table,eHTMLTag_applet,eHTMLTag_dd}};
|
||||
TagList gDLKids={2,{eHTMLTag_dd,eHTMLTag_dt}};
|
||||
TagList gDTKids={1,{eHTMLTag_dt}};
|
||||
TagList gFieldsetKids={2,{eHTMLTag_legend,eHTMLTag_text}};
|
||||
TagList gFontKids={3,{eHTMLTag_legend,eHTMLTag_table,eHTMLTag_text}}; // Added table to fix bug 93365
|
||||
TagList gFormKids={1,{eHTMLTag_keygen}};
|
||||
TagList gFramesetKids={3,{eHTMLTag_frame,eHTMLTag_frameset,eHTMLTag_noframes}};
|
||||
static const TagList gDLRootTags={5,{eHTMLTag_body,eHTMLTag_td,eHTMLTag_table,eHTMLTag_applet,eHTMLTag_dd}};
|
||||
static const TagList gDLKids={2,{eHTMLTag_dd,eHTMLTag_dt}};
|
||||
static const TagList gDTKids={1,{eHTMLTag_dt}};
|
||||
static const TagList gFieldsetKids={2,{eHTMLTag_legend,eHTMLTag_text}};
|
||||
static const TagList gFontKids={3,{eHTMLTag_legend,eHTMLTag_table,eHTMLTag_text}}; // Added table to fix bug 93365
|
||||
static const TagList gFormKids={1,{eHTMLTag_keygen}};
|
||||
static const TagList gFramesetKids={3,{eHTMLTag_frame,eHTMLTag_frameset,eHTMLTag_noframes}};
|
||||
|
||||
TagList gHtmlKids={9,{eHTMLTag_body,eHTMLTag_frameset,eHTMLTag_head,eHTMLTag_map,eHTMLTag_noscript,eHTMLTag_noframes,eHTMLTag_script,eHTMLTag_newline,eHTMLTag_whitespace}};
|
||||
TagList gHeadKids={8,{eHTMLTag_base,eHTMLTag_bgsound,eHTMLTag_link,eHTMLTag_meta,eHTMLTag_script,eHTMLTag_style,eHTMLTag_title,eHTMLTag_noembed}};
|
||||
static const TagList gHtmlKids={9,{eHTMLTag_body,eHTMLTag_frameset,eHTMLTag_head,eHTMLTag_map,eHTMLTag_noscript,eHTMLTag_noframes,eHTMLTag_script,eHTMLTag_newline,eHTMLTag_whitespace}};
|
||||
static const TagList gHeadKids={8,{eHTMLTag_base,eHTMLTag_bgsound,eHTMLTag_link,eHTMLTag_meta,eHTMLTag_script,eHTMLTag_style,eHTMLTag_title,eHTMLTag_noembed}};
|
||||
|
||||
TagList gLabelKids={1,{eHTMLTag_span}};
|
||||
TagList gLIKids={2,{eHTMLTag_ol,eHTMLTag_ul}};
|
||||
TagList gMapKids={1,{eHTMLTag_area}};
|
||||
TagList gPreKids={2,{eHTMLTag_hr,eHTMLTag_center}}; //note that CENTER is here for backward compatibility; it's not 4.0 spec.
|
||||
static const TagList gLabelKids={1,{eHTMLTag_span}};
|
||||
static const TagList gLIKids={2,{eHTMLTag_ol,eHTMLTag_ul}};
|
||||
static const TagList gMapKids={1,{eHTMLTag_area}};
|
||||
static const TagList gPreKids={2,{eHTMLTag_hr,eHTMLTag_center}}; //note that CENTER is here for backward compatibility; it's not 4.0 spec.
|
||||
|
||||
TagList gTableKids={9,{eHTMLTag_caption,eHTMLTag_col,eHTMLTag_colgroup,eHTMLTag_form,
|
||||
static const TagList gTableKids={9,{eHTMLTag_caption,eHTMLTag_col,eHTMLTag_colgroup,eHTMLTag_form,
|
||||
eHTMLTag_thead,eHTMLTag_tbody,eHTMLTag_tfoot,
|
||||
eHTMLTag_map,eHTMLTag_script}};// Removed INPUT - Ref. Bug 20087, 25382
|
||||
|
||||
TagList gTableElemKids={7,{eHTMLTag_form,eHTMLTag_map,eHTMLTag_noscript,eHTMLTag_script,eHTMLTag_td,eHTMLTag_th,eHTMLTag_tr}};
|
||||
TagList gTRKids={4,{eHTMLTag_td,eHTMLTag_th,eHTMLTag_form,eHTMLTag_script}};// Removed INPUT - Ref. Bug 20087, 25382 | Removed MAP to fix 58942
|
||||
TagList gTBodyKids={2,{eHTMLTag_tr,eHTMLTag_form}}; // Removed INPUT - Ref. Bug 20087, 25382
|
||||
TagList gULKids={2,{eHTMLTag_li,eHTMLTag_p}};
|
||||
static const TagList gTableElemKids={7,{eHTMLTag_form,eHTMLTag_map,eHTMLTag_noscript,eHTMLTag_script,eHTMLTag_td,eHTMLTag_th,eHTMLTag_tr}};
|
||||
static const TagList gTRKids={4,{eHTMLTag_td,eHTMLTag_th,eHTMLTag_form,eHTMLTag_script}};// Removed INPUT - Ref. Bug 20087, 25382 | Removed MAP to fix 58942
|
||||
static const TagList gTBodyKids={2,{eHTMLTag_tr,eHTMLTag_form}}; // Removed INPUT - Ref. Bug 20087, 25382
|
||||
static const TagList gULKids={2,{eHTMLTag_li,eHTMLTag_p}};
|
||||
|
||||
|
||||
//*********************************************************************************************
|
||||
// The following tag lists are used to define common set of root notes for the HTML elements...
|
||||
//*********************************************************************************************
|
||||
|
||||
TagList gRootTags={5,{eHTMLTag_body,eHTMLTag_td,eHTMLTag_table,eHTMLTag_applet,eHTMLTag_select}}; // Added SELECT to fix bug 98645
|
||||
TagList gTableRootTags={6,{eHTMLTag_applet,eHTMLTag_body,eHTMLTag_dl,eHTMLTag_ol,eHTMLTag_td,eHTMLTag_th}};
|
||||
TagList gHTMLRootTags={1,{eHTMLTag_unknown}};
|
||||
static const TagList gRootTags={5,{eHTMLTag_body,eHTMLTag_td,eHTMLTag_table,eHTMLTag_applet,eHTMLTag_select}}; // Added SELECT to fix bug 98645
|
||||
static const TagList gTableRootTags={6,{eHTMLTag_applet,eHTMLTag_body,eHTMLTag_dl,eHTMLTag_ol,eHTMLTag_td,eHTMLTag_th}};
|
||||
static const TagList gHTMLRootTags={1,{eHTMLTag_unknown}};
|
||||
|
||||
TagList gLIRootTags={8,{eHTMLTag_ul,eHTMLTag_ol,eHTMLTag_dir,eHTMLTag_menu,eHTMLTag_p,eHTMLTag_body,eHTMLTag_td,eHTMLTag_th}};
|
||||
static const TagList gLIRootTags={8,{eHTMLTag_ul,eHTMLTag_ol,eHTMLTag_dir,eHTMLTag_menu,eHTMLTag_p,eHTMLTag_body,eHTMLTag_td,eHTMLTag_th}};
|
||||
|
||||
TagList gOLRootTags={5,{eHTMLTag_body,eHTMLTag_li,eHTMLTag_td,eHTMLTag_th,eHTMLTag_select}};
|
||||
TagList gTDRootTags={6,{eHTMLTag_tr,eHTMLTag_tbody,eHTMLTag_thead,eHTMLTag_tfoot,eHTMLTag_table,eHTMLTag_applet}};
|
||||
TagList gNoframeRoot={2,{eHTMLTag_body,eHTMLTag_frameset}};
|
||||
static const TagList gOLRootTags={5,{eHTMLTag_body,eHTMLTag_li,eHTMLTag_td,eHTMLTag_th,eHTMLTag_select}};
|
||||
static const TagList gTDRootTags={6,{eHTMLTag_tr,eHTMLTag_tbody,eHTMLTag_thead,eHTMLTag_tfoot,eHTMLTag_table,eHTMLTag_applet}};
|
||||
static const TagList gNoframeRoot={2,{eHTMLTag_body,eHTMLTag_frameset}};
|
||||
|
||||
//*********************************************************************************************
|
||||
// The following tag lists are used to define the autoclose properties of the html elements...
|
||||
//*********************************************************************************************
|
||||
|
||||
TagList gBodyAutoClose={1,{eHTMLTag_head}};
|
||||
TagList gTBodyAutoClose={5,{eHTMLTag_thead,eHTMLTag_tfoot,eHTMLTag_tbody,eHTMLTag_td,eHTMLTag_th}}; // TD|TH inclusion - Bug# 24112
|
||||
TagList gCaptionAutoClose={1,{eHTMLTag_tbody}};
|
||||
TagList gLIAutoClose={2,{eHTMLTag_p,eHTMLTag_li}};
|
||||
TagList gPAutoClose={2,{eHTMLTag_p,eHTMLTag_li}};
|
||||
TagList gHRAutoClose={1,{eHTMLTag_p}};
|
||||
TagList gOLAutoClose={2,{eHTMLTag_p,eHTMLTag_ol}};
|
||||
TagList gDivAutoClose={1,{eHTMLTag_p}};
|
||||
static const TagList gBodyAutoClose={1,{eHTMLTag_head}};
|
||||
static const TagList gTBodyAutoClose={5,{eHTMLTag_thead,eHTMLTag_tfoot,eHTMLTag_tbody,eHTMLTag_td,eHTMLTag_th}}; // TD|TH inclusion - Bug# 24112
|
||||
static const TagList gCaptionAutoClose={1,{eHTMLTag_tbody}};
|
||||
static const TagList gLIAutoClose={2,{eHTMLTag_p,eHTMLTag_li}};
|
||||
static const TagList gPAutoClose={2,{eHTMLTag_p,eHTMLTag_li}};
|
||||
static const TagList gHRAutoClose={1,{eHTMLTag_p}};
|
||||
static const TagList gOLAutoClose={2,{eHTMLTag_p,eHTMLTag_ol}};
|
||||
static const TagList gDivAutoClose={1,{eHTMLTag_p}};
|
||||
|
||||
TagList gHeadingTags={6,{eHTMLTag_h1,eHTMLTag_h2,eHTMLTag_h3,eHTMLTag_h4,eHTMLTag_h5,eHTMLTag_h6}};
|
||||
static const TagList gHeadingTags={6,{eHTMLTag_h1,eHTMLTag_h2,eHTMLTag_h3,eHTMLTag_h4,eHTMLTag_h5,eHTMLTag_h6}};
|
||||
|
||||
TagList gTableCloseTags={6,{eHTMLTag_td,eHTMLTag_tr,eHTMLTag_th,eHTMLTag_tbody,eHTMLTag_thead,eHTMLTag_tfoot}};
|
||||
TagList gTRCloseTags={3,{eHTMLTag_tr,eHTMLTag_td,eHTMLTag_th}};
|
||||
TagList gTDCloseTags={2,{eHTMLTag_td,eHTMLTag_th}};
|
||||
TagList gDTCloseTags={3,{eHTMLTag_p,eHTMLTag_dd,eHTMLTag_dt}};
|
||||
TagList gULCloseTags={1,{eHTMLTag_li}};
|
||||
TagList gULAutoClose={2,{eHTMLTag_p,eHTMLTag_ul}}; //fix bug 50261..
|
||||
static const TagList gTableCloseTags={6,{eHTMLTag_td,eHTMLTag_tr,eHTMLTag_th,eHTMLTag_tbody,eHTMLTag_thead,eHTMLTag_tfoot}};
|
||||
static const TagList gTRCloseTags={3,{eHTMLTag_tr,eHTMLTag_td,eHTMLTag_th}};
|
||||
static const TagList gTDCloseTags={2,{eHTMLTag_td,eHTMLTag_th}};
|
||||
static const TagList gDTCloseTags={3,{eHTMLTag_p,eHTMLTag_dd,eHTMLTag_dt}};
|
||||
static const TagList gULCloseTags={1,{eHTMLTag_li}};
|
||||
static const TagList gULAutoClose={2,{eHTMLTag_p,eHTMLTag_ul}}; //fix bug 50261..
|
||||
|
||||
|
||||
TagList gExcludableParents={1,{eHTMLTag_pre}}; // Ref Bug 22913
|
||||
TagList gCaptionExcludableParents={1,{eHTMLTag_td}}; //Ref Bug 26488
|
||||
static const TagList gExcludableParents={1,{eHTMLTag_pre}}; // Ref Bug 22913
|
||||
static const TagList gCaptionExcludableParents={1,{eHTMLTag_td}}; //Ref Bug 26488
|
||||
|
||||
//*********************************************************************************************
|
||||
//Lastly, bind tags with their rules, their special parents and special kids.
|
||||
@ -178,19 +178,19 @@ nsHTMLElement* gHTMLElements=0;
|
||||
void Initialize(eHTMLTags aTag,
|
||||
eHTMLTags aRequiredAncestor,
|
||||
eHTMLTags aExcludingAncestor,
|
||||
TagList* aRootNodes,
|
||||
TagList* aEndRootNodes,
|
||||
TagList* aAutocloseStart,
|
||||
TagList* aAutocloseEnd,
|
||||
TagList* aSynonymousTags,
|
||||
TagList* aExcludableParents,
|
||||
const TagList* aRootNodes,
|
||||
const TagList* aEndRootNodes,
|
||||
const TagList* aAutocloseStart,
|
||||
const TagList* aAutocloseEnd,
|
||||
const TagList* aSynonymousTags,
|
||||
const TagList* aExcludableParents,
|
||||
int aParentBits,
|
||||
int aInclusionBits,
|
||||
int aExclusionBits,
|
||||
int aSpecialProperties,
|
||||
PRUint32 aPropagateRange,
|
||||
TagList* aSpecialParents,
|
||||
TagList* aSpecialKids,
|
||||
const TagList* aSpecialParents,
|
||||
const TagList* aSpecialKids,
|
||||
eHTMLTags aSkipTarget
|
||||
)
|
||||
{
|
||||
@ -1410,8 +1410,8 @@ PRBool nsHTMLElement::CanBeContained(eHTMLTags aChildTag,nsDTDContext &aContext)
|
||||
result=PR_TRUE;
|
||||
|
||||
if(0<theCount){
|
||||
TagList* theRootTags=gHTMLElements[aChildTag].GetRootTags();
|
||||
TagList* theSpecialParents=gHTMLElements[aChildTag].GetSpecialParents();
|
||||
const TagList* theRootTags=gHTMLElements[aChildTag].GetRootTags();
|
||||
const TagList* theSpecialParents=gHTMLElements[aChildTag].GetSpecialParents();
|
||||
if(theRootTags) {
|
||||
PRInt32 theRootIndex=LastOf(aContext,*theRootTags);
|
||||
PRInt32 theSPIndex=(theSpecialParents) ? LastOf(aContext,*theSpecialParents) : kNotFound;
|
||||
@ -1467,7 +1467,7 @@ PRBool nsHTMLElement::CanBeContained(eHTMLTags aChildTag,nsDTDContext &aContext)
|
||||
PRInt32 nsHTMLElement::GetIndexOfChildOrSynonym(nsDTDContext& aContext,eHTMLTags aChildTag) {
|
||||
PRInt32 theChildIndex=aContext.LastOf(aChildTag);
|
||||
if(kNotFound==theChildIndex) {
|
||||
TagList* theSynTags=gHTMLElements[aChildTag].GetSynonymousTags(); //get the list of tags that THIS tag can close
|
||||
const TagList* theSynTags=gHTMLElements[aChildTag].GetSynonymousTags(); //get the list of tags that THIS tag can close
|
||||
if(theSynTags) {
|
||||
theChildIndex=LastOf(aContext,*theSynTags);
|
||||
}
|
||||
@ -1770,7 +1770,7 @@ PRBool nsHTMLElement::IsExcludableParent(eHTMLTags aParent) const{
|
||||
|
||||
if(!IsTextTag(mTagID)) {
|
||||
if(mExcludableParents) {
|
||||
TagList* theParents=mExcludableParents;
|
||||
const TagList* theParents=mExcludableParents;
|
||||
if(FindTagInSet(aParent,theParents->mTags,theParents->mCount))
|
||||
result=PR_TRUE;
|
||||
}
|
||||
@ -1874,7 +1874,7 @@ PRBool nsHTMLElement::IsChildOfHead(eHTMLTags aChild,PRBool& aExclusively) {
|
||||
*/
|
||||
PRBool nsHTMLElement::SectionContains(eHTMLTags aChild,PRBool allowDepthSearch) {
|
||||
PRBool result=PR_FALSE;
|
||||
TagList* theRootTags=gHTMLElements[aChild].GetRootTags();
|
||||
const TagList* theRootTags=gHTMLElements[aChild].GetRootTags();
|
||||
|
||||
if(theRootTags){
|
||||
if(!FindTagInSet(mTagID,theRootTags->mTags,theRootTags->mCount)){
|
||||
@ -2175,7 +2175,7 @@ eHTMLTags nsHTMLElement::GetCloseTargetForEndTag(nsDTDContext& aContext,PRInt32
|
||||
// Note: we intentionally make 2 passes:
|
||||
// The first pass tries to exactly match, the 2nd pass matches the group.
|
||||
|
||||
TagList* theRootTags=gHTMLElements[mTagID].GetEndRootTags();
|
||||
const TagList* theRootTags=gHTMLElements[mTagID].GetEndRootTags();
|
||||
PRInt32 theIndexCopy=theIndex;
|
||||
while(--theIndex>=anIndex){
|
||||
eHTMLTags theTag=aContext.TagAt(theIndex);
|
||||
@ -2241,14 +2241,14 @@ PRBool nsHTMLElement::CanContain(eHTMLTags aChild) const{
|
||||
return CanContainSelf(); //not many tags can contain themselves...
|
||||
}
|
||||
|
||||
TagList* theCloseTags=gHTMLElements[aChild].GetAutoCloseStartTags();
|
||||
const TagList* theCloseTags=gHTMLElements[aChild].GetAutoCloseStartTags();
|
||||
if(theCloseTags){
|
||||
if(FindTagInSet(mTagID,theCloseTags->mTags,theCloseTags->mCount))
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
if(gHTMLElements[aChild].mExcludableParents) {
|
||||
TagList* theParents=gHTMLElements[aChild].mExcludableParents;
|
||||
const TagList* theParents=gHTMLElements[aChild].mExcludableParents;
|
||||
if(FindTagInSet(mTagID,theParents->mTags,theParents->mCount))
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
@ -195,15 +195,15 @@ struct nsHTMLElement {
|
||||
|
||||
static PRInt32 GetIndexOfChildOrSynonym(nsDTDContext& aContext,eHTMLTags aChildTag);
|
||||
|
||||
TagList* GetSynonymousTags(void) const {return mSynonymousTags;}
|
||||
TagList* GetRootTags(void) const {return mRootNodes;}
|
||||
TagList* GetEndRootTags(void) const {return mEndRootNodes;}
|
||||
TagList* GetAutoCloseStartTags(void) const {return mAutocloseStart;}
|
||||
TagList* GetAutoCloseEndTags(void) const {return mAutocloseEnd;}
|
||||
const TagList* GetSynonymousTags(void) const {return mSynonymousTags;}
|
||||
const TagList* GetRootTags(void) const {return mRootNodes;}
|
||||
const TagList* GetEndRootTags(void) const {return mEndRootNodes;}
|
||||
const TagList* GetAutoCloseStartTags(void) const {return mAutocloseStart;}
|
||||
const TagList* GetAutoCloseEndTags(void) const {return mAutocloseEnd;}
|
||||
eHTMLTags GetCloseTargetForEndTag(nsDTDContext& aContext,PRInt32 anIndex) const;
|
||||
|
||||
TagList* GetSpecialChildren(void) const {return mSpecialKids;}
|
||||
TagList* GetSpecialParents(void) const {return mSpecialParents;}
|
||||
const TagList* GetSpecialChildren(void) const {return mSpecialKids;}
|
||||
const TagList* GetSpecialParents(void) const {return mSpecialParents;}
|
||||
|
||||
PRBool IsMemberOf(PRInt32 aType) const;
|
||||
PRBool ContainsSet(PRInt32 aType) const;
|
||||
@ -239,19 +239,19 @@ struct nsHTMLElement {
|
||||
eHTMLTags mTagID;
|
||||
eHTMLTags mRequiredAncestor;
|
||||
eHTMLTags mExcludingAncestor; //If set, the presence of the excl-ancestor prevents this from opening.
|
||||
TagList* mRootNodes; //These are the tags above which you many not autoclose a START tag
|
||||
TagList* mEndRootNodes; //These are the tags above which you many not autoclose an END tag
|
||||
TagList* mAutocloseStart; //these are the start tags that you can automatically close with this START tag
|
||||
TagList* mAutocloseEnd; //these are the start tags that you can automatically close with this END tag
|
||||
TagList* mSynonymousTags; //These are morally equivalent; an end tag for one can close a start tag for another (like <Hn>)
|
||||
TagList* mExcludableParents; //These are the TAGS that cannot contain you
|
||||
const TagList* mRootNodes; //These are the tags above which you many not autoclose a START tag
|
||||
const TagList* mEndRootNodes; //These are the tags above which you many not autoclose an END tag
|
||||
const TagList* mAutocloseStart; //these are the start tags that you can automatically close with this START tag
|
||||
const TagList* mAutocloseEnd; //these are the start tags that you can automatically close with this END tag
|
||||
const TagList* mSynonymousTags; //These are morally equivalent; an end tag for one can close a start tag for another (like <Hn>)
|
||||
const TagList* mExcludableParents; //These are the TAGS that cannot contain you
|
||||
int mParentBits; //defines groups that can contain this element
|
||||
int mInclusionBits; //defines parental and containment rules
|
||||
int mExclusionBits; //defines things you CANNOT contain
|
||||
int mSpecialProperties; //used for various special purposes...
|
||||
PRUint32 mPropagateRange; //tells us how far a parent is willing to prop. badly formed children
|
||||
TagList* mSpecialParents; //These are the special tags that contain this tag (directly)
|
||||
TagList* mSpecialKids; //These are the extra things you can contain
|
||||
const TagList* mSpecialParents; //These are the special tags that contain this tag (directly)
|
||||
const TagList* mSpecialKids; //These are the extra things you can contain
|
||||
eHTMLTags mSkipTarget; //If set, then we skip all content until this tag is seen
|
||||
ContainFunc mCanBeContained;
|
||||
};
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
static const char* kWhitespace = " \r\n\t"; // Optimized for typical cases
|
||||
static const char kWhitespace[] = " \r\n\t"; // Optimized for typical cases
|
||||
|
||||
/***************************** EXPAT CALL BACKS *******************************/
|
||||
|
||||
|
||||
@ -270,7 +270,7 @@ static const PRUnichar sHTMLTagUnicodeName_xmp[] =
|
||||
|
||||
// static array of unicode tag names
|
||||
#define HTML_TAG(_tag) sHTMLTagUnicodeName_##_tag,
|
||||
static const PRUnichar* kTagUnicodeTable[] = {
|
||||
static const PRUnichar* const kTagUnicodeTable[] = {
|
||||
#include "nsHTMLTagList.h"
|
||||
};
|
||||
#undef HTML_TAG
|
||||
@ -279,7 +279,7 @@ static const PRUnichar* kTagUnicodeTable[] = {
|
||||
#ifdef DEBUG
|
||||
// static array of ASCII tag names for debugging purposes
|
||||
#define HTML_TAG(_tag) #_tag,
|
||||
static const char* kTagASCIIDebugTable[] = {
|
||||
static const char* const kTagASCIIDebugTable[] = {
|
||||
#include "nsHTMLTagList.h"
|
||||
};
|
||||
#undef HTML_TAG
|
||||
@ -507,6 +507,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
nsTestTagTable validateTagTable;
|
||||
static const nsTestTagTable validateTagTable;
|
||||
|
||||
#endif
|
||||
|
||||
@ -2051,7 +2051,7 @@ CEntityToken::ConsumeEntity(PRUnichar aChar,
|
||||
*/
|
||||
#define NOT_USED 0xfffd
|
||||
|
||||
static PRUint16 PA_HackTable[] = {
|
||||
static const PRUint16 PA_HackTable[] = {
|
||||
0x20ac, /* EURO SIGN */
|
||||
NOT_USED,
|
||||
0x201a, /* SINGLE LOW-9 QUOTATION MARK */
|
||||
|
||||
@ -49,7 +49,7 @@ static NS_DEFINE_IID(kILoggingSinkIID, NS_ILOGGING_SINK_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
// list of tags that have skipped content
|
||||
static char gSkippedContentTags[] = {
|
||||
static const char gSkippedContentTags[] = {
|
||||
eHTMLTag_style,
|
||||
eHTMLTag_script,
|
||||
eHTMLTag_server,
|
||||
|
||||
@ -88,8 +88,8 @@ nsReadEndCondition::nsReadEndCondition(const PRUnichar* aTerminateChars) :
|
||||
|
||||
static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
|
||||
|
||||
const char* kBadHTMLText="<H3>Oops...</H3>You just tried to read a non-existent document: <BR>";
|
||||
const char* kUnorderedStringError = "String argument must be ordered. Don't you read API's?";
|
||||
static const char kBadHTMLText[] ="<H3>Oops...</H3>You just tried to read a non-existent document: <BR>";
|
||||
static const char kUnorderedStringError[] = "String argument must be ordered. Don't you read API's?";
|
||||
|
||||
#ifdef __INCREMENTAL
|
||||
const int kBufsize=1;
|
||||
|
||||
@ -114,8 +114,8 @@ static NS_DEFINE_IID(kClassIID, NS_VIEWSOURCE_HTML_IID);
|
||||
// bug 22022 - these are used to toggle 'Wrap Long Lines' on the viewsource
|
||||
// window by selectively setting/unsetting the following class defined in
|
||||
// viewsource.css; the setting is remembered between invocations using a pref.
|
||||
static const char* kBodyId = "viewsource";
|
||||
static const char* kBodyClassWrap = "wrap";
|
||||
static const char kBodyId[] = "viewsource";
|
||||
static const char kBodyClassWrap[] = "wrap";
|
||||
|
||||
/**
|
||||
* This method gets called as part of our COM-like interfaces.
|
||||
|
||||
@ -83,8 +83,8 @@ static NS_DEFINE_IID(kClassIID, NS_INAVHTML_DTD_IID);
|
||||
static NS_DEFINE_CID(kFormProcessorCID, NS_FORMPROCESSOR_CID);
|
||||
|
||||
#ifdef DEBUG
|
||||
static const char* kNullToken = "Error: Null token given";
|
||||
static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
||||
static const char kNullToken[] = "Error: Null token given";
|
||||
static const char kInvalidTagStackPos[] = "Error: invalid tag stack position";
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_CRC
|
||||
@ -1191,8 +1191,8 @@ PRBool CanBeContained(eHTMLTags aChildTag,nsDTDContext& aContext) {
|
||||
PRInt32 theCount=aContext.GetCount();
|
||||
|
||||
if(0<theCount){
|
||||
TagList* theRootTags=gHTMLElements[aChildTag].GetRootTags();
|
||||
TagList* theSpecialParents=gHTMLElements[aChildTag].GetSpecialParents();
|
||||
const TagList* theRootTags=gHTMLElements[aChildTag].GetRootTags();
|
||||
const TagList* theSpecialParents=gHTMLElements[aChildTag].GetSpecialParents();
|
||||
if(theRootTags) {
|
||||
PRInt32 theRootIndex=LastOf(aContext,*theRootTags);
|
||||
PRInt32 theSPIndex=(theSpecialParents) ? LastOf(aContext,*theSpecialParents) : kNotFound;
|
||||
@ -1784,9 +1784,9 @@ nsresult CNavDTD::HandleStartToken(CToken* aToken) {
|
||||
* @return PR_TRUE if given tag can contain other tags
|
||||
*/
|
||||
static
|
||||
PRBool HasCloseablePeerAboveRoot(TagList& aRootTagList,nsDTDContext& aContext,eHTMLTags aTag,PRBool anEndTag) {
|
||||
PRBool HasCloseablePeerAboveRoot(const TagList& aRootTagList,nsDTDContext& aContext,eHTMLTags aTag,PRBool anEndTag) {
|
||||
PRInt32 theRootIndex=LastOf(aContext,aRootTagList);
|
||||
TagList* theCloseTags=(anEndTag) ? gHTMLElements[aTag].GetAutoCloseEndTags() : gHTMLElements[aTag].GetAutoCloseStartTags();
|
||||
const TagList* theCloseTags=(anEndTag) ? gHTMLElements[aTag].GetAutoCloseEndTags() : gHTMLElements[aTag].GetAutoCloseStartTags();
|
||||
PRInt32 theChildIndex=-1;
|
||||
|
||||
if(theCloseTags) {
|
||||
@ -1839,8 +1839,8 @@ eHTMLTags FindAutoCloseTargetForEndTag(eHTMLTags aCurrentTag,nsDTDContext& aCont
|
||||
3. Otherwise its non-specified and we simply presume we can close it.
|
||||
*/
|
||||
|
||||
TagList* theCloseTags=gHTMLElements[aCurrentTag].GetAutoCloseEndTags();
|
||||
TagList* theRootTags=gHTMLElements[aCurrentTag].GetEndRootTags();
|
||||
const TagList* theCloseTags=gHTMLElements[aCurrentTag].GetAutoCloseEndTags();
|
||||
const TagList* theRootTags=gHTMLElements[aCurrentTag].GetEndRootTags();
|
||||
|
||||
if(theCloseTags){
|
||||
//at a min., this code is needed for H1..H6
|
||||
@ -2767,7 +2767,7 @@ PRBool CNavDTD::BackwardPropagate(nsString& aSequence,eHTMLTags aParentTag,eHTML
|
||||
eHTMLTags theParentTag=aParentTag; //just init to get past first condition...
|
||||
|
||||
do {
|
||||
TagList* theRootTags=gHTMLElements[aChildTag].GetRootTags();
|
||||
const TagList* theRootTags=gHTMLElements[aChildTag].GetRootTags();
|
||||
if(theRootTags) {
|
||||
theParentTag=theRootTags->mTags[0];
|
||||
if(CanContain(theParentTag,aChildTag)) {
|
||||
@ -3676,7 +3676,7 @@ nsresult CNavDTD::CloseContainersTo(eHTMLTags aTarget,PRBool aClosedByStartTag){
|
||||
}
|
||||
|
||||
nsresult result=NS_OK;
|
||||
TagList* theRootTags=gHTMLElements[aTarget].GetRootTags();
|
||||
const TagList* theRootTags=gHTMLElements[aTarget].GetRootTags();
|
||||
eHTMLTags theParentTag=(theRootTags) ? theRootTags->mTags[0] : eHTMLTag_unknown;
|
||||
pos=mBodyContext->LastOf(theParentTag);
|
||||
if(kNotFound!=pos) {
|
||||
|
||||
@ -97,9 +97,9 @@ inline PRBool ContainsGroup(CGroupMembers& aGroupSet,CGroupMembers& aGroup) {
|
||||
return result;
|
||||
}
|
||||
|
||||
inline PRBool ListContainsTag(eHTMLTags* aTagList,eHTMLTags aTag) {
|
||||
inline PRBool ListContainsTag(const eHTMLTags* aTagList,eHTMLTags aTag) {
|
||||
if(aTagList) {
|
||||
eHTMLTags *theNextTag=aTagList;
|
||||
const eHTMLTags *theNextTag=aTagList;
|
||||
while(eHTMLTag_unknown!=*theNextTag) {
|
||||
if(aTag==*theNextTag) {
|
||||
return PR_TRUE;
|
||||
@ -362,9 +362,9 @@ public:
|
||||
eHTMLTags mDelegate;
|
||||
CGroupMembers mGroup;
|
||||
CGroupMembers mContainsGroups;
|
||||
eHTMLTags *mIncludeKids;
|
||||
eHTMLTags *mExcludeKids;
|
||||
eHTMLTags *mAutoClose; //other start tags that close this container
|
||||
const eHTMLTags *mIncludeKids;
|
||||
const eHTMLTags *mExcludeKids;
|
||||
const eHTMLTags *mAutoClose; //other start tags that close this container
|
||||
};
|
||||
|
||||
|
||||
@ -1932,8 +1932,8 @@ public:
|
||||
/**********************************************************
|
||||
This is for the body element...
|
||||
**********************************************************/
|
||||
static eHTMLTags gBodyKids[] = {eHTMLTag_button, eHTMLTag_del, eHTMLTag_ins, eHTMLTag_map,eHTMLTag_script, eHTMLTag_unknown};
|
||||
static eHTMLTags gBodyExcludeKids[] = {eHTMLTag_applet, eHTMLTag_button, eHTMLTag_iframe, eHTMLTag_object, eHTMLTag_unknown};
|
||||
static const eHTMLTags gBodyKids[] = {eHTMLTag_button, eHTMLTag_del, eHTMLTag_ins, eHTMLTag_map,eHTMLTag_script, eHTMLTag_unknown};
|
||||
static const eHTMLTags gBodyExcludeKids[] = {eHTMLTag_applet, eHTMLTag_button, eHTMLTag_iframe, eHTMLTag_object, eHTMLTag_unknown};
|
||||
|
||||
class CBodyElement: public CElement {
|
||||
public:
|
||||
@ -2140,27 +2140,27 @@ public:
|
||||
|
||||
static CElementTable *gElementTable = 0;
|
||||
|
||||
static eHTMLTags kDLKids[]={eHTMLTag_dd,eHTMLTag_dt,eHTMLTag_unknown};
|
||||
static eHTMLTags kAutoCloseDD[]={eHTMLTag_dd,eHTMLTag_dt,eHTMLTag_dl,eHTMLTag_unknown};
|
||||
static eHTMLTags kButtonExcludeKids[]={ eHTMLTag_a,eHTMLTag_button,eHTMLTag_select,eHTMLTag_textarea,
|
||||
static const eHTMLTags kDLKids[]={eHTMLTag_dd,eHTMLTag_dt,eHTMLTag_unknown};
|
||||
static const eHTMLTags kAutoCloseDD[]={eHTMLTag_dd,eHTMLTag_dt,eHTMLTag_dl,eHTMLTag_unknown};
|
||||
static const eHTMLTags kButtonExcludeKids[]={ eHTMLTag_a,eHTMLTag_button,eHTMLTag_select,eHTMLTag_textarea,
|
||||
eHTMLTag_input,eHTMLTag_iframe,eHTMLTag_form,eHTMLTag_isindex,
|
||||
eHTMLTag_fieldset,eHTMLTag_unknown};
|
||||
static eHTMLTags kColgroupKids[]={eHTMLTag_col,eHTMLTag_unknown};
|
||||
static eHTMLTags kDirKids[]={eHTMLTag_li,eHTMLTag_unknown};
|
||||
static eHTMLTags kOptionGroupKids[]={eHTMLTag_option,eHTMLTag_unknown};
|
||||
static eHTMLTags kFieldsetKids[]={eHTMLTag_legend,eHTMLTag_unknown};
|
||||
static eHTMLTags kFormKids[]={eHTMLTag_script,eHTMLTag_unknown};
|
||||
static eHTMLTags kLIExcludeKids[]={eHTMLTag_dir,eHTMLTag_menu,eHTMLTag_unknown};
|
||||
static eHTMLTags kMapKids[]={eHTMLTag_area,eHTMLTag_unknown};
|
||||
static eHTMLTags kPreExcludeKids[]={eHTMLTag_image,eHTMLTag_object,eHTMLTag_applet,
|
||||
static const eHTMLTags kColgroupKids[]={eHTMLTag_col,eHTMLTag_unknown};
|
||||
static const eHTMLTags kDirKids[]={eHTMLTag_li,eHTMLTag_unknown};
|
||||
static const eHTMLTags kOptionGroupKids[]={eHTMLTag_option,eHTMLTag_unknown};
|
||||
static const eHTMLTags kFieldsetKids[]={eHTMLTag_legend,eHTMLTag_unknown};
|
||||
static const eHTMLTags kFormKids[]={eHTMLTag_script,eHTMLTag_unknown};
|
||||
static const eHTMLTags kLIExcludeKids[]={eHTMLTag_dir,eHTMLTag_menu,eHTMLTag_unknown};
|
||||
static const eHTMLTags kMapKids[]={eHTMLTag_area,eHTMLTag_unknown};
|
||||
static const eHTMLTags kPreExcludeKids[]={eHTMLTag_image,eHTMLTag_object,eHTMLTag_applet,
|
||||
eHTMLTag_big,eHTMLTag_small,eHTMLTag_sub,eHTMLTag_sup,
|
||||
eHTMLTag_font,eHTMLTag_basefont,eHTMLTag_unknown};
|
||||
static eHTMLTags kSelectKids[]={eHTMLTag_optgroup,eHTMLTag_option,eHTMLTag_unknown};
|
||||
static eHTMLTags kBlockQuoteKids[]={eHTMLTag_script,eHTMLTag_unknown};
|
||||
static eHTMLTags kFramesetKids[]={eHTMLTag_noframes,eHTMLTag_unknown};
|
||||
static eHTMLTags kObjectKids[]={eHTMLTag_param,eHTMLTag_unknown};
|
||||
static eHTMLTags kTBodyKids[]={eHTMLTag_tr,eHTMLTag_unknown};
|
||||
static eHTMLTags kUnknownKids[]={eHTMLTag_html,eHTMLTag_unknown};
|
||||
static const eHTMLTags kSelectKids[]={eHTMLTag_optgroup,eHTMLTag_option,eHTMLTag_unknown};
|
||||
static const eHTMLTags kBlockQuoteKids[]={eHTMLTag_script,eHTMLTag_unknown};
|
||||
static const eHTMLTags kFramesetKids[]={eHTMLTag_noframes,eHTMLTag_unknown};
|
||||
static const eHTMLTags kObjectKids[]={eHTMLTag_param,eHTMLTag_unknown};
|
||||
static const eHTMLTags kTBodyKids[]={eHTMLTag_tr,eHTMLTag_unknown};
|
||||
static const eHTMLTags kUnknownKids[]={eHTMLTag_html,eHTMLTag_unknown};
|
||||
|
||||
|
||||
inline CElement* CElement::GetElement(eHTMLTags aTag) {
|
||||
@ -2496,7 +2496,7 @@ void CElementTable::DebugDumpGroups(CElement* aTag){
|
||||
|
||||
if(aTag->mIncludeKids) {
|
||||
printf("\n%s",prefix);
|
||||
eHTMLTags *theKid=aTag->mIncludeKids;
|
||||
const eHTMLTags *theKid=aTag->mIncludeKids;
|
||||
printf("+ ");
|
||||
while(eHTMLTag_unknown!=*theKid){
|
||||
const PRUnichar *t = nsHTMLTags::GetStringValue(*theKid++);
|
||||
@ -2506,7 +2506,7 @@ void CElementTable::DebugDumpGroups(CElement* aTag){
|
||||
|
||||
if(aTag->mExcludeKids) {
|
||||
printf("\n%s",prefix);
|
||||
eHTMLTags *theKid=aTag->mExcludeKids;
|
||||
const eHTMLTags *theKid=aTag->mExcludeKids;
|
||||
printf("- ");
|
||||
while(eHTMLTag_unknown!=*theKid){
|
||||
const PRUnichar *t = nsHTMLTags::GetStringValue(*theKid++);
|
||||
|
||||
@ -607,7 +607,7 @@ struct TagList {
|
||||
* @param aTagList
|
||||
* @return index of tag, or kNotFound if not found
|
||||
*/
|
||||
inline PRInt32 LastOf(nsDTDContext& aContext,TagList& aTagList){
|
||||
inline PRInt32 LastOf(nsDTDContext& aContext, const TagList& aTagList){
|
||||
int max = aContext.GetCount();
|
||||
int index;
|
||||
for(index=max-1;index>=0;index--){
|
||||
|
||||
@ -52,109 +52,109 @@
|
||||
|
||||
|
||||
//First, define the set of taglists for tags with special parents...
|
||||
TagList gAParents={1,{eHTMLTag_map}};
|
||||
TagList gInAddress={1,{eHTMLTag_address}};
|
||||
TagList gInHead={1,{eHTMLTag_head}};
|
||||
TagList gInTable={1,{eHTMLTag_table}};
|
||||
TagList gInHTML={1,{eHTMLTag_html}};
|
||||
TagList gInBody={1,{eHTMLTag_body}};
|
||||
TagList gInForm={1,{eHTMLTag_form}};
|
||||
TagList gInFieldset={1,{eHTMLTag_fieldset}};
|
||||
TagList gInTR={1,{eHTMLTag_tr}};
|
||||
TagList gInDL={2,{eHTMLTag_dl,eHTMLTag_body}};
|
||||
TagList gInFrameset={1,{eHTMLTag_frameset}};
|
||||
TagList gInNoframes={1,{eHTMLTag_noframes}};
|
||||
static const TagList gAParents={1,{eHTMLTag_map}};
|
||||
static const TagList gInAddress={1,{eHTMLTag_address}};
|
||||
static const TagList gInHead={1,{eHTMLTag_head}};
|
||||
static const TagList gInTable={1,{eHTMLTag_table}};
|
||||
static const TagList gInHTML={1,{eHTMLTag_html}};
|
||||
static const TagList gInBody={1,{eHTMLTag_body}};
|
||||
static const TagList gInForm={1,{eHTMLTag_form}};
|
||||
static const TagList gInFieldset={1,{eHTMLTag_fieldset}};
|
||||
static const TagList gInTR={1,{eHTMLTag_tr}};
|
||||
static const TagList gInDL={2,{eHTMLTag_dl,eHTMLTag_body}};
|
||||
static const TagList gInFrameset={1,{eHTMLTag_frameset}};
|
||||
static const TagList gInNoframes={1,{eHTMLTag_noframes}};
|
||||
//Removed ADDRESS to solve 24885
|
||||
TagList gInP={2,{eHTMLTag_span,eHTMLTag_table}}; // added table for bug 43678, removed FORM bug 94269
|
||||
TagList gOptgroupParents={2,{eHTMLTag_select,eHTMLTag_optgroup}};
|
||||
TagList gBodyParents={2,{eHTMLTag_html,eHTMLTag_noframes}};
|
||||
TagList gColParents={2,{eHTMLTag_table,eHTMLTag_colgroup}};
|
||||
TagList gFramesetParents={2,{eHTMLTag_html,eHTMLTag_frameset}};
|
||||
TagList gLegendParents={1,{eHTMLTag_fieldset}};
|
||||
TagList gAreaParent={1,{eHTMLTag_map}};
|
||||
TagList gParamParents={2,{eHTMLTag_applet,eHTMLTag_object}};
|
||||
TagList gTRParents={4,{eHTMLTag_tbody,eHTMLTag_tfoot,eHTMLTag_thead,eHTMLTag_table}};
|
||||
TagList gTREndParents={5,{eHTMLTag_tbody,eHTMLTag_tfoot,eHTMLTag_thead,eHTMLTag_table,eHTMLTag_applet}};
|
||||
static const TagList gInP={2,{eHTMLTag_span,eHTMLTag_table}}; // added table for bug 43678, removed FORM bug 94269
|
||||
static const TagList gOptgroupParents={2,{eHTMLTag_select,eHTMLTag_optgroup}};
|
||||
static const TagList gBodyParents={2,{eHTMLTag_html,eHTMLTag_noframes}};
|
||||
static const TagList gColParents={2,{eHTMLTag_table,eHTMLTag_colgroup}};
|
||||
static const TagList gFramesetParents={2,{eHTMLTag_html,eHTMLTag_frameset}};
|
||||
static const TagList gLegendParents={1,{eHTMLTag_fieldset}};
|
||||
static const TagList gAreaParent={1,{eHTMLTag_map}};
|
||||
static const TagList gParamParents={2,{eHTMLTag_applet,eHTMLTag_object}};
|
||||
static const TagList gTRParents={4,{eHTMLTag_tbody,eHTMLTag_tfoot,eHTMLTag_thead,eHTMLTag_table}};
|
||||
static const TagList gTREndParents={5,{eHTMLTag_tbody,eHTMLTag_tfoot,eHTMLTag_thead,eHTMLTag_table,eHTMLTag_applet}};
|
||||
|
||||
//*********************************************************************************************
|
||||
// Next, define the set of taglists for tags with special kids...
|
||||
//*********************************************************************************************
|
||||
|
||||
TagList gContainsText={4,{eHTMLTag_text,eHTMLTag_newline,eHTMLTag_whitespace,eHTMLTag_entity}};
|
||||
TagList gUnknownKids={2,{eHTMLTag_html,eHTMLTag_frameset}};
|
||||
TagList gContainsOpts={3,{eHTMLTag_option,eHTMLTag_optgroup,eHTMLTag_script}};
|
||||
TagList gContainsParam={1,{eHTMLTag_param}};
|
||||
TagList gColgroupKids={1,{eHTMLTag_col}};
|
||||
TagList gAddressKids={1,{eHTMLTag_p}};
|
||||
TagList gBodyKids={8, {eHTMLTag_dd,eHTMLTag_del,eHTMLTag_dt,eHTMLTag_ins,
|
||||
static const TagList gContainsText={4,{eHTMLTag_text,eHTMLTag_newline,eHTMLTag_whitespace,eHTMLTag_entity}};
|
||||
static const TagList gUnknownKids={2,{eHTMLTag_html,eHTMLTag_frameset}};
|
||||
static const TagList gContainsOpts={3,{eHTMLTag_option,eHTMLTag_optgroup,eHTMLTag_script}};
|
||||
static const TagList gContainsParam={1,{eHTMLTag_param}};
|
||||
static const TagList gColgroupKids={1,{eHTMLTag_col}};
|
||||
static const TagList gAddressKids={1,{eHTMLTag_p}};
|
||||
static const TagList gBodyKids={8, {eHTMLTag_dd,eHTMLTag_del,eHTMLTag_dt,eHTMLTag_ins,
|
||||
eHTMLTag_noscript,eHTMLTag_script,eHTMLTag_li,eHTMLTag_param}}; // Added PARAM for bug 54448
|
||||
TagList gButtonKids={2,{eHTMLTag_caption,eHTMLTag_legend}};
|
||||
static const TagList gButtonKids={2,{eHTMLTag_caption,eHTMLTag_legend}};
|
||||
|
||||
TagList gDLRootTags={5,{eHTMLTag_body,eHTMLTag_td,eHTMLTag_table,eHTMLTag_applet,eHTMLTag_dd}};
|
||||
TagList gDLKids={2,{eHTMLTag_dd,eHTMLTag_dt}};
|
||||
TagList gDTKids={1,{eHTMLTag_dt}};
|
||||
TagList gFieldsetKids={2,{eHTMLTag_legend,eHTMLTag_text}};
|
||||
TagList gFontKids={3,{eHTMLTag_legend,eHTMLTag_table,eHTMLTag_text}}; // Added table to fix bug 93365
|
||||
TagList gFormKids={1,{eHTMLTag_keygen}};
|
||||
TagList gFramesetKids={3,{eHTMLTag_frame,eHTMLTag_frameset,eHTMLTag_noframes}};
|
||||
static const TagList gDLRootTags={5,{eHTMLTag_body,eHTMLTag_td,eHTMLTag_table,eHTMLTag_applet,eHTMLTag_dd}};
|
||||
static const TagList gDLKids={2,{eHTMLTag_dd,eHTMLTag_dt}};
|
||||
static const TagList gDTKids={1,{eHTMLTag_dt}};
|
||||
static const TagList gFieldsetKids={2,{eHTMLTag_legend,eHTMLTag_text}};
|
||||
static const TagList gFontKids={3,{eHTMLTag_legend,eHTMLTag_table,eHTMLTag_text}}; // Added table to fix bug 93365
|
||||
static const TagList gFormKids={1,{eHTMLTag_keygen}};
|
||||
static const TagList gFramesetKids={3,{eHTMLTag_frame,eHTMLTag_frameset,eHTMLTag_noframes}};
|
||||
|
||||
TagList gHtmlKids={9,{eHTMLTag_body,eHTMLTag_frameset,eHTMLTag_head,eHTMLTag_map,eHTMLTag_noscript,eHTMLTag_noframes,eHTMLTag_script,eHTMLTag_newline,eHTMLTag_whitespace}};
|
||||
TagList gHeadKids={8,{eHTMLTag_base,eHTMLTag_bgsound,eHTMLTag_link,eHTMLTag_meta,eHTMLTag_script,eHTMLTag_style,eHTMLTag_title,eHTMLTag_noembed}};
|
||||
static const TagList gHtmlKids={9,{eHTMLTag_body,eHTMLTag_frameset,eHTMLTag_head,eHTMLTag_map,eHTMLTag_noscript,eHTMLTag_noframes,eHTMLTag_script,eHTMLTag_newline,eHTMLTag_whitespace}};
|
||||
static const TagList gHeadKids={8,{eHTMLTag_base,eHTMLTag_bgsound,eHTMLTag_link,eHTMLTag_meta,eHTMLTag_script,eHTMLTag_style,eHTMLTag_title,eHTMLTag_noembed}};
|
||||
|
||||
TagList gLabelKids={1,{eHTMLTag_span}};
|
||||
TagList gLIKids={2,{eHTMLTag_ol,eHTMLTag_ul}};
|
||||
TagList gMapKids={1,{eHTMLTag_area}};
|
||||
TagList gPreKids={2,{eHTMLTag_hr,eHTMLTag_center}}; //note that CENTER is here for backward compatibility; it's not 4.0 spec.
|
||||
static const TagList gLabelKids={1,{eHTMLTag_span}};
|
||||
static const TagList gLIKids={2,{eHTMLTag_ol,eHTMLTag_ul}};
|
||||
static const TagList gMapKids={1,{eHTMLTag_area}};
|
||||
static const TagList gPreKids={2,{eHTMLTag_hr,eHTMLTag_center}}; //note that CENTER is here for backward compatibility; it's not 4.0 spec.
|
||||
|
||||
TagList gTableKids={9,{eHTMLTag_caption,eHTMLTag_col,eHTMLTag_colgroup,eHTMLTag_form,
|
||||
static const TagList gTableKids={9,{eHTMLTag_caption,eHTMLTag_col,eHTMLTag_colgroup,eHTMLTag_form,
|
||||
eHTMLTag_thead,eHTMLTag_tbody,eHTMLTag_tfoot,
|
||||
eHTMLTag_map,eHTMLTag_script}};// Removed INPUT - Ref. Bug 20087, 25382
|
||||
|
||||
TagList gTableElemKids={7,{eHTMLTag_form,eHTMLTag_map,eHTMLTag_noscript,eHTMLTag_script,eHTMLTag_td,eHTMLTag_th,eHTMLTag_tr}};
|
||||
TagList gTRKids={4,{eHTMLTag_td,eHTMLTag_th,eHTMLTag_form,eHTMLTag_script}};// Removed INPUT - Ref. Bug 20087, 25382 | Removed MAP to fix 58942
|
||||
TagList gTBodyKids={2,{eHTMLTag_tr,eHTMLTag_form}}; // Removed INPUT - Ref. Bug 20087, 25382
|
||||
TagList gULKids={2,{eHTMLTag_li,eHTMLTag_p}};
|
||||
static const TagList gTableElemKids={7,{eHTMLTag_form,eHTMLTag_map,eHTMLTag_noscript,eHTMLTag_script,eHTMLTag_td,eHTMLTag_th,eHTMLTag_tr}};
|
||||
static const TagList gTRKids={4,{eHTMLTag_td,eHTMLTag_th,eHTMLTag_form,eHTMLTag_script}};// Removed INPUT - Ref. Bug 20087, 25382 | Removed MAP to fix 58942
|
||||
static const TagList gTBodyKids={2,{eHTMLTag_tr,eHTMLTag_form}}; // Removed INPUT - Ref. Bug 20087, 25382
|
||||
static const TagList gULKids={2,{eHTMLTag_li,eHTMLTag_p}};
|
||||
|
||||
|
||||
//*********************************************************************************************
|
||||
// The following tag lists are used to define common set of root notes for the HTML elements...
|
||||
//*********************************************************************************************
|
||||
|
||||
TagList gRootTags={5,{eHTMLTag_body,eHTMLTag_td,eHTMLTag_table,eHTMLTag_applet,eHTMLTag_select}}; // Added SELECT to fix bug 98645
|
||||
TagList gTableRootTags={6,{eHTMLTag_applet,eHTMLTag_body,eHTMLTag_dl,eHTMLTag_ol,eHTMLTag_td,eHTMLTag_th}};
|
||||
TagList gHTMLRootTags={1,{eHTMLTag_unknown}};
|
||||
static const TagList gRootTags={5,{eHTMLTag_body,eHTMLTag_td,eHTMLTag_table,eHTMLTag_applet,eHTMLTag_select}}; // Added SELECT to fix bug 98645
|
||||
static const TagList gTableRootTags={6,{eHTMLTag_applet,eHTMLTag_body,eHTMLTag_dl,eHTMLTag_ol,eHTMLTag_td,eHTMLTag_th}};
|
||||
static const TagList gHTMLRootTags={1,{eHTMLTag_unknown}};
|
||||
|
||||
TagList gLIRootTags={8,{eHTMLTag_ul,eHTMLTag_ol,eHTMLTag_dir,eHTMLTag_menu,eHTMLTag_p,eHTMLTag_body,eHTMLTag_td,eHTMLTag_th}};
|
||||
static const TagList gLIRootTags={8,{eHTMLTag_ul,eHTMLTag_ol,eHTMLTag_dir,eHTMLTag_menu,eHTMLTag_p,eHTMLTag_body,eHTMLTag_td,eHTMLTag_th}};
|
||||
|
||||
TagList gOLRootTags={5,{eHTMLTag_body,eHTMLTag_li,eHTMLTag_td,eHTMLTag_th,eHTMLTag_select}};
|
||||
TagList gTDRootTags={6,{eHTMLTag_tr,eHTMLTag_tbody,eHTMLTag_thead,eHTMLTag_tfoot,eHTMLTag_table,eHTMLTag_applet}};
|
||||
TagList gNoframeRoot={2,{eHTMLTag_body,eHTMLTag_frameset}};
|
||||
static const TagList gOLRootTags={5,{eHTMLTag_body,eHTMLTag_li,eHTMLTag_td,eHTMLTag_th,eHTMLTag_select}};
|
||||
static const TagList gTDRootTags={6,{eHTMLTag_tr,eHTMLTag_tbody,eHTMLTag_thead,eHTMLTag_tfoot,eHTMLTag_table,eHTMLTag_applet}};
|
||||
static const TagList gNoframeRoot={2,{eHTMLTag_body,eHTMLTag_frameset}};
|
||||
|
||||
//*********************************************************************************************
|
||||
// The following tag lists are used to define the autoclose properties of the html elements...
|
||||
//*********************************************************************************************
|
||||
|
||||
TagList gBodyAutoClose={1,{eHTMLTag_head}};
|
||||
TagList gTBodyAutoClose={5,{eHTMLTag_thead,eHTMLTag_tfoot,eHTMLTag_tbody,eHTMLTag_td,eHTMLTag_th}}; // TD|TH inclusion - Bug# 24112
|
||||
TagList gCaptionAutoClose={1,{eHTMLTag_tbody}};
|
||||
TagList gLIAutoClose={2,{eHTMLTag_p,eHTMLTag_li}};
|
||||
TagList gPAutoClose={2,{eHTMLTag_p,eHTMLTag_li}};
|
||||
TagList gHRAutoClose={1,{eHTMLTag_p}};
|
||||
TagList gOLAutoClose={2,{eHTMLTag_p,eHTMLTag_ol}};
|
||||
TagList gDivAutoClose={1,{eHTMLTag_p}};
|
||||
static const TagList gBodyAutoClose={1,{eHTMLTag_head}};
|
||||
static const TagList gTBodyAutoClose={5,{eHTMLTag_thead,eHTMLTag_tfoot,eHTMLTag_tbody,eHTMLTag_td,eHTMLTag_th}}; // TD|TH inclusion - Bug# 24112
|
||||
static const TagList gCaptionAutoClose={1,{eHTMLTag_tbody}};
|
||||
static const TagList gLIAutoClose={2,{eHTMLTag_p,eHTMLTag_li}};
|
||||
static const TagList gPAutoClose={2,{eHTMLTag_p,eHTMLTag_li}};
|
||||
static const TagList gHRAutoClose={1,{eHTMLTag_p}};
|
||||
static const TagList gOLAutoClose={2,{eHTMLTag_p,eHTMLTag_ol}};
|
||||
static const TagList gDivAutoClose={1,{eHTMLTag_p}};
|
||||
|
||||
TagList gHeadingTags={6,{eHTMLTag_h1,eHTMLTag_h2,eHTMLTag_h3,eHTMLTag_h4,eHTMLTag_h5,eHTMLTag_h6}};
|
||||
static const TagList gHeadingTags={6,{eHTMLTag_h1,eHTMLTag_h2,eHTMLTag_h3,eHTMLTag_h4,eHTMLTag_h5,eHTMLTag_h6}};
|
||||
|
||||
TagList gTableCloseTags={6,{eHTMLTag_td,eHTMLTag_tr,eHTMLTag_th,eHTMLTag_tbody,eHTMLTag_thead,eHTMLTag_tfoot}};
|
||||
TagList gTRCloseTags={3,{eHTMLTag_tr,eHTMLTag_td,eHTMLTag_th}};
|
||||
TagList gTDCloseTags={2,{eHTMLTag_td,eHTMLTag_th}};
|
||||
TagList gDTCloseTags={3,{eHTMLTag_p,eHTMLTag_dd,eHTMLTag_dt}};
|
||||
TagList gULCloseTags={1,{eHTMLTag_li}};
|
||||
TagList gULAutoClose={2,{eHTMLTag_p,eHTMLTag_ul}}; //fix bug 50261..
|
||||
static const TagList gTableCloseTags={6,{eHTMLTag_td,eHTMLTag_tr,eHTMLTag_th,eHTMLTag_tbody,eHTMLTag_thead,eHTMLTag_tfoot}};
|
||||
static const TagList gTRCloseTags={3,{eHTMLTag_tr,eHTMLTag_td,eHTMLTag_th}};
|
||||
static const TagList gTDCloseTags={2,{eHTMLTag_td,eHTMLTag_th}};
|
||||
static const TagList gDTCloseTags={3,{eHTMLTag_p,eHTMLTag_dd,eHTMLTag_dt}};
|
||||
static const TagList gULCloseTags={1,{eHTMLTag_li}};
|
||||
static const TagList gULAutoClose={2,{eHTMLTag_p,eHTMLTag_ul}}; //fix bug 50261..
|
||||
|
||||
|
||||
TagList gExcludableParents={1,{eHTMLTag_pre}}; // Ref Bug 22913
|
||||
TagList gCaptionExcludableParents={1,{eHTMLTag_td}}; //Ref Bug 26488
|
||||
static const TagList gExcludableParents={1,{eHTMLTag_pre}}; // Ref Bug 22913
|
||||
static const TagList gCaptionExcludableParents={1,{eHTMLTag_td}}; //Ref Bug 26488
|
||||
|
||||
//*********************************************************************************************
|
||||
//Lastly, bind tags with their rules, their special parents and special kids.
|
||||
@ -178,19 +178,19 @@ nsHTMLElement* gHTMLElements=0;
|
||||
void Initialize(eHTMLTags aTag,
|
||||
eHTMLTags aRequiredAncestor,
|
||||
eHTMLTags aExcludingAncestor,
|
||||
TagList* aRootNodes,
|
||||
TagList* aEndRootNodes,
|
||||
TagList* aAutocloseStart,
|
||||
TagList* aAutocloseEnd,
|
||||
TagList* aSynonymousTags,
|
||||
TagList* aExcludableParents,
|
||||
const TagList* aRootNodes,
|
||||
const TagList* aEndRootNodes,
|
||||
const TagList* aAutocloseStart,
|
||||
const TagList* aAutocloseEnd,
|
||||
const TagList* aSynonymousTags,
|
||||
const TagList* aExcludableParents,
|
||||
int aParentBits,
|
||||
int aInclusionBits,
|
||||
int aExclusionBits,
|
||||
int aSpecialProperties,
|
||||
PRUint32 aPropagateRange,
|
||||
TagList* aSpecialParents,
|
||||
TagList* aSpecialKids,
|
||||
const TagList* aSpecialParents,
|
||||
const TagList* aSpecialKids,
|
||||
eHTMLTags aSkipTarget
|
||||
)
|
||||
{
|
||||
@ -1410,8 +1410,8 @@ PRBool nsHTMLElement::CanBeContained(eHTMLTags aChildTag,nsDTDContext &aContext)
|
||||
result=PR_TRUE;
|
||||
|
||||
if(0<theCount){
|
||||
TagList* theRootTags=gHTMLElements[aChildTag].GetRootTags();
|
||||
TagList* theSpecialParents=gHTMLElements[aChildTag].GetSpecialParents();
|
||||
const TagList* theRootTags=gHTMLElements[aChildTag].GetRootTags();
|
||||
const TagList* theSpecialParents=gHTMLElements[aChildTag].GetSpecialParents();
|
||||
if(theRootTags) {
|
||||
PRInt32 theRootIndex=LastOf(aContext,*theRootTags);
|
||||
PRInt32 theSPIndex=(theSpecialParents) ? LastOf(aContext,*theSpecialParents) : kNotFound;
|
||||
@ -1467,7 +1467,7 @@ PRBool nsHTMLElement::CanBeContained(eHTMLTags aChildTag,nsDTDContext &aContext)
|
||||
PRInt32 nsHTMLElement::GetIndexOfChildOrSynonym(nsDTDContext& aContext,eHTMLTags aChildTag) {
|
||||
PRInt32 theChildIndex=aContext.LastOf(aChildTag);
|
||||
if(kNotFound==theChildIndex) {
|
||||
TagList* theSynTags=gHTMLElements[aChildTag].GetSynonymousTags(); //get the list of tags that THIS tag can close
|
||||
const TagList* theSynTags=gHTMLElements[aChildTag].GetSynonymousTags(); //get the list of tags that THIS tag can close
|
||||
if(theSynTags) {
|
||||
theChildIndex=LastOf(aContext,*theSynTags);
|
||||
}
|
||||
@ -1770,7 +1770,7 @@ PRBool nsHTMLElement::IsExcludableParent(eHTMLTags aParent) const{
|
||||
|
||||
if(!IsTextTag(mTagID)) {
|
||||
if(mExcludableParents) {
|
||||
TagList* theParents=mExcludableParents;
|
||||
const TagList* theParents=mExcludableParents;
|
||||
if(FindTagInSet(aParent,theParents->mTags,theParents->mCount))
|
||||
result=PR_TRUE;
|
||||
}
|
||||
@ -1874,7 +1874,7 @@ PRBool nsHTMLElement::IsChildOfHead(eHTMLTags aChild,PRBool& aExclusively) {
|
||||
*/
|
||||
PRBool nsHTMLElement::SectionContains(eHTMLTags aChild,PRBool allowDepthSearch) {
|
||||
PRBool result=PR_FALSE;
|
||||
TagList* theRootTags=gHTMLElements[aChild].GetRootTags();
|
||||
const TagList* theRootTags=gHTMLElements[aChild].GetRootTags();
|
||||
|
||||
if(theRootTags){
|
||||
if(!FindTagInSet(mTagID,theRootTags->mTags,theRootTags->mCount)){
|
||||
@ -2175,7 +2175,7 @@ eHTMLTags nsHTMLElement::GetCloseTargetForEndTag(nsDTDContext& aContext,PRInt32
|
||||
// Note: we intentionally make 2 passes:
|
||||
// The first pass tries to exactly match, the 2nd pass matches the group.
|
||||
|
||||
TagList* theRootTags=gHTMLElements[mTagID].GetEndRootTags();
|
||||
const TagList* theRootTags=gHTMLElements[mTagID].GetEndRootTags();
|
||||
PRInt32 theIndexCopy=theIndex;
|
||||
while(--theIndex>=anIndex){
|
||||
eHTMLTags theTag=aContext.TagAt(theIndex);
|
||||
@ -2241,14 +2241,14 @@ PRBool nsHTMLElement::CanContain(eHTMLTags aChild) const{
|
||||
return CanContainSelf(); //not many tags can contain themselves...
|
||||
}
|
||||
|
||||
TagList* theCloseTags=gHTMLElements[aChild].GetAutoCloseStartTags();
|
||||
const TagList* theCloseTags=gHTMLElements[aChild].GetAutoCloseStartTags();
|
||||
if(theCloseTags){
|
||||
if(FindTagInSet(mTagID,theCloseTags->mTags,theCloseTags->mCount))
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
if(gHTMLElements[aChild].mExcludableParents) {
|
||||
TagList* theParents=gHTMLElements[aChild].mExcludableParents;
|
||||
const TagList* theParents=gHTMLElements[aChild].mExcludableParents;
|
||||
if(FindTagInSet(mTagID,theParents->mTags,theParents->mCount))
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
@ -195,15 +195,15 @@ struct nsHTMLElement {
|
||||
|
||||
static PRInt32 GetIndexOfChildOrSynonym(nsDTDContext& aContext,eHTMLTags aChildTag);
|
||||
|
||||
TagList* GetSynonymousTags(void) const {return mSynonymousTags;}
|
||||
TagList* GetRootTags(void) const {return mRootNodes;}
|
||||
TagList* GetEndRootTags(void) const {return mEndRootNodes;}
|
||||
TagList* GetAutoCloseStartTags(void) const {return mAutocloseStart;}
|
||||
TagList* GetAutoCloseEndTags(void) const {return mAutocloseEnd;}
|
||||
const TagList* GetSynonymousTags(void) const {return mSynonymousTags;}
|
||||
const TagList* GetRootTags(void) const {return mRootNodes;}
|
||||
const TagList* GetEndRootTags(void) const {return mEndRootNodes;}
|
||||
const TagList* GetAutoCloseStartTags(void) const {return mAutocloseStart;}
|
||||
const TagList* GetAutoCloseEndTags(void) const {return mAutocloseEnd;}
|
||||
eHTMLTags GetCloseTargetForEndTag(nsDTDContext& aContext,PRInt32 anIndex) const;
|
||||
|
||||
TagList* GetSpecialChildren(void) const {return mSpecialKids;}
|
||||
TagList* GetSpecialParents(void) const {return mSpecialParents;}
|
||||
const TagList* GetSpecialChildren(void) const {return mSpecialKids;}
|
||||
const TagList* GetSpecialParents(void) const {return mSpecialParents;}
|
||||
|
||||
PRBool IsMemberOf(PRInt32 aType) const;
|
||||
PRBool ContainsSet(PRInt32 aType) const;
|
||||
@ -239,19 +239,19 @@ struct nsHTMLElement {
|
||||
eHTMLTags mTagID;
|
||||
eHTMLTags mRequiredAncestor;
|
||||
eHTMLTags mExcludingAncestor; //If set, the presence of the excl-ancestor prevents this from opening.
|
||||
TagList* mRootNodes; //These are the tags above which you many not autoclose a START tag
|
||||
TagList* mEndRootNodes; //These are the tags above which you many not autoclose an END tag
|
||||
TagList* mAutocloseStart; //these are the start tags that you can automatically close with this START tag
|
||||
TagList* mAutocloseEnd; //these are the start tags that you can automatically close with this END tag
|
||||
TagList* mSynonymousTags; //These are morally equivalent; an end tag for one can close a start tag for another (like <Hn>)
|
||||
TagList* mExcludableParents; //These are the TAGS that cannot contain you
|
||||
const TagList* mRootNodes; //These are the tags above which you many not autoclose a START tag
|
||||
const TagList* mEndRootNodes; //These are the tags above which you many not autoclose an END tag
|
||||
const TagList* mAutocloseStart; //these are the start tags that you can automatically close with this START tag
|
||||
const TagList* mAutocloseEnd; //these are the start tags that you can automatically close with this END tag
|
||||
const TagList* mSynonymousTags; //These are morally equivalent; an end tag for one can close a start tag for another (like <Hn>)
|
||||
const TagList* mExcludableParents; //These are the TAGS that cannot contain you
|
||||
int mParentBits; //defines groups that can contain this element
|
||||
int mInclusionBits; //defines parental and containment rules
|
||||
int mExclusionBits; //defines things you CANNOT contain
|
||||
int mSpecialProperties; //used for various special purposes...
|
||||
PRUint32 mPropagateRange; //tells us how far a parent is willing to prop. badly formed children
|
||||
TagList* mSpecialParents; //These are the special tags that contain this tag (directly)
|
||||
TagList* mSpecialKids; //These are the extra things you can contain
|
||||
const TagList* mSpecialParents; //These are the special tags that contain this tag (directly)
|
||||
const TagList* mSpecialKids; //These are the extra things you can contain
|
||||
eHTMLTags mSkipTarget; //If set, then we skip all content until this tag is seen
|
||||
ContainFunc mCanBeContained;
|
||||
};
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
static const char* kWhitespace = " \r\n\t"; // Optimized for typical cases
|
||||
static const char kWhitespace[] = " \r\n\t"; // Optimized for typical cases
|
||||
|
||||
/***************************** EXPAT CALL BACKS *******************************/
|
||||
|
||||
|
||||
@ -270,7 +270,7 @@ static const PRUnichar sHTMLTagUnicodeName_xmp[] =
|
||||
|
||||
// static array of unicode tag names
|
||||
#define HTML_TAG(_tag) sHTMLTagUnicodeName_##_tag,
|
||||
static const PRUnichar* kTagUnicodeTable[] = {
|
||||
static const PRUnichar* const kTagUnicodeTable[] = {
|
||||
#include "nsHTMLTagList.h"
|
||||
};
|
||||
#undef HTML_TAG
|
||||
@ -279,7 +279,7 @@ static const PRUnichar* kTagUnicodeTable[] = {
|
||||
#ifdef DEBUG
|
||||
// static array of ASCII tag names for debugging purposes
|
||||
#define HTML_TAG(_tag) #_tag,
|
||||
static const char* kTagASCIIDebugTable[] = {
|
||||
static const char* const kTagASCIIDebugTable[] = {
|
||||
#include "nsHTMLTagList.h"
|
||||
};
|
||||
#undef HTML_TAG
|
||||
@ -507,6 +507,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
nsTestTagTable validateTagTable;
|
||||
static const nsTestTagTable validateTagTable;
|
||||
|
||||
#endif
|
||||
|
||||
@ -2051,7 +2051,7 @@ CEntityToken::ConsumeEntity(PRUnichar aChar,
|
||||
*/
|
||||
#define NOT_USED 0xfffd
|
||||
|
||||
static PRUint16 PA_HackTable[] = {
|
||||
static const PRUint16 PA_HackTable[] = {
|
||||
0x20ac, /* EURO SIGN */
|
||||
NOT_USED,
|
||||
0x201a, /* SINGLE LOW-9 QUOTATION MARK */
|
||||
|
||||
@ -49,7 +49,7 @@ static NS_DEFINE_IID(kILoggingSinkIID, NS_ILOGGING_SINK_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
// list of tags that have skipped content
|
||||
static char gSkippedContentTags[] = {
|
||||
static const char gSkippedContentTags[] = {
|
||||
eHTMLTag_style,
|
||||
eHTMLTag_script,
|
||||
eHTMLTag_server,
|
||||
|
||||
@ -88,8 +88,8 @@ nsReadEndCondition::nsReadEndCondition(const PRUnichar* aTerminateChars) :
|
||||
|
||||
static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
|
||||
|
||||
const char* kBadHTMLText="<H3>Oops...</H3>You just tried to read a non-existent document: <BR>";
|
||||
const char* kUnorderedStringError = "String argument must be ordered. Don't you read API's?";
|
||||
static const char kBadHTMLText[] ="<H3>Oops...</H3>You just tried to read a non-existent document: <BR>";
|
||||
static const char kUnorderedStringError[] = "String argument must be ordered. Don't you read API's?";
|
||||
|
||||
#ifdef __INCREMENTAL
|
||||
const int kBufsize=1;
|
||||
|
||||
@ -114,8 +114,8 @@ static NS_DEFINE_IID(kClassIID, NS_VIEWSOURCE_HTML_IID);
|
||||
// bug 22022 - these are used to toggle 'Wrap Long Lines' on the viewsource
|
||||
// window by selectively setting/unsetting the following class defined in
|
||||
// viewsource.css; the setting is remembered between invocations using a pref.
|
||||
static const char* kBodyId = "viewsource";
|
||||
static const char* kBodyClassWrap = "wrap";
|
||||
static const char kBodyId[] = "viewsource";
|
||||
static const char kBodyClassWrap[] = "wrap";
|
||||
|
||||
/**
|
||||
* This method gets called as part of our COM-like interfaces.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user