KHtml

dtd.cpp
1 /**
2  * This file is part of the DOM implementation for KDE.
3  *
4  * Copyright (C) 1999 Lars Knoll ([email protected])
5  * (C) 2006-2007 Allan Sandfeld Jensen ([email protected])
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public License
18  * along with this library; see the file COPYING.LIB. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  *
22  */
23 
24 #include "html/dtd.h"
25 
26 using namespace DOM;
27 
28 #include "khtml_debug.h"
29 
30 // priority of tags. Closing tags of higher priority close tags of lower
31 // priority.
32 // Update this list, whenever you change htmltags.*
33 //
34 // 0 elements with forbidden close tag and text. They don't get pushed
35 // to the stack.
36 // 1 formatting elements
37 // 3 form nobr noscript
38 // 5 phrasing elements
39 // 6 TD TH SELECT
40 // 7 TR
41 // 8 tbody thead tfoot
42 // 9 table
43 // 10 body frameset head noembed noframes
44 // 11 html
45 
46 const unsigned short DOM::tagPriorityArray[] = {
47  0, // 0
48  1, // ID_A == 1
49  1, // ID_ABBR
50  1, // ID_ACRONYM
51  5, // ID_ADDRESS
52  1, // ID_APPLET
53  0, // ID_AREA
54  1, // ID_AUDIO
55  1, // ID_B
56  0, // ID_BASE
57  0, // ID_BASEFONT
58  1, // ID_BDO
59  1, // ID_BIG
60  5, // ID_BLOCKQUOTE
61  10, // ID_BODY
62  0, // ID_BR
63  1, // ID_BUTTON
64  1, // ID_CANVAS
65  5, // ID_CAPTION
66  5, // ID_CENTER
67  1, // ID_CITE
68  1, // ID_CODE
69  0, // ID_COL
70  1, // ID_COLGROUP
71  5, // ID_DD
72  1, // ID_DEL
73  1, // ID_DFN
74  5, // ID_DIR
75  5, // ID_DIV
76  5, // ID_DL
77  5, // ID_DT
78  1, // ID_EM
79  0, // ID_EMBED
80  5, // ID_FIELDSET
81  1, // ID_FONT
82  3, // ID_FORM
83  0, // ID_FRAME
84  10,// ID_FRAMESET
85  5, // ID_H1
86  5, // ID_H2
87  5, // ID_H3
88  5, // ID_H4
89  5, // ID_H5
90  5, // ID_H6
91  10,// ID_HEAD
92  0, // ID_HR
93  11,// ID_HTML
94  1, // ID_I
95  1, // ID_IFRAME
96  1, // ID_ILAYER
97  0, // ID_IMAGE
98  0, // ID_IMG
99  0, // ID_INPUT
100  1, // ID_INS
101  0, // ID_ISINDEX
102  1, // ID_KBD
103  0, // ID_KEYGEN
104  1, // ID_LABEL
105  1, // ID_LAYER
106  1, // ID_LEGEND
107  5, // ID_LI
108  0, // ID_LINK
109  5, // ID_LISTING
110  1, // ID_MAP
111  5, // ID_MARQUEE
112  5, // ID_MENU
113  0, // ID_META
114  5, // ID_NOBR
115  10,// ID_NOEMBED
116  10,// ID_NOFRAMES
117  3, // ID_NOSCRIPT
118  1, // ID_NOLAYER
119  5, // ID_OBJECT
120  5, // ID_OL
121  1, // ID_OPTGROUP
122  2, // ID_OPTION
123  5, // ID_P
124  0, // ID_PARAM
125  5, // ID_PLAINTEXT
126  5, // ID_PRE
127  1, // ID_Q
128  1, // ID_S
129  1, // ID_SAMP
130  1, // ID_SCRIPT
131  6, // ID_SELECT
132  1, // ID_SMALL
133  0, // ID_SOURCE
134  1, // ID_SPAN
135  1, // ID_STRIKE
136  1, // ID_STRONG
137  1, // ID_STYLE
138  1, // ID_SUB
139  1, // ID_SUP
140  9, // ID_TABLE
141  8, // ID_TBODY
142  6, // ID_TD
143  1, // ID_TEXTAREA
144  8, // ID_TFOOT
145  6, // ID_TH
146  8, // ID_THEAD
147  1, // ID_TITLE
148  7, // ID_TR
149  1, // ID_TT
150  1, // ID_U
151  5, // ID_UL
152  1, // ID_VAR
153  1, // ID_VIDEO
154  0, // ID_WBR
155  5, // ID_XMP
156  0, // ID_TEXT
157  0 // ID_COMMENT
158 };
159 
160 const tagStatus DOM::endTagArray[] = {
161  REQUIRED, // 0
162  REQUIRED, // ID_A == 1
163  REQUIRED, // ID_ABBR
164  REQUIRED, // ID_ACRONYM
165  REQUIRED, // ID_ADDRESS
166  REQUIRED, // ID_APPLET
167  FORBIDDEN, // ID_AREA
168  REQUIRED, // ID_AUDIO
169  REQUIRED, // ID_B
170  FORBIDDEN, // ID_BASE
171  FORBIDDEN, // ID_BASEFONT
172  REQUIRED, // ID_BDO
173  REQUIRED, // ID_BIG
174  REQUIRED, // ID_BLOCKQUOTE
175  REQUIRED, // ID_BODY
176  FORBIDDEN, // ID_BR
177  REQUIRED, // ID_BUTTON
178  REQUIRED, // ID_CANVAS
179  REQUIRED, // ID_CAPTION
180  REQUIRED, // ID_CENTER
181  REQUIRED, // ID_CITE
182  REQUIRED, // ID_CODE
183  FORBIDDEN, // ID_COL
184  OPTIONAL, // ID_COLGROUP
185  OPTIONAL, // ID_DD
186  REQUIRED, // ID_DEL
187  REQUIRED, // ID_DFN
188  REQUIRED, // ID_DIR
189  REQUIRED, // ID_DIV
190  REQUIRED, // ID_DL
191  OPTIONAL, // ID_DT
192  REQUIRED, // ID_EM
193  REQUIRED, // ID_EMBED
194  REQUIRED, // ID_FIELDSET
195  REQUIRED, // ID_FONT
196  REQUIRED, // ID_FORM
197  FORBIDDEN, // ID_FRAME
198  REQUIRED, // ID_FRAMESET
199  REQUIRED, // ID_H1
200  REQUIRED, // ID_H2
201  REQUIRED, // ID_H3
202  REQUIRED, // ID_H4
203  REQUIRED, // ID_H5
204  REQUIRED, // ID_H6
205  OPTIONAL, // ID_HEAD
206  FORBIDDEN, // ID_HR
207  REQUIRED, // ID_HTML
208  REQUIRED, // ID_I
209  REQUIRED, // ID_IFRAME
210  REQUIRED, // ID_ILAYER
211  FORBIDDEN, // ID_IMAGE
212  FORBIDDEN, // ID_IMG
213  FORBIDDEN, // ID_INPUT
214  REQUIRED, // ID_INS
215  FORBIDDEN, // ID_ISINDEX
216  REQUIRED, // ID_KBD
217  REQUIRED, // ID_KEYGEN
218  REQUIRED, // ID_LABEL
219  REQUIRED, // ID_LAYER
220  REQUIRED, // ID_LEGEND
221  OPTIONAL, // ID_LI
222  FORBIDDEN, // ID_LINK
223  REQUIRED, // ID_LISTING
224  REQUIRED, // ID_MAP
225  REQUIRED, // ID_MARQUEE
226  REQUIRED, // ID_MENU
227  FORBIDDEN, // ID_META
228  REQUIRED, // ID_NOBR
229  REQUIRED, // ID_NOEMBED
230  REQUIRED, // ID_NOFRAMES
231  REQUIRED, // ID_NOSCRIPT
232  REQUIRED, // ID_NOLAYER
233  REQUIRED, // ID_OBJECT
234  REQUIRED, // ID_OL
235  REQUIRED, // ID_OPTGROUP
236  OPTIONAL, // ID_OPTION
237  OPTIONAL, // ID_P
238  FORBIDDEN, // ID_PARAM
239  REQUIRED, // ID_PLAINTEXT
240  REQUIRED, // ID_PRE
241  REQUIRED, // ID_Q
242  REQUIRED, // ID_S
243  REQUIRED, // ID_SAMP
244  REQUIRED, // ID_SCRIPT
245  REQUIRED, // ID_SELECT
246  REQUIRED, // ID_SMALL
247  FORBIDDEN, // ID_SOURCE
248  REQUIRED, // ID_SPAN
249  REQUIRED, // ID_STRIKE
250  REQUIRED, // ID_STRONG
251  REQUIRED, // ID_STYLE
252  REQUIRED, // ID_SUB
253  REQUIRED, // ID_SUP
254  REQUIRED, // ID_TABLE
255  OPTIONAL, // ID_TBODY
256  OPTIONAL, // ID_TD
257  REQUIRED, // ID_TEXTAREA
258  OPTIONAL, // ID_TFOOT
259  OPTIONAL, // ID_TH
260  OPTIONAL, // ID_THEAD
261  REQUIRED, // ID_TITLE
262  OPTIONAL, // ID_TR
263  REQUIRED, // ID_TT
264  REQUIRED, // ID_U
265  REQUIRED, // ID_UL
266  REQUIRED, // ID_VAR
267  REQUIRED, // ID_VIDEO
268  FORBIDDEN, // ID_WBR
269  REQUIRED, // ID_XMP
270  REQUIRED, // ID_TEXT
271  REQUIRED // ID_COMMENT
272 };
273 
274 // This a combination of HTML4.dtd XHTML11.dtd and various extensions
275 // and deprecated elements
276 static const ushort tag_list_inline[] = {
277  ID_TEXT,
278  // %fontstyle
279  ID_TT,
280  ID_I,
281  ID_B,
282  ID_BIG,
283  ID_SMALL,
284  ID_U, // legacy
285  ID_S, // legacy
286  ID_STRIKE, // legacy
287  ID_FONT, // legacy
288  ID_BASEFONT, // legacy
289  // %phrase
290  ID_EM,
291  ID_STRONG,
292  ID_DFN,
293  ID_CODE,
294  ID_Q,
295  ID_SAMP,
296  ID_KBD,
297  ID_VAR,
298  ID_CITE,
299  ID_ABBR,
300  ID_ACRONYM,
301  ID_SUB,
302  ID_SUP,
303  // %inline.forms
304  ID_INPUT,
305  ID_SELECT,
306  ID_TEXTAREA,
307  ID_LABEL,
308  ID_BUTTON,
309  // %special
310  ID_A,
311  ID_OBJECT,
312  ID_IMAGE,
313  ID_IMG,
314  ID_APPLET,
315  ID_IFRAME,
316  ID_EMBED, // ?
317  // %special.pre
318  ID_BR,
319  ID_SPAN,
320  ID_BDO,
321  ID_MAP,
322  // %misc.inline
323  ID_SCRIPT,
324  ID_INS,
325  ID_DEL,
326  // non-standard:
327  ID_ILAYER, // deprecated
328  ID_NOBR, // ?
329  ID_WBR, // ?
330  ID_CANVAS,
331  ID_AUDIO,
332  ID_VIDEO,
333  0
334 };
335 
336 static const ushort tag_list_quirk_inline[] = {
337  ID_NOSCRIPT, // block, but parsed as inline in Mozilla and MSIE
338  0
339 };
340 
341 static const ushort tag_list_block[] = {
342  ID_TEXT, // white-space is allowed
343  ID_P,
344  // %headings
345  ID_H1,
346  ID_H2,
347  ID_H3,
348  ID_H4,
349  ID_H5,
350  ID_H6,
351  // %lists
352  ID_UL,
353  ID_OL,
354  ID_DL,
355  ID_DIR, // legacy
356  ID_MENU, // legacy
357  // %blocktext
358  ID_LISTING,
359  ID_PRE,
360  ID_HR,
361  ID_BLOCKQUOTE,
362  ID_ADDRESS,
363  ID_PLAINTEXT, // ?
364  ID_XMP, // ?
365  ID_CENTER, // legacy
366  // other
367  ID_DIV,
368  ID_FIELDSET,
369  ID_TABLE,
370  ID_NOSCRIPT,
371  ID_NOFRAMES,
372  ID_FORM,
373  ID_ISINDEX, // legacy
374  // non-standard:
375  ID_LAYER, // deprecated
376  ID_MARQUEE, // extension
377  0
378 };
379 
380 // block elements allowed for quirky error recovery
381 static const ushort tag_list_quirk_block[] = {
382  ID_LI,
383  ID_DD,
384  0
385 };
386 
387 static const ushort tag_list_select[] = {
388  ID_TEXT,
389  ID_OPTGROUP,
390  ID_OPTION,
391  ID_COMMENT,
392  ID_SCRIPT,
393  0
394 };
395 
396 static const ushort tag_list_frame[] = {
397  ID_FRAMESET,
398  ID_FRAME,
399  ID_NOFRAMES,
400  ID_COMMENT,
401  0
402 };
403 
404 static const ushort tag_list_head[] = {
405  ID_SCRIPT,
406  ID_STYLE,
407  ID_META,
408  ID_LINK,
409  ID_TITLE,
410  ID_ISINDEX,
411  ID_BASE,
412  ID_COMMENT,
413  0
414 };
415 
416 // cf. HTML5 8.2.3.2
417 static const ushort scope_boundary[] = {
418  ID_APPLET,
419  ID_CAPTION,
420  ID_HTML,
421  ID_TABLE,
422  ID_TD,
423  ID_TH,
424  ID_BUTTON,
425  ID_MARQUEE,
426  ID_OBJECT,
427 // ID_FOREIGNOBJECT, - only in SVG namespace
428  0
429 };
430 
431 static bool check_array(ushort child, const ushort *tagList)
432 {
433  int i = 0;
434  while (tagList[i] != 0) {
435  if (tagList[i] == child) {
436  return true;
437  }
438  i++;
439  }
440  return false;
441 }
442 
443 static bool check_block(ushort childID, bool strict)
444 {
445  return check_array(childID, tag_list_block) ||
446  (!strict && check_array(childID, tag_list_quirk_block));
447 }
448 
449 static bool check_inline(ushort childID, bool strict)
450 {
451  return check_array(childID, tag_list_inline) ||
452  (!strict && check_array(childID, tag_list_quirk_inline));
453 }
454 
455 static bool check_flow(ushort childID, bool strict)
456 {
457  return check_block(childID, strict) || check_inline(childID, strict);
458 }
459 
460 bool DOM::checkIsScopeBoundary(ushort tagID)
461 {
462  return check_array(tagID, scope_boundary);
463 }
464 
465 bool DOM::checkChild(ushort tagID, ushort childID, bool strict)
466 {
467  //qCDebug(KHTML_LOG) << "checkChild: " << tagID << "/" << childID;
468 
469  if (childID == ID_COMMENT) {
470  return true;
471  }
472 
473  // Treat custom elements the same as <span>.
474  if (tagID > ID_LAST_TAG) {
475  tagID = ID_SPAN;
476  }
477  if (childID > ID_LAST_TAG) {
478  childID = ID_SPAN;
479  }
480 
481  switch (tagID) {
482  case ID_TT:
483  case ID_I:
484  case ID_B:
485  case ID_U:
486  case ID_S:
487  case ID_STRIKE:
488  case ID_BIG:
489  case ID_SMALL:
490  case ID_EM:
491  case ID_STRONG:
492  case ID_DFN:
493  case ID_CODE:
494  case ID_SAMP:
495  case ID_KBD:
496  case ID_VAR:
497  case ID_CITE:
498  case ID_ABBR:
499  case ID_ACRONYM:
500  case ID_SUB:
501  case ID_SUP:
502  case ID_BDO:
503  case ID_FONT:
504  case ID_LEGEND:
505  case ID_Q:
506  case ID_A:
507  case ID_NOBR:
508  case ID_WBR:
509  // %inline *
510  return check_inline(childID, strict) || check_block(childID, strict);
511  case ID_P:
512  // P: %inline *
513  return check_inline(childID, strict) ||
514  (!strict && childID == ID_TABLE);
515  case ID_H1:
516  case ID_H2:
517  case ID_H3:
518  case ID_H4:
519  case ID_H5:
520  case ID_H6:
521  // %inline *
522  return check_inline(childID, strict) ||
523  (!strict && check_block(childID, true) && (childID < ID_H1 || childID > ID_H6));
524  case ID_BASEFONT:
525  case ID_BR:
526  case ID_AREA:
527  case ID_LINK:
528  case ID_IMAGE:
529  case ID_IMG:
530  case ID_PARAM:
531  case ID_HR:
532  case ID_INPUT:
533  case ID_COL:
534  case ID_FRAME:
535  case ID_ISINDEX:
536  case ID_BASE:
537  case ID_META:
538  case ID_COMMENT:
539  // BASEFONT: EMPTY
540  return false;
541  case ID_BODY:
542  // BODY: %block | SCRIPT (but even strict sites expect %flow)
543  return check_flow(childID, strict);
544  case ID_ADDRESS:
545  // ADDRESS: %inline *
546  return check_inline(childID, strict) ||
547  (!strict && childID == ID_P);
548  case ID_DT:
549  // DT: %inline *
550  return check_inline(childID, strict) ||
551  (!strict && check_block(childID, true) && childID != ID_DL);
552  case ID_LI:
553  case ID_DIV:
554  case ID_SPAN:
555  case ID_ILAYER:
556  case ID_LAYER:
557  case ID_CENTER:
558  case ID_BLOCKQUOTE:
559  case ID_INS:
560  case ID_DEL:
561  case ID_DD:
562  case ID_TH:
563  case ID_TD:
564  case ID_IFRAME:
565  case ID_NOFRAMES:
566  case ID_NOSCRIPT:
567  case ID_CAPTION:
568  case ID_MARQUEE:
569  case ID_CANVAS:
570  // DIV: %flow *
571  return check_flow(childID, strict);
572  case ID_MAP:
573  // MAP: ( %block | AREA ) (but "prose" in HTML5)
574  return check_flow(childID, true) || childID == ID_AREA ||
575  (!strict && childID == ID_SCRIPT);
576  case ID_OBJECT:
577  case ID_EMBED:
578  case ID_APPLET:
579  // OBJECT: %flow | PARAM *
580  return check_flow(childID, true) || childID == ID_PARAM;
581  case ID_AUDIO:
582  case ID_VIDEO:
583  return check_flow(childID, true) || childID == ID_SOURCE;
584  case ID_PRE:
585  case ID_XMP:
586  case ID_PLAINTEXT:
587  case ID_LISTING:
588  // PRE: %flow * - _5
589  return check_flow(childID, true);
590  case ID_DL:
591  // DL: DT | DD +
592  return (childID == ID_DT || childID == ID_DD || check_flow(childID, strict));
593  case ID_OL:
594  case ID_UL:
595  case ID_DIR:
596  case ID_MENU:
597  // OL: LI +
598  // For DIR and MENU, the DTD says - %block, but it contradicts spec language..
599  return (childID == ID_LI || check_flow(childID, strict));
600  case ID_FORM:
601  // FORM: %flow * - FORM
602  return check_flow(childID, strict);
603  case ID_LABEL:
604  // LABEL: %inline * - LABEL
605  return check_inline(childID, strict) ||
606  (!strict && check_block(childID, true));
607  case ID_KEYGEN:
608  // KEYGEN does not really allow any children
609  // from outside, just need this to be able
610  // to add the keylengths ourself
611  // Yes, consider it a hack (Dirk)
612  case ID_SELECT:
613  // SELECT: _7 +
614  return check_array(childID, tag_list_select);
615  case ID_OPTGROUP:
616  // OPTGROUP: OPTION +
617  if (childID == ID_OPTION) {
618  return true;
619  }
620  return false;
621  case ID_OPTION:
622  if (childID == ID_SCRIPT) {
623  return true;
624  }
625  // fallthrough intentional
626  case ID_TEXTAREA:
627  case ID_TITLE:
628  case ID_STYLE:
629  case ID_SCRIPT:
630  // OPTION: TEXT
631  if (childID == ID_TEXT) {
632  return true;
633  }
634  return false;
635  case ID_FIELDSET:
636  // FIELDSET: ( TEXT , LEGEND , %flow * )
637  if (childID == ID_TEXT) {
638  return true;
639  }
640  if (childID == ID_LEGEND) {
641  return true;
642  }
643  return check_flow(childID, strict);
644  case ID_BUTTON:
645  // BUTTON: %flow * - _8
646  return check_flow(childID, strict);
647  case ID_TABLE:
648  // TABLE: ( CAPTION ? , ( COL * | COLGROUP * ) , THEAD ? , TFOOT ? , TBODY + )
649  switch (childID) {
650  case ID_CAPTION:
651  case ID_COL:
652  case ID_COLGROUP:
653  case ID_THEAD:
654  case ID_TFOOT:
655  case ID_TBODY:
656  case ID_FORM:
657  case ID_SCRIPT:
658  return true;
659  default:
660  return false;
661  }
662  case ID_THEAD:
663  case ID_TFOOT:
664  case ID_TBODY:
665  // THEAD: TR +
666  if (childID == ID_TR || childID == ID_SCRIPT) {
667  return true;
668  }
669  return false;
670  case ID_COLGROUP:
671  // COLGROUP: COL *
672  if (childID == ID_COL) {
673  return true;
674  }
675  return false;
676  case ID_TR:
677  // TR: (TD, TH)
678  return (childID == ID_TH || childID == ID_TD || childID == ID_SCRIPT);
679  case ID_FRAMESET:
680  // FRAMESET: _10
681  return check_array(childID, tag_list_frame);
682  case ID_HEAD:
683  // HEAD: _11
684  return check_array(childID, tag_list_head);
685  case ID_HTML:
686  // HTML: ( HEAD , COMMENT, ( BODY | ( FRAMESET & NOFRAMES ? ) ) )
687  switch (childID) {
688  case ID_HEAD:
689  case ID_BODY:
690  case ID_FRAMESET:
691  case ID_NOFRAMES:
692  case ID_SCRIPT:
693  return true;
694  default:
695  return false;
696  }
697  default:
698  // qCDebug(KHTML_LOG) << "unhandled tag in dtd.cpp:checkChild(): tagID=" << tagID << "!";
699  return false;
700  }
701 }
702 
703 void DOM::addForbidden(int tagId, ushort *forbiddenTags)
704 {
705  switch (tagId) {
706  case ID_A:
707  // we allow nested anchors. The innermost one wil be taken...
708  //forbiddenTags[ID_A]++;
709  break;
710  case ID_NOBR:
711  forbiddenTags[ID_PRE]++;
712  forbiddenTags[ID_LISTING]++;
713  // fall through
714  case ID_PRE:
715  case ID_LISTING:
716  case ID_PLAINTEXT:
717  case ID_XMP:
718  //forbiddenTags[ID_IMAGE]++;
719  //forbiddenTags[ID_IMG]++;
720  forbiddenTags[ID_OBJECT]++;
721  forbiddenTags[ID_EMBED]++;
722  forbiddenTags[ID_APPLET]++;
723  // why forbid them. We can deal with them in PRE
724  //forbiddenTags[ID_BIG]++;
725  //forbiddenTags[ID_SMALL]++;
726  //forbiddenTags[ID_SUB]++;
727  //forbiddenTags[ID_SUP]++;
728  forbiddenTags[ID_BASEFONT]++;
729  break;
730  case ID_LABEL:
731  forbiddenTags[ID_LABEL]++;
732  break;
733  case ID_BUTTON:
734  forbiddenTags[ID_A]++;
735  forbiddenTags[ID_INPUT]++;
736  forbiddenTags[ID_SELECT]++;
737  forbiddenTags[ID_TEXTAREA]++;
738  forbiddenTags[ID_LABEL]++;
739  forbiddenTags[ID_BUTTON]++;
740  forbiddenTags[ID_FORM]++;
741  forbiddenTags[ID_ISINDEX]++;
742  forbiddenTags[ID_FIELDSET]++;
743  forbiddenTags[ID_IFRAME]++;
744  break;
745  default:
746  break;
747  }
748 }
749 
750 void DOM::removeForbidden(int tagId, ushort *forbiddenTags)
751 {
752  switch (tagId) {
753  case ID_A:
754  //forbiddenTags[ID_A]--;
755  break;
756  case ID_NOBR:
757  forbiddenTags[ID_PRE]--;
758  forbiddenTags[ID_LISTING]--;
759  // fall through
760  case ID_PRE:
761  case ID_LISTING:
762  case ID_XMP:
763  case ID_PLAINTEXT:
764  //forbiddenTags[ID_IMAGE]--;
765  //forbiddenTags[ID_IMG]--;
766  forbiddenTags[ID_OBJECT]--;
767  forbiddenTags[ID_EMBED]--;
768  forbiddenTags[ID_APPLET]--;
769  //forbiddenTags[ID_BIG]--;
770  //forbiddenTags[ID_SMALL]--;
771  //forbiddenTags[ID_SUB]--;
772  //forbiddenTags[ID_SUP]--;
773  forbiddenTags[ID_BASEFONT]--;
774  break;
775  case ID_LABEL:
776  forbiddenTags[ID_LABEL]--;
777  break;
778  case ID_BUTTON:
779  forbiddenTags[ID_A]--;
780  forbiddenTags[ID_INPUT]--;
781  forbiddenTags[ID_SELECT]--;
782  forbiddenTags[ID_TEXTAREA]--;
783  forbiddenTags[ID_LABEL]--;
784  forbiddenTags[ID_BUTTON]--;
785  forbiddenTags[ID_FORM]--;
786  forbiddenTags[ID_ISINDEX]--;
787  forbiddenTags[ID_FIELDSET]--;
788  forbiddenTags[ID_IFRAME]--;
789  break;
790  default:
791  break;
792  }
793 }
794 
This library provides a full-featured HTML parser and widget.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Oct 26 2021 22:48:01 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.