1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 sw=2 et tw=78: */
3 /* ***** BEGIN LICENSE BLOCK *****
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at
9 * http://www.mozilla.org/MPL/
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
16 * The Original Code is mozilla.org code.
18 * The Initial Developer of the Original Code is
19 * Netscape Communications Corporation.
20 * Portions created by the Initial Developer are Copyright (C) 1998
21 * the Initial Developer. All Rights Reserved.
24 * Blake Kaplan <mrbkap@gmail.com>
25 * Mats Palmgren <mats.palmgren@bredband.net>
27 * Alternatively, the contents of this file may be used under the terms of
28 * either of the GNU General Public License Version 2 or later (the "GPL"),
29 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30 * in which case the provisions of the GPL or the LGPL are applicable instead
31 * of those above. If you wish to allow use of your version of this file only
32 * under the terms of either the GPL or the LGPL, and not to allow others to
33 * use your version of this file under the terms of the MPL, indicate your
34 * decision by deleting the provisions above and replace them with the notice
35 * and other provisions required by the GPL or the LGPL. If you do not delete
36 * the provisions above, a recipient may use your version of this file under
37 * the terms of any one of the MPL, the GPL or the LGPL.
39 * ***** END LICENSE BLOCK ***** */
43 #include "nsElementTable.h"
45 /*****************************************************************************
46 Now it's time to list all the html elements all with their capabilities...
47 ******************************************************************************/
49 #define DECL_TAG_LIST(name_, list_) \
50 static const eHTMLTags name_##list[] = list_; \
51 static const TagList name_ = { NS_ARRAY_LENGTH(name_##list), name_##list };
55 //First, define the set of taglists for tags with special parents...
56 DECL_TAG_LIST(gAParents
,{eHTMLTag_map
})
57 DECL_TAG_LIST(gInAddress
,{eHTMLTag_address
})
58 DECL_TAG_LIST(gInHead
,{eHTMLTag_head
})
59 DECL_TAG_LIST(gInTable
,{eHTMLTag_table
})
60 DECL_TAG_LIST(gInHTML
,{eHTMLTag_html
})
61 DECL_TAG_LIST(gInBody
,{eHTMLTag_body
})
62 DECL_TAG_LIST(gInForm
,{eHTMLTag_form
})
63 DECL_TAG_LIST(gInFieldset
,{eHTMLTag_fieldset
})
64 DECL_TAG_LIST(gInTR
,{eHTMLTag_tr
})
65 DECL_TAG_LIST(gInDL
,{eHTMLTag_dl COMMA eHTMLTag_body
})
66 DECL_TAG_LIST(gInFrameset
,{eHTMLTag_frameset
})
67 DECL_TAG_LIST(gInNoframes
,{eHTMLTag_noframes
})
68 //Removed ADDRESS to solve 24885
69 // gInP: nsHTMLElement::CanContain() also allows table in Quirks mode for bug 43678, removed FORM bug 94269
70 DECL_TAG_LIST(gInP
,{eHTMLTag_span
})
71 DECL_TAG_LIST(gOptgroupParents
,{eHTMLTag_select COMMA eHTMLTag_optgroup
})
72 DECL_TAG_LIST(gBodyParents
,{eHTMLTag_html COMMA eHTMLTag_noframes
})
73 DECL_TAG_LIST(gColParents
,{eHTMLTag_table COMMA eHTMLTag_colgroup
})
74 DECL_TAG_LIST(gFramesetParents
,{eHTMLTag_html COMMA eHTMLTag_frameset
})
75 DECL_TAG_LIST(gLegendParents
,{eHTMLTag_fieldset
})
76 DECL_TAG_LIST(gAreaParent
,{eHTMLTag_map
})
77 DECL_TAG_LIST(gParamParents
,{eHTMLTag_applet COMMA eHTMLTag_object
})
78 DECL_TAG_LIST(gTRParents
,{eHTMLTag_tbody COMMA eHTMLTag_tfoot COMMA eHTMLTag_thead COMMA eHTMLTag_table
})
79 DECL_TAG_LIST(gTREndParents
,{eHTMLTag_tbody COMMA eHTMLTag_tfoot COMMA eHTMLTag_thead COMMA eHTMLTag_table COMMA eHTMLTag_applet
})
81 DECL_TAG_LIST(gSourceParents
,{eHTMLTag_video COMMA eHTMLTag_audio
})
84 //*********************************************************************************************
85 // Next, define the set of taglists for tags with special kids...
86 //*********************************************************************************************
88 DECL_TAG_LIST(gContainsText
,{eHTMLTag_text COMMA eHTMLTag_newline COMMA eHTMLTag_whitespace COMMA eHTMLTag_entity
})
89 DECL_TAG_LIST(gUnknownKids
,{eHTMLTag_html COMMA eHTMLTag_frameset
})
91 // The presence of <input>, <select>, and <textarea> in gContainsOpts is due to
92 // the exclgroup that <select> sets... If I don't include those here, they
93 // just get dropped automatically, since they are not allowed to open inside
94 // <select>. Note that we are NOT allowing them to actually open without
95 // closing the select -- see gInputAutoClose. Further note that I'm not
96 // including <button> in the list because in IE it doesn't autoclose <select>!
97 DECL_TAG_LIST(gContainsOpts
,{eHTMLTag_option COMMA eHTMLTag_optgroup COMMA eHTMLTag_script COMMA eHTMLTag_input COMMA eHTMLTag_select COMMA eHTMLTag_textarea
})
98 // Similar deal for <option> except it allows all of gContainsText _and_ the things that should autoclose selects.
99 DECL_TAG_LIST(gContainedInOpt
,{eHTMLTag_text COMMA eHTMLTag_newline COMMA eHTMLTag_whitespace COMMA eHTMLTag_entity COMMA eHTMLTag_input COMMA eHTMLTag_select COMMA eHTMLTag_textarea
})
100 DECL_TAG_LIST(gContainsParam
,{eHTMLTag_param
})
101 DECL_TAG_LIST(gColgroupKids
,{eHTMLTag_col
})
102 DECL_TAG_LIST(gAddressKids
,{eHTMLTag_p
})
103 DECL_TAG_LIST(gBodyKids
,{eHTMLTag_dd COMMA eHTMLTag_del COMMA eHTMLTag_dt COMMA eHTMLTag_ins COMMA eHTMLTag_noscript COMMA eHTMLTag_script COMMA eHTMLTag_li COMMA eHTMLTag_param
}) // Added PARAM for bug 54448
104 DECL_TAG_LIST(gButtonKids
,{eHTMLTag_caption COMMA eHTMLTag_legend
})
106 DECL_TAG_LIST(gDLRootTags
,{eHTMLTag_body COMMA eHTMLTag_td COMMA eHTMLTag_table COMMA eHTMLTag_applet COMMA eHTMLTag_dd
})
107 DECL_TAG_LIST(gDLKids
,{eHTMLTag_dd COMMA eHTMLTag_dt
})
108 DECL_TAG_LIST(gDTKids
,{eHTMLTag_dt
})
109 DECL_TAG_LIST(gFieldsetKids
,{eHTMLTag_legend COMMA eHTMLTag_text
})
110 DECL_TAG_LIST(gFontKids
,{eHTMLTag_legend COMMA eHTMLTag_table COMMA eHTMLTag_text COMMA eHTMLTag_li
}) // Added table to fix bug 93365, li to fix bug 96031
111 DECL_TAG_LIST(gFormKids
,{eHTMLTag_keygen
})
112 DECL_TAG_LIST(gFramesetKids
,{eHTMLTag_frame COMMA eHTMLTag_frameset COMMA eHTMLTag_noframes
})
114 DECL_TAG_LIST(gHtmlKids
,{eHTMLTag_body COMMA eHTMLTag_frameset COMMA eHTMLTag_head COMMA eHTMLTag_noscript COMMA eHTMLTag_noframes COMMA eHTMLTag_script COMMA eHTMLTag_newline COMMA eHTMLTag_whitespace
})
116 DECL_TAG_LIST(gLabelKids
,{eHTMLTag_span
})
117 DECL_TAG_LIST(gLIKids
,{eHTMLTag_ol COMMA eHTMLTag_ul
})
118 DECL_TAG_LIST(gMapKids
,{eHTMLTag_area
})
119 DECL_TAG_LIST(gPreKids
,{eHTMLTag_hr COMMA eHTMLTag_center
}) //note that CENTER is here for backward compatibility; it's not 4.0 spec.
121 DECL_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_script
})// Removed INPUT - Ref. Bug 20087, 25382
123 DECL_TAG_LIST(gTableElemKids
,{eHTMLTag_form COMMA eHTMLTag_noscript COMMA eHTMLTag_script COMMA eHTMLTag_td COMMA eHTMLTag_th COMMA eHTMLTag_tr
})
124 DECL_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
125 DECL_TAG_LIST(gTBodyKids
,{eHTMLTag_tr COMMA eHTMLTag_form
}) // Removed INPUT - Ref. Bug 20087, 25382
126 DECL_TAG_LIST(gULKids
,{eHTMLTag_li COMMA eHTMLTag_p
})
128 DECL_TAG_LIST(gVideoKids
,{eHTMLTag_source
})
129 DECL_TAG_LIST(gAudioKids
,{eHTMLTag_source
})
132 //*********************************************************************************************
133 // The following tag lists are used to define common set of root notes for the HTML elements...
134 //*********************************************************************************************
136 DECL_TAG_LIST(gRootTags
,{eHTMLTag_body COMMA eHTMLTag_td COMMA eHTMLTag_table COMMA eHTMLTag_applet COMMA eHTMLTag_select
}) // Added SELECT to fix bug 98645
137 DECL_TAG_LIST(gTableRootTags
,{eHTMLTag_applet COMMA eHTMLTag_body COMMA eHTMLTag_dl COMMA eHTMLTag_ol COMMA eHTMLTag_td COMMA eHTMLTag_th
})
138 DECL_TAG_LIST(gHTMLRootTags
,{eHTMLTag_unknown
})
140 DECL_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
})
142 DECL_TAG_LIST(gOLRootTags
,{eHTMLTag_body COMMA eHTMLTag_li COMMA eHTMLTag_td COMMA eHTMLTag_th COMMA eHTMLTag_select
})
143 DECL_TAG_LIST(gTDRootTags
,{eHTMLTag_tr COMMA eHTMLTag_tbody COMMA eHTMLTag_thead COMMA eHTMLTag_tfoot COMMA eHTMLTag_table COMMA eHTMLTag_applet
})
144 DECL_TAG_LIST(gNoframeRoot
,{eHTMLTag_body COMMA eHTMLTag_frameset
})
146 //*********************************************************************************************
147 // The following tag lists are used to define the autoclose properties of the html elements...
148 //*********************************************************************************************
150 DECL_TAG_LIST(gBodyAutoClose
,{eHTMLTag_head
})
151 DECL_TAG_LIST(gTBodyAutoClose
,{eHTMLTag_thead COMMA eHTMLTag_tfoot COMMA eHTMLTag_tbody COMMA eHTMLTag_td COMMA eHTMLTag_th
}) // TD|TH inclusion - Bug# 24112
152 DECL_TAG_LIST(gCaptionAutoClose
,{eHTMLTag_tbody
})
153 DECL_TAG_LIST(gLIAutoClose
,{eHTMLTag_p COMMA eHTMLTag_li
})
154 DECL_TAG_LIST(gPAutoClose
,{eHTMLTag_p COMMA eHTMLTag_li
})
155 DECL_TAG_LIST(gHRAutoClose
,{eHTMLTag_p
})
156 DECL_TAG_LIST(gOLAutoClose
,{eHTMLTag_p COMMA eHTMLTag_ol
})
157 DECL_TAG_LIST(gDivAutoClose
,{eHTMLTag_p
})
158 // Form controls that autoclose <select> use this
159 DECL_TAG_LIST(gInputAutoClose
,{eHTMLTag_select COMMA eHTMLTag_optgroup COMMA eHTMLTag_option
})
161 DECL_TAG_LIST(gHeadingTags
,{eHTMLTag_h1 COMMA eHTMLTag_h2 COMMA eHTMLTag_h3 COMMA eHTMLTag_h4 COMMA eHTMLTag_h5 COMMA eHTMLTag_h6
})
163 DECL_TAG_LIST(gTableCloseTags
,{eHTMLTag_td COMMA eHTMLTag_tr COMMA eHTMLTag_th COMMA eHTMLTag_tbody COMMA eHTMLTag_thead COMMA eHTMLTag_tfoot
})
164 DECL_TAG_LIST(gTRCloseTags
,{eHTMLTag_tr COMMA eHTMLTag_td COMMA eHTMLTag_th
})
165 DECL_TAG_LIST(gTDCloseTags
,{eHTMLTag_td COMMA eHTMLTag_th
})
166 DECL_TAG_LIST(gDTCloseTags
,{eHTMLTag_p COMMA eHTMLTag_dd COMMA eHTMLTag_dt
})
167 DECL_TAG_LIST(gULCloseTags
,{eHTMLTag_li
})
168 DECL_TAG_LIST(gULAutoClose
,{eHTMLTag_p COMMA eHTMLTag_ul
}) //fix bug 50261..
170 DECL_TAG_LIST(gExcludableParents
,{eHTMLTag_pre
}) // Ref Bug 22913
171 DECL_TAG_LIST(gCaptionExcludableParents
,{eHTMLTag_td
}) //Ref Bug 26488
173 //*********************************************************************************************
174 //Lastly, bind tags with their rules, their special parents and special kids.
175 //*********************************************************************************************
178 const int kNoPropRange
=0;
179 const int kDefaultPropRange
=1;
180 const int kBodyPropRange
=2;
182 //*********************************************************************************************
184 // Now let's declare the element table...
186 //*********************************************************************************************
189 const nsHTMLElement gHTMLElements
[] = {
191 /*tag*/ eHTMLTag_unknown
,
192 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
193 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
194 /*autoclose starttags and endtags*/ 0,0,0,0,
195 /*parent,incl,exclgroups*/ kNone
, kNone
, kNone
,
196 /*special props, prop-range*/ kNonContainer
, 10,
197 /*special parents,kids*/ 0,&gUnknownKids
,
201 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
202 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
203 /*autoclose starttags and endtags*/ 0,0,0,0,
204 /*parent,incl,exclgroups*/ kSpecial
, kInlineEntity
, kNone
,
205 /*special props, prop-range*/ kVerifyHierarchy
, kDefaultPropRange
,
206 /*special parents,kids*/ 0,0,
209 /*tag*/ eHTMLTag_abbr
,
210 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
211 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
212 /*autoclose starttags and endtags*/ 0,0,0,0,
213 /*parent,incl,exclgroups*/ kPhrase
, (kSelf
|kInlineEntity
), kNone
,
214 /*special props, prop-range*/ 0,kDefaultPropRange
,
215 /*special parents,kids*/ 0,0,
218 /*tag*/ eHTMLTag_acronym
,
219 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
220 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
221 /*autoclose starttags and endtags*/ 0,0,0,0,
222 /*parent,incl,exclgroups*/ kPhrase
, (kSelf
|kInlineEntity
), kNone
,
223 /*special props, prop-range*/ 0,kDefaultPropRange
,
224 /*special parents,kids*/ 0,0,
227 /*tag*/ eHTMLTag_address
,
228 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
229 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
230 /*autoclose starttags and endtags*/ 0,0,0,0,
231 /*parent,incl,exclgroups*/ kBlock
, kInlineEntity
, kNone
,
232 /*special props, prop-range*/ 0,kDefaultPropRange
,
233 /*special parents,kids*/ 0,&gAddressKids
,
236 /*tag*/ eHTMLTag_applet
,
237 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
238 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
239 /*autoclose starttags and endtags*/ 0,0,0,0,
240 /*parent,incl,exclgroups*/ kSpecial
, (kSelf
|kInlineEntity
|kFlowEntity
), kNone
,
241 /*special props, prop-range*/ kRequiresBody
,kDefaultPropRange
,
242 /*special parents,kids*/ 0,&gContainsParam
,
245 /*tag*/ eHTMLTag_area
,
246 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
247 /*rootnodes,endrootnodes*/ &gAreaParent
,&gRootTags
,
248 /*autoclose starttags and endtags*/ 0,0,0,0,
249 /*parent,incl,exclgroups*/ kNone
, kInlineEntity
, kSelf
,
250 /*special props, prop-range*/ kNonContainer
,kDefaultPropRange
,
251 /*special parents,kids*/ &gAreaParent
,0,
253 #if defined(MOZ_MEDIA)
255 /*tag*/ eHTMLTag_audio
,
256 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
257 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
258 /*autoclose starttags and endtags*/ 0, 0, 0,0,
259 /*parent,incl,exclgroups*/ kSpecial
, (kFlowEntity
|kSelf
), kNone
,
260 /*special props, prop-range*/ 0,kDefaultPropRange
,
261 /*special parents,kids*/ 0,&gAudioKids
,
266 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
267 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
268 /*autoclose starttags and endtags*/ 0,0,0,0,
269 /*parent,incl,exclgroups*/ kFontStyle
, (kInlineEntity
|kSelf
), kNone
,
270 /*special props, prop-range*/ 0, kDefaultPropRange
,
271 /*special parents,kids*/ 0,0,
274 /*tag*/ eHTMLTag_base
,
275 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
276 /*rootnodes,endrootnodes*/ &gInHead
,&gRootTags
,
277 /*autoclose starttags and endtags*/ 0,0,0,0,
278 /*parent,incl,exclgroups*/ kHeadContent
, kNone
, kNone
,
279 /*special props, prop-range*/ kNonContainer
, kNoPropRange
,
280 /*special parents,kids*/ &gInHead
,0,
283 /*tag*/ eHTMLTag_basefont
,
284 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
285 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
286 /*autoclose starttags and endtags*/ 0,0,0,0,
287 /*parent,incl,exclgroups*/ kSpecial
, kInlineEntity
, kNone
,
288 /*special props, prop-range*/ kNonContainer
, kNoPropRange
,
289 /*special parents,kids*/ 0,0,
292 /*tag*/ eHTMLTag_bdo
,
293 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
294 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
295 /*autoclose starttags and endtags*/ 0,0,0,0,
296 /*parent,incl,exclgroups*/ kSpecial
, (kSelf
|kInlineEntity
), kNone
,
297 /*special props, prop-range*/ 0, kDefaultPropRange
,
298 /*special parents,kids*/ 0,0,
301 /*tag*/ eHTMLTag_bgsound
,
302 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
303 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
304 /*autoclose starttags and endtags*/ 0,0,0,0,
305 /*parent,incl,exclgroups*/ (kFlowEntity
|kHeadMisc
), kNone
, kNone
,
306 /*special props, prop-range*/ kNonContainer
,kDefaultPropRange
,
307 /*special parents,kids*/ 0,0,
310 /*tag*/ eHTMLTag_big
,
311 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
312 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
313 /*autoclose starttags and endtags*/ 0,0,0,0,
314 /*parent,incl,exclgroups*/ kFontStyle
, (kInlineEntity
|kSelf
), kNone
,
315 /*special props, prop-range*/ 0, kDefaultPropRange
,
316 /*special parents,kids*/ 0,0,
319 /*tag*/ eHTMLTag_blink
,
320 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
321 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
322 /*autoclose starttags and endtags*/ 0,0,0,0,
323 /*parent,incl,exclgroups*/ kFontStyle
, (kFlowEntity
|kSelf
), kNone
,
324 /*special props, prop-range*/ 0, kDefaultPropRange
,
325 /*special parents,kids*/ 0,0,
328 /*tag*/ eHTMLTag_blockquote
,
329 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
330 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
331 /*autoclose starttags and endtags*/ 0,0,0,0, //remove excludeable parents to fix bug 53473
332 /*parent,incl,exclgroups*/ kBlock
, (kSelf
|kFlowEntity
), kNone
,
333 /*special props, prop-range*/ 0,kDefaultPropRange
,
334 /*special parents,kids*/ 0,0,
337 /*tag*/ eHTMLTag_body
,
338 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_frameset
,
339 /*rootnodes,endrootnodes*/ &gInHTML
,&gInHTML
,
340 /*autoclose starttags and endtags*/ &gBodyAutoClose
,0,0,0,
341 /*parent,incl,exclgroups*/ kHTMLContent
,(kFlowEntity
|kSelf
), kNone
,
342 /*special props, prop-range*/ kOmitEndTag
, kBodyPropRange
,
343 /*special parents,kids*/ 0,&gBodyKids
,
347 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
348 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
349 /*autoclose starttags and endtags*/ 0,0,0,0,
350 /*parent,incl,exclgroups*/ kSpecial
, kNone
, kNone
,
351 /*special props, prop-range*/ kRequiresBody
|kNonContainer
, kNoPropRange
,
352 /*special parents,kids*/ 0,0,
355 /*tag*/ eHTMLTag_button
,
356 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
357 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
358 /*autoclose starttags and endtags*/ 0,0,0,0,
359 /*parent,incl,exclgroups*/ kFormControl
, kFlowEntity
, kFormControl
,
360 /*special props, prop-range*/ kRequiresBody
,kDefaultPropRange
,
361 /*special parents,kids*/ 0,&gButtonKids
,
364 /*tag*/ eHTMLTag_canvas
,
365 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
366 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
367 /*autoclose starttags and endtags*/ 0,0,0,0,
368 /*parent,incl,exclgroups*/ kSpecial
, (kFlowEntity
|kSelf
), kNone
,
369 /*special props, prop-range*/ 0, kDefaultPropRange
,
370 /*special parents,kids*/ 0,0,
373 /*tag*/ eHTMLTag_caption
,
374 /*req-parent excl-parent*/ eHTMLTag_table
,eHTMLTag_unknown
,
375 /*rootnodes,endrootnodes*/ &gInTable
,&gInTable
,
376 /*autoclose starttags and endtags*/ &gCaptionAutoClose
,0,0,0,
377 /*parent,incl,exclgroups*/ kNone
, kFlowEntity
, kSelf
,
378 /*special props, prop-range*/ (kNoPropagate
|kNoStyleLeaksOut
),kDefaultPropRange
,
379 /*special parents,kids*/ &gInTable
,0,
382 /*tag*/ eHTMLTag_center
,
383 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
384 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
385 /*autoclose starttags and endtags*/ 0,0,0,0,
386 /*parent,incl,exclgroups*/ kBlock
, (kSelf
|kFlowEntity
), kNone
,
387 /*special props, prop-range*/ 0,kDefaultPropRange
,
388 /*special parents,kids*/ 0,0,
391 /*tag*/ eHTMLTag_cite
,
392 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
393 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
394 /*autoclose starttags and endtags*/ 0,0,0,0,
395 /*parent,incl,exclgroups*/ kPhrase
, (kSelf
|kInlineEntity
), kNone
,
396 /*special props, prop-range*/ 0,kDefaultPropRange
,
397 /*special parents,kids*/ 0,0,
400 /*tag*/ eHTMLTag_code
,
401 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
402 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
403 /*autoclose starttags and endtags*/ 0,0,0,0,
404 /*parent,incl,exclgroups*/ kPhrase
, (kSelf
|kInlineEntity
), kNone
,
405 /*special props, prop-range*/ 0,kDefaultPropRange
,
406 /*special parents,kids*/ 0,0,
409 /*tag*/ eHTMLTag_col
,
410 /*req-parent excl-parent*/ eHTMLTag_table
,eHTMLTag_unknown
,
411 /*rootnodes,endrootnodes*/ &gColParents
,&gColParents
,
412 /*autoclose starttags and endtags*/ 0,0,0,0,
413 /*parent,incl,exclgroups*/ kNone
, kNone
, kNone
,
414 /*special props, prop-range*/ kNoPropagate
|kNonContainer
,kDefaultPropRange
,
415 /*special parents,kids*/ &gColParents
,0,
418 /*tag*/ eHTMLTag_colgroup
,
419 /*req-parent excl-parent*/ eHTMLTag_table
,eHTMLTag_unknown
,
420 /*rootnodes,endrootnodes*/ &gInTable
,&gInTable
,
421 /*autoclose starttags and endtags*/ 0,0,0,0,
422 /*parent,incl,exclgroups*/ kNone
, kNone
, kNone
,
423 /*special props, prop-range*/ kNoPropagate
,kDefaultPropRange
,
424 /*special parents,kids*/ &gInTable
,&gColgroupKids
,
428 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
429 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
430 /*autoclose starttags and endtags*/ &gDTCloseTags
,0,&gDLKids
,0,
431 /*parent,incl,exclgroups*/ kInlineEntity
, kFlowEntity
, kNone
,
432 /*special props, prop-range*/ kNoPropagate
|kMustCloseSelf
|kVerifyHierarchy
|kRequiresBody
,kDefaultPropRange
,
433 /*special parents,kids*/ &gInDL
,0,
436 /*tag*/ eHTMLTag_del
,
437 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
438 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
439 /*autoclose starttags and endtags*/ 0,0,0,0,
440 /*parent,incl,exclgroups*/ kFlowEntity
, (kSelf
|kFlowEntity
), kNone
,
441 /*special props, prop-range*/ 0, kDefaultPropRange
,
442 /*special parents,kids*/ &gInBody
,0,
445 /*tag*/ eHTMLTag_dfn
,
446 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
447 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
448 /*autoclose starttags and endtags*/ 0,0,0,0,
449 /*parent,incl,exclgroups*/ kPhrase
, (kSelf
|kInlineEntity
), kNone
,
450 /*special props, prop-range*/ 0,kDefaultPropRange
,
451 /*special parents,kids*/ 0,0,
454 /*tag*/ eHTMLTag_dir
,
455 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
456 /*rootnodes,endrootnodes*/ &gOLRootTags
,&gOLRootTags
,
457 /*autoclose starttags and endtags*/ &gOLAutoClose
, &gULCloseTags
, 0,0,
458 /*parent,incl,exclgroups*/ kList
, (kFlowEntity
|kSelf
), kNone
,
459 /*special props, prop-range*/ 0,kDefaultPropRange
,
460 /*special parents,kids*/ 0,&gULKids
,
463 /*tag*/ eHTMLTag_div
,
464 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
465 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
466 /*autoclose starttags and endtags*/ &gDivAutoClose
,0,0,0,
467 /*parent,incl,exclgroups*/ kBlock
, (kSelf
|kFlowEntity
), kNone
,
468 /*special props, prop-range*/ 0,kDefaultPropRange
,
469 /*special parents,kids*/ 0,0,
473 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
474 /*rootnodes,endrootnodes*/ &gDLRootTags
,&gRootTags
, //fix bug 57634
475 /*autoclose starttags and endtags*/ 0,0,0,&gDTKids
, // DT should not contain DL - bug 100466
476 /*parent,incl,exclgroups*/ kBlock
, kSelf
|kFlowEntity
, kNone
,
477 /*special props, prop-range*/ 0, kNoPropRange
,
478 /*special parents,kids*/ 0,&gDLKids
,
482 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
483 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
484 /*autoclose starttags and endtags*/ &gDTCloseTags
,0,&gDLKids
,0,
485 /*parent,incl,exclgroups*/ kInlineEntity
, (kFlowEntity
-kHeading
), kNone
, // dt's parent group is inline - bug 65467
486 /*special props, prop-range*/ (kNoPropagate
|kMustCloseSelf
|kVerifyHierarchy
|kRequiresBody
),kDefaultPropRange
,
487 /*special parents,kids*/ &gInDL
,0,
491 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
492 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
493 /*autoclose starttags and endtags*/ 0,0,0,0,
494 /*parent,incl,exclgroups*/ kPhrase
, (kSelf
|kInlineEntity
), kNone
,
495 /*special props, prop-range*/ 0, kDefaultPropRange
,
496 /*special parents,kids*/ 0,0,
499 /*tag*/ eHTMLTag_embed
,
500 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
501 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
502 /*autoclose starttags and endtags*/ 0,0,0,0,
503 /*parent,incl,exclgroups*/ kSpecial
, kNone
, kNone
,
504 /*special props, prop-range*/ kNonContainer
|kRequiresBody
,kDefaultPropRange
,
505 /*special parents,kids*/ 0,&gContainsParam
,
508 /*tag*/ eHTMLTag_fieldset
,
509 /*requiredAncestor*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
510 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
511 /*autoclose starttags and endtags*/ 0,0,0,0,
512 /*parent,incl,exclgroups*/ kBlock
, (kSelf
|kFlowEntity
), kNone
,
513 /*special props, prop-range*/ kNoPropagate
,kDefaultPropRange
,
514 /*special parents,kids*/ 0,&gFieldsetKids
,
517 /*tag*/ eHTMLTag_font
,
518 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
519 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
520 /*autoclose starttags and endtags*/ 0,0,0,0,
521 /*parent,incl,exclgroups*/ kFontStyle
, (kSelf
|kInlineEntity
), kNone
,
522 /*special props, prop-range*/ 0, kDefaultPropRange
,
523 /*special parents,kids*/ 0,&gFontKids
,
526 /*tag*/ eHTMLTag_form
,
527 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
528 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
529 /*autoclose starttags and endtags*/ 0,0,0,0,
530 /*parent,incl,exclgroups*/ kBlock
, kFlowEntity
, kNone
,
531 /*special props, prop-range*/ kNoStyleLeaksIn
, kNoPropRange
,
532 /*special parents,kids*/ 0,&gFormKids
,
535 /*tag*/ eHTMLTag_frame
,
536 /*req-parent excl-parent*/ eHTMLTag_frameset
,eHTMLTag_unknown
,
537 /*rootnodes,endrootnodes*/ &gInFrameset
,&gInFrameset
,
538 /*autoclose starttags and endtags*/ 0,0,0,0,
539 /*parent,incl,exclgroups*/ kNone
, kNone
, kNone
,
540 /*special props, prop-range*/ kNoPropagate
|kNoStyleLeaksIn
|kNonContainer
, kNoPropRange
,
541 /*special parents,kids*/ &gInFrameset
,0,
544 /*tag*/ eHTMLTag_frameset
,
545 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_body
,
546 /*rootnodes,endrootnodes*/ &gFramesetParents
,&gInHTML
,
547 /*autoclose starttags and endtags*/ 0,0,0,0,
548 /*parent,incl,exclgroups*/ kHTMLContent
, kSelf
, kAllTags
,
549 /*special props, prop-range*/ kNoPropagate
|kNoStyleLeaksIn
, kNoPropRange
,
550 /*special parents,kids*/ &gInHTML
,&gFramesetKids
,
555 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
556 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
557 /*autoclose starttags and endtags*/ &gHeadingTags
, &gHeadingTags
, &gHeadingTags
,0,
558 /*parent,incl,exclgroups*/ kHeading
, kFlowEntity
, kNone
,
559 /*special props, prop-range*/ kVerifyHierarchy
,kDefaultPropRange
,
560 /*special parents,kids*/ 0,0,
564 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
565 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
566 /*autoclose starttags and endtags*/ &gHeadingTags
, &gHeadingTags
, &gHeadingTags
,0,
567 /*parent,incl,exclgroups*/ kHeading
, kFlowEntity
, kNone
,
568 /*special props, prop-range*/ kVerifyHierarchy
,kDefaultPropRange
,
569 /*special parents,kids*/ 0,0,
573 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
574 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
575 /*autoclose starttags and endtags*/ &gHeadingTags
, &gHeadingTags
, &gHeadingTags
,0,
576 /*parent,incl,exclgroups*/ kHeading
, kFlowEntity
, kNone
,
577 /*special props, prop-range*/ kVerifyHierarchy
,kDefaultPropRange
,
578 /*special parents,kids*/ 0,0,
582 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
583 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
584 /*autoclose starttags and endtags*/ &gHeadingTags
, &gHeadingTags
, &gHeadingTags
,0,
585 /*parent,incl,exclgroups*/ kHeading
, kFlowEntity
, kNone
,
586 /*special props, prop-range*/ kVerifyHierarchy
,kDefaultPropRange
,
587 /*special parents,kids*/ 0,0,
591 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
592 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
593 /*autoclose starttags and endtags*/ &gHeadingTags
, &gHeadingTags
, &gHeadingTags
,0,
594 /*parent,incl,exclgroups*/ kHeading
, kFlowEntity
, kNone
,
595 /*special props, prop-range*/ kVerifyHierarchy
,kDefaultPropRange
,
596 /*special parents,kids*/ 0,0,
600 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
601 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
602 /*autoclose starttags and endtags*/ &gHeadingTags
, &gHeadingTags
, &gHeadingTags
,0,
603 /*parent,incl,exclgroups*/ kHeading
, kFlowEntity
, kNone
,
604 /*special props, prop-range*/ kVerifyHierarchy
,kDefaultPropRange
,
605 /*special parents,kids*/ 0,0,
608 /*tag*/ eHTMLTag_head
,
609 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
610 /*rootnodes,endrootnodes*/ &gInHTML
,&gInHTML
,
611 /*autoclose starttags and endtags*/ 0,0,0,0,
612 /*parent,incl,exclgroups*/ kHTMLContent
, (kHeadContent
|kHeadMisc
), kNone
,
613 /*special props, prop-range*/ kNoStyleLeaksIn
, kDefaultPropRange
,
614 /*special parents,kids*/ &gInHTML
,0,
618 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
619 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
620 /*autoclose starttags and endtags*/ &gHRAutoClose
,0,0,0,
621 /*parent,incl,exclgroups*/ kBlock
, kNone
, kNone
,
622 /*special props, prop-range*/ kNonContainer
|kRequiresBody
,kDefaultPropRange
,
623 /*special parents,kids*/ 0,0,
626 /*tag*/ eHTMLTag_html
,
627 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_html
,
628 /*rootnodes,endrootnodes*/ &gHTMLRootTags
,&gHTMLRootTags
,
629 /*autoclose starttags and endtags*/ 0,0,0,0,
630 /*parent,incl,exclgroups*/ kNone
, kHTMLContent
, kNone
,
631 /*special props, prop-range*/ kSaveMisplaced
|kOmitEndTag
|kNoStyleLeaksIn
, kDefaultPropRange
,
632 /*special parents,kids*/ 0,&gHtmlKids
,
636 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
637 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
638 /*autoclose starttags and endtags*/ 0,0,0,0,
639 /*parent,incl,exclgroups*/ kFontStyle
, (kSelf
|kInlineEntity
), kNone
,
640 /*special props, prop-range*/ 0, kDefaultPropRange
,
641 /*special parents,kids*/ 0,0,
644 /*tag*/ eHTMLTag_iframe
,
645 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
646 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
647 /*autoclose starttags and endtags*/ 0,0,0,0,
648 /*parent,incl,exclgroups*/ kSpecial
, (kSelf
|kFlowEntity
), kNone
,
649 /*special props, prop-range*/ kNoStyleLeaksIn
, kNoPropRange
,
650 /*special parents,kids*/ 0,0,
653 /*tag*/ eHTMLTag_image
,
654 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
655 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
656 /*autoclose starttags and endtags*/ 0,0,0,0,
657 /*parent,incl,exclgroups*/ kSpecial
, kNone
, kNone
,
658 /*special props, prop-range*/ kNonContainer
,kDefaultPropRange
,
659 /*special parents,kids*/ 0,0,
662 /*tag*/ eHTMLTag_img
,
663 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
664 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
665 /*autoclose starttags and endtags*/ 0,0,0,0,
666 /*parent,incl,exclgroups*/ kSpecial
, kNone
, kNone
,
667 /*special props, prop-range*/ kNonContainer
|kRequiresBody
,kDefaultPropRange
,
668 /*special parents,kids*/ 0,0,
671 /*tag*/ eHTMLTag_input
,
672 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
673 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
674 /*autoclose starttags and endtags*/ &gInputAutoClose
,0,0,0,
675 /*parent,incl,exclgroups*/ kFormControl
, kNone
, kNone
,
676 /*special props, prop-range*/ kNonContainer
|kRequiresBody
,kDefaultPropRange
,
677 /*special parents,kids*/ 0,0,
680 /*tag*/ eHTMLTag_ins
,
681 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
682 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
683 /*autoclose starttags and endtags*/ 0,0,0,0,
684 /*parent,incl,exclgroups*/ kFlowEntity
, (kSelf
|kFlowEntity
), kNone
,
685 /*special props, prop-range*/ 0, kDefaultPropRange
,
686 /*special parents,kids*/ 0,0,
689 /*tag*/ eHTMLTag_isindex
,
690 /*requiredAncestor*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
691 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
692 /*autoclose starttags and endtags*/ 0,0,0,0,
693 /*parent,incl,exclgroups*/ kBlock
, kFlowEntity
, kNone
,
694 /*special props, prop-range*/ kNonContainer
|kRequiresBody
,kDefaultPropRange
,
695 /*special parents,kids*/ &gInBody
,0,
698 /*tag*/ eHTMLTag_kbd
,
699 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
700 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
701 /*autoclose starttags and endtags*/ 0,0,0,0,
702 /*parent,incl,exclgroups*/ kPhrase
, (kSelf
|kInlineEntity
), kNone
,
703 /*special props, prop-range*/ 0,kDefaultPropRange
,
704 /*special parents,kids*/ 0,0,
707 /*tag*/ eHTMLTag_keygen
,
708 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
709 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
710 /*autoclose starttags and endtags*/ 0,0,0,0,
711 /*parent,incl,exclgroups*/ kFlowEntity
, kNone
, kNone
,
712 /*special props, prop-range*/ kNonContainer
,kDefaultPropRange
,
713 /*special parents,kids*/ 0,0,
716 /*tag*/ eHTMLTag_label
,
717 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
718 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
719 /*autoclose starttags and endtags*/ 0,0,0,0,
720 /*parent,incl,exclgroups*/ kFormControl
, kInlineEntity
, kSelf
,
721 /*special props, prop-range*/ 0,kDefaultPropRange
,
722 /*special parents,kids*/ 0,&gLabelKids
,
725 /*tag*/ eHTMLTag_legend
,
726 /*requiredAncestor*/ eHTMLTag_fieldset
,eHTMLTag_unknown
,
727 /*rootnodes,endrootnodes*/ &gInFieldset
,&gInFieldset
,
728 /*autoclose starttags and endtags*/ 0,0,0,0,
729 /*parent,incl,exclgroups*/ kNone
, kInlineEntity
, kNone
,
730 /*special props, prop-range*/ kRequiresBody
,kDefaultPropRange
,
731 /*special parents,kids*/ &gInFieldset
,0,
735 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
736 /*rootnodes,endrootnodes*/ &gLIRootTags
,&gLIRootTags
,
737 /*autoclose starttags and endtags*/ &gLIAutoClose
,0,0,0,
738 /*parent,incl,exclgroups*/ kBlockEntity
, kFlowEntity
, kSelf
, // changed this back to kBlockEntity so we enable RS handling for phrasals. ref bug 181697
739 /*special props, prop-range*/ kNoPropagate
|kVerifyHierarchy
|kRequiresBody
, kDefaultPropRange
,
740 /*special parents,kids*/ 0,&gLIKids
,
743 /*tag*/ eHTMLTag_link
,
744 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
745 /*rootnodes,endrootnodes*/ &gInHead
,&gInHead
,
746 /*autoclose starttags and endtags*/ 0,0,0,0,
747 /*parent,incl,exclgroups*/ kAllTags
- kHeadContent
, kNone
, kNone
,
748 /*special props, prop-range*/ kNonContainer
|kPreferHead
|kLegalOpen
,kDefaultPropRange
,
749 /*special parents,kids*/ &gInHead
,0,
752 /*tag*/ eHTMLTag_listing
,
753 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
754 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
755 /*autoclose starttags and endtags*/ 0,0,0,0,
756 /*parent,incl,exclgroups*/ kPreformatted
, (kSelf
|kFlowEntity
), kNone
, //add flowentity to fix 54993
757 /*special props, prop-range*/ 0,kDefaultPropRange
,
758 /*special parents,kids*/ 0,0,
761 /*tag*/ eHTMLTag_map
,
762 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
763 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
764 /*autoclose starttags and endtags*/ 0,0,0,0,
765 /*parent,incl,exclgroups*/ kSpecial
, kInlineEntity
|kBlockEntity
, kNone
,
766 /*special props, prop-range*/ 0, kDefaultPropRange
,
767 /*special parents,kids*/ 0,&gMapKids
,
770 /*tag*/ eHTMLTag_marquee
,
771 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
772 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
773 /*autoclose starttags and endtags*/ 0,0,0,0,
774 /*parent,incl,exclgroups*/ kSpecial
, (kSelf
|kFlowEntity
), kNone
,
775 /*special props, prop-range*/ kRequiresBody
, kDefaultPropRange
,
776 /*special parents,kids*/ 0,0,
779 /*tag*/ eHTMLTag_menu
,
780 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
781 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
782 /*autoclose starttags and endtags*/ 0,0,0,0,
783 /*parent,incl,exclgroups*/ kList
, (kSelf
|kFlowEntity
), kNone
,
784 /*special props, prop-range*/ 0,kDefaultPropRange
,
785 /*special parents,kids*/ 0,&gULKids
,
788 /*tag*/ eHTMLTag_meta
,
789 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
790 /*rootnodes,endrootnodes*/ &gInHead
,&gInHead
,
791 /*autoclose starttags and endtags*/ 0,0,0,0,
792 /*parent,incl,exclgroups*/ kHeadContent
, kNone
, kNone
,
793 /*special props, prop-range*/ kNoStyleLeaksIn
|kNonContainer
, kDefaultPropRange
,
794 /*special parents,kids*/ &gInHead
,0,
797 /*tag*/ eHTMLTag_multicol
,
798 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
799 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
800 /*autoclose starttags and endtags*/ 0,0,0,0,
801 /*parent,incl,exclgroups*/ kBlock
, kFlowEntity
, kNone
,
802 /*special props, prop-range*/ 0,kDefaultPropRange
,
803 /*special parents,kids*/ 0,0,
806 /*tag*/ eHTMLTag_nobr
,
807 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
808 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
809 /*autoclose starttags and endtags*/ 0,0,0,0,
810 /*parent,incl,exclgroups*/ kExtensions
, kFlowEntity
, kNone
,
811 /*special props, prop-range*/ 0,kDefaultPropRange
,
812 /*special parents,kids*/ 0,0,
815 /*tag*/ eHTMLTag_noembed
,
816 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
817 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
818 /*autoclose starttags and endtags*/ 0,0,0,0,
819 /*parent,incl,exclgroups*/ kFlowEntity
, kFlowEntity
, kNone
,
820 /*special props, prop-range*/ 0, kNoPropRange
,
821 /*special parents,kids*/ 0,0,
824 /*tag*/ eHTMLTag_noframes
,
825 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
826 /*rootnodes,endrootnodes*/ &gNoframeRoot
,&gNoframeRoot
,
827 /*autoclose starttags and endtags*/ 0,0,0,0,
828 /*parent,incl,exclgroups*/ kFlowEntity
, kFlowEntity
, kNone
,
829 /*special props, prop-range*/ 0, kNoPropRange
,
830 /*special parents,kids*/ &gNoframeRoot
,0,
833 /*tag*/ eHTMLTag_noscript
,
834 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
835 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
836 /*autoclose starttags and endtags*/ 0,0,0,0,
837 /*parent,incl,exclgroups*/ kFlowEntity
|kHeadMisc
, kFlowEntity
|kSelf
, kNone
,
838 /*special props, prop-range*/ 0, kNoPropRange
,
839 /*special parents,kids*/ 0,0,
842 /*tag*/ eHTMLTag_object
,
843 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
844 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
845 /*autoclose starttags and endtags*/ 0,0,0,0,
846 /*parent,incl,exclgroups*/ kSpecial
, (kFlowEntity
|kSelf
), kNone
,
847 /*special props, prop-range*/ kNoStyleLeaksOut
|kPreferBody
,kDefaultPropRange
,
848 /*special parents,kids*/ 0,&gContainsParam
,
852 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
853 /*rootnodes,endrootnodes*/ &gOLRootTags
,&gOLRootTags
,
854 /*autoclose starttags and endtags*/ &gOLAutoClose
, &gULCloseTags
, 0,0,
855 /*parent,incl,exclgroups*/ kList
, (kFlowEntity
|kSelf
), kNone
,
856 /*special props, prop-range*/ 0,kDefaultPropRange
,
857 /*special parents,kids*/ 0,&gULKids
,
860 /*tag*/ eHTMLTag_optgroup
,
861 /*requiredAncestor*/ eHTMLTag_select
,eHTMLTag_unknown
,
862 /*rootnodes,endrootnodes*/ &gOptgroupParents
,&gOptgroupParents
,
863 /*autoclose starttags and endtags*/ 0,0,0,0,
864 /*parent,incl,exclgroups*/ kNone
, kNone
, kNone
,
865 /*special props, prop-range*/ 0,kDefaultPropRange
,
866 /*special parents,kids*/ &gOptgroupParents
,&gContainsOpts
,
869 /*tag*/ eHTMLTag_option
,
870 /*requiredAncestor*/ eHTMLTag_select
,eHTMLTag_unknown
,
871 /*rootnodes,endrootnodes*/ &gOptgroupParents
,&gOptgroupParents
,
872 /*autoclose starttags and endtags*/ 0,0,0,0,
873 /*parent,incl,exclgroups*/ kNone
, kPCDATA
, kFlowEntity
|kHeadMisc
,
874 /*special props, prop-range*/ kNoStyleLeaksIn
|kNoPropagate
, kDefaultPropRange
,
875 /*special parents,kids*/ &gOptgroupParents
,&gContainedInOpt
,
879 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
880 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
881 /*autoclose starttags and endtags*/ 0,0,0,0,
882 /*parent,incl,exclgroups*/ kBlock
, kInlineEntity
, kNone
, //this used to contain FLOW. But it's really an inline container.
883 /*special props, prop-range*/ kHandleStrayTag
,kDefaultPropRange
, //otherwise it tries to contain things like H1..H6
884 /*special parents,kids*/ 0,&gInP
,
887 /*tag*/ eHTMLTag_param
,
888 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
889 /*rootnodes,endrootnodes*/ &gParamParents
,&gParamParents
,
890 /*autoclose starttags and endtags*/ &gPAutoClose
,0,0,0,
891 /*parent,incl,exclgroups*/ kNone
, kNone
, kNone
,
892 /*special props, prop-range*/ kNonContainer
, kNoPropRange
,
893 /*special parents,kids*/ &gParamParents
,0,
896 /*tag*/ eHTMLTag_plaintext
,
897 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
898 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
899 /*autoclose starttags and endtags*/ 0,0,0,0,
900 /*parent,incl,exclgroups*/ kExtensions
, kCDATA
, kNone
,
901 /*special props, prop-range*/ 0, kDefaultPropRange
,
902 /*special parents,kids*/ 0,0,
905 /*tag*/ eHTMLTag_pre
,
906 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
907 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
908 /*autoclose starttags and endtags*/ 0,0,0,0,
909 /*parent,incl,exclgroups*/ kBlock
|kPreformatted
, (kSelf
|kFlowEntity
), kNone
, // Note: PRE is a block level element - bug 80009
910 /*special props, prop-range*/ kRequiresBody
, kDefaultPropRange
,
911 /*special parents,kids*/ 0,&gPreKids
,
915 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
916 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
917 /*autoclose starttags and endtags*/ 0,0,0,0,
918 /*parent,incl,exclgroups*/ kSpecial
, (kSelf
|kInlineEntity
), kNone
,
919 /*special props, prop-range*/ 0, kDefaultPropRange
,
920 /*special parents,kids*/ 0,0,
924 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
925 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
926 /*autoclose starttags and endtags*/ 0,0,0,0,
927 /*parent,incl,exclgroups*/ kFontStyle
, (kSelf
|kInlineEntity
), kNone
,
928 /*special props, prop-range*/ 0, kDefaultPropRange
,
929 /*special parents,kids*/ 0,0,
932 /*tag*/ eHTMLTag_samp
,
933 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
934 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
935 /*autoclose starttags and endtags*/ 0,0,0,0,
936 /*parent,incl,exclgroups*/ kPhrase
, (kSelf
|kInlineEntity
), kNone
,
937 /*special props, prop-range*/ 0,kDefaultPropRange
,
938 /*special parents,kids*/ 0,0,
941 /*tag*/ eHTMLTag_script
,
942 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
943 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
944 /*autoclose starttags and endtags*/ 0,0,0,0,
945 /*parent,incl,exclgroups*/ (kSpecial
|kHeadContent
), kCDATA
, kNone
, // note: this is kHeadContent since shipping this breaks things.
946 /*special props, prop-range*/ kNoStyleLeaksIn
|kLegalOpen
, kNoPropRange
,
947 /*special parents,kids*/ 0,&gContainsText
,
950 /*tag*/ eHTMLTag_select
,
951 /*requiredAncestor*/ eHTMLTag_unknown
, eHTMLTag_unknown
,
952 /*rootnodes,endrootnodes*/ &gInForm
,&gInForm
,
953 /*autoclose starttags and endtags*/ &gInputAutoClose
,0,0,0,
954 /*parent,incl,exclgroups*/ kFormControl
, kNone
, kFlowEntity
|kDLChild
|kHeadMisc
, // Added kHeadMisc to fix bug 287349
955 /*special props, prop-range*/ kNoPropagate
|kNoStyleLeaksIn
|kRequiresBody
, kDefaultPropRange
,
956 /*special parents,kids*/ &gInForm
,&gContainsOpts
,
959 /*tag*/ eHTMLTag_small
,
960 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
961 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
962 /*autoclose starttags and endtags*/ 0,0,0,0,
963 /*parent,incl,exclgroups*/ kFontStyle
, (kSelf
|kInlineEntity
), kNone
,
964 /*special props, prop-range*/ 0, kDefaultPropRange
,
965 /*special parents,kids*/ 0,0,
967 #if defined(MOZ_MEDIA)
969 /*tag*/ eHTMLTag_source
,
970 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
971 /*rootnodes,endrootnodes*/ &gSourceParents
,&gSourceParents
,
972 /*autoclose starttags and endtags*/ &gPAutoClose
, 0, 0,0,
973 /*parent,incl,exclgroups*/ kNone
, kNone
, kNone
,
974 /*special props, prop-range*/ kNonContainer
,kNoPropRange
,
975 /*special parents,kids*/ &gSourceParents
,0,
980 /*tag*/ eHTMLTag_spacer
,
981 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
982 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
983 /*autoclose starttags and endtags*/ 0,0,0,0,
984 /*parent,incl,exclgroups*/ kExtensions
, kNone
, kNone
,
985 /*special props, prop-range*/ kNonContainer
,kDefaultPropRange
,
986 /*special parents,kids*/ 0,0,
990 // I made span a special% tag again, (instead of inline).
991 // This fixes the case: <font color="blue"><p><span>text</span>
993 /*tag*/ eHTMLTag_span
,
994 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
995 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
996 /*autoclose starttags and endtags*/ 0,0,0,0,
997 /*parent,incl,exclgroups*/ kSpecial
, (kInlineEntity
|kSelf
|kFlowEntity
), kNone
,
998 /*special props, prop-range*/ 0,kDefaultPropRange
,
999 /*special parents,kids*/ 0,0,
1003 /*tag*/ eHTMLTag_strike
,
1004 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1005 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
1006 /*autoclose starttags and endtags*/ 0,0,0,0,
1007 /*parent,incl,exclgroups*/ kFontStyle
, (kSelf
|kInlineEntity
), kNone
,
1008 /*special props, prop-range*/ 0, kDefaultPropRange
,
1009 /*special parents,kids*/ 0,0,
1013 /*tag*/ eHTMLTag_strong
,
1014 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1015 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
1016 /*autoclose starttags and endtags*/ 0,0,0,0,
1017 /*parent,incl,exclgroups*/ kPhrase
, (kSelf
|kInlineEntity
), kNone
, //changed this to inline per spec; fix bug 44584.
1018 /*special props, prop-range*/ 0, kDefaultPropRange
,
1019 /*special parents,kids*/ 0,&gContainsText
,
1023 /*tag*/ eHTMLTag_style
,
1024 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1025 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
1026 /*autoclose starttags and endtags*/ 0,0,0,0,
1027 /*parent,incl,exclgroups*/ kAllTags
- kHeadContent
, kCDATA
, kNone
,
1028 /*special props, prop-range*/ kNoStyleLeaksIn
|kPreferHead
|kLegalOpen
, kNoPropRange
,
1029 /*special parents,kids*/ 0,0,
1032 /*tag*/ eHTMLTag_sub
,
1033 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1034 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
1035 /*autoclose starttags and endtags*/ 0,0,0,0,
1036 /*parent,incl,exclgroups*/ kSpecial
, (kSelf
|kInlineEntity
), kNone
,
1037 /*special props, prop-range*/ 0, kDefaultPropRange
,
1038 /*special parents,kids*/ 0,0,
1042 /*tag*/ eHTMLTag_sup
,
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
, (kSelf
|kInlineEntity
), kNone
,
1047 /*special props, prop-range*/ 0, kDefaultPropRange
,
1048 /*special parents,kids*/ 0,0,
1051 /*tag*/ eHTMLTag_table
,
1052 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1053 /*rootnodes,endrootnodes*/ &gTableRootTags
,&gTableRootTags
,
1054 /*autoclose starttags and endtags*/ 0,&gTableCloseTags
,0,0,
1055 /*parent,incl,exclgroups*/ kBlock
, kNone
, (kSelf
|kInlineEntity
),
1056 /*special props, prop-range*/ (kBadContentWatch
|kNoStyleLeaksIn
|kRequiresBody
), 2,
1057 /*special parents,kids*/ 0,&gTableKids
,
1060 /*tag*/ eHTMLTag_tbody
,
1061 /*requiredAncestor*/ eHTMLTag_table
, eHTMLTag_unknown
,
1062 /*rootnodes,endrootnodes*/ &gInTable
,&gInTable
,
1063 /*autoclose starttags and endtags*/ &gTBodyAutoClose
,0,0,0,
1064 /*parent,incl,exclgroups*/ kNone
, kNone
, (kSelf
|kInlineEntity
),
1065 /*special props, prop-range*/ (kNoPropagate
|kBadContentWatch
|kNoStyleLeaksIn
|kNoStyleLeaksOut
), kDefaultPropRange
,
1066 /*special parents,kids*/ &gInTable
,&gTBodyKids
,
1069 /*tag*/ eHTMLTag_td
,
1070 /*requiredAncestor*/ eHTMLTag_table
, eHTMLTag_unknown
,
1071 /*rootnodes,endrootnodes*/ &gTDRootTags
,&gTDRootTags
,
1072 /*autoclose starttags and endtags*/ &gTDCloseTags
,&gTDCloseTags
,0,&gExcludableParents
,
1073 /*parent,incl,exclgroups*/ kNone
, kFlowEntity
, kSelf
,
1074 /*special props, prop-range*/ kNoStyleLeaksIn
|kNoStyleLeaksOut
, kDefaultPropRange
,
1075 /*special parents,kids*/ &gTDRootTags
,&gBodyKids
,
1078 /*tag*/ eHTMLTag_textarea
,
1079 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1080 /*rootnodes,endrootnodes*/ &gInForm
,&gInForm
,
1081 /*autoclose starttags and endtags*/ &gInputAutoClose
,0,0,0,
1082 /*parent,incl,exclgroups*/ kFormControl
, kPCDATA
, kNone
,
1083 /*special props, prop-range*/ kRequiresBody
|kNoStyleLeaksIn
,kDefaultPropRange
,
1084 /*special parents,kids*/ &gInForm
,&gContainsText
,
1087 /*tag*/ eHTMLTag_tfoot
,
1088 /*requiredAncestor*/ eHTMLTag_table
, eHTMLTag_unknown
,
1089 /*rootnodes,endrootnodes*/ &gInTable
,&gInTable
,
1090 /*autoclose starttags and endtags*/ &gTBodyAutoClose
,0,0,0,
1091 /*parent,incl,exclgroups*/ kNone
, kNone
, kSelf
,
1092 /*special props, prop-range*/ (kNoPropagate
|kBadContentWatch
|kNoStyleLeaksIn
|kNoStyleLeaksOut
), kNoPropRange
,
1093 /*special parents,kids*/ &gInTable
,&gTableElemKids
,
1096 /*tag*/ eHTMLTag_th
,
1097 /*requiredAncestor*/ eHTMLTag_table
, eHTMLTag_unknown
,
1098 /*rootnodes,endrootnodes*/ &gTDRootTags
,&gTDRootTags
,
1099 /*autoclose starttags and endtags*/ &gTDCloseTags
,&gTDCloseTags
,0,0,
1100 /*parent,incl,exclgroups*/ kNone
, kFlowEntity
, kSelf
,
1101 /*special props, prop-range*/ (kNoStyleLeaksIn
|kNoStyleLeaksOut
), kDefaultPropRange
,
1102 /*special parents,kids*/ &gTDRootTags
,&gBodyKids
,
1105 /*tag*/ eHTMLTag_thead
,
1106 /*req-parent excl-parent*/ eHTMLTag_table
,eHTMLTag_unknown
, //fix bug 54840...
1107 /*rootnodes,endrootnodes*/ &gInTable
,&gInTable
,
1108 /*autoclose starttags and endtags*/ &gTBodyAutoClose
,0,0,0,
1109 /*parent,incl,exclgroups*/ kNone
, kNone
, kSelf
,
1110 /*special props, prop-range*/ (kNoPropagate
|kBadContentWatch
|kNoStyleLeaksIn
|kNoStyleLeaksOut
), kNoPropRange
,
1111 /*special parents,kids*/ &gInTable
,&gTableElemKids
,
1114 /*tag*/ eHTMLTag_title
,
1115 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1116 /*rootnodes,endrootnodes*/ &gInHead
,&gInHead
,
1117 /*autoclose starttags and endtags*/ 0,0,0,0,
1118 /*parent,incl,exclgroups*/ kHeadContent
,kPCDATA
, kNone
,
1119 /*special props, prop-range*/ kNoStyleLeaksIn
, kNoPropRange
,
1120 /*special parents,kids*/ &gInHead
,&gContainsText
,
1123 /*tag*/ eHTMLTag_tr
,
1124 /*requiredAncestor*/ eHTMLTag_table
, eHTMLTag_unknown
,
1125 /*rootnodes,endrootnodes*/ &gTRParents
,&gTREndParents
,
1126 /*autoclose starttags and endtags*/ &gTRCloseTags
,0,0,0,
1127 /*parent,incl,exclgroups*/ kNone
, kNone
, kInlineEntity
,
1128 /*special props, prop-range*/ (kBadContentWatch
|kNoStyleLeaksIn
|kNoStyleLeaksOut
), kNoPropRange
,
1129 /*special parents,kids*/ &gTRParents
,&gTRKids
,
1132 /*tag*/ eHTMLTag_tt
,
1133 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1134 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
1135 /*autoclose starttags and endtags*/ 0,0,0,0,
1136 /*parent,incl,exclgroups*/ kFontStyle
, (kSelf
|kInlineEntity
), kNone
,
1137 /*special props, prop-range*/ 0, kDefaultPropRange
,
1138 /*special parents,kids*/ 0,0,
1142 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1143 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
1144 /*autoclose starttags and endtags*/ 0,0,0,0,
1145 /*parent,incl,exclgroups*/ kFontStyle
, (kSelf
|kInlineEntity
), kNone
,
1146 /*special props, prop-range*/ 0, kDefaultPropRange
,
1147 /*special parents,kids*/ 0,0,
1150 /*tag*/ eHTMLTag_ul
,
1151 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1152 /*rootnodes,endrootnodes*/ &gOLRootTags
,&gOLRootTags
,
1153 /*autoclose starttags and endtags*/ &gULAutoClose
,&gULCloseTags
,0,0,
1154 /*parent,incl,exclgroups*/ kList
, (kFlowEntity
|kSelf
), kNone
,
1155 /*special props, prop-range*/ 0,kDefaultPropRange
,
1156 /*special parents,kids*/ 0,&gULKids
,
1159 /*tag*/ eHTMLTag_var
,
1160 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1161 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
1162 /*autoclose starttags and endtags*/ 0,0,0,0,
1163 /*parent,incl,exclgroups*/ kPhrase
, (kSelf
|kInlineEntity
), kNone
,
1164 /*special props, prop-range*/ 0,kDefaultPropRange
,
1165 /*special parents,kids*/ 0,0,
1167 #if defined(MOZ_MEDIA)
1169 /*tag*/ eHTMLTag_video
,
1170 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1171 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
1172 /*autoclose starttags and endtags*/ 0, 0, 0,0,
1173 /*parent,incl,exclgroups*/ kSpecial
, (kFlowEntity
|kSelf
), kNone
,
1174 /*special props, prop-range*/ 0,kDefaultPropRange
,
1175 /*special parents,kids*/ 0,&gVideoKids
,
1179 /*tag*/ eHTMLTag_wbr
,
1180 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1181 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
1182 /*autoclose starttags and endtags*/ 0,0,0,0,
1183 /*parent,incl,exclgroups*/ kExtensions
, kNone
, kNone
,
1184 /*special props, prop-range*/ kNonContainer
|kRequiresBody
,kNoPropRange
,
1185 /*special parents,kids*/ 0,0,
1188 /*tag*/ eHTMLTag_xmp
,
1189 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1190 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
1191 /*autoclose starttags and endtags*/ 0,0,0,0,
1192 /*parent,incl,exclgroups*/ kInlineEntity
|kPreformatted
, kCDATA
, kNone
,
1193 /*special props, prop-range*/ kNone
,kDefaultPropRange
,
1194 /*special parents,kids*/ 0,0,
1197 /*tag*/ eHTMLTag_text
,
1198 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1199 /*rootnodes,endrootnodes*/ &gInBody
,&gInBody
,
1200 /*autoclose starttags and endtags*/ 0,0,0,0,
1201 /*parent,incl,exclgroups*/ kFlowEntity
, kNone
, kNone
,
1202 /*special props, prop-range*/ kNonContainer
|kRequiresBody
,kNoPropRange
,
1203 /*special parents,kids*/ 0,0,
1206 // Whitespace must have a parent model of kHeadMisc to ensure that we
1207 // do the right thing for whitespace in the head section of a document.
1208 // (i.e., it must be non-exclusively a child of the head).
1210 /*tag*/ eHTMLTag_whitespace
,
1211 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1212 /*rootnodes,endrootnodes*/ &gInBody
,&gInBody
,
1213 /*autoclose starttags and endtags*/ 0,0,0,0,
1214 /*parent,incl,exclgroups*/ kFlowEntity
|kHeadMisc
, kNone
, kNone
,
1215 /*special props, prop-range*/ kNonContainer
|kLegalOpen
,kNoPropRange
,
1216 /*special parents,kids*/ 0,0,
1219 // Newlines must have a parent model of kHeadMisc to ensure that we
1220 // do the right thing for whitespace in the head section of a document.
1221 // (i.e., it must be non-exclusively a child of the head).
1223 /*tag*/ eHTMLTag_newline
,
1224 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1225 /*rootnodes,endrootnodes*/ &gInBody
,&gInBody
,
1226 /*autoclose starttags and endtags*/ 0,0,0,0,
1227 /*parent,incl,exclgroups*/ kFlowEntity
|kHeadMisc
, kNone
, kNone
,
1228 /*special props, prop-range*/ kNonContainer
|kLegalOpen
, kNoPropRange
,
1229 /*special parents,kids*/ 0,0,
1232 // Comments must have a parent model of kHeadMisc to ensure that we
1233 // do the right thing for whitespace in the head section of a document
1234 // (i.e., it must be non-exclusively a child of the head).
1236 /*tag*/ eHTMLTag_comment
,
1237 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1238 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
1239 /*autoclose starttags and endtags*/ 0,0,0,0,
1240 /*parent,incl,exclgroups*/ kFlowEntity
|kHeadMisc
, kNone
, kNone
,
1241 /*special props, prop-range*/ kOmitEndTag
|kLegalOpen
,kNoPropRange
,
1242 /*special parents,kids*/ 0,0,
1245 /*tag*/ eHTMLTag_entity
,
1246 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1247 /*rootnodes,endrootnodes*/ &gInBody
,&gInBody
,
1248 /*autoclose starttags and endtags*/ 0,0,0,0,
1249 /*parent,incl,exclgroups*/ kFlowEntity
, kNone
, kNone
,
1250 /*special props, prop-range*/ 0, kNoPropRange
,
1251 /*special parents,kids*/ 0,0,
1254 /*tag*/ eHTMLTag_doctypeDecl
,
1255 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1256 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
1257 /*autoclose starttags and endtags*/ 0,0,0,0,
1258 /*parent,incl,exclgroups*/ kFlowEntity
, kNone
, kNone
,
1259 /*special props, prop-range*/ kOmitEndTag
,kNoPropRange
,
1260 /*special parents,kids*/ 0,0,
1263 /*tag*/ eHTMLTag_markupDecl
,
1264 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1265 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
1266 /*autoclose starttags and endtags*/ 0,0,0,0,
1267 /*parent,incl,exclgroups*/ kFlowEntity
, kNone
, kNone
,
1268 /*special props, prop-range*/ kOmitEndTag
,kNoPropRange
,
1269 /*special parents,kids*/ 0,0,
1272 /*tag*/ eHTMLTag_instruction
,
1273 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_unknown
,
1274 /*rootnodes,endrootnodes*/ 0,0,
1275 /*autoclose starttags and endtags*/ 0,0,0,0,
1276 /*parent,incl,exclgroups*/ kFlowEntity
, kNone
, kNone
,
1277 /*special props, prop-range*/ kOmitEndTag
,kNoPropRange
,
1278 /*special parents,kids*/ 0,0,
1281 // Userdefined tags must have a parent model of kHeadMisc to ensure that
1282 // we do the right thing for whitespace in the head section of a document.
1283 // (i.e., it must be non-exclusively a child of the head).
1285 /*tag*/ eHTMLTag_userdefined
,
1286 /*req-parent excl-parent*/ eHTMLTag_unknown
,eHTMLTag_frameset
,
1287 /*rootnodes,endrootnodes*/ &gRootTags
,&gRootTags
,
1288 /*autoclose starttags and endtags*/ &gBodyAutoClose
,0,0,0,
1289 /*parent,incl,exclgroups*/ (kFlowEntity
|kHeadMisc
), (kInlineEntity
|kSelf
), kNone
, // Treat userdefined as inline element - Ref bug 56245,66772
1290 /*special props, prop-range*/ kPreferBody
, kBodyPropRange
,
1291 /*special parents,kids*/ &gInNoframes
,&gBodyKids
,
1296 void CheckElementTable() {
1297 for (eHTMLTags t
= eHTMLTag_unknown
; t
<= eHTMLTag_userdefined
; t
= eHTMLTags(t
+ 1)) {
1298 NS_ASSERTION(gHTMLElements
[t
].mTagID
== t
, "gHTMLElements entries does match tag list.");
1304 * Call this to find the index of a given child, or (if not found)
1305 * the index of its nearest synonym.
1307 * @update gess 3/25/98
1308 * @param aTagStack -- list of open tags
1309 * @param aTag -- tag to test for containership
1310 * @return index of kNotFound
1312 PRInt32
nsHTMLElement::GetIndexOfChildOrSynonym(nsDTDContext
& aContext
,eHTMLTags aChildTag
) {
1313 PRInt32 theChildIndex
=aContext
.LastOf(aChildTag
);
1314 if(kNotFound
==theChildIndex
) {
1315 const TagList
* theSynTags
=gHTMLElements
[aChildTag
].GetSynonymousTags(); //get the list of tags that THIS tag can close
1317 theChildIndex
=LastOf(aContext
,*theSynTags
);
1320 return theChildIndex
;
1325 * @update gess1/21/99
1329 PRBool
nsHTMLElement::HasSpecialProperty(PRInt32 aProperty
) const{
1330 PRBool result
=TestBits(mSpecialProperties
,aProperty
);
1336 * @update gess12/13/98
1340 PRBool
nsHTMLElement::IsContainer(eHTMLTags aChild
) {
1341 PRBool result
=(eHTMLTag_unknown
==aChild
);
1344 result
=!TestBits(gHTMLElements
[aChild
].mSpecialProperties
,kNonContainer
);
1350 * This tests whether all the bits in the parentbits
1351 * are included in the given set. It may be too
1352 * broad a question for most cases.
1354 * @update gess12/13/98
1358 PRBool
nsHTMLElement::IsMemberOf(PRInt32 aSet
) const{
1359 return TestBits(aSet
,mParentBits
);
1363 * This tests whether all the bits in the parentbits
1364 * are included in the given set. It may be too
1365 * broad a question for most cases.
1367 * @update gess12/13/98
1371 PRBool
nsHTMLElement::ContainsSet(PRInt32 aSet
) const{
1372 return TestBits(mParentBits
,aSet
);
1376 * This method determines whether the given tag closes other blocks.
1378 * @update gess 12/20/99 -- added H1..H6 to this list.
1382 PRBool
nsHTMLElement::IsBlockCloser(eHTMLTags aTag
){
1383 PRBool result
=PR_FALSE
;
1385 if((aTag
>=eHTMLTag_unknown
) & (aTag
<=eHTMLTag_xmp
)){
1387 result
=(gHTMLElements
[aTag
].IsBlock() ||
1388 gHTMLElements
[aTag
].IsBlockEntity() ||
1389 (kHeading
==gHTMLElements
[aTag
].mParentBits
));
1391 // NOBR is a block closure - Ref. Bug# 24462
1392 // DIR is a block closure - Ref. Bug# 25845
1393 // TD is a block closure - Ref. Bug# 27490
1394 // TR is a block closure - Ref. Bug# 26488
1395 // OBJECT is a block closure - Ref. Bug# 88992
1397 static eHTMLTags gClosers
[]={ eHTMLTag_table
,eHTMLTag_tbody
,
1398 eHTMLTag_td
,eHTMLTag_th
,
1399 eHTMLTag_tr
,eHTMLTag_caption
,
1400 eHTMLTag_object
,eHTMLTag_applet
,
1401 eHTMLTag_ol
, eHTMLTag_ul
,
1403 eHTMLTag_nobr
,eHTMLTag_dir
};
1405 result
=FindTagInSet(aTag
,gClosers
,sizeof(gClosers
)/sizeof(eHTMLTag_body
));
1414 * @update gess 01/04/99
1418 PRBool
nsHTMLElement::IsInlineEntity(eHTMLTags aTag
){
1419 PRBool result
=PR_FALSE
;
1420 if((aTag
>=eHTMLTag_unknown
) & (aTag
<=eHTMLTag_xmp
)){
1421 result
=TestBits(gHTMLElements
[aTag
].mParentBits
,kInlineEntity
);
1428 * @update gess 01/04/99
1432 PRBool
nsHTMLElement::IsFlowEntity(eHTMLTags aTag
){
1433 PRBool result
=PR_FALSE
;
1435 if((aTag
>=eHTMLTag_unknown
) & (aTag
<=eHTMLTag_xmp
)){
1436 result
=TestBits(gHTMLElements
[aTag
].mParentBits
,kFlowEntity
);
1443 * @update gess 01/04/99
1447 PRBool
nsHTMLElement::IsBlockParent(eHTMLTags aTag
){
1448 PRBool result
=PR_FALSE
;
1449 if((aTag
>=eHTMLTag_unknown
) & (aTag
<=eHTMLTag_xmp
)){
1450 result
=TestBits(gHTMLElements
[aTag
].mInclusionBits
,kBlockEntity
);
1457 * @update gess 01/04/99
1461 PRBool
nsHTMLElement::IsInlineParent(eHTMLTags aTag
){
1462 PRBool result
=PR_FALSE
;
1463 if((aTag
>=eHTMLTag_unknown
) & (aTag
<=eHTMLTag_xmp
)){
1464 result
=TestBits(gHTMLElements
[aTag
].mInclusionBits
,kInlineEntity
);
1472 * @update gess 01/04/99
1476 PRBool
nsHTMLElement::IsFlowParent(eHTMLTags aTag
){
1477 PRBool result
=PR_FALSE
;
1478 if((aTag
>=eHTMLTag_unknown
) & (aTag
<=eHTMLTag_xmp
)){
1479 result
=TestBits(gHTMLElements
[aTag
].mInclusionBits
,kFlowEntity
);
1486 * @update harishd 11/19/99
1490 PRBool
nsHTMLElement::IsSpecialParent(eHTMLTags aTag
) const{
1491 PRBool result
=PR_FALSE
;
1492 if(mSpecialParents
) {
1493 if(FindTagInSet(aTag
,mSpecialParents
->mTags
,mSpecialParents
->mCount
))
1500 * Tells us whether the given tag opens a section
1501 * @update gess 01/04/99
1503 * @return TRUE if opens section
1505 PRBool
nsHTMLElement::IsSectionTag(eHTMLTags aTag
){
1506 PRBool result
=PR_FALSE
;
1509 case eHTMLTag_frameset
:
1523 * @update gess 01/04/99
1527 PRBool
nsHTMLElement::CanContain(eHTMLTags aParent
,eHTMLTags aChild
,nsDTDMode aMode
){
1528 PRBool result
=PR_FALSE
;
1529 if((aParent
>=eHTMLTag_unknown
) && (aParent
<=eHTMLTag_userdefined
)){
1530 result
=gHTMLElements
[aParent
].CanContain(aChild
,aMode
);
1537 * @update gess 01/04/99
1541 PRBool
nsHTMLElement::CanExclude(eHTMLTags aChild
) const{
1542 PRBool result
=PR_FALSE
;
1544 if(gHTMLElements
[aChild
].HasSpecialProperty(kLegalOpen
)) {
1545 // Some tags could be opened anywhere, in the document, as they please.
1549 //Note that special kids takes precedence over exclusions...
1551 if(FindTagInSet(aChild
,mSpecialKids
->mTags
,mSpecialKids
->mCount
)) {
1557 if(gHTMLElements
[aChild
].IsMemberOf(mExclusionBits
)) {
1566 * @update harishd 03/01/00
1570 PRBool
nsHTMLElement::IsExcludableParent(eHTMLTags aParent
) const{
1571 PRBool result
=PR_FALSE
;
1573 if(!IsTextTag(mTagID
)) {
1574 if(mExcludableParents
) {
1575 const TagList
* theParents
=mExcludableParents
;
1576 if(FindTagInSet(aParent
,theParents
->mTags
,theParents
->mCount
))
1580 // If you're a block parent make sure that you're not the
1581 // parent of a TABLE element. ex. <table><tr><td><div><td></tr></table>
1582 // IE & Nav. render this as table with two cells ( which I think is correct ).
1583 // NOTE: If need arise we could use the root node to solve this problem
1584 if(nsHTMLElement::IsBlockParent(aParent
)){
1586 case eHTMLTag_caption
:
1587 case eHTMLTag_thead
:
1588 case eHTMLTag_tbody
:
1589 case eHTMLTag_tfoot
:
1605 * @update gess 01/04/99
1609 PRBool
nsHTMLElement::CanOmitEndTag(void) const{
1610 PRBool result
=!IsContainer(mTagID
);
1612 result
=TestBits(mSpecialProperties
,kOmitEndTag
);
1617 * Returns whether a given tag can be a direct child of the <head> node of
1620 * @param aChild The tag in question.
1621 * @param aExclusively [out]Whether or not this tag can *only* appear in the
1622 * head (as opposed to things like <object> which can be
1623 either in the body or the head).
1624 * @return Whether this tag can appear in the head.
1626 PRBool
nsHTMLElement::IsChildOfHead(eHTMLTags aChild
,PRBool
& aExclusively
) {
1627 aExclusively
= PR_TRUE
;
1629 // Is this a head-only tag?
1630 if (gHTMLElements
[aChild
].mParentBits
& kHeadContent
) {
1635 // If not, check if it can appear in the head.
1636 if (gHTMLElements
[aChild
].mParentBits
& kHeadMisc
) {
1637 aExclusively
= PR_FALSE
;
1648 * @update gess12/13/98
1652 PRBool
nsHTMLElement::SectionContains(eHTMLTags aChild
,PRBool allowDepthSearch
) const {
1653 PRBool result
=PR_FALSE
;
1654 const TagList
* theRootTags
=gHTMLElements
[aChild
].GetRootTags();
1657 if(!FindTagInSet(mTagID
,theRootTags
->mTags
,theRootTags
->mCount
)){
1658 eHTMLTags theRootBase
=theRootTags
->mTags
[0];
1659 if((eHTMLTag_unknown
!=theRootBase
) && (allowDepthSearch
))
1660 result
=SectionContains(theRootBase
,allowDepthSearch
);
1662 else result
=PR_TRUE
;
1668 * This method should be called to determine if the a tags
1669 * hierarchy needs to be validated.
1671 * @update harishd 04/19/00
1676 PRBool
nsHTMLElement::ShouldVerifyHierarchy() const {
1677 PRBool result
=PR_FALSE
;
1679 // If the tag cannot contain itself then we need to make sure that
1680 // anywhere in the hierarchy we don't nest accidently.
1681 // Ex: <H1><LI><H1><LI>. Inner LI has the potential of getting nested
1682 // inside outer LI.If the tag can contain self, Ex: <A><B><A>,
1683 // ( B can contain self )then ask the child (<A>) if it requires a containment check.
1684 if(mTagID
!=eHTMLTag_userdefined
) {
1685 result
=HasSpecialProperty(kVerifyHierarchy
);
1692 * @update gess12/13/98
1696 PRBool
nsHTMLElement::IsResidualStyleTag(eHTMLTags aChild
) {
1697 PRBool result
=PR_FALSE
;
1703 case eHTMLTag_blink
:
1711 case eHTMLTag_small
:
1712 case eHTMLTag_strong
:
1713 case eHTMLTag_strike
:
1722 case eHTMLTag_acronym
:
1723 case eHTMLTag_center
:
1740 * @update gess12/13/98
1744 PRBool
nsHTMLElement::CanContainType(PRInt32 aType
) const{
1745 PRInt32 answer
=mInclusionBits
& aType
;
1746 PRBool result
=PRBool(0!=answer
);
1752 * @update gess12/13/98
1756 PRBool
nsHTMLElement::IsWhitespaceTag(eHTMLTags aChild
) {
1757 PRBool result
=PR_FALSE
;
1760 case eHTMLTag_newline
:
1761 case eHTMLTag_whitespace
:
1772 * @update gess12/13/98
1776 PRBool
nsHTMLElement::IsTextTag(eHTMLTags aChild
) {
1777 PRBool result
=PR_FALSE
;
1781 case eHTMLTag_entity
:
1782 case eHTMLTag_newline
:
1783 case eHTMLTag_whitespace
:
1794 * @update gess12/13/98
1798 PRBool
nsHTMLElement::CanContainSelf(void) const {
1799 PRBool result
=PRBool(TestBits(mInclusionBits
,kSelf
)!=0);
1804 * This method is called to determine (once and for all) whether a start tag
1805 * can close another tag on the stack. This method will return
1806 * false if something prevents aParentTag from closing.
1808 * @update gess 12/20/99
1809 * @param aContext is the tag stack we're testing against
1810 * @param aIndex is the index of the tag we want to close
1811 * @param aChildTag is the child we're trying to close
1812 * @return TRUE if we can autoclose the start tag; FALSE otherwise
1814 PRBool
nsHTMLElement::CanAutoCloseTag(nsDTDContext
& aContext
,PRInt32 aIndex
,
1815 eHTMLTags aChildTag
) const{
1818 PRBool result
= PR_TRUE
;
1819 eHTMLTags thePrevTag
;
1821 for(thePos
= aContext
.GetCount() - 1; thePos
>= aIndex
; thePos
--) {
1822 thePrevTag
= aContext
.TagAt(thePos
);
1824 if (thePrevTag
== eHTMLTag_applet
||
1825 thePrevTag
== eHTMLTag_td
) {
1836 * @update gess 10.17.2000
1840 eHTMLTags
nsHTMLElement::GetCloseTargetForEndTag(nsDTDContext
& aContext
,PRInt32 anIndex
,nsDTDMode aMode
) const{
1841 eHTMLTags result
=eHTMLTag_unknown
;
1843 int theCount
=aContext
.GetCount();
1844 int theIndex
=theCount
;
1846 if(IsMemberOf(kPhrase
)){
1848 while((--theIndex
>=anIndex
) && (eHTMLTag_unknown
==result
)){
1849 eHTMLTags theTag
= aContext
.TagAt(theIndex
);
1850 if(theTag
!= mTagID
) {
1851 // Allow phrasals to close userdefined tags. bug 256731
1852 if(eHTMLTag_userdefined
== theTag
) {
1853 continue; // We can close this.
1856 // Fixes a derivative of bug 22842...
1857 if(CanContainType(kBlock
)) { // INS/DEL can contain blocks.
1858 if(gHTMLElements
[eHTMLTags(theTag
)].IsMemberOf(kBlockEntity
) ||
1859 gHTMLElements
[eHTMLTags(theTag
)].IsMemberOf(kFlowEntity
)) {
1860 if(HasOptionalEndTag(theTag
)) {
1861 continue; // Then I can close it.
1866 // Phrasal elements can close other phrasals, along with fontstyle,
1867 // extensions, and special tags...
1868 if(!gHTMLElements
[theTag
].IsMemberOf(kSpecial
|
1871 kExtensions
)) { //fix bug 56665
1872 break; // It's not something I can close
1876 result
=theTag
; // Stop because you just found yourself on the stack
1882 else if(IsMemberOf(kSpecial
)){
1884 while((--theIndex
>=anIndex
) && (eHTMLTag_unknown
==result
)){
1885 eHTMLTags theTag
=aContext
.TagAt(theIndex
);
1886 if(theTag
!=mTagID
) {
1887 // Special elements can close other specials, along with fontstyle
1888 // extensions, and phrasal tags...
1890 // Added Phrasal to fix bug 26347
1891 if((eHTMLTag_userdefined
==theTag
) ||
1892 gHTMLElements
[theTag
].IsSpecialEntity() ||
1893 gHTMLElements
[theTag
].IsFontStyleEntity()||
1894 gHTMLElements
[theTag
].IsPhraseEntity() ||
1895 gHTMLElements
[theTag
].IsMemberOf(kExtensions
)) {
1900 // Fixes bug 22842...
1901 if(CanContainType(kBlock
)) {
1902 if(gHTMLElements
[eHTMLTags(theTag
)].IsMemberOf(kBlockEntity
) ||
1903 gHTMLElements
[eHTMLTags(theTag
)].IsMemberOf(kFlowEntity
)) {
1904 if(HasOptionalEndTag(theTag
)) {
1905 continue; // Then I can close it.
1909 break; // It's not something I can close
1913 result
=theTag
; // Stop because you just found yourself on the stack
1919 else if(ContainsSet(kPreformatted
) ||
1920 IsMemberOf(kFormControl
|kExtensions
|kPreformatted
)){ //bug54834...
1922 while((--theIndex
>=anIndex
) && (eHTMLTag_unknown
==result
)){
1923 eHTMLTags theTag
=aContext
.TagAt(theIndex
);
1924 if(theTag
!=mTagID
) {
1925 if(!CanContain(theTag
,aMode
)) {
1926 break; //it's not something I can close
1930 result
=theTag
; //stop because you just found yourself on the stack
1936 else if(IsMemberOf(kList
)){
1938 while((--theIndex
>=anIndex
) && (eHTMLTag_unknown
==result
)){
1939 eHTMLTags theTag
=aContext
.TagAt(theIndex
);
1940 if(theTag
!=mTagID
) {
1941 if(!CanContain(theTag
,aMode
)) {
1942 break; //it's not something I can close
1946 result
=theTag
; //stop because you just found yourself on the stack
1952 else if(IsResidualStyleTag(mTagID
)){
1954 // Before finding a close target, for the current tag, make sure
1955 // that the tag above does not gate.
1956 // Note: we intentionally make 2 passes:
1957 // The first pass tries to exactly match, the 2nd pass matches the group.
1959 const TagList
* theRootTags
=gHTMLElements
[mTagID
].GetEndRootTags();
1960 PRInt32 theIndexCopy
=theIndex
;
1961 while(--theIndex
>=anIndex
){
1962 eHTMLTags theTag
=aContext
.TagAt(theIndex
);
1963 if(theTag
== mTagID
) {
1964 return theTag
; // we found our target.
1966 else if (!CanContain(theTag
,aMode
) ||
1967 (theRootTags
&& FindTagInSet(theTag
,theRootTags
->mTags
,theRootTags
->mCount
))) {
1968 // If you cannot contain this tag then
1969 // you cannot close it either. It looks like
1970 // the tag trying to close is misplaced.
1971 // In the following Exs. notice the misplaced /font:
1972 // Ex. <font><table><tr><td></font></td></tr></table. -- Ref. bug 56245
1973 // Ex. <font><select><option></font></select> -- Ref. bug 37618
1974 // Ex. <font><select></font><option></select> -- Ref. bug 98187
1975 return eHTMLTag_unknown
;
1979 theIndex
=theIndexCopy
;
1980 while(--theIndex
>=anIndex
){
1981 eHTMLTags theTag
=aContext
.TagAt(theIndex
);
1982 if(gHTMLElements
[theTag
].IsMemberOf(mParentBits
)) {
1988 else if(gHTMLElements
[mTagID
].IsTableElement()) {
1990 //This fixes 57378...
1991 //example: <TABLE><THEAD><TR><TH></THEAD> which didn't close the <THEAD>
1993 PRInt32 theLastTable
=aContext
.LastOf(eHTMLTag_table
);
1994 PRInt32 theLastOfMe
=aContext
.LastOf(mTagID
);
1995 if(theLastTable
<theLastOfMe
) {
2001 else if(mTagID
== eHTMLTag_legend
) {
2002 while((--theIndex
>=anIndex
) && (eHTMLTag_unknown
==result
)){
2003 eHTMLTags theTag
= aContext
.TagAt(theIndex
);
2004 if (theTag
== mTagID
) {
2009 if (!CanContain(theTag
, aMode
)) {
2015 else if (mTagID
== eHTMLTag_head
) {
2016 while (--theIndex
>= anIndex
) {
2017 eHTMLTags tag
= aContext
.TagAt(theIndex
);
2018 if (tag
== eHTMLTag_html
) {
2019 // HTML gates head closing, but the head should never be the parent of
2024 if (tag
== eHTMLTag_head
) {
2025 result
= eHTMLTag_head
;
2036 * See whether this tag can DIRECTLY contain the given child.
2037 * @update gess12/13/98
2041 PRBool
nsHTMLElement::CanContain(eHTMLTags aChild
,nsDTDMode aMode
) const{
2044 if(IsContainer(mTagID
)){
2046 if(gHTMLElements
[aChild
].HasSpecialProperty(kLegalOpen
)) {
2047 // Some tags could be opened anywhere, in the document, as they please.
2051 if(mTagID
==aChild
) {
2052 return CanContainSelf(); //not many tags can contain themselves...
2055 const TagList
* theCloseTags
=gHTMLElements
[aChild
].GetAutoCloseStartTags();
2057 if(FindTagInSet(mTagID
,theCloseTags
->mTags
,theCloseTags
->mCount
))
2061 if(gHTMLElements
[aChild
].mExcludableParents
) {
2062 const TagList
* theParents
=gHTMLElements
[aChild
].mExcludableParents
;
2063 if(FindTagInSet(mTagID
,theParents
->mTags
,theParents
->mCount
))
2067 if(gHTMLElements
[aChild
].IsExcludableParent(mTagID
))
2070 if(gHTMLElements
[aChild
].IsBlockCloser(aChild
)){
2071 if(nsHTMLElement::IsBlockParent(mTagID
)){
2076 if(nsHTMLElement::IsInlineEntity(aChild
)){
2077 if(nsHTMLElement::IsInlineParent(mTagID
)){
2082 if(nsHTMLElement::IsFlowEntity(aChild
)) {
2083 if(nsHTMLElement::IsFlowParent(mTagID
)){
2088 if(nsHTMLElement::IsTextTag(aChild
)) {
2089 // Allow <xmp> to contain text.
2090 if(nsHTMLElement::IsInlineParent(mTagID
) || CanContainType(kCDATA
)){
2095 if(CanContainType(gHTMLElements
[aChild
].mParentBits
)) {
2100 if(FindTagInSet(aChild
,mSpecialKids
->mTags
,mSpecialKids
->mCount
)) {
2105 // Allow <p> to contain <table> only in Quirks mode, bug 43678 and bug 91927
2106 if (aChild
== eHTMLTag_table
&& mTagID
== eHTMLTag_p
&& aMode
== eDTDMode_quirks
) {
2115 void nsHTMLElement::DebugDumpContainment(const char* aFilename
,const char* aTitle
){
2118 void nsHTMLElement::DebugDumpMembership(const char* aFilename
){
2121 void nsHTMLElement::DebugDumpContainType(const char* aFilename
){