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