View Javadoc
1   /*
2    * Copyright (c) 2002-2025 Gargoyle Software Inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * https://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */
15  package org.htmlunit.general.huge;
16  
17  import java.util.ArrayList;
18  import java.util.Arrays;
19  import java.util.Collection;
20  import java.util.List;
21  
22  import org.htmlunit.WebClient;
23  import org.htmlunit.WebDriverTestCase;
24  import org.htmlunit.html.DefaultElementFactory;
25  import org.htmlunit.junit.annotation.Alerts;
26  import org.htmlunit.junit.annotation.HtmlUnitNYI;
27  import org.junit.jupiter.params.ParameterizedTest;
28  import org.junit.jupiter.params.provider.Arguments;
29  import org.junit.jupiter.params.provider.MethodSource;
30  import org.openqa.selenium.JavascriptExecutor;
31  import org.openqa.selenium.WebDriver;
32  import org.openqa.selenium.htmlunit.HtmlUnitDriver;
33  
34  /**
35   * Tests for an element to close another element, which is defined in
36   * {@link org.htmlunit.cyberneko.HTMLElements}.
37   *
38   * @author Ahmed Ashour
39   * @author Ronald Brill
40   */
41  public class ElementClosesElementTest extends WebDriverTestCase {
42  
43      private static int ServerRestartCount_;
44  
45      private static final List<String> PARENT_ZERO = Arrays.asList("area", "base", "basefont", "bgsound", "br",
46              "command", "col", "colgroup",
47              "embed", "frame", "frameset", "head", "hr", "iframe", "image", "img", "input", "keygen",
48              "link", "meta", "noembed", "noframes", "noscript", "param", "plaintext",
49              "script", "select", "source", "style",
50              "table", "tbody", "template", "textarea", "tfoot", "thead", "title",
51              "tr", "track", "wbr", "xmp");
52  
53      private static final List<String> CHILD_ZERO = Arrays.asList("body", "caption", "col", "colgroup",
54              "frame", "frameset", "head", "html", "tbody", "td", "tfoot", "th", "thead", "tr");
55  
56      private static final List<String> SVG_CHILD_ZERO = Arrays.asList("b", "big", "blockquote", "body", "br",
57              "center", "code", "dd", "div", "dl", "dt", "em", "embed", "h1", "h2", "h3", "h4", "h5", "h6", "head",
58              "hr", "i", "img", "li", "listing", "menu", "meta", "nobr", "ol", "p", "pre", "ruby", "s", "small",
59              "span", "strike", "strong", "sub", "sup", "table", "tt", "u", "ul", "var");
60  
61      private static final String RESULT_SCRIPT = "  var e = document.getElementById('outer');\n"
62              + "  var res = '-';\n"
63              + "  try {\n"
64              + "    res = e == null ? e : e.children.length;\n"
65              + "  } catch(e) { res = 'exception'; }\n"
66              + "  return '' + res;";
67  
68      /**
69       * Returns the parameterized data.
70       * @return the parameterized data
71       * @throws Exception if an error occurs
72       */
73      public static Collection<Arguments> data() throws Exception {
74          final List<Arguments> list = new ArrayList<>();
75          final List<String> strings = new ArrayList<>(DefaultElementFactory.SUPPORTED_TAGS_);
76          strings.add("unknown");
77  
78          for (final String parent : strings) {
79              for (final String child : strings) {
80                  list.add(Arguments.of(parent, child));
81              }
82          }
83          return list;
84      }
85  
86      /**
87       * The default test.
88       * @throws Exception if an error occurs
89       */
90      @ParameterizedTest(name = "_{0}_{1}")
91      @MethodSource("data")
92      void test(final String parent, final String child) throws Exception {
93          String bodyStart = "<body>\n";
94          String bodyEnd = "</body>\n";
95  
96          final String html;
97          if ("caption".equals(parent)) {
98              html = "<table><caption id='outer'><" + child + "></table>\n";
99          }
100         else if ("col".equals(parent)) {
101             html = "<table><colgroup><col id='outer'><" + child + "></table>\n";
102         }
103         else if ("colgroup".equals(parent)) {
104             html = "<table><colgroup id='outer'><" + child + "></table>\n";
105         }
106         else if ("frame".equals(parent)) {
107             bodyStart = "<frameset>\n";
108             html = "<frame id='outer'><" + child + "></frame>\n";
109             bodyEnd = "</frameset></html>";
110         }
111         else if ("frameset".equals(parent)) {
112             bodyStart = "";
113             html = "<frameset id='outer'><" + child + "></frameset>\n";
114             bodyEnd = "";
115         }
116         else if ("script".equals(parent)) {
117             html = "<script id='outer'>//<" + child + ">\n</script>\n";
118         }
119         else if ("tbody".equals(parent)) {
120             html = "<table><tbody id='outer'><" + child + "></table>\n";
121         }
122         else if ("td".equals(parent)) {
123             html = "<table><tr><td id='outer'><" + child + "></table>\n";
124         }
125         else if ("tfoot".equals(parent)) {
126             html = "<table><tfoot id='outer'><" + child + "></table>\n";
127         }
128         else if ("th".equals(parent)) {
129             html = "<table><tr><th id='outer'><" + child + "></table>\n";
130         }
131         else if ("thead".equals(parent)) {
132             html = "<table><thead id='outer'><" + child + "></table>\n";
133         }
134         else if ("tr".equals(parent)) {
135             html = "<table><tr id='outer'><" + child + "></table>\n";
136         }
137         else {
138             html = "<" + parent + " id='outer'><" + child + ">\n";
139         }
140 
141         String pageHtml = DOCTYPE_HTML
142                 + "<html><head>\n"
143                 + "<title>-</title>\n"
144                 + "</head>\n"
145                 + bodyStart
146                 + html
147                 + bodyEnd
148                 + "</html>";
149 
150         if ("basefont".equals(parent)
151                 || "base".equals(parent)
152                 || "isindex".equals(parent)) {
153             pageHtml = DOCTYPE_HTML
154                 + "<html><head>\n"
155                 + "<" + parent + " id='outer'><" + child + ">\n"
156                 + "</head><body>\n"
157                 + "</body></html>";
158         }
159         else if ("head".equals(parent)) {
160             pageHtml = DOCTYPE_HTML
161                 + "<html><head id='outer'><" + child + ">\n"
162                 + "</head><body>\n"
163                 + "</body></html>";
164         }
165         else if ("title".equals(parent)) {
166             pageHtml = DOCTYPE_HTML
167                 + "<html><head>\n"
168                 + "<title id='outer'><" + child + ">\n"
169                 + "</head><body>\n"
170                 + "</body></html>";
171         }
172 
173         String expected = "1";
174         if (getExpectedAlerts().length == 1) {
175             expected = getExpectedAlerts()[0];
176         }
177         else {
178             if (CHILD_ZERO.contains(child)) {
179                 expected = "0";
180             }
181             else if (PARENT_ZERO.contains(parent)) {
182                 expected = "0";
183             }
184             else if ("html".equals(parent)) {
185                 expected = "2";
186             }
187 
188             if ("svg".equals(parent)) {
189                 expected = "1";
190                 if (SVG_CHILD_ZERO.contains(child)) {
191                     expected = "0";
192                 }
193             }
194 
195             if ("command".equals(parent) && getBrowserVersion().isFirefox()) {
196                 expected = "1";
197             }
198         }
199 
200         ServerRestartCount_++;
201         if (ServerRestartCount_ == 200) {
202             stopWebServers();
203             ServerRestartCount_ = 0;
204         }
205 
206         final WebDriver driver = getWebDriver();
207         if (driver instanceof HtmlUnitDriver) {
208             final WebClient webClient = ((HtmlUnitDriver) driver).getWebClient();
209             webClient.getOptions().setThrowExceptionOnScriptError(false);
210         }
211 
212         loadPage2(pageHtml);
213 
214         final String result = (String) ((JavascriptExecutor) driver).executeScript(RESULT_SCRIPT);
215         assertEquals(expected, result);
216     }
217 
218     /**
219      * {@inheritDoc}
220      */
221     @Override
222     protected boolean isWebClientCached() {
223         return true;
224     }
225 
226     @Alerts("0")
227     void _a_a() throws Exception {
228         test("a", "a");
229     }
230 
231     @Alerts("0")
232     void _button_button() throws Exception {
233         test("button", "button");
234     }
235 
236     @Alerts("1")
237     void _colgroup_col() throws Exception {
238         test("colgroup", "col");
239     }
240 
241     @Alerts("1")
242     void _colgroup_template() throws Exception {
243         test("colgroup", "template");
244     }
245 
246     @Alerts("0")
247     void _command_body() throws Exception {
248         test("command", "body");
249     }
250 
251     @Alerts("0")
252     void _command_caption() throws Exception {
253         test("command", "caption");
254     }
255 
256     @Alerts("0")
257     void _command_col() throws Exception {
258         test("command", "col");
259     }
260 
261     @Alerts("0")
262     void _command_colgroup() throws Exception {
263         test("command", "colgroup");
264     }
265 
266     @Alerts("0")
267     void _command_frame() throws Exception {
268         test("command", "frame");
269     }
270 
271     @Alerts("0")
272     void _command_frameset() throws Exception {
273         test("command", "frameset");
274     }
275 
276     @Alerts("0")
277     void _command_head() throws Exception {
278         test("command", "head");
279     }
280 
281     @Alerts("0")
282     void _command_html() throws Exception {
283         test("command", "html");
284     }
285 
286     @Alerts("0")
287     void _command_tbody() throws Exception {
288         test("command", "tbody");
289     }
290 
291     @Alerts("0")
292     void _command_td() throws Exception {
293         test("command", "td");
294     }
295 
296     @Alerts("0")
297     void _command_tfoot() throws Exception {
298         test("command", "tfoot");
299     }
300 
301     @Alerts("0")
302     void _command_th() throws Exception {
303         test("command", "th");
304     }
305 
306     @Alerts("0")
307     void _command_thead() throws Exception {
308         test("command", "thead");
309     }
310 
311     @Alerts("0")
312     void _command_tr() throws Exception {
313         test("command", "tr");
314     }
315 
316     @Alerts("0")
317     void _dd_dd() throws Exception {
318         test("dd", "dd");
319     }
320 
321     @Alerts("0")
322     void _dd_dt() throws Exception {
323         test("dd", "dt");
324     }
325 
326     @Alerts("0")
327     void _dt_dd() throws Exception {
328         test("dt", "dd");
329     }
330 
331     @Alerts("0")
332     void _dt_dt() throws Exception {
333         test("dt", "dt");
334     }
335 
336     @Alerts("0")
337     void _form_form() throws Exception {
338         test("form", "form");
339     }
340 
341     @Alerts("1")
342     void _form_isindex() throws Exception {
343         test("form", "isindex");
344     }
345 
346     @Alerts("1")
347     void _frameset_frame() throws Exception {
348         test("frameset", "frame");
349     }
350 
351     @Alerts("1")
352     void _frameset_frameset() throws Exception {
353         test("frameset", "frameset");
354     }
355 
356     @Alerts("1")
357     void _frameset_noframes() throws Exception {
358         test("frameset", "noframes");
359     }
360 
361     @Alerts("0")
362     void _h1_h1() throws Exception {
363         test("h1", "h1");
364     }
365 
366     @Alerts("0")
367     void _h1_h2() throws Exception {
368         test("h1", "h2");
369     }
370 
371     @Alerts("0")
372     void _h1_h3() throws Exception {
373         test("h1", "h3");
374     }
375 
376     @Alerts("0")
377     void _h1_h4() throws Exception {
378         test("h1", "h4");
379     }
380 
381     @Alerts("0")
382     void _h1_h5() throws Exception {
383         test("h1", "h5");
384     }
385 
386     @Alerts("0")
387     void _h1_h6() throws Exception {
388         test("h1", "h6");
389     }
390 
391     @Alerts("0")
392     void _h2_h1() throws Exception {
393         test("h2", "h1");
394     }
395 
396     @Alerts("0")
397     void _h2_h2() throws Exception {
398         test("h2", "h2");
399     }
400 
401     @Alerts("0")
402     void _h2_h3() throws Exception {
403         test("h2", "h3");
404     }
405 
406     @Alerts("0")
407     void _h2_h4() throws Exception {
408         test("h2", "h4");
409     }
410 
411     @Alerts("0")
412     void _h2_h5() throws Exception {
413         test("h2", "h5");
414     }
415 
416     @Alerts("0")
417     void _h2_h6() throws Exception {
418         test("h2", "h6");
419     }
420 
421     @Alerts("0")
422     void _h3_h1() throws Exception {
423         test("h3", "h1");
424     }
425 
426     @Alerts("0")
427     void _h3_h2() throws Exception {
428         test("h3", "h2");
429     }
430 
431     @Alerts("0")
432     void _h3_h3() throws Exception {
433         test("h3", "h3");
434     }
435 
436     @Alerts("0")
437     void _h3_h4() throws Exception {
438         test("h3", "h4");
439     }
440 
441     @Alerts("0")
442     void _h3_h5() throws Exception {
443         test("h3", "h5");
444     }
445 
446     @Alerts("0")
447     void _h3_h6() throws Exception {
448         test("h3", "h6");
449     }
450 
451     @Alerts("0")
452     void _h4_h1() throws Exception {
453         test("h4", "h1");
454     }
455 
456     @Alerts("0")
457     void _h4_h2() throws Exception {
458         test("h4", "h2");
459     }
460 
461     @Alerts("0")
462     void _h4_h3() throws Exception {
463         test("h4", "h3");
464     }
465 
466     @Alerts("0")
467     void _h4_h4() throws Exception {
468         test("h4", "h4");
469     }
470 
471     @Alerts("0")
472     void _h4_h5() throws Exception {
473         test("h4", "h5");
474     }
475 
476     @Alerts("0")
477     void _h4_h6() throws Exception {
478         test("h4", "h6");
479     }
480 
481     @Alerts("0")
482     void _h5_h1() throws Exception {
483         test("h5", "h1");
484     }
485 
486     @Alerts("0")
487     void _h5_h2() throws Exception {
488         test("h5", "h2");
489     }
490 
491     @Alerts("0")
492     void _h5_h3() throws Exception {
493         test("h5", "h3");
494     }
495 
496     @Alerts("0")
497     void _h5_h4() throws Exception {
498         test("h5", "h4");
499     }
500 
501     @Alerts("0")
502     void _h5_h5() throws Exception {
503         test("h5", "h5");
504     }
505 
506     @Alerts("0")
507     void _h5_h6() throws Exception {
508         test("h5", "h6");
509     }
510 
511     @Alerts("0")
512     void _h6_h1() throws Exception {
513         test("h6", "h1");
514     }
515 
516     @Alerts("0")
517     void _h6_h2() throws Exception {
518         test("h6", "h2");
519     }
520 
521     @Alerts("0")
522     void _h6_h3() throws Exception {
523         test("h6", "h3");
524     }
525 
526     @Alerts("0")
527     void _h6_h4() throws Exception {
528         test("h6", "h4");
529     }
530 
531     @Alerts("0")
532     void _h6_h5() throws Exception {
533         test("h6", "h5");
534     }
535 
536     @Alerts("0")
537     void _h6_h6() throws Exception {
538         test("h6", "h6");
539     }
540 
541     @Alerts("1")
542     void _head_base() throws Exception {
543         test("head", "base");
544     }
545 
546     @Alerts("1")
547     void _head_basefont() throws Exception {
548         test("head", "basefont");
549     }
550 
551     @Alerts("1")
552     void _head_bgsound() throws Exception {
553         test("head", "bgsound");
554     }
555 
556     @Alerts(DEFAULT = "1",
557             FF = "0",
558             FF_ESR = "0")
559     void _head_command() throws Exception {
560         test("head", "command");
561     }
562 
563     @Alerts("1")
564     void _head_link() throws Exception {
565         test("head", "link");
566     }
567 
568     @Alerts("1")
569     void _head_meta() throws Exception {
570         test("head", "meta");
571     }
572 
573     @Alerts("1")
574     void _head_noframes() throws Exception {
575         test("head", "noframes");
576     }
577 
578     @Alerts("1")
579     void _head_noscript() throws Exception {
580         test("head", "noscript");
581     }
582 
583     @Alerts("1")
584     void _head_script() throws Exception {
585         test("head", "script");
586     }
587 
588     @Alerts("1")
589     void _head_style() throws Exception {
590         test("head", "style");
591     }
592 
593     @Alerts("1")
594     void _head_template() throws Exception {
595         test("head", "template");
596     }
597 
598     @Alerts("1")
599     void _head_title() throws Exception {
600         test("head", "title");
601     }
602 
603     @Alerts("2")
604     void _html_body() throws Exception {
605         test("html", "body");
606     }
607 
608     @Alerts("2")
609     void _html_caption() throws Exception {
610         test("html", "caption");
611     }
612 
613     @Alerts("2")
614     void _html_col() throws Exception {
615         test("html", "col");
616     }
617 
618     @Alerts("2")
619     void _html_colgroup() throws Exception {
620         test("html", "colgroup");
621     }
622 
623     @Alerts("2")
624     void _html_frame() throws Exception {
625         test("html", "frame");
626     }
627 
628     @Alerts("2")
629     void _html_frameset() throws Exception {
630         test("html", "frameset");
631     }
632 
633     @Alerts("2")
634     void _html_head() throws Exception {
635         test("html", "head");
636     }
637 
638     @Alerts("2")
639     void _html_html() throws Exception {
640         test("html", "html");
641     }
642 
643     @Alerts("2")
644     void _html_tbody() throws Exception {
645         test("html", "tbody");
646     }
647 
648     @Alerts("2")
649     void _html_td() throws Exception {
650         test("html", "td");
651     }
652 
653     @Alerts("2")
654     void _html_tfoot() throws Exception {
655         test("html", "tfoot");
656     }
657 
658     @Alerts("2")
659     void _html_th() throws Exception {
660         test("html", "th");
661     }
662 
663     @Alerts("2")
664     void _html_thead() throws Exception {
665         test("html", "thead");
666     }
667 
668     @Alerts("2")
669     void _html_tr() throws Exception {
670         test("html", "tr");
671     }
672 
673     @Alerts("null")
674     @HtmlUnitNYI(
675             CHROME = "0",
676             EDGE = "0",
677             FF = "0",
678             FF_ESR = "0")
679     void _isindex_frameset() throws Exception {
680         test("isindex", "frameset");
681     }
682 
683     @Alerts("1")
684     void _isindex_isindex() throws Exception {
685         test("isindex", "isindex");
686     }
687 
688     @Alerts("0")
689     void _li_caption() throws Exception {
690         test("li", "caption");
691     }
692 
693     @Alerts("0")
694     void _li_li() throws Exception {
695         test("li", "li");
696     }
697 
698     @Alerts("0")
699     void _nobr_nobr() throws Exception {
700         test("nobr", "nobr");
701     }
702 
703     @Alerts("0")
704     void _option_optgroup() throws Exception {
705         test("option", "optgroup");
706     }
707 
708     @Alerts("0")
709     void _option_option() throws Exception {
710         test("option", "option");
711     }
712 
713     @Alerts("0")
714     void _p_address() throws Exception {
715         test("p", "address");
716     }
717 
718     @Alerts("0")
719     void _p_article() throws Exception {
720         test("p", "article");
721     }
722 
723     @Alerts("0")
724     void _p_aside() throws Exception {
725         test("p", "aside");
726     }
727 
728     @Alerts("0")
729     void _p_blockquote() throws Exception {
730         test("p", "blockquote");
731     }
732 
733     @Alerts("0")
734     void _p_center() throws Exception {
735         test("p", "center");
736     }
737 
738     @Alerts("0")
739     void _p_dd() throws Exception {
740         test("p", "dd");
741     }
742 
743     @Alerts("0")
744     void _p_details() throws Exception {
745         test("p", "details");
746     }
747 
748     @Alerts("0")
749     void _p_dialog() throws Exception {
750         test("p", "dialog");
751     }
752 
753     @Alerts("0")
754     void _p_dir() throws Exception {
755         test("p", "dir");
756     }
757 
758     @Alerts("0")
759     void _p_div() throws Exception {
760         test("p", "div");
761     }
762 
763     @Alerts("0")
764     void _p_dl() throws Exception {
765         test("p", "dl");
766     }
767 
768     @Alerts("0")
769     void _p_dt() throws Exception {
770         test("p", "dt");
771     }
772 
773     @Alerts("0")
774     void _p_fieldset() throws Exception {
775         test("p", "fieldset");
776     }
777 
778     @Alerts("0")
779     void _p_figcaption() throws Exception {
780         test("p", "figcaption");
781     }
782 
783     @Alerts("0")
784     void _p_figure() throws Exception {
785         test("p", "figure");
786     }
787 
788     @Alerts("0")
789     void _p_footer() throws Exception {
790         test("p", "footer");
791     }
792 
793     @Alerts("0")
794     void _p_form() throws Exception {
795         test("p", "form");
796     }
797 
798     @Alerts("0")
799     void _p_h1() throws Exception {
800         test("p", "h1");
801     }
802 
803     @Alerts("0")
804     void _p_h2() throws Exception {
805         test("p", "h2");
806     }
807 
808     @Alerts("0")
809     void _p_h3() throws Exception {
810         test("p", "h3");
811     }
812 
813     @Alerts("0")
814     void _p_h4() throws Exception {
815         test("p", "h4");
816     }
817 
818     @Alerts("0")
819     void _p_h5() throws Exception {
820         test("p", "h5");
821     }
822 
823     @Alerts("0")
824     void _p_h6() throws Exception {
825         test("p", "h6");
826     }
827 
828     @Alerts("0")
829     void _p_header() throws Exception {
830         test("p", "header");
831     }
832 
833     @Alerts("0")
834     void _p_hr() throws Exception {
835         test("p", "hr");
836     }
837 
838     @Alerts("1")
839     void _p_isindex() throws Exception {
840         test("p", "isindex");
841     }
842 
843     @Alerts("0")
844     void _p_li() throws Exception {
845         test("p", "li");
846     }
847 
848     @Alerts("0")
849     void _p_listing() throws Exception {
850         test("p", "listing");
851     }
852 
853     @Alerts("0")
854     void _p_main() throws Exception {
855         test("p", "main");
856     }
857 
858     @Alerts("0")
859     void _p_menu() throws Exception {
860         test("p", "menu");
861     }
862 
863     @Alerts("0")
864     void _p_nav() throws Exception {
865         test("p", "nav");
866     }
867 
868     @Alerts("0")
869     void _p_ol() throws Exception {
870         test("p", "ol");
871     }
872 
873     @Alerts("0")
874     void _p_p() throws Exception {
875         test("p", "p");
876     }
877 
878     @Alerts("0")
879     void _p_plaintext() throws Exception {
880         test("p", "plaintext");
881     }
882 
883     @Alerts("0")
884     void _p_pre() throws Exception {
885         test("p", "pre");
886     }
887 
888     @Alerts("0")
889     void _p_section() throws Exception {
890         test("p", "section");
891     }
892 
893     @Alerts("0")
894     void _p_summary() throws Exception {
895         test("p", "summary");
896     }
897 
898     @Alerts("0")
899     void _p_ul() throws Exception {
900         test("p", "ul");
901     }
902 
903     @Alerts("0")
904     void _p_xmp() throws Exception {
905         test("p", "xmp");
906     }
907 
908     @Alerts("1")
909     void _ruby_blink() throws Exception {
910         test("ruby", "blink");
911     }
912 
913     @Alerts(DEFAULT = "1",
914             FF = "0",
915             FF_ESR = "0")
916     @HtmlUnitNYI(FF = "1",
917             FF_ESR = "1")
918     void _select_hr() throws Exception {
919         test("select", "hr");
920     }
921 
922     @Alerts("1")
923     void _select_optgroup() throws Exception {
924         test("select", "optgroup");
925     }
926 
927     @Alerts("1")
928     void _select_option() throws Exception {
929         test("select", "option");
930     }
931 
932     @Alerts("1")
933     void _select_script() throws Exception {
934         test("select", "script");
935     }
936 
937     @Alerts("1")
938     void _select_template() throws Exception {
939         test("select", "template");
940     }
941 
942     @Alerts("1")
943     void _table_caption() throws Exception {
944         test("table", "caption");
945     }
946 
947     @Alerts("1")
948     void _table_col() throws Exception {
949         test("table", "col");
950     }
951 
952     @Alerts("1")
953     void _table_colgroup() throws Exception {
954         test("table", "colgroup");
955     }
956 
957     @Alerts("1")
958     void _table_form() throws Exception {
959         test("table", "form");
960     }
961 
962     @Alerts("1")
963     void _table_script() throws Exception {
964         test("table", "script");
965     }
966 
967     @Alerts("1")
968     void _table_style() throws Exception {
969         test("table", "style");
970     }
971 
972     @Alerts("1")
973     void _table_tbody() throws Exception {
974         test("table", "tbody");
975     }
976 
977     @Alerts("1")
978     void _table_td() throws Exception {
979         test("table", "td");
980     }
981 
982     @Alerts("1")
983     void _table_template() throws Exception {
984         test("table", "template");
985     }
986 
987     @Alerts("1")
988     void _table_tfoot() throws Exception {
989         test("table", "tfoot");
990     }
991 
992     @Alerts("1")
993     void _table_th() throws Exception {
994         test("table", "th");
995     }
996 
997     @Alerts("1")
998     void _table_thead() throws Exception {
999         test("table", "thead");
1000     }
1001 
1002     @Alerts("1")
1003     void _table_tr() throws Exception {
1004         test("table", "tr");
1005     }
1006 
1007     @Alerts("1")
1008     void _tbody_form() throws Exception {
1009         test("tbody", "form");
1010     }
1011 
1012     @Alerts("1")
1013     void _tbody_script() throws Exception {
1014         test("tbody", "script");
1015     }
1016 
1017     @Alerts("1")
1018     void _tbody_style() throws Exception {
1019         test("tbody", "style");
1020     }
1021 
1022     @Alerts("1")
1023     void _tbody_td() throws Exception {
1024         test("tbody", "td");
1025     }
1026 
1027     @Alerts("1")
1028     void _tbody_template() throws Exception {
1029         test("tbody", "template");
1030     }
1031 
1032     @Alerts("1")
1033     void _tbody_th() throws Exception {
1034         test("tbody", "th");
1035     }
1036 
1037     @Alerts("1")
1038     void _tbody_tr() throws Exception {
1039         test("tbody", "tr");
1040     }
1041 
1042     @Alerts("1")
1043     void _tfoot_form() throws Exception {
1044         test("tfoot", "form");
1045     }
1046 
1047     @Alerts("1")
1048     void _tfoot_script() throws Exception {
1049         test("tfoot", "script");
1050     }
1051 
1052     @Alerts("1")
1053     void _tfoot_style() throws Exception {
1054         test("tfoot", "style");
1055     }
1056 
1057     @Alerts("1")
1058     void _tfoot_td() throws Exception {
1059         test("tfoot", "td");
1060     }
1061 
1062     @Alerts("1")
1063     void _tfoot_template() throws Exception {
1064         test("tfoot", "template");
1065     }
1066 
1067     @Alerts("1")
1068     void _tfoot_th() throws Exception {
1069         test("tfoot", "th");
1070     }
1071 
1072     @Alerts("1")
1073     void _tfoot_tr() throws Exception {
1074         test("tfoot", "tr");
1075     }
1076 
1077     @Alerts("1")
1078     void _thead_form() throws Exception {
1079         test("thead", "form");
1080     }
1081 
1082     @Alerts("1")
1083     void _thead_script() throws Exception {
1084         test("thead", "script");
1085     }
1086 
1087     @Alerts("1")
1088     void _thead_style() throws Exception {
1089         test("thead", "style");
1090     }
1091 
1092     @Alerts("1")
1093     void _thead_td() throws Exception {
1094         test("thead", "td");
1095     }
1096 
1097     @Alerts("1")
1098     void _thead_template() throws Exception {
1099         test("thead", "template");
1100     }
1101 
1102     @Alerts("1")
1103     void _thead_th() throws Exception {
1104         test("thead", "th");
1105     }
1106 
1107     @Alerts("1")
1108     void _thead_tr() throws Exception {
1109         test("thead", "tr");
1110     }
1111 
1112     @Alerts("1")
1113     void _tr_form() throws Exception {
1114         test("tr", "form");
1115     }
1116 
1117     @Alerts("1")
1118     void _tr_script() throws Exception {
1119         test("tr", "script");
1120     }
1121 
1122     @Alerts("1")
1123     void _tr_style() throws Exception {
1124         test("tr", "style");
1125     }
1126 
1127     @Alerts("1")
1128     void _tr_td() throws Exception {
1129         test("tr", "td");
1130     }
1131 
1132     @Alerts("1")
1133     void _tr_template() throws Exception {
1134         test("tr", "template");
1135     }
1136 
1137     @Alerts("1")
1138     void _tr_th() throws Exception {
1139         test("tr", "th");
1140     }
1141 
1142     @Alerts("0")
1143     void _template_caption() throws Exception {
1144         test("template", "tr");
1145     }
1146 
1147     @Alerts("0")
1148     void _template_col() throws Exception {
1149         test("template", "col");
1150     }
1151 
1152     @Alerts("0")
1153     void _template_colgroup() throws Exception {
1154         test("template", "colgroup");
1155     }
1156 
1157     @Alerts("0")
1158     void _template_frame() throws Exception {
1159         test("template", "frame");
1160     }
1161 
1162     @Alerts("0")
1163     void _template_tbody() throws Exception {
1164         test("template", "tbody");
1165     }
1166 
1167     @Alerts("0")
1168     void _template_td() throws Exception {
1169         test("template", "td");
1170     }
1171 
1172     @Alerts("0")
1173     void _template_tfoot() throws Exception {
1174         test("template", "tfoot");
1175     }
1176 
1177     @Alerts("0")
1178     void _template_th() throws Exception {
1179         test("template", "th");
1180     }
1181 
1182     @Alerts("0")
1183     void _template_thead() throws Exception {
1184         test("template", "thead");
1185     }
1186 
1187     @Alerts("0")
1188     void _template_tr() throws Exception {
1189         test("template", "tr");
1190     }
1191 }