source: trunk/third/mozilla/htmlparser/src/nsElementTable.cpp @ 22482

Revision 22482, 95.3 KB checked in by rbasch, 19 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r22481, which included commits to RCS files with non-trunk default branches.
Line 
1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* ***** BEGIN LICENSE BLOCK *****
3 * Version: NPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Netscape Public License
6 * Version 1.1 (the "License"); you may not use this file except in
7 * compliance with the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/NPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is mozilla.org code.
16 *
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 *
24 *
25 * Alternatively, the contents of this file may be used under the terms of
26 * either the GNU General Public License Version 2 or later (the "GPL"), or
27 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the NPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the NPL, the GPL or the LGPL.
36 *
37 * ***** END LICENSE BLOCK ***** */
38
39
40/**
41 * MODULE NOTES:
42 * @update  gess 4/1/98
43 *
44 */
45
46#include "nsIAtom.h"
47#include "nsElementTable.h"
48
49/*****************************************************************************
50  Now it's time to list all the html elements all with their capabilities...
51******************************************************************************/
52
53#define DECL_TAG_LIST(name_, list_)                                           \
54  static const eHTMLTags name_##list[] = list_;                               \
55  static const TagList name_ = { NS_ARRAY_LENGTH(name_##list), name_##list };
56
57#define COMMA ,
58
59//First, define the set of taglists for tags with special parents...
60DECL_TAG_LIST(gAParents,{eHTMLTag_map})
61DECL_TAG_LIST(gInAddress,{eHTMLTag_address})
62DECL_TAG_LIST(gInHead,{eHTMLTag_head})
63DECL_TAG_LIST(gInTable,{eHTMLTag_table})
64DECL_TAG_LIST(gInHTML,{eHTMLTag_html})
65DECL_TAG_LIST(gInBody,{eHTMLTag_body})
66DECL_TAG_LIST(gInForm,{eHTMLTag_form})
67DECL_TAG_LIST(gInFieldset,{eHTMLTag_fieldset})
68DECL_TAG_LIST(gInTR,{eHTMLTag_tr})
69DECL_TAG_LIST(gInDL,{eHTMLTag_dl COMMA eHTMLTag_body})
70DECL_TAG_LIST(gInFrameset,{eHTMLTag_frameset})
71DECL_TAG_LIST(gInNoframes,{eHTMLTag_noframes})
72//Removed ADDRESS to solve 24885
73// gInP: nsHTMLElement::CanContain() also allows table in Quirks mode for bug 43678, removed FORM bug 94269
74DECL_TAG_LIST(gInP,{eHTMLTag_span})
75DECL_TAG_LIST(gOptgroupParents,{eHTMLTag_select COMMA eHTMLTag_optgroup})
76DECL_TAG_LIST(gBodyParents,{eHTMLTag_html COMMA eHTMLTag_noframes})
77DECL_TAG_LIST(gColParents,{eHTMLTag_table COMMA eHTMLTag_colgroup})
78DECL_TAG_LIST(gFramesetParents,{eHTMLTag_html COMMA eHTMLTag_frameset})
79DECL_TAG_LIST(gLegendParents,{eHTMLTag_fieldset})
80DECL_TAG_LIST(gAreaParent,{eHTMLTag_map})
81DECL_TAG_LIST(gParamParents,{eHTMLTag_applet COMMA eHTMLTag_object})
82DECL_TAG_LIST(gTRParents,{eHTMLTag_tbody COMMA eHTMLTag_tfoot COMMA eHTMLTag_thead COMMA eHTMLTag_table})
83DECL_TAG_LIST(gTREndParents,{eHTMLTag_tbody COMMA eHTMLTag_tfoot COMMA eHTMLTag_thead COMMA eHTMLTag_table COMMA eHTMLTag_applet})
84
85//*********************************************************************************************
86//  Next, define the set of taglists for tags with special kids...
87//*********************************************************************************************
88
89DECL_TAG_LIST(gContainsText,{eHTMLTag_text COMMA eHTMLTag_newline COMMA eHTMLTag_whitespace COMMA eHTMLTag_entity})
90DECL_TAG_LIST(gUnknownKids,{eHTMLTag_html COMMA eHTMLTag_frameset})
91DECL_TAG_LIST(gContainsOpts,{eHTMLTag_option COMMA eHTMLTag_optgroup COMMA eHTMLTag_script})
92DECL_TAG_LIST(gContainsParam,{eHTMLTag_param})
93DECL_TAG_LIST(gColgroupKids,{eHTMLTag_col})
94DECL_TAG_LIST(gAddressKids,{eHTMLTag_p})
95DECL_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}) // Added PARAM for bug 54448
96DECL_TAG_LIST(gButtonKids,{eHTMLTag_caption COMMA eHTMLTag_legend})
97
98DECL_TAG_LIST(gDLRootTags,{eHTMLTag_body COMMA eHTMLTag_td COMMA eHTMLTag_table COMMA eHTMLTag_applet COMMA eHTMLTag_dd})
99DECL_TAG_LIST(gDLKids,{eHTMLTag_dd COMMA eHTMLTag_dt})
100DECL_TAG_LIST(gDTKids,{eHTMLTag_dt})
101DECL_TAG_LIST(gFieldsetKids,{eHTMLTag_legend COMMA eHTMLTag_text})
102DECL_TAG_LIST(gFontKids,{eHTMLTag_legend COMMA eHTMLTag_table COMMA eHTMLTag_text}) // Added table to fix bug 93365
103DECL_TAG_LIST(gFormKids,{eHTMLTag_keygen})
104DECL_TAG_LIST(gFramesetKids,{eHTMLTag_frame COMMA eHTMLTag_frameset COMMA eHTMLTag_noframes})
105
106DECL_TAG_LIST(gHtmlKids,{eHTMLTag_body COMMA eHTMLTag_frameset COMMA eHTMLTag_head COMMA eHTMLTag_map COMMA eHTMLTag_noscript COMMA eHTMLTag_noframes COMMA eHTMLTag_script COMMA eHTMLTag_newline COMMA eHTMLTag_whitespace})
107DECL_TAG_LIST(gHeadKids,{eHTMLTag_base COMMA eHTMLTag_bgsound COMMA eHTMLTag_link COMMA eHTMLTag_meta COMMA eHTMLTag_script COMMA eHTMLTag_style COMMA eHTMLTag_title COMMA eHTMLTag_noembed})
108
109DECL_TAG_LIST(gLabelKids,{eHTMLTag_span})
110DECL_TAG_LIST(gLIKids,{eHTMLTag_ol COMMA eHTMLTag_ul})
111DECL_TAG_LIST(gMapKids,{eHTMLTag_area})
112DECL_TAG_LIST(gPreKids,{eHTMLTag_hr COMMA eHTMLTag_center})  //note that CENTER is here for backward compatibility; it's not 4.0 spec.
113
114DECL_TAG_LIST(gTableKids,{eHTMLTag_caption COMMA eHTMLTag_col COMMA eHTMLTag_colgroup COMMA eHTMLTag_form COMMA  eHTMLTag_thead COMMA eHTMLTag_tbody COMMA eHTMLTag_tfoot COMMA  eHTMLTag_map COMMA eHTMLTag_script})// Removed INPUT - Ref. Bug 20087, 25382
115 
116DECL_TAG_LIST(gTableElemKids,{eHTMLTag_form COMMA eHTMLTag_map COMMA eHTMLTag_noscript COMMA eHTMLTag_script COMMA eHTMLTag_td COMMA eHTMLTag_th COMMA eHTMLTag_tr})
117DECL_TAG_LIST(gTRKids,{eHTMLTag_td COMMA eHTMLTag_th COMMA eHTMLTag_form COMMA eHTMLTag_script})// Removed INPUT - Ref. Bug 20087, 25382 |  Removed MAP to fix 58942
118DECL_TAG_LIST(gTBodyKids,{eHTMLTag_tr COMMA eHTMLTag_form}) // Removed INPUT - Ref. Bug 20087, 25382
119DECL_TAG_LIST(gULKids,{eHTMLTag_li COMMA eHTMLTag_p})
120
121
122//*********************************************************************************************
123// The following tag lists are used to define common set of root notes for the HTML elements...
124//*********************************************************************************************
125
126DECL_TAG_LIST(gRootTags,{eHTMLTag_body COMMA eHTMLTag_td COMMA eHTMLTag_table COMMA eHTMLTag_applet COMMA eHTMLTag_select}) // Added SELECT to fix bug 98645
127DECL_TAG_LIST(gTableRootTags,{eHTMLTag_applet COMMA eHTMLTag_body COMMA eHTMLTag_dl COMMA eHTMLTag_ol COMMA eHTMLTag_td COMMA eHTMLTag_th})
128DECL_TAG_LIST(gHTMLRootTags,{eHTMLTag_unknown})
129 
130DECL_TAG_LIST(gLIRootTags,{eHTMLTag_ul COMMA eHTMLTag_ol COMMA eHTMLTag_dir COMMA eHTMLTag_menu COMMA eHTMLTag_p COMMA eHTMLTag_body COMMA eHTMLTag_td COMMA eHTMLTag_th})
131
132DECL_TAG_LIST(gOLRootTags,{eHTMLTag_body COMMA eHTMLTag_li COMMA eHTMLTag_td COMMA eHTMLTag_th COMMA eHTMLTag_select})
133DECL_TAG_LIST(gTDRootTags,{eHTMLTag_tr COMMA eHTMLTag_tbody COMMA eHTMLTag_thead COMMA eHTMLTag_tfoot COMMA eHTMLTag_table COMMA eHTMLTag_applet})
134DECL_TAG_LIST(gNoframeRoot,{eHTMLTag_body COMMA eHTMLTag_frameset})
135
136//*********************************************************************************************
137// The following tag lists are used to define the autoclose properties of the html elements...
138//*********************************************************************************************
139
140DECL_TAG_LIST(gBodyAutoClose,{eHTMLTag_head})
141DECL_TAG_LIST(gTBodyAutoClose,{eHTMLTag_thead COMMA eHTMLTag_tfoot COMMA eHTMLTag_tbody COMMA eHTMLTag_td COMMA eHTMLTag_th})  // TD|TH inclusion - Bug# 24112
142DECL_TAG_LIST(gCaptionAutoClose,{eHTMLTag_tbody})
143DECL_TAG_LIST(gLIAutoClose,{eHTMLTag_p COMMA eHTMLTag_li})
144DECL_TAG_LIST(gPAutoClose,{eHTMLTag_p COMMA eHTMLTag_li})
145DECL_TAG_LIST(gHRAutoClose,{eHTMLTag_p})
146DECL_TAG_LIST(gOLAutoClose,{eHTMLTag_p COMMA eHTMLTag_ol})
147DECL_TAG_LIST(gDivAutoClose,{eHTMLTag_p})
148
149DECL_TAG_LIST(gHeadingTags,{eHTMLTag_h1 COMMA eHTMLTag_h2 COMMA eHTMLTag_h3 COMMA eHTMLTag_h4 COMMA eHTMLTag_h5 COMMA eHTMLTag_h6})
150
151DECL_TAG_LIST(gTableCloseTags,{eHTMLTag_td COMMA eHTMLTag_tr COMMA eHTMLTag_th COMMA eHTMLTag_tbody COMMA eHTMLTag_thead COMMA eHTMLTag_tfoot})
152DECL_TAG_LIST(gTRCloseTags,{eHTMLTag_tr COMMA eHTMLTag_td COMMA eHTMLTag_th})
153DECL_TAG_LIST(gTDCloseTags,{eHTMLTag_td COMMA eHTMLTag_th})
154DECL_TAG_LIST(gDTCloseTags,{eHTMLTag_p COMMA eHTMLTag_dd COMMA eHTMLTag_dt})
155DECL_TAG_LIST(gULCloseTags,{eHTMLTag_li})
156DECL_TAG_LIST(gULAutoClose,{eHTMLTag_p COMMA eHTMLTag_ul}) //fix bug 50261..
157
158
159DECL_TAG_LIST(gExcludableParents,{eHTMLTag_pre}) // Ref Bug 22913
160DECL_TAG_LIST(gCaptionExcludableParents,{eHTMLTag_td}) //Ref Bug 26488
161
162//*********************************************************************************************
163//Lastly, bind tags with their rules, their special parents and special kids.
164//*********************************************************************************************
165
166
167const int kNoPropRange=0;
168const int kDefaultPropRange=1;
169const int kBodyPropRange=2;
170
171PRBool CanBeContainedLI(eHTMLTags aChildTag,nsDTDContext &aContext);
172
173//*********************************************************************************************
174//
175//        Now let's dynamically build the element table...
176//
177//*********************************************************************************************
178nsHTMLElement* gHTMLElements=0;
179
180
181void Initialize(eHTMLTags aTag,
182                eHTMLTags aRequiredAncestor,
183                eHTMLTags aExcludingAncestor,
184                const TagList* aRootNodes,
185                const TagList*  aEndRootNodes,
186                const TagList*  aAutocloseStart,   
187                const TagList*  aAutocloseEnd,     
188                const TagList*  aSynonymousTags,   
189                const TagList*  aExcludableParents, 
190                int       aParentBits,       
191                int       aInclusionBits,
192                int       aExclusionBits,     
193                int       aSpecialProperties,
194                PRUint32  aPropagateRange,
195                const TagList*  aSpecialParents,   
196                const TagList*  aSpecialKids,   
197                eHTMLTags aSkipTarget
198                )
199{
200  gHTMLElements[aTag].mTagID=aTag;
201  gHTMLElements[aTag].mRequiredAncestor=aRequiredAncestor;
202  gHTMLElements[aTag].mExcludingAncestor=aExcludingAncestor;
203  gHTMLElements[aTag].mRootNodes=aRootNodes;         
204  gHTMLElements[aTag].mEndRootNodes=aEndRootNodes;
205  gHTMLElements[aTag].mAutocloseStart=aAutocloseStart;
206  gHTMLElements[aTag].mAutocloseEnd=aAutocloseEnd;
207  gHTMLElements[aTag].mSynonymousTags=aSynonymousTags;
208  gHTMLElements[aTag].mExcludableParents=aExcludableParents;
209  gHTMLElements[aTag].mParentBits=aParentBits;
210  gHTMLElements[aTag].mInclusionBits=aInclusionBits;
211  gHTMLElements[aTag].mExclusionBits=aExclusionBits;
212  gHTMLElements[aTag].mSpecialProperties=aSpecialProperties;
213  gHTMLElements[aTag].mPropagateRange=aPropagateRange;
214  gHTMLElements[aTag].mSpecialParents=aSpecialParents;
215  gHTMLElements[aTag].mSpecialKids=aSpecialKids;
216  gHTMLElements[aTag].mSkipTarget=aSkipTarget;
217  gHTMLElements[aTag].mCanBeContained=0; //most use the default impl.
218}
219
220
221void InitializeElementTable(void) {         
222  if(!gHTMLElements) {
223    gHTMLElements=new nsHTMLElement[eHTMLTag_userdefined+5];
224
225    Initialize(
226        /*tag*/                             eHTMLTag_unknown,
227        /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
228              /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags,               
229        /*autoclose starttags and endtags*/ 0,0,0,0,
230        /*parent,incl,exclgroups*/          kNone, kNone, kNone,       
231        /*special props, prop-range*/       kOmitWS|kNonContainer, 10,
232        /*special parents,kids,skip*/       0,&gUnknownKids,eHTMLTag_unknown);       
233
234    /*************************************************
235      Note: I changed A to contain flow elements
236            since it's such a popular (but illegal)
237            idiom.
238     *************************************************/
239
240    Initialize(
241      /*tag*/                             eHTMLTag_a,
242      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
243            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
244      /*autoclose starttags and endtags*/ 0,0,0,0,
245      /*parent,incl,exclgroups*/          kSpecial, kInlineEntity, kNone,         
246      /*special props, prop-range*/       kVerifyHierarchy,kDefaultPropRange,
247      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
248
249    Initialize(
250      /*tag*/                             eHTMLTag_abbr,
251      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
252            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
253      /*autoclose starttags and endtags*/ 0,0,0,0,
254      /*parent,incl,exclgroups*/          kPhrase, (kSelf|kInlineEntity), kNone,       
255      /*special props, prop-range*/       0,kDefaultPropRange,
256      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
257
258    Initialize(
259      /*tag*/                             eHTMLTag_acronym,
260      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
261            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
262      /*autoclose starttags and endtags*/ 0,0,0,0,
263      /*parent,incl,exclgroups*/          kPhrase, (kSelf|kInlineEntity), kNone,       
264      /*special props, prop-range*/       0,kDefaultPropRange,
265      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
266
267    Initialize(
268      /*tag*/                             eHTMLTag_address,
269      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
270            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
271      /*autoclose starttags and endtags*/ 0,0,0,0,
272      /*parent,incl,exclgroups*/          kBlock, kInlineEntity, kNone,
273      /*special props, prop-range*/       0,kDefaultPropRange,
274      /*special parents,kids,skip*/       0,&gAddressKids,eHTMLTag_unknown);
275
276    Initialize(
277      /*tag*/                             eHTMLTag_applet,
278      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
279            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
280      /*autoclose starttags and endtags*/ 0,0,0,0,
281      /*parent,incl,exclgroups*/          kSpecial, (kSelf|kInlineEntity|kFlowEntity), kNone,   
282      /*special props, prop-range*/       0,kDefaultPropRange,
283      /*special parents,kids,skip*/       0,&gContainsParam,eHTMLTag_unknown);
284
285    Initialize(
286      /*tag*/                             eHTMLTag_area,
287      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
288            /*rootnodes,endrootnodes*/          &gAreaParent,&gRootTags,       
289      /*autoclose starttags and endtags*/ 0,0,0,0,
290      /*parent,incl,exclgroups*/          kNone, kInlineEntity, kSelf, 
291      /*special props, prop-range*/       kNonContainer,kDefaultPropRange,
292      /*special parents,kids,skip*/       &gAreaParent,0,eHTMLTag_unknown);
293
294    Initialize(
295      /*tag*/                             eHTMLTag_b,
296      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
297            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
298      /*autoclose starttags and endtags*/ 0,0,0,0,
299      /*parent,incl,exclgroups*/          kFontStyle, (kInlineEntity|kSelf), kNone,     
300      /*special props, prop-range*/       0,kDefaultPropRange,
301      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
302
303    Initialize(
304      /*tag*/                             eHTMLTag_base,
305      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
306            /*rootnodes,endrootnodes*/          &gInHead,       &gRootTags,
307      /*autoclose starttags and endtags*/ 0,0,0,0,
308      /*parent,incl,exclgroups*/          kNone, kNone, kNone, 
309      /*special props, prop-range*/       kNonContainer, kNoPropRange,
310      /*special parents,kids,skip*/       &gInHead,0,eHTMLTag_unknown);
311
312    Initialize(
313      /*tag*/                             eHTMLTag_basefont,
314      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
315            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
316      /*autoclose starttags and endtags*/ 0,0,0,0,
317      /*parent,incl,exclgroups*/          kSpecial, kInlineEntity, kNone,       
318      /*special props, prop-range*/       kNonContainer, kNoPropRange,
319      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
320
321    Initialize(
322      /*tag*/                             eHTMLTag_bdo,
323      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
324            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
325      /*autoclose starttags and endtags*/ 0,0,0,0,
326      /*parent,incl,exclgroups*/          kSpecial, (kSelf|kInlineEntity), kNone,       
327      /*special props, prop-range*/       0,kDefaultPropRange,
328      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
329
330    Initialize(
331      /*tag*/                             eHTMLTag_bgsound,
332      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
333            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
334      /*autoclose starttags and endtags*/ 0,0,0,0,
335      /*parent,incl,exclgroups*/          kBlock, kNone, kNone,
336      /*special props, prop-range*/       0,kNoPropRange,
337      /*special parents,kids,skip*/       &gInHead,0,eHTMLTag_unknown);
338
339    Initialize(
340      /*tag*/                             eHTMLTag_big,
341      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
342            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
343      /*autoclose starttags and endtags*/ 0,0,0,0,
344      /*parent,incl,exclgroups*/          kFontStyle, (kInlineEntity|kSelf), kNone,     
345      /*special props, prop-range*/       0,kDefaultPropRange,
346      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
347
348    Initialize(
349      /*tag*/                             eHTMLTag_blink,
350      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
351            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
352      /*autoclose starttags and endtags*/ 0,0,0,0,
353      /*parent,incl,exclgroups*/          kFontStyle, (kFlowEntity|kSelf), kNone,       
354      /*special props, prop-range*/       0,kDefaultPropRange,
355      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
356
357    Initialize(
358      /*tag*/                             eHTMLTag_blockquote,
359      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
360            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
361      /*autoclose starttags and endtags*/ 0,0,0,0,  //remove excludeable parents to fix bug 53473
362      /*parent,incl,exclgroups*/          kBlock, (kSelf|kFlowEntity), kNone,   
363      /*special props, prop-range*/       0,kDefaultPropRange,
364      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
365
366    Initialize(
367      /*tag*/                             eHTMLTag_body,
368      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_frameset,
369            /*rootnodes,endrootnodes*/          &gInHTML,       &gInHTML,
370      /*autoclose starttags and endtags*/ &gBodyAutoClose,0,0,0,
371      /*parent,incl,exclgroups*/          kHTMLContent,(kFlowEntity|kSelf), kNone,     
372      /*special props, prop-range*/       kOmitEndTag, kBodyPropRange,
373      /*special parents,kids,skip*/       0,&gBodyKids,eHTMLTag_unknown);
374
375    Initialize(
376      /*tag*/                             eHTMLTag_br,
377      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
378            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
379      /*autoclose starttags and endtags*/ 0,0,0,0,
380      /*parent,incl,exclgroups*/          kSpecial, kNone, kNone,       
381      /*special props, prop-range*/       kNonContainer, kNoPropRange,
382      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
383
384    Initialize(
385      /*tag*/                             eHTMLTag_button,
386      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
387            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
388      /*autoclose starttags and endtags*/ 0,0,0,0,
389      /*parent,incl,exclgroups*/          kFormControl, kFlowEntity, kFormControl,     
390      /*special props, prop-range*/       kRequiresBody,kDefaultPropRange,
391      /*special parents,kids,skip*/       0,&gButtonKids,eHTMLTag_unknown);
392
393    Initialize(
394      /*tag*/                             eHTMLTag_caption,
395      /*req-parent excl-parent*/          eHTMLTag_table,eHTMLTag_unknown,
396            /*rootnodes,endrootnodes*/          &gInTable,&gInTable,   
397      /*autoclose starttags and endtags*/ &gCaptionAutoClose,0,0,0,
398      /*parent,incl,exclgroups*/          kNone, kFlowEntity, kSelf,   
399      /*special props, prop-range*/       (kNoPropagate|kNoStyleLeaksOut),kDefaultPropRange,
400      /*special parents,kids,skip*/       &gInTable,0,eHTMLTag_unknown);
401
402    Initialize(
403      /*tag*/                             eHTMLTag_center,
404      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
405            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
406      /*autoclose starttags and endtags*/ 0,0,0,0,
407      /*parent,incl,exclgroups*/          kBlock, (kSelf|kFlowEntity), kNone,   
408      /*special props, prop-range*/       0,kDefaultPropRange,
409      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
410
411    Initialize(
412      /*tag*/                             eHTMLTag_cite,
413      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
414            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
415      /*autoclose starttags and endtags*/ 0,0,0,0,
416      /*parent,incl,exclgroups*/          kPhrase, (kSelf|kInlineEntity), kNone,       
417      /*special props, prop-range*/       0,kDefaultPropRange,
418      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
419
420    Initialize(
421      /*tag*/                             eHTMLTag_code,
422      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
423            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
424      /*autoclose starttags and endtags*/ 0,0,0,0,
425      /*parent,incl,exclgroups*/          kPhrase, (kSelf|kInlineEntity), kNone,       
426      /*special props, prop-range*/       0,kDefaultPropRange,
427      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
428
429    Initialize(
430      /*tag*/                             eHTMLTag_col,
431      /*req-parent excl-parent*/          eHTMLTag_table,eHTMLTag_unknown,
432            /*rootnodes,endrootnodes*/          &gColParents,&gColParents,     
433      /*autoclose starttags and endtags*/ 0,0,0,0,
434      /*parent,incl,exclgroups*/          kNone, kNone, kNone, 
435      /*special props, prop-range*/       kNoPropagate|kOmitWS|kNonContainer,kDefaultPropRange,
436      /*special parents,kids,skip*/       &gColParents,0,eHTMLTag_unknown);
437
438    Initialize(
439      /*tag*/                             eHTMLTag_colgroup,
440      /*req-parent excl-parent*/          eHTMLTag_table,eHTMLTag_unknown,
441            /*rootnodes,endrootnodes*/          &gInTable,&gInTable,   
442      /*autoclose starttags and endtags*/ 0,0,0,0,
443      /*parent,incl,exclgroups*/          kNone, kNone, kNone, 
444      /*special props, prop-range*/       kOmitWS|kNoPropagate,kDefaultPropRange,
445      /*special parents,kids,skip*/       &gInTable,&gColgroupKids,eHTMLTag_unknown);
446
447    Initialize(
448      /*tag*/                             eHTMLTag_counter,
449      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
450            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
451      /*autoclose starttags and endtags*/ 0,0,0,0,
452      /*parent,incl,exclgroups*/          kPhrase, (kFlowEntity|kSelf), kNone, 
453      /*special props, prop-range*/       0,kDefaultPropRange,
454      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
455
456    Initialize(
457      /*tag*/                             eHTMLTag_dd,
458      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
459            /*rootnodes,endrootnodes*/          &gRootTags,     &gRootTags,     
460      /*autoclose starttags and endtags*/ &gDTCloseTags,0,&gDLKids,0,
461      /*parent,incl,exclgroups*/          kInlineEntity, kFlowEntity, kNone,
462      /*special props, prop-range*/       kNoPropagate|kMustCloseSelf|kVerifyHierarchy,kDefaultPropRange,
463      /*special parents,kids,skip*/       &gInDL,0,eHTMLTag_unknown);
464
465    Initialize(
466      /*tag*/                             eHTMLTag_del,
467      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
468            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
469      /*autoclose starttags and endtags*/ 0,0,0,0,
470      /*parent,incl,exclgroups*/          kFlowEntity, (kSelf|kFlowEntity), kNone,     
471      /*special props, prop-range*/       0,kDefaultPropRange,
472      /*special parents,kids,skip*/       &gInBody,0,eHTMLTag_unknown);
473
474    Initialize(
475      /*tag*/                             eHTMLTag_dfn,
476      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
477            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
478      /*autoclose starttags and endtags*/ 0,0,0,0,
479      /*parent,incl,exclgroups*/          kPhrase, (kSelf|kInlineEntity), kNone,       
480      /*special props, prop-range*/       0,kDefaultPropRange,
481      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
482
483    Initialize(
484      /*tag*/                             eHTMLTag_dir,
485      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
486            /*rootnodes,endrootnodes*/          &gOLRootTags,&gOLRootTags,     
487      /*autoclose starttags and endtags*/ &gOLAutoClose, &gULCloseTags, 0,0,
488      /*parent,incl,exclgroups*/          kList, (kFlowEntity|kSelf), kNone,   
489      /*special props, prop-range*/       0,kDefaultPropRange,
490      /*special parents,kids,skip*/       0,&gULKids,eHTMLTag_unknown);
491
492    Initialize(
493      /*tag*/                             eHTMLTag_div,
494      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
495            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
496      /*autoclose starttags and endtags*/ &gDivAutoClose,0,0,0,
497      /*parent,incl,exclgroups*/          kBlock, (kSelf|kFlowEntity), kNone,   
498      /*special props, prop-range*/       0,kDefaultPropRange,
499      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
500
501    Initialize(
502      /*tag*/                             eHTMLTag_dl,
503      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
504            /*rootnodes,endrootnodes*/          &gDLRootTags,&gRootTags,        //fix bug 57634
505      /*autoclose starttags and endtags*/ 0,0,0,&gDTKids,           // DT should not contain DL - bug 100466
506      /*parent,incl,exclgroups*/          kBlock, kSelf|kFlowEntity, kNone,     
507      /*special props, prop-range*/       0, kNoPropRange,
508      /*special parents,kids,skip*/       0,&gDLKids,eHTMLTag_unknown);
509
510    Initialize(
511      /*tag*/                             eHTMLTag_dt,
512      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
513            /*rootnodes,endrootnodes*/          &gRootTags,     &gRootTags,     
514      /*autoclose starttags and endtags*/ &gDTCloseTags,0,&gDLKids,0,
515      /*parent,incl,exclgroups*/          kInlineEntity, (kFlowEntity-kHeading), kNone, // dt's parent group is inline - bug 65467
516      /*special props, prop-range*/       (kNoPropagate|kMustCloseSelf|kVerifyHierarchy),kDefaultPropRange,
517      /*special parents,kids,skip*/       &gInDL,0,eHTMLTag_unknown);
518
519    Initialize(
520      /*tag*/                             eHTMLTag_em,
521      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
522            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
523      /*autoclose starttags and endtags*/ 0,0,0,0,
524      /*parent,incl,exclgroups*/          kPhrase, (kSelf|kInlineEntity), kNone,       
525      /*special props, prop-range*/       0,kDefaultPropRange,
526      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
527
528    Initialize(
529      /*tag*/                             eHTMLTag_embed,
530      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
531            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
532      /*autoclose starttags and endtags*/ 0,0,0,0,
533      /*parent,incl,exclgroups*/          kBlockEntity, kNone, kNone,   
534      /*special props, prop-range*/       kNonContainer,kDefaultPropRange,
535      /*special parents,kids,skip*/       0,&gContainsParam,eHTMLTag_unknown);
536
537    Initialize(
538      /*tag*/                             eHTMLTag_endnote,
539      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
540            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
541      /*autoclose starttags and endtags*/ 0,0,0,0,
542      /*parent,incl,exclgroups*/          kFlowEntity, kFlowEntity, kNone,     
543      /*special props, prop-range*/       0,kDefaultPropRange,
544      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
545
546    Initialize(
547      /*tag*/                             eHTMLTag_fieldset,
548      /*requiredAncestor*/                eHTMLTag_unknown,eHTMLTag_unknown,
549            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
550      /*autoclose starttags and endtags*/ 0,0,0,0,
551      /*parent,incl,exclgroups*/          kBlock, (kSelf|kFlowEntity), kNone,   
552      /*special props, prop-range*/       kNoPropagate,kDefaultPropRange,
553      /*special parents,kids,skip*/       0,&gFieldsetKids,eHTMLTag_unknown);
554
555    Initialize(
556      /*tag*/                             eHTMLTag_font,
557      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
558            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
559      /*autoclose starttags and endtags*/ 0,0,0,0,
560      /*parent,incl,exclgroups*/          kFontStyle, (kSelf|kInlineEntity), kNone,     
561      /*special props, prop-range*/       0,kDefaultPropRange,
562      /*special parents,kids,skip*/       0,&gFontKids,eHTMLTag_unknown);
563
564    Initialize(
565      /*tag*/                             eHTMLTag_form,
566      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
567            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
568      /*autoclose starttags and endtags*/ 0,0,0,0,
569      /*parent,incl,exclgroups*/          kBlock, kFlowEntity, kNone,   
570      /*special props, prop-range*/       kNoStyleLeaksIn, kNoPropRange,
571      /*special parents,kids,skip*/       0,&gFormKids,eHTMLTag_unknown);
572
573    Initialize(
574      /*tag*/                             eHTMLTag_frame,
575      /*req-parent excl-parent*/          eHTMLTag_frameset,eHTMLTag_unknown,
576            /*rootnodes,endrootnodes*/          &gInFrameset,&gInFrameset,     
577      /*autoclose starttags and endtags*/ 0,0,0,0,
578      /*parent,incl,exclgroups*/          kNone, kNone, kNone, 
579      /*special props, prop-range*/       kNoPropagate|kNoStyleLeaksIn|kNonContainer, kNoPropRange,
580      /*special parents,kids,skip*/       &gInFrameset,0,eHTMLTag_unknown);
581
582    Initialize(
583      /*tag*/                             eHTMLTag_frameset,
584      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_body,
585            /*rootnodes,endrootnodes*/          &gFramesetParents,&gInHTML,     
586      /*autoclose starttags and endtags*/ 0,0,0,0,
587      /*parent,incl,exclgroups*/          kHTMLContent, kSelf, kAllTags,       
588      /*special props, prop-range*/       kOmitWS|kNoPropagate|kNoStyleLeaksIn, kNoPropRange,
589      /*special parents,kids,skip*/       &gInHTML,&gFramesetKids,eHTMLTag_unknown);
590
591
592    Initialize(
593      /*tag*/                             eHTMLTag_h1,
594      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
595            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
596      /*autoclose starttags and endtags*/ &gHeadingTags,  &gHeadingTags, &gHeadingTags,0,
597      /*parent,incl,exclgroups*/          kHeading, kFlowEntity, kNone,
598      /*special props, prop-range*/       kVerifyHierarchy,kDefaultPropRange,
599      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
600
601    Initialize(
602      /*tag*/                             eHTMLTag_h2,
603      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
604            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
605      /*autoclose starttags and endtags*/ &gHeadingTags,  &gHeadingTags, &gHeadingTags,0,
606      /*parent,incl,exclgroups*/          kHeading, kFlowEntity, kNone,
607      /*special props, prop-range*/       kVerifyHierarchy,kDefaultPropRange,
608      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
609
610    Initialize(
611      /*tag*/                             eHTMLTag_h3,
612      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
613            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
614      /*autoclose starttags and endtags*/ &gHeadingTags,  &gHeadingTags, &gHeadingTags,0,
615      /*parent,incl,exclgroups*/          kHeading, kFlowEntity, kNone,
616      /*special props, prop-range*/       kVerifyHierarchy,kDefaultPropRange,
617      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
618
619    Initialize(
620      /*tag*/                             eHTMLTag_h4,
621      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
622            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
623      /*autoclose starttags and endtags*/ &gHeadingTags,  &gHeadingTags, &gHeadingTags,0,
624      /*parent,incl,exclgroups*/          kHeading, kFlowEntity, kNone,
625      /*special props, prop-range*/       kVerifyHierarchy,kDefaultPropRange,
626      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
627
628    Initialize(
629      /*tag*/                             eHTMLTag_h5,
630      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
631            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
632      /*autoclose starttags and endtags*/ &gHeadingTags,  &gHeadingTags, &gHeadingTags,0,
633      /*parent,incl,exclgroups*/          kHeading, kFlowEntity, kNone,
634      /*special props, prop-range*/       kVerifyHierarchy,kDefaultPropRange,
635      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
636
637    Initialize(
638      /*tag*/                             eHTMLTag_h6,
639      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
640            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
641      /*autoclose starttags and endtags*/ &gHeadingTags,  &gHeadingTags, &gHeadingTags,0,
642      /*parent,incl,exclgroups*/          kHeading, kFlowEntity, kNone,
643      /*special props, prop-range*/       kVerifyHierarchy,kDefaultPropRange,
644      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
645
646    Initialize(
647      /*tag*/                             eHTMLTag_head,
648      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
649            /*rootnodes,endrootnodes*/          &gInHTML,       &gInHTML,
650      /*autoclose starttags and endtags*/ 0,0,0,0,
651      /*parent,incl,exclgroups*/          kHTMLContent, (kHeadContent|kHeadMisc), kNone,       
652      /*special props, prop-range*/       kNoStyleLeaksIn, kDefaultPropRange,
653      /*special parents,kids,skip*/       &gInHTML,&gHeadKids,eHTMLTag_unknown);
654
655    Initialize(
656      /*tag*/                             eHTMLTag_hr,
657      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
658            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
659      /*autoclose starttags and endtags*/ &gHRAutoClose,0,0,0,
660      /*parent,incl,exclgroups*/          kBlock, kNone, kNone,
661      /*special props, prop-range*/       kNonContainer,kDefaultPropRange,
662      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
663
664    Initialize(
665      /*tag*/                             eHTMLTag_html,
666      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_html,
667            /*rootnodes,endrootnodes*/          &gHTMLRootTags, &gHTMLRootTags,
668      /*autoclose starttags and endtags*/ 0,0,0,0,
669      /*parent,incl,exclgroups*/          kNone, kHTMLContent, kNone,   
670      /*special props, prop-range*/       kSaveMisplaced|kOmitEndTag|kNoStyleLeaksIn, kDefaultPropRange,
671      /*special parents,kids,skip*/       0,&gHtmlKids,eHTMLTag_unknown);
672
673    Initialize(
674      /*tag*/                             eHTMLTag_i,
675      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
676            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
677      /*autoclose starttags and endtags*/ 0,0,0,0,
678      /*parent,incl,exclgroups*/          kFontStyle, (kSelf|kInlineEntity), kNone,     
679      /*special props, prop-range*/       0, kDefaultPropRange,
680      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
681
682    Initialize(
683      /*tag*/                             eHTMLTag_iframe,
684      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
685            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
686      /*autoclose starttags and endtags*/ 0,0,0,0,
687      /*parent,incl,exclgroups*/          kSpecial, (kSelf|kFlowEntity), kNone,
688      /*special props, prop-range*/       kNoStyleLeaksIn, kNoPropRange,
689      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
690
691    Initialize(
692      /*tag*/                             eHTMLTag_image,
693      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
694            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
695      /*autoclose starttags and endtags*/ 0,0,0,0,
696      /*parent,incl,exclgroups*/          kSpecial, kNone, kNone,       
697      /*special props, prop-range*/       kNonContainer,kDefaultPropRange,
698      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
699
700    Initialize(
701      /*tag*/                             eHTMLTag_img,
702      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
703            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
704      /*autoclose starttags and endtags*/ 0,0,0,0,
705      /*parent,incl,exclgroups*/          kSpecial, kNone, kNone,       
706      /*special props, prop-range*/       kNonContainer,kDefaultPropRange,
707      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
708
709    Initialize(
710      /*tag*/                             eHTMLTag_input,
711      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
712            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
713      /*autoclose starttags and endtags*/ 0,0,0,0,
714      /*parent,incl,exclgroups*/          kFormControl, kNone, kNone,   
715      /*special props, prop-range*/       kNonContainer|kRequiresBody,kDefaultPropRange,
716      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
717
718    Initialize(
719      /*tag*/                             eHTMLTag_ins,
720      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
721            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
722      /*autoclose starttags and endtags*/ 0,0,0,0,
723      /*parent,incl,exclgroups*/          kFlowEntity, (kSelf|kFlowEntity), kNone,     
724      /*special props, prop-range*/       0,kDefaultPropRange,
725      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
726
727    Initialize(
728      /*tag*/                             eHTMLTag_isindex,
729      /*requiredAncestor*/                eHTMLTag_unknown,eHTMLTag_unknown,
730            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
731      /*autoclose starttags and endtags*/ 0,0,0,0,
732      /*parent,incl,exclgroups*/          (kBlock|kHeadContent), kFlowEntity, kNone,   
733      /*special props, prop-range*/       kNonContainer,kDefaultPropRange,
734      /*special parents,kids,skip*/       &gInBody,0,eHTMLTag_unknown);
735
736    Initialize(
737      /*tag*/                             eHTMLTag_kbd,
738      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
739            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
740      /*autoclose starttags and endtags*/ 0,0,0,0,
741      /*parent,incl,exclgroups*/          kPhrase, (kSelf|kInlineEntity), kNone,       
742      /*special props, prop-range*/       0,kDefaultPropRange,
743      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
744
745    Initialize(
746      /*tag*/                             eHTMLTag_keygen,
747      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
748            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
749      /*autoclose starttags and endtags*/ 0,0,0,0,
750      /*parent,incl,exclgroups*/          kFlowEntity, kNone, kNone,   
751      /*special props, prop-range*/       kNonContainer,kDefaultPropRange,
752      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
753
754    Initialize(
755      /*tag*/                             eHTMLTag_label,
756      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
757            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
758      /*autoclose starttags and endtags*/ 0,0,0,0,
759      /*parent,incl,exclgroups*/          kFormControl, kInlineEntity, kSelf,   
760      /*special props, prop-range*/       0,kDefaultPropRange,
761      /*special parents,kids,skip*/       0,&gLabelKids,eHTMLTag_unknown);
762
763    Initialize(
764      /*tag*/                             eHTMLTag_legend,
765      /*requiredAncestor*/                eHTMLTag_fieldset,eHTMLTag_unknown,
766            /*rootnodes,endrootnodes*/          &gInFieldset,&gInFieldset,     
767      /*autoclose starttags and endtags*/ 0,0,0,0,
768      /*parent,incl,exclgroups*/          kNone, kInlineEntity, kNone, 
769      /*special props, prop-range*/       kRequiresBody,kDefaultPropRange,
770      /*special parents,kids,skip*/       &gInFieldset,0,eHTMLTag_unknown);
771
772    Initialize(
773      /*tag*/                             eHTMLTag_li,
774      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
775            /*rootnodes,endrootnodes*/          &gLIRootTags,&gLIRootTags,     
776      /*autoclose starttags and endtags*/ &gLIAutoClose,0,0,0,
777      /*parent,incl,exclgroups*/          kFlowEntity, kFlowEntity, kSelf, // For compat. sake LI's parent model should be flow - Ref. bug 96031
778      /*special props, prop-range*/       kNoPropagate|kVerifyHierarchy, kDefaultPropRange,
779      /*special parents,kids,skip*/       0,&gLIKids,eHTMLTag_unknown);
780
781    gHTMLElements[eHTMLTag_li].mCanBeContained=&CanBeContainedLI;
782
783    Initialize(
784      /*tag*/                             eHTMLTag_link,
785      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
786            /*rootnodes,endrootnodes*/          &gInHead,&gInHead,     
787      /*autoclose starttags and endtags*/ 0,0,0,0,
788      /*parent,incl,exclgroups*/          kHeadMisc, kNone, kNone,     
789      /*special props, prop-range*/       kNonContainer,kDefaultPropRange,
790      /*special parents,kids,skip*/       &gInHead,0,eHTMLTag_unknown);
791
792    Initialize(
793      /*tag*/                             eHTMLTag_listing,
794      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
795            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
796      /*autoclose starttags and endtags*/ 0,0,0,0,
797      /*parent,incl,exclgroups*/          kPreformatted, (kSelf|kFlowEntity), kNone,    //add flowentity to fix 54993
798      /*special props, prop-range*/       0,kDefaultPropRange,
799      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
800
801    Initialize(
802      /*tag*/                             eHTMLTag_map,
803      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
804            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
805      /*autoclose starttags and endtags*/ 0,0,0,0,
806      /*parent,incl,exclgroups*/          kSpecial, kInlineEntity|kBlockEntity, kNone, 
807      /*special props, prop-range*/       kOmitWS, kDefaultPropRange,
808      /*special parents,kids,skip*/       0,&gMapKids,eHTMLTag_unknown);
809   
810    Initialize(
811      /*tag*/                             eHTMLTag_marquee,
812      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
813      /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags,       
814      /*autoclose starttags and endtags*/ 0,0,0,0,
815      /*parent,incl,exclgroups*/          kBlock, kFlowEntity, kNone,   
816      /*special props, prop-range*/       0, kDefaultPropRange,
817      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
818
819    Initialize(
820      /*tag*/                             eHTMLTag_menu,
821      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
822            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
823      /*autoclose starttags and endtags*/ 0,0,0,0,
824      /*parent,incl,exclgroups*/          kList, (kSelf|kFlowEntity), kNone,   
825      /*special props, prop-range*/       0,kDefaultPropRange,
826      /*special parents,kids,skip*/       0,&gULKids,eHTMLTag_unknown);
827
828    Initialize(
829      /*tag*/                             eHTMLTag_meta,
830      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
831            /*rootnodes,endrootnodes*/          &gInHead,       &gInHead,
832      /*autoclose starttags and endtags*/ 0,0,0,0,
833      /*parent,incl,exclgroups*/          kHeadMisc, kNone, kNone,     
834      /*special props, prop-range*/       kNoStyleLeaksIn|kNonContainer, kDefaultPropRange,
835      /*special parents,kids,skip*/       &gInHead,0,eHTMLTag_unknown);
836
837    Initialize(
838      /*tag*/                             eHTMLTag_multicol,
839      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
840            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
841      /*autoclose starttags and endtags*/ 0,0,0,0,
842      /*parent,incl,exclgroups*/          kExtensions, kNone, kNone,   
843      /*special props, prop-range*/       0,kDefaultPropRange,
844      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
845
846    Initialize(
847      /*tag*/                             eHTMLTag_nobr,
848      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
849            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
850      /*autoclose starttags and endtags*/ 0,0,0,0,
851      /*parent,incl,exclgroups*/          kInlineEntity, (kFlowEntity), kNone, 
852      /*special props, prop-range*/       0,kDefaultPropRange,
853      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
854
855    Initialize(
856      /*tag*/                             eHTMLTag_noembed,
857      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
858            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
859      /*autoclose starttags and endtags*/ 0,0,0,0,
860      /*parent,incl,exclgroups*/          kNone, kNone, kNone, 
861      /*special props, prop-range*/       kDiscardTag, kDefaultPropRange,
862      /*special parents,kids,skip*/       0,0,eHTMLTag_noembed);
863
864    Initialize(
865      /*tag*/                             eHTMLTag_noframes,
866      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
867            /*rootnodes,endrootnodes*/          &gNoframeRoot,&gNoframeRoot,   
868      /*autoclose starttags and endtags*/ 0,0,0,0,
869      /*parent,incl,exclgroups*/          kBlock, kFlowEntity, kNone,   
870      /*special props, prop-range*/       0, kNoPropRange,
871      /*special parents,kids,skip*/       &gNoframeRoot,0,eHTMLTag_unknown);
872
873    Initialize(
874      /*tag*/                             eHTMLTag_noscript,
875      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
876            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
877      /*autoclose starttags and endtags*/ 0,0,0,0,
878      /*parent,incl,exclgroups*/          kBlock, kFlowEntity|kSelf, kNone,     
879      /*special props, prop-range*/       kLegalOpen, kNoPropRange,
880      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
881
882    Initialize(
883      /*tag*/                             eHTMLTag_object,
884      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
885            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
886      /*autoclose starttags and endtags*/ 0,0,0,0,
887      /*parent,incl,exclgroups*/          (kHeadMisc|kSpecial), (kFlowEntity|kInlineEntity|kSelf), kNone,       
888      /*special props, prop-range*/       kNoStyleLeaksOut,kDefaultPropRange,
889      /*special parents,kids,skip*/       0,&gContainsParam,eHTMLTag_unknown);
890
891    Initialize(
892      /*tag*/                             eHTMLTag_ol,
893      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
894            /*rootnodes,endrootnodes*/          &gOLRootTags,&gOLRootTags,     
895      /*autoclose starttags and endtags*/ &gOLAutoClose, &gULCloseTags, 0,0,
896      /*parent,incl,exclgroups*/          kList, (kFlowEntity|kSelf), kNone,   
897      /*special props, prop-range*/       0,kDefaultPropRange,   
898      /*special parents,kids,skip*/       0,&gULKids,eHTMLTag_unknown);
899
900    Initialize(
901      /*tag*/                             eHTMLTag_optgroup,
902      /*requiredAncestor*/                eHTMLTag_select,eHTMLTag_unknown,
903            /*rootnodes,endrootnodes*/          &gOptgroupParents,&gOptgroupParents,   
904      /*autoclose starttags and endtags*/ 0,0,0,0,
905      /*parent,incl,exclgroups*/          kNone, kNone, kNone, 
906      /*special props, prop-range*/       kOmitWS,kDefaultPropRange,
907      /*special parents,kids,skip*/       &gOptgroupParents,&gContainsOpts,eHTMLTag_unknown);
908
909    Initialize(
910      /*tag*/                             eHTMLTag_option,
911      /*requiredAncestor*/                eHTMLTag_select,eHTMLTag_unknown,
912            /*rootnodes,endrootnodes*/          &gOptgroupParents,&gOptgroupParents,     
913      /*autoclose starttags and endtags*/ 0,0,0,0,
914      /*parent,incl,exclgroups*/          kNone, kPCDATA, kFlowEntity, 
915      /*special props, prop-range*/       kNoStyleLeaksIn|kNoPropagate, kDefaultPropRange,
916      /*special parents,kids,skip*/       &gOptgroupParents,&gContainsText,eHTMLTag_unknown);
917
918    Initialize(
919      /*tag*/                             eHTMLTag_p,
920      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
921            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
922      /*autoclose starttags and endtags*/ 0,0,0,0,
923      /*parent,incl,exclgroups*/          kBlock, kInlineEntity, kNone,      //this used to contain FLOW. But it's really an inline container.
924      /*special props, prop-range*/       kHandleStrayTag,kDefaultPropRange, //otherwise it tries to contain things like H1..H6
925      /*special parents,kids,skip*/       0,&gInP,eHTMLTag_unknown);
926
927    Initialize(
928      /*tag*/                             eHTMLTag_param,
929      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
930            /*rootnodes,endrootnodes*/          &gParamParents, &gParamParents,
931      /*autoclose starttags and endtags*/ &gPAutoClose,0,0,0,
932      /*parent,incl,exclgroups*/          kNone, kNone, kNone, 
933      /*special props, prop-range*/       kNonContainer, kNoPropRange,
934      /*special parents,kids,skip*/       &gParamParents,0,eHTMLTag_unknown);
935
936    Initialize(
937      /*tag*/                             eHTMLTag_plaintext,
938      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
939            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
940      /*autoclose starttags and endtags*/ 0,0,0,0,
941      /*parent,incl,exclgroups*/          kExtensions, kFlowEntity, kNone,     
942      /*special props, prop-range*/       kNone,kDefaultPropRange,
943      /*special parents,kids,skip*/       0,0,eHTMLTag_plaintext); // Bug  56914
944
945    Initialize(
946      /*tag*/                             eHTMLTag_pre,
947      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
948            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
949      /*autoclose starttags and endtags*/ 0,0,0,0,
950      /*parent,incl,exclgroups*/          kBlock|kPreformatted, (kSelf|kFlowEntity), kNone,     // Note: PRE is a block level element - bug 80009
951      /*special props, prop-range*/       0, kDefaultPropRange,
952      /*special parents,kids,skip*/       0,&gPreKids,eHTMLTag_unknown);
953
954    Initialize(
955      /*tag*/                             eHTMLTag_q,
956      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
957            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
958      /*autoclose starttags and endtags*/ 0,0,0,0,
959      /*parent,incl,exclgroups*/          kSpecial, (kSelf|kInlineEntity), kNone,       
960      /*special props, prop-range*/       0,kDefaultPropRange,
961      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
962 
963    Initialize(
964      /*tag*/                             eHTMLTag_s,
965      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
966            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
967      /*autoclose starttags and endtags*/ 0,0,0,0,
968      /*parent,incl,exclgroups*/          kFontStyle, (kSelf|kInlineEntity), kNone,     
969      /*special props, prop-range*/       0,kDefaultPropRange,
970      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
971
972    Initialize(
973      /*tag*/                             eHTMLTag_samp,
974      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
975            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
976      /*autoclose starttags and endtags*/ 0,0,0,0,
977      /*parent,incl,exclgroups*/          kPhrase, (kSelf|kInlineEntity), kNone,       
978      /*special props, prop-range*/       0,kDefaultPropRange,
979      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
980
981    Initialize(
982      /*tag*/                             eHTMLTag_script,
983      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
984            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
985      /*autoclose starttags and endtags*/ 0,0,0,0,
986      /*parent,incl,exclgroups*/          (kSpecial|kHeadMisc), kCDATA, kNone, 
987      /*special props, prop-range*/       kNoStyleLeaksIn|kLegalOpen, kNoPropRange,
988      /*special parents,kids,skip*/       0,&gContainsText,eHTMLTag_script);
989
990    Initialize(
991      /*tag*/                             eHTMLTag_select,
992      /*requiredAncestor*/                eHTMLTag_unknown, eHTMLTag_unknown,
993            /*rootnodes,endrootnodes*/          &gInForm,&gInForm,     
994      /*autoclose starttags and endtags*/ 0,0,0,0,
995      /*parent,incl,exclgroups*/          kFormControl, kNone, kFlowEntity|kDLChild,   
996      /*special props, prop-range*/       kNoPropagate|kOmitWS|kNoStyleLeaksIn, kDefaultPropRange,
997      /*special parents,kids,skip*/       &gInForm,&gContainsOpts,eHTMLTag_unknown);
998
999    Initialize(
1000      /*tag*/                             eHTMLTag_server,
1001      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1002            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
1003      /*autoclose starttags and endtags*/ 0,0,0,0,
1004      /*parent,incl,exclgroups*/          (kSpecial|kHeadMisc), kCDATA, kNone, 
1005      /*special props, prop-range*/       (kNoStyleLeaksIn|kLegalOpen), kNoPropRange,
1006      /*special parents,kids,skip*/       0,&gContainsText,eHTMLTag_server);
1007
1008    Initialize(
1009      /*tag*/                             eHTMLTag_small,
1010      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1011            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
1012      /*autoclose starttags and endtags*/ 0,0,0,0,
1013      /*parent,incl,exclgroups*/          kFontStyle, (kSelf|kInlineEntity), kNone,     
1014      /*special props, prop-range*/       0,kDefaultPropRange,
1015      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
1016
1017    Initialize(
1018   
1019      /*tag*/                             eHTMLTag_sound,
1020      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1021            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
1022      /*autoclose starttags and endtags*/ 0,0,0,0,
1023      /*parent,incl,exclgroups*/          (kFlowEntity|kHeadContent), kNone, kNone,      // Added kFlowEntity|kHeadContent & kNonContainer in
1024      /*special props, prop-range*/       kNonContainer,kDefaultPropRange,           // Ref. to Bug 25749
1025      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
1026
1027    Initialize(
1028   
1029      /*tag*/                             eHTMLTag_spacer,
1030      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1031            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
1032      /*autoclose starttags and endtags*/ 0,0,0,0,
1033      /*parent,incl,exclgroups*/          kExtensions, kNone, kNone,   
1034      /*special props, prop-range*/       kNonContainer,kDefaultPropRange,
1035      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
1036
1037    Initialize(
1038   
1039          // I made span a special% tag again, (instead of inline).
1040          // This fixes the case:  <font color="blue"><p><span>text</span>
1041
1042      /*tag*/                             eHTMLTag_span,
1043      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1044            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
1045      /*autoclose starttags and endtags*/ 0,0,0,0,
1046      /*parent,incl,exclgroups*/          kSpecial, (kInlineEntity|kSelf|kFlowEntity), kNone,   
1047      /*special props, prop-range*/       0,kDefaultPropRange,
1048      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
1049       
1050    Initialize(
1051   
1052      /*tag*/                             eHTMLTag_strike,
1053      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1054            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
1055      /*autoclose starttags and endtags*/ 0,0,0,0,
1056      /*parent,incl,exclgroups*/          kFontStyle, (kSelf|kInlineEntity), kNone,     
1057      /*special props, prop-range*/       0,kDefaultPropRange,
1058      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
1059
1060    Initialize(
1061   
1062      /*tag*/                             eHTMLTag_strong,
1063      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1064            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
1065      /*autoclose starttags and endtags*/ 0,0,0,0,
1066      /*parent,incl,exclgroups*/          kPhrase, (kSelf|kInlineEntity), kNone,        //changed this to inline per spec; fix bug 44584.
1067      /*special props, prop-range*/       0,kDefaultPropRange,
1068      /*special parents,kids,skip*/       0,&gContainsText,eHTMLTag_unknown);
1069
1070    Initialize(
1071   
1072      /*tag*/                             eHTMLTag_style,
1073      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1074            /*rootnodes,endrootnodes*/          &gInHead,       &gInHead,       
1075      /*autoclose starttags and endtags*/ 0,0,0,0,
1076      /*parent,incl,exclgroups*/          kHeadMisc, kCDATA, kNone,     
1077      /*special props, prop-range*/       kNoStyleLeaksIn|kNonContainer, kNoPropRange,
1078      /*special parents,kids,skip*/       &gInHead,0,eHTMLTag_style);
1079
1080    Initialize(
1081      /*tag*/                             eHTMLTag_sub,
1082      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1083            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
1084      /*autoclose starttags and endtags*/ 0,0,0,0,
1085      /*parent,incl,exclgroups*/          kSpecial, (kSelf|kInlineEntity), kNone,       
1086      /*special props, prop-range*/       0,kDefaultPropRange,
1087      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
1088
1089    Initialize(
1090   
1091      /*tag*/                             eHTMLTag_sup,
1092      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1093            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
1094      /*autoclose starttags and endtags*/ 0,0,0,0,
1095      /*parent,incl,exclgroups*/          kSpecial, (kSelf|kInlineEntity), kNone,       
1096      /*special props, prop-range*/       0,kDefaultPropRange,
1097      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
1098
1099    Initialize(
1100      /*tag*/                             eHTMLTag_table,
1101      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1102            /*rootnodes,endrootnodes*/          &gTableRootTags,&gTableRootTags,       
1103      /*autoclose starttags and endtags*/ 0,&gTableCloseTags,0,0,
1104      /*parent,incl,exclgroups*/          kBlock, kNone, (kSelf|kInlineEntity),
1105      /*special props, prop-range*/       (kBadContentWatch|kNoStyleLeaksIn), 2,
1106      /*special parents,kids,skip*/       0,&gTableKids,eHTMLTag_unknown);
1107
1108    Initialize(
1109      /*tag*/                             eHTMLTag_tbody,
1110      /*requiredAncestor*/                eHTMLTag_table, eHTMLTag_unknown,
1111            /*rootnodes,endrootnodes*/          &gInTable,      &gInTable,     
1112      /*autoclose starttags and endtags*/ &gTBodyAutoClose,0,0,0,
1113      /*parent,incl,exclgroups*/          kNone, kNone, (kSelf|kInlineEntity), 
1114      /*special props, prop-range*/       (kNoPropagate|kBadContentWatch|kNoStyleLeaksIn|kNoStyleLeaksOut), kDefaultPropRange,
1115      /*special parents,kids,skip*/       &gInTable,&gTBodyKids,eHTMLTag_unknown);
1116
1117    Initialize(
1118      /*tag*/                             eHTMLTag_td,
1119      /*requiredAncestor*/                eHTMLTag_table, eHTMLTag_unknown,
1120            /*rootnodes,endrootnodes*/          &gTDRootTags,&gTDRootTags,     
1121      /*autoclose starttags and endtags*/ &gTDCloseTags,&gTDCloseTags,0,&gExcludableParents,
1122      /*parent,incl,exclgroups*/          kNone, kFlowEntity, kSelf,   
1123      /*special props, prop-range*/       kNoStyleLeaksIn|kNoStyleLeaksOut, kDefaultPropRange,
1124      /*special parents,kids,skip*/       &gTDRootTags,&gBodyKids,eHTMLTag_unknown);
1125
1126    Initialize(
1127      /*tag*/                             eHTMLTag_textarea,
1128      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1129            /*rootnodes,endrootnodes*/          &gInForm,       &gInForm,       
1130      /*autoclose starttags and endtags*/ 0,0,0,0,
1131      /*parent,incl,exclgroups*/          kFormControl, kPCDATA, kNone,
1132      /*special props, prop-range*/       kRequiresBody,kDefaultPropRange,
1133      /*special parents,kids,skip*/       &gInForm,&gContainsText,eHTMLTag_textarea);
1134
1135    Initialize(
1136      /*tag*/                             eHTMLTag_tfoot,
1137      /*requiredAncestor*/                eHTMLTag_table, eHTMLTag_unknown,
1138            /*rootnodes,endrootnodes*/          &gInTable,      &gInTable,
1139      /*autoclose starttags and endtags*/ &gTBodyAutoClose,0,0,0,
1140      /*parent,incl,exclgroups*/          kNone, kNone, kSelf, 
1141      /*special props, prop-range*/       (kNoPropagate|kBadContentWatch|kNoStyleLeaksIn|kNoStyleLeaksOut), kNoPropRange,
1142      /*special parents,kids,skip*/       &gInTable,&gTableElemKids,eHTMLTag_unknown);
1143
1144    Initialize(
1145      /*tag*/                             eHTMLTag_th,
1146      /*requiredAncestor*/                eHTMLTag_table, eHTMLTag_unknown,
1147            /*rootnodes,endrootnodes*/          &gTDRootTags,&gTDRootTags,     
1148      /*autoclose starttags and endtags*/ &gTDCloseTags,&gTDCloseTags,0,0,
1149      /*parent,incl,exclgroups*/          kNone, kFlowEntity, kSelf,   
1150      /*special props, prop-range*/       (kNoStyleLeaksIn|kNoStyleLeaksOut), kDefaultPropRange,
1151      /*special parents,kids,skip*/       &gTDRootTags,&gBodyKids,eHTMLTag_unknown);
1152
1153    Initialize(
1154      /*tag*/                             eHTMLTag_thead,
1155      /*req-parent excl-parent*/          eHTMLTag_table,eHTMLTag_unknown,  //fix bug 54840...
1156            /*rootnodes,endrootnodes*/          &gInTable,&gInTable,           
1157      /*autoclose starttags and endtags*/ &gTBodyAutoClose,0,0,0,
1158      /*parent,incl,exclgroups*/          kNone, kNone, kSelf, 
1159      /*special props, prop-range*/       (kNoPropagate|kBadContentWatch|kNoStyleLeaksIn|kNoStyleLeaksOut), kNoPropRange,
1160      /*special parents,kids,skip*/       &gInTable,&gTableElemKids,eHTMLTag_unknown);
1161
1162    Initialize(
1163      /*tag*/                             eHTMLTag_title,
1164      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1165            /*rootnodes,endrootnodes*/          &gInHead,&gInHead,     
1166      /*autoclose starttags and endtags*/ 0,0,0,0,
1167      /*parent,incl,exclgroups*/          kHeadMisc,kPCDATA, kNone,     
1168      /*special props, prop-range*/       kOmitWS|kNoStyleLeaksIn, kNoPropRange,
1169      /*special parents,kids,skip*/       &gInHead,&gContainsText,eHTMLTag_title);
1170
1171    Initialize(
1172      /*tag*/                             eHTMLTag_tr,
1173      /*requiredAncestor*/                eHTMLTag_table, eHTMLTag_unknown,
1174            /*rootnodes,endrootnodes*/          &gTRParents,&gTREndParents,     
1175      /*autoclose starttags and endtags*/ &gTRCloseTags,0,0,0,
1176      /*parent,incl,exclgroups*/          kNone, kNone, kInlineEntity, 
1177      /*special props, prop-range*/       (kBadContentWatch|kNoStyleLeaksIn|kNoStyleLeaksOut), kNoPropRange,
1178      /*special parents,kids,skip*/       &gTRParents,&gTRKids,eHTMLTag_unknown);
1179
1180    Initialize(
1181      /*tag*/                             eHTMLTag_tt,
1182      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1183            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
1184      /*autoclose starttags and endtags*/ 0,0,0,0,
1185      /*parent,incl,exclgroups*/          kFontStyle, (kSelf|kInlineEntity), kNone,     
1186      /*special props, prop-range*/       0,kDefaultPropRange,
1187      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
1188
1189    Initialize(
1190      /*tag*/                             eHTMLTag_u,
1191      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1192            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
1193      /*autoclose starttags and endtags*/ 0,0,0,0,
1194      /*parent,incl,exclgroups*/          kFontStyle, (kSelf|kInlineEntity), kNone,     
1195      /*special props, prop-range*/       0,kDefaultPropRange,
1196      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
1197
1198    Initialize(
1199      /*tag*/                             eHTMLTag_ul,
1200      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1201            /*rootnodes,endrootnodes*/          &gOLRootTags,&gOLRootTags,     
1202      /*autoclose starttags and endtags*/ &gULAutoClose,&gULCloseTags,0,0,
1203      /*parent,incl,exclgroups*/          kList, (kFlowEntity|kSelf), kNone,   
1204      /*special props, prop-range*/       0,kDefaultPropRange,
1205      /*special parents,kids,skip*/       0,&gULKids,eHTMLTag_unknown);
1206
1207    Initialize(
1208      /*tag*/                             eHTMLTag_var,
1209      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1210            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
1211      /*autoclose starttags and endtags*/ 0,0,0,0,
1212      /*parent,incl,exclgroups*/          kPhrase, (kSelf|kInlineEntity), kNone,       
1213      /*special props, prop-range*/       0,kDefaultPropRange,
1214      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
1215
1216    Initialize(
1217      /*tag*/                             eHTMLTag_wbr,
1218      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1219            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
1220      /*autoclose starttags and endtags*/ 0,0,0,0,
1221      /*parent,incl,exclgroups*/          kExtensions, kNone, kNone,   
1222      /*special props, prop-range*/       kNonContainer,kNoPropRange,
1223      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
1224
1225    Initialize(
1226      /*tag*/                             eHTMLTag_xmp,
1227      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1228            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
1229      /*autoclose starttags and endtags*/ 0,0,0,0,
1230      /*parent,incl,exclgroups*/          kInlineEntity|kPreformatted, kNone, kNone,   
1231      /*special props, prop-range*/       kNone,kDefaultPropRange,
1232      /*special parents,kids,skip*/       0,0,eHTMLTag_xmp);
1233
1234    Initialize(
1235      /*tag*/                             eHTMLTag_text,
1236      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1237            /*rootnodes,endrootnodes*/          &gInBody,&gInBody,     
1238      /*autoclose starttags and endtags*/ 0,0,0,0,
1239      /*parent,incl,exclgroups*/          kFlowEntity, kNone, kNone,   
1240      /*special props, prop-range*/       kNonContainer|kRequiresBody,kNoPropRange,
1241      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
1242
1243    Initialize(
1244      /*tag*/                             eHTMLTag_whitespace,
1245      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1246            /*rootnodes,endrootnodes*/          &gInBody,&gInBody,     
1247      /*autoclose starttags and endtags*/ 0,0,0,0,
1248      /*parent,incl,exclgroups*/          kFlowEntity, kNone, kNone,   
1249      /*special props, prop-range*/       kNonContainer,kNoPropRange,
1250      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
1251
1252    Initialize(
1253      /*tag*/                             eHTMLTag_newline,
1254      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1255            /*rootnodes,endrootnodes*/          &gInBody,&gInBody,     
1256      /*autoclose starttags and endtags*/ 0,0,0,0,
1257      /*parent,incl,exclgroups*/          kFlowEntity, kNone, kNone,   
1258      /*special props, prop-range*/       kNonContainer, kNoPropRange,
1259      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
1260
1261    Initialize(
1262      /*tag*/                             eHTMLTag_comment,
1263      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1264            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
1265      /*autoclose starttags and endtags*/ 0,0,0,0,
1266      /*parent,incl,exclgroups*/          kFlowEntity, kNone, kNone,   
1267      /*special props, prop-range*/       kOmitEndTag|kLegalOpen,kNoPropRange,
1268      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
1269
1270    Initialize(
1271      /*tag*/                             eHTMLTag_entity,
1272      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1273            /*rootnodes,endrootnodes*/          &gInBody,&gInBody,     
1274      /*autoclose starttags and endtags*/ 0,0,0,0,
1275      /*parent,incl,exclgroups*/          kFlowEntity, kNone, kNone,   
1276      /*special props, prop-range*/       0, kNoPropRange,
1277      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
1278
1279    Initialize(
1280      /*tag*/                             eHTMLTag_doctypeDecl,
1281      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1282            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
1283      /*autoclose starttags and endtags*/ 0,0,0,0,
1284      /*parent,incl,exclgroups*/          kFlowEntity, kNone, kNone,   
1285      /*special props, prop-range*/       kOmitEndTag,kNoPropRange,
1286      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
1287
1288    Initialize(
1289      /*tag*/                             eHTMLTag_markupDecl,
1290      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1291            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
1292      /*autoclose starttags and endtags*/ 0,0,0,0,
1293      /*parent,incl,exclgroups*/          kFlowEntity, kNone, kNone,   
1294      /*special props, prop-range*/       kOmitEndTag,kNoPropRange,
1295      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
1296
1297    Initialize(
1298      /*tag*/                             eHTMLTag_instruction,
1299      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_unknown,
1300            /*rootnodes,endrootnodes*/          0,0,   
1301      /*autoclose starttags and endtags*/ 0,0,0,0,
1302      /*parent,incl,exclgroups*/          kFlowEntity, kNone, kNone,   
1303      /*special props, prop-range*/       kOmitEndTag,kNoPropRange,
1304      /*special parents,kids,skip*/       0,0,eHTMLTag_unknown);
1305
1306    Initialize(
1307      /*tag*/                             eHTMLTag_userdefined,
1308      /*req-parent excl-parent*/          eHTMLTag_unknown,eHTMLTag_frameset,
1309            /*rootnodes,endrootnodes*/          &gRootTags,&gRootTags, 
1310      /*autoclose starttags and endtags*/ &gBodyAutoClose,0,0,0,
1311      /*parent,incl,exclgroups*/          kFlowEntity, (kInlineEntity|kSelf), kNone,    // Treat userdefined as inline element - Ref bug 56245,66772
1312      /*special props, prop-range*/       kNone, kBodyPropRange,                     
1313      /*special parents,kids,skip*/       &gInNoframes,&gBodyKids,eHTMLTag_unknown);
1314  }//if
1315}
1316
1317void DeleteElementTable(void) {
1318  if(gHTMLElements) {
1319    delete [] gHTMLElements;
1320    gHTMLElements=0;
1321  }
1322}
1323
1324/**
1325 * This is called to answer the CanBeContained question when LI is the parent
1326 * @update      gess 10/13/00
1327 * @param
1328 * @return
1329 */
1330PRBool CanBeContainedLI(eHTMLTags aChildTag,nsDTDContext &aContext) {
1331  PRBool result=PR_TRUE;
1332
1333  //walk the parent hierarchy, to see if the LI is in a block or an inline.
1334  PRInt32 anIndex=aContext.GetCount();
1335  PRBool  theLIHasABlockParent=PR_FALSE;
1336
1337  PRBool theChildIsBlock=PR_FALSE;
1338 
1339  if((aChildTag>eHTMLTag_unknown) && (aChildTag<eHTMLTag_userdefined)) {
1340    theChildIsBlock=  (eHTMLTag_dt==aChildTag) ||
1341                      (eHTMLTag_dd==aChildTag) ||
1342                      (gHTMLElements[aChildTag].IsMemberOf(kBlock))       ||
1343                      (gHTMLElements[aChildTag].IsMemberOf(kBlockEntity)) ||
1344                      (gHTMLElements[aChildTag].IsMemberOf(kHeading))     ||
1345                      (gHTMLElements[aChildTag].IsMemberOf(kPreformatted))||
1346                      (gHTMLElements[aChildTag].IsMemberOf(kList));
1347  }
1348
1349  if(theChildIsBlock) {
1350
1351    while(--anIndex>0) {
1352      eHTMLTags aParent=aContext.TagAt(anIndex);
1353      if((eHTMLTag_ul==aParent) ||
1354         (eHTMLTag_ol==aParent) ||
1355         (eHTMLTag_table==aParent) ||
1356         (eHTMLTag_dir==aParent)) {
1357        theLIHasABlockParent=PR_TRUE;
1358        break;
1359      }
1360    }
1361    result=theLIHasABlockParent;
1362  }   
1363  else {
1364    result=PR_TRUE;
1365  }
1366  return result;
1367}
1368
1369/**
1370 * This is the default implementation, that was moved out of CNavDTD, so that it can be made
1371 * to behave in a more flexible manner. At this point, the code itself has not changed.
1372 * NOTE: This is not called YET. It's just a placeholder for future changes.
1373 *
1374 * @update      gess 10/13/00
1375 * @param
1376 * @return
1377 */
1378PRBool nsHTMLElement::CanBeContained(eHTMLTags aChildTag,nsDTDContext &aContext) {
1379  PRBool result=PR_TRUE;
1380  if(!mCanBeContained) {
1381
1382    /* #    Interesting test cases:       Result:
1383     * 1.   <UL><LI>..<B>..<LI>           inner <LI> closes outer <LI>
1384     * 2.   <CENTER><DL><DT><A><CENTER>   allow nested <CENTER>
1385     * 3.   <TABLE><TR><TD><TABLE>...     allow nested <TABLE>
1386     * 4.   <FRAMESET> ... <FRAMESET>
1387     */
1388
1389    //Note: This method is going away. First we need to get the elementtable to do closures right, and
1390    //      therefore we must get residual style handling to work.
1391
1392    //the changes to this method were added to fix bug 54651...
1393
1394    PRInt32 theCount=aContext.GetCount();
1395    result=PR_TRUE;
1396
1397    if(0<theCount){
1398      const TagList* theRootTags=gHTMLElements[aChildTag].GetRootTags();
1399      const TagList* theSpecialParents=gHTMLElements[aChildTag].GetSpecialParents();
1400      if(theRootTags) {
1401        PRInt32 theRootIndex=LastOf(aContext,*theRootTags);
1402        PRInt32 theSPIndex=(theSpecialParents) ? LastOf(aContext,*theSpecialParents) : kNotFound; 
1403        PRInt32 theChildIndex=GetIndexOfChildOrSynonym(aContext,aChildTag);
1404        PRInt32 theTargetIndex=(theRootIndex>theSPIndex) ? theRootIndex : theSPIndex;
1405
1406        if((theTargetIndex==theCount-1) ||
1407          ((theTargetIndex==theChildIndex) && gHTMLElements[aChildTag].CanContainSelf())) {
1408          result=PR_TRUE;
1409        }
1410        else {
1411       
1412          result=PR_FALSE;
1413
1414          static eHTMLTags gTableElements[]={eHTMLTag_td,eHTMLTag_th};
1415
1416          PRInt32 theIndex=theCount-1;
1417          while(theChildIndex<theIndex) {
1418            eHTMLTags theParentTag=aContext.TagAt(theIndex--);
1419            if (gHTMLElements[theParentTag].IsMemberOf(kBlockEntity)  ||
1420                gHTMLElements[theParentTag].IsMemberOf(kHeading)      ||
1421                gHTMLElements[theParentTag].IsMemberOf(kPreformatted) ||
1422                gHTMLElements[theParentTag].IsMemberOf(kFormControl) || //added this to fix bug 44479
1423                gHTMLElements[theParentTag].IsMemberOf(kList)) {
1424              if(!HasOptionalEndTag(theParentTag)) {
1425                result=PR_TRUE;
1426                break;
1427              }
1428            }
1429            else if(FindTagInSet(theParentTag,gTableElements,sizeof(gTableElements)/sizeof(eHTMLTag_unknown))){
1430              result=PR_TRUE;  //added this to catch a case we missed; bug 57173.
1431              break;
1432            }
1433          }
1434        }
1435      }
1436    }
1437
1438  }
1439  else result=(*mCanBeContained)(aChildTag,aContext);
1440  return result;
1441}
1442
1443/**
1444 *  Call this to find the index of a given child, or (if not found)
1445 *  the index of its nearest synonym.
1446 *   
1447 *  @update  gess 3/25/98
1448 *  @param   aTagStack -- list of open tags
1449 *  @param   aTag -- tag to test for containership
1450 *  @return  index of kNotFound
1451 */
1452PRInt32 nsHTMLElement::GetIndexOfChildOrSynonym(nsDTDContext& aContext,eHTMLTags aChildTag) {
1453  PRInt32 theChildIndex=aContext.LastOf(aChildTag);
1454  if(kNotFound==theChildIndex) {
1455    const TagList* theSynTags=gHTMLElements[aChildTag].GetSynonymousTags(); //get the list of tags that THIS tag can close
1456    if(theSynTags) {
1457      theChildIndex=LastOf(aContext,*theSynTags);
1458    }
1459    else{
1460      PRInt32 theGroup=nsHTMLElement::GetSynonymousGroups(aChildTag);
1461      if(theGroup) {
1462        theChildIndex=aContext.GetCount();
1463        while(-1<--theChildIndex) {
1464          eHTMLTags theTag=aContext[theChildIndex];
1465          if(gHTMLElements[theTag].IsMemberOf(theGroup)) {
1466            break;   
1467          }
1468        }
1469      }
1470    }
1471  }
1472  return theChildIndex;
1473}
1474
1475int nsHTMLElement::GetSynonymousGroups(eHTMLTags aTag) {
1476  int result=0;
1477
1478  int theGroup=gHTMLElements[aTag].mParentBits;
1479  switch(theGroup) {
1480
1481    case kPhrase:
1482    case kSpecial:
1483    case kFontStyle:
1484    case kHTMLContent:
1485    case kHeadContent:
1486    case kHeadMisc:
1487    case kFormControl:
1488    case kPreformatted:
1489    case kHeading:
1490    case kBlockMisc:
1491    case kBlock:
1492    case kList:
1493    case kPCDATA:
1494    case kExtensions:
1495    case kTable:
1496    case kSelf:
1497    case kInlineEntity:
1498    case kBlockEntity:
1499    case kFlowEntity:
1500    case kAllTags:
1501    default:
1502      break;
1503  }
1504
1505  if(eHTMLTag_font==aTag)  //hack for backward compatibility
1506    result&=kFontStyle;
1507
1508  return result;
1509}
1510
1511/**
1512 *
1513 * @update      gess1/21/99
1514 * @param
1515 * @return
1516 */
1517PRBool nsHTMLElement::HasSpecialProperty(PRInt32 aProperty) const{
1518  PRBool result=TestBits(mSpecialProperties,aProperty);
1519  return result;
1520}
1521
1522/**
1523 *
1524 * @update      gess12/13/98
1525 * @param
1526 * @return
1527 */
1528PRBool nsHTMLElement::IsContainer(eHTMLTags aChild) {
1529  PRBool result=(eHTMLTag_unknown==aChild);
1530
1531  if(!result){
1532    result=!TestBits(gHTMLElements[aChild].mSpecialProperties,kNonContainer);
1533  }
1534  return result;
1535}
1536
1537/**
1538 * This tests whether all the bits in the parentbits
1539 * are included in the given set. It may be too
1540 * broad a question for most cases.
1541 *
1542 * @update      gess12/13/98
1543 * @param
1544 * @return
1545 */
1546PRBool nsHTMLElement::IsMemberOf(PRInt32 aSet) const{
1547  return TestBits(aSet,mParentBits);
1548}
1549
1550/**
1551 * This tests whether all the bits in the parentbits
1552 * are included in the given set. It may be too
1553 * broad a question for most cases.
1554 *
1555 * @update      gess12/13/98
1556 * @param
1557 * @return
1558 */
1559PRBool nsHTMLElement::ContainsSet(PRInt32 aSet) const{
1560  return TestBits(mParentBits,aSet);
1561}
1562
1563/**
1564 * This method determines whether the given tag closes other blocks.
1565 *
1566 * @update      gess 12/20/99 -- added H1..H6 to this list.
1567 * @param
1568 * @return
1569 */
1570PRBool nsHTMLElement::IsBlockCloser(eHTMLTags aTag){
1571  PRBool result=PR_FALSE;
1572   
1573  if((aTag>=eHTMLTag_unknown) & (aTag<=eHTMLTag_xmp)){
1574
1575    result=(gHTMLElements[aTag].IsBlock() ||
1576            gHTMLElements[aTag].IsBlockEntity() ||
1577            (kHeading==gHTMLElements[aTag].mParentBits));
1578    if(!result) {
1579      // NOBR is a block closure   - Ref. Bug# 24462
1580      // DIR is a block closure    - Ref. Bug# 25845
1581      // TD is a block closure     - Ref. Bug# 27490
1582      // TR is a block closure     - Ref. Bug# 26488
1583      // OBJECT is a block closure - Ref. Bug# 88992
1584
1585      static eHTMLTags gClosers[]={ eHTMLTag_table,eHTMLTag_tbody,
1586                                    eHTMLTag_td,eHTMLTag_th,
1587                                    eHTMLTag_tr,eHTMLTag_caption,
1588                                    eHTMLTag_object,eHTMLTag_applet,
1589                                    eHTMLTag_ol, eHTMLTag_ul,
1590                                    eHTMLTag_optgroup,
1591                                    eHTMLTag_nobr,eHTMLTag_dir};
1592
1593      result=FindTagInSet(aTag,gClosers,sizeof(gClosers)/sizeof(eHTMLTag_body));
1594    }
1595  }
1596  return result;
1597}
1598
1599
1600/**
1601 *
1602 * @update      gess 01/04/99
1603 * @param
1604 * @return
1605 */
1606PRBool nsHTMLElement::IsInlineEntity(eHTMLTags aTag){
1607  PRBool result=PR_FALSE;
1608  if((aTag>=eHTMLTag_unknown) & (aTag<=eHTMLTag_xmp)){
1609    result=TestBits(gHTMLElements[aTag].mParentBits,kInlineEntity);
1610  }
1611  return result;
1612}
1613
1614/**
1615 *
1616 * @update      gess 01/04/99
1617 * @param
1618 * @return
1619 */
1620PRBool nsHTMLElement::IsFlowEntity(eHTMLTags aTag){
1621  PRBool result=PR_FALSE;
1622
1623  if((aTag>=eHTMLTag_unknown) & (aTag<=eHTMLTag_xmp)){
1624    result=TestBits(gHTMLElements[aTag].mParentBits,kFlowEntity);
1625  }
1626  return result;
1627}
1628
1629/**
1630 *
1631 * @update      gess 01/04/99
1632 * @param
1633 * @return
1634 */
1635PRBool nsHTMLElement::IsBlockParent(eHTMLTags aTag){
1636  PRBool result=PR_FALSE;
1637  if((aTag>=eHTMLTag_unknown) & (aTag<=eHTMLTag_xmp)){
1638    result=TestBits(gHTMLElements[aTag].mInclusionBits,kBlockEntity);
1639  }
1640  return result;
1641}
1642
1643/**
1644 *
1645 * @update      gess 01/04/99
1646 * @param
1647 * @return
1648 */
1649PRBool nsHTMLElement::IsInlineParent(eHTMLTags aTag){
1650  PRBool result=PR_FALSE;
1651  if((aTag>=eHTMLTag_unknown) & (aTag<=eHTMLTag_xmp)){
1652    result=TestBits(gHTMLElements[aTag].mInclusionBits,kInlineEntity);
1653  }
1654  return result;
1655}
1656
1657
1658/**
1659 *
1660 * @update      gess 01/04/99
1661 * @param
1662 * @return
1663 */
1664PRBool nsHTMLElement::IsFlowParent(eHTMLTags aTag){
1665  PRBool result=PR_FALSE;
1666  if((aTag>=eHTMLTag_unknown) & (aTag<=eHTMLTag_xmp)){
1667    result=TestBits(gHTMLElements[aTag].mInclusionBits,kFlowEntity);
1668  }
1669  return result;
1670}
1671
1672/**
1673 *
1674 * @update      harishd 11/19/99
1675 * @param
1676 * @return
1677 */
1678PRBool nsHTMLElement::IsSpecialParent(eHTMLTags aTag) const{
1679  PRBool result=PR_FALSE;
1680  if(mSpecialParents) {
1681    if(FindTagInSet(aTag,mSpecialParents->mTags,mSpecialParents->mCount))
1682        result=PR_TRUE;
1683  }
1684  return result;
1685}
1686
1687/**
1688 * Tells us whether the given tag opens a section
1689 * @update      gess 01/04/99
1690 * @param   id of tag
1691 * @return  TRUE if opens section
1692 */
1693PRBool nsHTMLElement::IsSectionTag(eHTMLTags aTag){
1694  PRBool result=PR_FALSE;
1695  switch(aTag){
1696    case eHTMLTag_html:
1697    case eHTMLTag_frameset:
1698    case eHTMLTag_body:
1699    case eHTMLTag_head:
1700      result=PR_TRUE;
1701      break;
1702    default:
1703      result=PR_FALSE;
1704  }
1705  return result;
1706}
1707
1708
1709/**
1710 *
1711 * @update      gess 01/04/99
1712 * @param
1713 * @return
1714 */
1715PRBool nsHTMLElement::CanContain(eHTMLTags aParent,eHTMLTags aChild,nsDTDMode aMode){
1716  PRBool result=PR_FALSE;
1717  if((aParent>=eHTMLTag_unknown) & (aParent<=eHTMLTag_userdefined)){
1718    result=gHTMLElements[aParent].CanContain(aChild,aMode);
1719  }
1720  return result;
1721}
1722
1723/**
1724 *
1725 * @update      gess 01/04/99
1726 * @param
1727 * @return
1728 */
1729PRBool nsHTMLElement::CanExclude(eHTMLTags aChild) const{
1730  PRBool result=PR_FALSE;
1731
1732    //Note that special kids takes precedence over exclusions...
1733  if(mSpecialKids) {
1734    if(FindTagInSet(aChild,mSpecialKids->mTags,mSpecialKids->mCount)) {
1735      return PR_FALSE;
1736    }
1737  }
1738
1739  if(eHTMLTag_unknown!=mExclusionBits){
1740    if(gHTMLElements[aChild].IsMemberOf(mExclusionBits)) {
1741      result=PR_TRUE;
1742    }
1743  }
1744  return result;
1745}
1746
1747/**
1748 *
1749 * @update      harishd 03/01/00
1750 * @param
1751 * @return
1752 */
1753PRBool nsHTMLElement::IsExcludableParent(eHTMLTags aParent) const{
1754  PRBool result=PR_FALSE;
1755
1756  if(!IsTextTag(mTagID)) {
1757    if(mExcludableParents) {
1758      const TagList* theParents=mExcludableParents;
1759      if(FindTagInSet(aParent,theParents->mTags,theParents->mCount))
1760        result=PR_TRUE;
1761    }
1762    if(!result) {
1763      // If you're a block parent make sure that you're not the
1764      // parent of a TABLE element. ex. <table><tr><td><div><td></tr></table>
1765      // IE & Nav. render this as table with two cells ( which I think is correct ).
1766      // NOTE: If need arise we could use the root node to solve this problem
1767      if(nsHTMLElement::IsBlockParent(aParent)){
1768        switch(mTagID) {
1769          case eHTMLTag_caption:
1770          case eHTMLTag_thead:
1771          case eHTMLTag_tbody:
1772          case eHTMLTag_tfoot:
1773          case eHTMLTag_td:
1774          case eHTMLTag_th:
1775          case eHTMLTag_tr:
1776            result=PR_TRUE;
1777          default:
1778            break;
1779        }
1780      }
1781    }
1782  }
1783  return result;
1784}
1785
1786/**
1787 *
1788 * @update      gess 01/04/99
1789 * @param
1790 * @return
1791 */
1792PRBool nsHTMLElement::CanOmitEndTag(void) const{
1793  PRBool result=!IsContainer(mTagID);
1794  if(!result)
1795    result=TestBits(mSpecialProperties,kOmitEndTag);
1796  return result;
1797}
1798
1799/**
1800 *
1801 * @update      gess 01/04/99
1802 * @param
1803 * @return
1804 */
1805PRBool nsHTMLElement::CanOmitStartTag(eHTMLTags aChild) const{
1806  PRBool result=PR_FALSE;
1807  return result;
1808}
1809
1810/**
1811 *
1812 * @update      gess12/13/98
1813 * @param
1814 * @return
1815 */
1816PRBool nsHTMLElement::IsChildOfHead(eHTMLTags aChild,PRBool& aExclusively) {
1817#if 0
1818  PRBool result=PR_FALSE;
1819
1820  aExclusively=PR_FALSE;
1821
1822  switch(aChild) {
1823
1824    case eHTMLTag_base:
1825    case eHTMLTag_link:
1826    case eHTMLTag_meta:
1827    case eHTMLTag_title:
1828    case eHTMLTag_style:
1829      aExclusively=result=PR_TRUE;
1830      break;
1831
1832    case eHTMLTag_bgsound:
1833    case eHTMLTag_script:
1834    case eHTMLTag_noembed:
1835    case eHTMLTag_noscript:
1836    case eHTMLTag_whitespace:
1837    case eHTMLTag_newline:
1838    case eHTMLTag_comment:
1839      result=PR_TRUE;
1840      break;
1841
1842    default:
1843      break;
1844  }
1845  return result;
1846#else
1847  aExclusively=PR_TRUE;
1848  return FindTagInSet(aChild,gHeadKids.mTags,gHeadKids.mCount);
1849#endif
1850}
1851
1852
1853
1854/**
1855 *
1856 * @update      gess12/13/98
1857 * @param
1858 * @return
1859 */
1860PRBool nsHTMLElement::SectionContains(eHTMLTags aChild,PRBool allowDepthSearch) {
1861  PRBool result=PR_FALSE;
1862  const TagList* theRootTags=gHTMLElements[aChild].GetRootTags();
1863
1864  if(theRootTags){
1865    if(!FindTagInSet(mTagID,theRootTags->mTags,theRootTags->mCount)){
1866      eHTMLTags theRootBase=theRootTags->mTags[0];
1867      if((eHTMLTag_unknown!=theRootBase) && (allowDepthSearch))
1868        result=SectionContains(theRootBase,allowDepthSearch);
1869    }
1870    else result=PR_TRUE;
1871  }
1872  return result;
1873}
1874
1875/**
1876 * This method should be called to determine if the a tags
1877 * hierarchy needs to be validated.
1878 *
1879 * @update      harishd 04/19/00
1880 * @param
1881 * @return
1882 */
1883
1884PRBool nsHTMLElement::ShouldVerifyHierarchy() {
1885  PRBool result=PR_FALSE;
1886 
1887  // If the tag cannot contain itself then we need to make sure that
1888  // anywhere in the hierarchy we don't nest accidently.
1889  // Ex: <H1><LI><H1><LI>. Inner LI has the potential of getting nested
1890  // inside outer LI.If the tag can contain self, Ex: <A><B><A>,
1891  // ( B can contain self )then ask the child (<A>) if it requires a containment check.
1892  if(mTagID!=eHTMLTag_userdefined) {
1893    result=HasSpecialProperty(kVerifyHierarchy);
1894  }
1895  return result;
1896}
1897 
1898/**
1899 *
1900 * @update      gess12/13/98
1901 * @param
1902 * @return
1903 */
1904PRBool nsHTMLElement::IsResidualStyleTag(eHTMLTags aChild) {
1905  PRBool result=PR_FALSE;
1906  switch(aChild) {
1907    case eHTMLTag_a:       
1908    case eHTMLTag_b:
1909    case eHTMLTag_bdo:     
1910    case eHTMLTag_big:       
1911    case eHTMLTag_blink:
1912    case eHTMLTag_del:
1913    case eHTMLTag_em:
1914    case eHTMLTag_font:   
1915    case eHTMLTag_i:         
1916    case eHTMLTag_ins:
1917    case eHTMLTag_q:
1918    case eHTMLTag_s:       
1919    case eHTMLTag_small:
1920    case eHTMLTag_strong:
1921    case eHTMLTag_strike:   
1922    case eHTMLTag_sub:     
1923    case eHTMLTag_sup:       
1924    case eHTMLTag_tt:
1925    case eHTMLTag_u:       
1926      result=PR_TRUE;
1927      break;
1928
1929    case eHTMLTag_abbr:
1930    case eHTMLTag_acronym:   
1931    case eHTMLTag_center: 
1932    case eHTMLTag_cite:     
1933    case eHTMLTag_code:
1934    case eHTMLTag_dfn:       
1935    case eHTMLTag_kbd:     
1936    case eHTMLTag_samp:     
1937    case eHTMLTag_span:   
1938    case eHTMLTag_var:
1939      result=PR_FALSE;
1940    default:
1941      break;
1942  };
1943  return result;
1944}
1945
1946/**
1947 *
1948 * @update      gess12/13/98
1949 * @param
1950 * @return
1951 */
1952PRBool nsHTMLElement::CanContainType(PRInt32 aType) const{
1953  PRInt32 answer=mInclusionBits & aType;
1954  PRBool  result=PRBool(0!=answer);
1955  return result;
1956}
1957
1958/**
1959 *
1960 * @update      gess12/13/98
1961 * @param
1962 * @return
1963 */
1964PRBool nsHTMLElement::IsWhitespaceTag(eHTMLTags aChild) {
1965  PRBool result=PR_FALSE;
1966
1967  switch(aChild) {
1968    case eHTMLTag_newline:
1969    case eHTMLTag_whitespace:
1970      result=PR_TRUE;
1971      break;
1972    default:
1973      break;
1974  }
1975  return result;
1976}
1977
1978/**
1979 *
1980 * @update      gess12/13/98
1981 * @param
1982 * @return
1983 */
1984PRBool nsHTMLElement::IsTextTag(eHTMLTags aChild) {
1985  PRBool result=PR_FALSE;
1986
1987  switch(aChild) {
1988    case eHTMLTag_text:
1989    case eHTMLTag_entity:
1990    case eHTMLTag_newline:
1991    case eHTMLTag_whitespace:
1992      result=PR_TRUE;
1993      break;
1994    default:
1995      break;
1996  }
1997  return result;
1998}
1999
2000/**
2001 *
2002 * @update      gess12/13/98
2003 * @param
2004 * @return
2005 */
2006PRBool nsHTMLElement::CanContainSelf(void) const {
2007  PRBool result=PRBool(TestBits(mInclusionBits,kSelf)!=0);
2008  return result;
2009}
2010
2011/**
2012 * This method is called to determine (once and for all) whether a start tag
2013 * can close another tag on the stack. This method will return
2014 * false if something prevents aParentTag from closing.
2015 *
2016 * @update      gess 12/20/99
2017 * @param   aContext is the tag stack we're testing against
2018 * @param   aChildTag is the child we're trying to close
2019 * @param   aCount is the number tags we should test
2020 * @return  TRUE if we can autoclose the start tag; FALSE otherwise
2021 */
2022PRBool nsHTMLElement::CanAutoCloseTag(nsDTDContext& aContext,eHTMLTags aChildTag) const{
2023
2024  PRInt32 thePos=aContext.GetCount();
2025  PRBool  result=PR_FALSE;
2026  eHTMLTags thePrevTag=eHTMLTag_unknown;
2027
2028  for(thePos=aContext.GetCount()-1;thePos>0;thePos--) {
2029    thePrevTag=aContext.TagAt(thePos);
2030    switch(thePrevTag) {
2031      case eHTMLTag_applet:
2032      case eHTMLTag_td:                 
2033        thePos=0;
2034        result=PR_FALSE;
2035        break;
2036      case eHTMLTag_body:
2037        result=aChildTag!=thePrevTag;
2038        thePos=0;
2039      default:
2040        if(aChildTag==thePrevTag) {
2041          result=PR_TRUE;
2042          thePos=0;
2043        }
2044        break;
2045    } //switch
2046  } //for
2047 
2048  return result;
2049}
2050
2051/**
2052 *
2053 * @update      gess 10.17.2000
2054 * @param
2055 * @return 
2056 */
2057eHTMLTags nsHTMLElement::GetCloseTargetForEndTag(nsDTDContext& aContext,PRInt32 anIndex,nsDTDMode aMode) const{
2058  eHTMLTags result=eHTMLTag_unknown;
2059
2060  int theCount=aContext.GetCount();
2061  int theIndex=theCount;
2062
2063  if(IsMemberOf(kPhrase)){
2064
2065    while((--theIndex>=anIndex) && (eHTMLTag_unknown==result)){
2066      eHTMLTags theTag=aContext.TagAt(theIndex);
2067      if(theTag!=mTagID) {
2068
2069          //fixes a derivative of bug 22842...
2070        if(CanContainType(kBlock)) { //INS/DEL can contain blocks.
2071          if(gHTMLElements[eHTMLTags(theTag)].IsMemberOf(kBlockEntity) || gHTMLElements[eHTMLTags(theTag)].IsMemberOf(kFlowEntity)) {
2072            if(HasOptionalEndTag(theTag)) {
2073              continue; //then I can close it.
2074            }
2075          }
2076        }
2077
2078        //phrasal elements can close other phrasals, along with fontstyle and special tags...
2079        if(!gHTMLElements[theTag].IsMemberOf(kSpecial|kFontStyle|kPhrase)) {  //fix bug 56665
2080          break; //it's not something I can close
2081        }
2082      }
2083      else {
2084        result=theTag; //stop because you just found yourself on the stack
2085        break;
2086      }
2087    }
2088  }
2089 
2090  else if(IsMemberOf(kSpecial)){
2091
2092    while((--theIndex>=anIndex) && (eHTMLTag_unknown==result)){
2093      eHTMLTags theTag=aContext.TagAt(theIndex);
2094      if(theTag!=mTagID) {
2095        //phrasal elements can close other phrasals, along with fontstyle and special tags...
2096
2097        if((eHTMLTag_userdefined==theTag) ||
2098            gHTMLElements[theTag].IsSpecialEntity()  ||
2099            gHTMLElements[theTag].IsFontStyleEntity()||
2100            gHTMLElements[theTag].IsPhraseEntity()) { // Added Phrasel to fix bug 26347
2101          continue;
2102        }
2103        else {
2104
2105            //fixes bug 22842...
2106          if(CanContainType(kBlock)) {
2107            if(gHTMLElements[eHTMLTags(theTag)].IsMemberOf(kBlockEntity) || gHTMLElements[eHTMLTags(theTag)].IsMemberOf(kFlowEntity)) {
2108              if(HasOptionalEndTag(theTag)) {
2109                continue; //then I can close it.
2110              }
2111            }
2112          }
2113          break; //it's not something I can close
2114        }
2115      }
2116      else {
2117        result=theTag; //stop because you just found yourself on the stack
2118        break;
2119      }
2120    }
2121  }
2122
2123  else if(ContainsSet(kPreformatted) || 
2124          IsMemberOf(kFormControl|kExtensions|kPreformatted)){  //bug54834...
2125
2126    while((--theIndex>=anIndex) && (eHTMLTag_unknown==result)){
2127      eHTMLTags theTag=aContext.TagAt(theIndex);
2128      if(theTag!=mTagID) {
2129        if(!CanContain(theTag,aMode)) {
2130          break; //it's not something I can close
2131        }
2132      }
2133      else {
2134        result=theTag; //stop because you just found yourself on the stack
2135        break;
2136      }
2137    }
2138  }
2139
2140  else if(IsMemberOf(kList)){
2141
2142    while((--theIndex>=anIndex) && (eHTMLTag_unknown==result)){
2143      eHTMLTags theTag=aContext.TagAt(theIndex);
2144      if(theTag!=mTagID) {
2145        if(!CanContain(theTag,aMode)) {
2146          break; //it's not something I can close
2147        }
2148      }
2149      else {
2150        result=theTag; //stop because you just found yourself on the stack
2151        break;
2152      }
2153    }
2154  }
2155
2156  else if(IsResidualStyleTag(mTagID)){
2157   
2158    // Before finding a close target, for the current tag, make sure
2159    // that the tag above does not gate.
2160    // Note: we intentionally make 2 passes:
2161    // The first pass tries to exactly match, the 2nd pass matches the group.
2162
2163    const TagList* theRootTags=gHTMLElements[mTagID].GetEndRootTags();
2164    PRInt32 theIndexCopy=theIndex;
2165    while(--theIndex>=anIndex){
2166      eHTMLTags theTag=aContext.TagAt(theIndex);
2167      if(theTag == mTagID) {
2168        return theTag; // we found our target.
2169      }
2170      else if (!CanContain(theTag,aMode) ||
2171               (theRootTags && FindTagInSet(theTag,theRootTags->mTags,theRootTags->mCount))) {
2172        // If you cannot contain this tag then
2173        // you cannot close it either. It looks like
2174        // the tag trying to close is misplaced.
2175        // In the following Exs. notice the misplaced /font:
2176        // Ex. <font><table><tr><td></font></td></tr></table. -- Ref. bug 56245
2177        // Ex. <font><select><option></font></select> -- Ref. bug 37618
2178        // Ex. <font><select></font><option></select> -- Ref. bug 98187
2179        return eHTMLTag_unknown;
2180      }
2181    }
2182
2183    theIndex=theIndexCopy;
2184    while(--theIndex>=anIndex){
2185      eHTMLTags theTag=aContext.TagAt(theIndex);
2186      if(gHTMLElements[theTag].IsMemberOf(mParentBits)) {
2187        return theTag;
2188      }
2189    }   
2190  }
2191
2192  else if(gHTMLElements[mTagID].IsTableElement()) {
2193   
2194      //This fixes 57378...
2195      //example: <TABLE><THEAD><TR><TH></THEAD> which didn't close the <THEAD>
2196
2197    PRInt32 theLastTable=aContext.LastOf(eHTMLTag_table);
2198    PRInt32 theLastOfMe=aContext.LastOf(mTagID);
2199    if(theLastTable<theLastOfMe) {
2200      return mTagID;
2201    }
2202       
2203  }
2204
2205  return result;
2206}
2207
2208
2209/**
2210 * See whether this tag can DIRECTLY contain the given child.
2211 * @update      gess12/13/98
2212 * @param
2213 * @return
2214 */
2215PRBool nsHTMLElement::CanContain(eHTMLTags aChild,nsDTDMode aMode) const{
2216
2217
2218  if(IsContainer(mTagID)){
2219
2220    if(gHTMLElements[aChild].HasSpecialProperty(kLegalOpen)) {
2221      // Some tags could be opened anywhere, in the document, as they please.
2222      return PR_TRUE;
2223    }
2224
2225    if(mTagID==aChild) {
2226      return CanContainSelf();  //not many tags can contain themselves...
2227    }
2228
2229    const TagList* theCloseTags=gHTMLElements[aChild].GetAutoCloseStartTags();
2230    if(theCloseTags){
2231      if(FindTagInSet(mTagID,theCloseTags->mTags,theCloseTags->mCount))
2232        return PR_FALSE;
2233    }
2234
2235    if(gHTMLElements[aChild].mExcludableParents) {
2236      const TagList* theParents=gHTMLElements[aChild].mExcludableParents;
2237      if(FindTagInSet(mTagID,theParents->mTags,theParents->mCount))
2238        return PR_FALSE;
2239    }
2240   
2241    if(gHTMLElements[aChild].IsExcludableParent(mTagID))
2242      return PR_FALSE;
2243
2244    if(gHTMLElements[aChild].IsBlockCloser(aChild)){
2245      if(nsHTMLElement::IsBlockParent(mTagID)){
2246        return PR_TRUE;
2247      }
2248    }
2249
2250    if(nsHTMLElement::IsInlineEntity(aChild)){
2251      if(nsHTMLElement::IsInlineParent(mTagID)){
2252        return PR_TRUE;
2253      }
2254    }
2255
2256    if(nsHTMLElement::IsFlowEntity(aChild)) {
2257      if(nsHTMLElement::IsFlowParent(mTagID)){
2258        return PR_TRUE;
2259      }
2260    }
2261
2262    if(nsHTMLElement::IsTextTag(aChild)) {
2263      if(nsHTMLElement::IsInlineParent(mTagID)){
2264        return PR_TRUE;
2265      }
2266    }
2267
2268    if(CanContainType(gHTMLElements[aChild].mParentBits)) {
2269      return PR_TRUE;
2270    }
2271 
2272    if(mSpecialKids) {
2273      if(FindTagInSet(aChild,mSpecialKids->mTags,mSpecialKids->mCount)) {
2274        return PR_TRUE;
2275      }
2276    }
2277
2278    // Allow <p> to contain <table> only in Quirks mode, bug 43678 and bug 91927
2279    if (aChild == eHTMLTag_table && mTagID == eHTMLTag_p && aMode == eDTDMode_quirks) {
2280      return PR_TRUE;
2281    }
2282  }
2283 
2284  return PR_FALSE;
2285}
2286
2287#ifdef DEBUG
2288void nsHTMLElement::DebugDumpContainment(const char* aFilename,const char* aTitle){
2289}
2290
2291void nsHTMLElement::DebugDumpMembership(const char* aFilename){
2292}
2293
2294void nsHTMLElement::DebugDumpContainType(const char* aFilename){
2295}
2296#endif
Note: See TracBrowser for help on using the repository browser.