1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.htmlunit.general;
16
17 import org.htmlunit.WebDriverTestCase;
18 import org.htmlunit.junit.BrowserRunner;
19 import org.htmlunit.junit.annotation.Alerts;
20 import org.junit.Test;
21 import org.junit.runner.RunWith;
22
23
24
25
26
27
28
29 @RunWith(BrowserRunner.class)
30 public class ElementDefaultStyleDisplayTest extends WebDriverTestCase {
31
32 private void test(final String tagName) throws Exception {
33 final String html = DOCTYPE_HTML
34 + "<html><head>\n"
35 + "<script>\n"
36 + LOG_TEXTAREA_FUNCTION
37 + " function test() {\n"
38 + " var e = document.createElement('" + tagName + "');\n"
39 + " log(window.getComputedStyle(e, null).display);\n"
40 + " document.body.appendChild(e);\n"
41 + " log(window.getComputedStyle(e, null).display);\n"
42 + " }\n"
43 + "</script></head>\n"
44 + "<body onload='test()'>\n"
45 + LOG_TEXTAREA
46 + "</body></html>";
47
48 loadPageVerifyTextArea2(html);
49 }
50
51
52
53
54
55
56 @Test
57 @Alerts({"", "inline"})
58 public void abbr() throws Exception {
59 test("abbr");
60 }
61
62
63
64
65
66
67 @Test
68 @Alerts({"", "inline"})
69 public void acronym() throws Exception {
70 test("acronym");
71 }
72
73
74
75
76
77
78 @Test
79 @Alerts({"", "inline"})
80 public void a() throws Exception {
81 test("a");
82 }
83
84
85
86
87
88
89 @Test
90 @Alerts({"", "block"})
91 public void address() throws Exception {
92 test("address");
93 }
94
95
96
97
98
99
100 @Test
101 @Alerts({"", "inline"})
102 public void applet() throws Exception {
103 test("applet");
104 }
105
106
107
108
109
110
111 @Test
112 @Alerts(DEFAULT = {"", "inline"},
113 FF = {"", "none"},
114 FF_ESR = {"", "none"})
115 public void area() throws Exception {
116 test("area");
117 }
118
119
120
121
122
123
124 @Test
125 @Alerts({"", "block"})
126 public void article() throws Exception {
127 test("article");
128 }
129
130
131
132
133
134
135 @Test
136 @Alerts({"", "block"})
137 public void aside() throws Exception {
138 test("aside");
139 }
140
141
142
143
144
145
146 @Test
147 @Alerts({"", "none"})
148 public void audio() throws Exception {
149 test("audio");
150 }
151
152
153
154
155
156
157 @Test
158 @Alerts({"", "inline"})
159 public void bgsound() throws Exception {
160 test("bgsound");
161 }
162
163
164
165
166
167
168 @Test
169 @Alerts({"", "none"})
170 public void base() throws Exception {
171 test("base");
172 }
173
174
175
176
177
178
179 @Test
180 @Alerts({"", "none"})
181 public void basefont() throws Exception {
182 test("basefont");
183 }
184
185
186
187
188
189
190 @Test
191 @Alerts({"", "inline"})
192 public void bdi() throws Exception {
193 test("bdi");
194 }
195
196
197
198
199
200
201 @Test
202 @Alerts({"", "inline"})
203 public void bdo() throws Exception {
204 test("bdo");
205 }
206
207
208
209
210
211
212 @Test
213 @Alerts({"", "inline"})
214 public void big() throws Exception {
215 test("big");
216 }
217
218
219
220
221
222
223 @Test
224 @Alerts({"", "inline"})
225 public void blink() throws Exception {
226 test("blink");
227 }
228
229
230
231
232
233
234 @Test
235 @Alerts({"", "block"})
236 public void blockquote() throws Exception {
237 test("blockquote");
238 }
239
240
241
242
243
244
245 @Test
246 @Alerts({"", "block"})
247 public void body() throws Exception {
248 test("body");
249 }
250
251
252
253
254
255
256 @Test
257 @Alerts({"", "inline"})
258 public void b() throws Exception {
259 test("b");
260 }
261
262
263
264
265
266
267 @Test
268 @Alerts({"", "inline"})
269 public void br() throws Exception {
270 test("br");
271 }
272
273
274
275
276
277
278 @Test
279 @Alerts({"", "inline-block"})
280 public void button() throws Exception {
281 test("button");
282 }
283
284
285
286
287
288
289 @Test
290 @Alerts({"", "inline"})
291 public void canvas() throws Exception {
292 test("canvas");
293 }
294
295
296
297
298
299
300 @Test
301 @Alerts({"", "table-caption"})
302 public void caption() throws Exception {
303 test("caption");
304 }
305
306
307
308
309
310
311 @Test
312 @Alerts({"", "block"})
313 public void center() throws Exception {
314 test("center");
315 }
316
317
318
319
320
321
322 @Test
323 @Alerts({"", "inline"})
324 public void cite() throws Exception {
325 test("cite");
326 }
327
328
329
330
331
332
333 @Test
334 @Alerts({"", "inline"})
335 public void code() throws Exception {
336 test("code");
337 }
338
339
340
341
342
343
344 @Test
345 @Alerts({"", "inline"})
346 public void command() throws Exception {
347 test("command");
348 }
349
350
351
352
353
354
355 @Test
356 @Alerts({"", "none"})
357 public void datalist() throws Exception {
358 test("datalist");
359 }
360
361
362
363
364
365
366 @Test
367 @Alerts({"", "inline"})
368 public void dfn() throws Exception {
369 test("dfn");
370 }
371
372
373
374
375
376
377 @Test
378 @Alerts({"", "block"})
379 public void dd() throws Exception {
380 test("dd");
381 }
382
383
384
385
386
387
388 @Test
389 @Alerts({"", "inline"})
390 public void del() throws Exception {
391 test("del");
392 }
393
394
395
396
397
398
399 @Test
400 @Alerts({"", "block"})
401 public void details() throws Exception {
402 test("details");
403 }
404
405
406
407
408
409
410 @Test
411 @Alerts({"", "none"})
412 public void dialog() throws Exception {
413 test("dialog");
414 }
415
416
417
418
419
420
421 @Test
422 @Alerts({"", "block"})
423 public void dir() throws Exception {
424 test("dir");
425 }
426
427
428
429
430
431
432 @Test
433 @Alerts({"", "block"})
434 public void div() throws Exception {
435 test("div");
436 }
437
438
439
440
441
442
443 @Test
444 @Alerts({"", "block"})
445 public void dl() throws Exception {
446 test("dl");
447 }
448
449
450
451
452
453
454 @Test
455 @Alerts({"", "block"})
456 public void dt() throws Exception {
457 test("dt");
458 }
459
460
461
462
463
464
465 @Test
466 @Alerts({"", "inline"})
467 public void embed() throws Exception {
468 test("embed");
469 }
470
471
472
473
474
475
476 @Test
477 @Alerts({"", "inline"})
478 public void em() throws Exception {
479 test("em");
480 }
481
482
483
484
485
486
487 @Test
488 @Alerts({"", "block"})
489 public void fieldset() throws Exception {
490 test("fieldset");
491 }
492
493
494
495
496
497
498 @Test
499 @Alerts({"", "block"})
500 public void figcaption() throws Exception {
501 test("figcaption");
502 }
503
504
505
506
507
508
509 @Test
510 @Alerts({"", "block"})
511 public void figure() throws Exception {
512 test("figure");
513 }
514
515
516
517
518
519
520 @Test
521 @Alerts({"", "inline"})
522 public void font() throws Exception {
523 test("font");
524 }
525
526
527
528
529
530
531 @Test
532 @Alerts({"", "block"})
533 public void form() throws Exception {
534 test("form");
535 }
536
537
538
539
540
541
542 @Test
543 @Alerts({"", "block"})
544 public void footer() throws Exception {
545 test("footer");
546 }
547
548
549
550
551
552
553 @Test
554 @Alerts(DEFAULT = {"", "block"},
555 FF = {"", "inline"},
556 FF_ESR = {"", "inline"})
557 public void frame() throws Exception {
558 test("frame");
559 }
560
561
562
563
564
565
566 @Test
567 @Alerts({"", "block"})
568 public void frameset() throws Exception {
569 test("frameset");
570 }
571
572
573
574
575
576
577 @Test
578 @Alerts({"", "none"})
579 public void head() throws Exception {
580 test("head");
581 }
582
583
584
585
586
587
588 @Test
589 @Alerts({"", "block"})
590 public void header() throws Exception {
591 test("header");
592 }
593
594
595
596
597
598
599 @Test
600 @Alerts({"", "block"})
601 public void h1() throws Exception {
602 test("h1");
603 }
604
605
606
607
608
609
610 @Test
611 @Alerts({"", "block"})
612 public void h2() throws Exception {
613 test("h2");
614 }
615
616
617
618
619
620
621 @Test
622 @Alerts({"", "block"})
623 public void h3() throws Exception {
624 test("h3");
625 }
626
627
628
629
630
631
632 @Test
633 @Alerts({"", "block"})
634 public void h4() throws Exception {
635 test("h4");
636 }
637
638
639
640
641
642
643 @Test
644 @Alerts({"", "block"})
645 public void h5() throws Exception {
646 test("h5");
647 }
648
649
650
651
652
653
654 @Test
655 @Alerts({"", "block"})
656 public void h6() throws Exception {
657 test("h6");
658 }
659
660
661
662
663
664
665 @Test
666 @Alerts({"", "block"})
667 public void hr() throws Exception {
668 test("hr");
669 }
670
671
672
673
674
675
676 @Test
677 @Alerts({"", "block"})
678 public void html() throws Exception {
679 test("html");
680 }
681
682
683
684
685
686
687 @Test
688 @Alerts({"", "inline"})
689 public void iframe() throws Exception {
690 test("iframe");
691 }
692
693
694
695
696
697
698 @Test
699 @Alerts({"", "inline"})
700 public void q() throws Exception {
701 test("q");
702 }
703
704
705
706
707
708
709 @Test
710 @Alerts({"", "inline"})
711 public void img() throws Exception {
712 test("img");
713 }
714
715
716
717
718
719
720 @Test
721 @Alerts({"", "inline"})
722 public void image() throws Exception {
723 test("image");
724 }
725
726
727
728
729
730
731 @Test
732 @Alerts({"", "inline"})
733 public void ins() throws Exception {
734 test("ins");
735 }
736
737
738
739
740
741
742 @Test
743 @Alerts({"", "inline"})
744 public void isindex() throws Exception {
745 test("isindex");
746 }
747
748
749
750
751
752
753 @Test
754 @Alerts({"", "inline"})
755 public void i() throws Exception {
756 test("i");
757 }
758
759
760
761
762
763
764 @Test
765 @Alerts({"", "inline"})
766 public void kbd() throws Exception {
767 test("kbd");
768 }
769
770
771
772
773 @Test
774 @Alerts({"", "inline"})
775 public void keygen() throws Exception {
776 test("keygen");
777 }
778
779
780
781
782
783
784 @Test
785 @Alerts({"", "inline"})
786 public void label() throws Exception {
787 test("label");
788 }
789
790
791
792
793
794
795 @Test
796 @Alerts({"", "inline"})
797 public void layer() throws Exception {
798 test("layer");
799 }
800
801
802
803
804
805
806 @Test
807 @Alerts({"", "block"})
808 public void legend() throws Exception {
809 test("legend");
810 }
811
812
813
814
815
816
817 @Test
818 @Alerts({"", "block"})
819 public void listing() throws Exception {
820 test("listing");
821 }
822
823
824
825
826
827
828 @Test
829 @Alerts({"", "list-item"})
830 public void li() throws Exception {
831 test("li");
832 }
833
834
835
836
837
838
839 @Test
840 @Alerts({"", "none"})
841 public void link() throws Exception {
842 test("link");
843 }
844
845
846
847
848
849
850 @Test
851 @Alerts({"", "block"})
852 public void main() throws Exception {
853 test("main");
854 }
855
856
857
858
859
860
861 @Test
862 @Alerts({"", "inline"})
863 public void map() throws Exception {
864 test("map");
865 }
866
867
868
869
870
871
872 @Test
873 @Alerts({"", "inline"})
874 public void mark() throws Exception {
875 test("mark");
876 }
877
878
879
880
881
882
883 @Test
884 @Alerts({"", "inline-block"})
885 public void marquee() throws Exception {
886 test("marquee");
887 }
888
889
890
891
892
893
894 @Test
895 @Alerts({"", "block"})
896 public void menu() throws Exception {
897 test("menu");
898 }
899
900
901
902
903
904
905 @Test
906 @Alerts({"", "inline"})
907 public void menuitem() throws Exception {
908 test("menuitem");
909 }
910
911
912
913
914
915
916 @Test
917 @Alerts({"", "none"})
918 public void meta() throws Exception {
919 test("meta");
920 }
921
922
923
924
925
926
927 @Test
928 @Alerts({"", "inline-block"})
929 public void meter() throws Exception {
930 test("meter");
931 }
932
933
934
935
936
937
938 @Test
939 @Alerts({"", "inline"})
940 public void multicol() throws Exception {
941 test("multicol");
942 }
943
944
945
946
947
948
949 @Test
950 @Alerts({"", "block"})
951 public void nav() throws Exception {
952 test("nav");
953 }
954
955
956
957
958
959
960 @Test
961 @Alerts({"", "inline"})
962 public void nextid() throws Exception {
963 test("nextid");
964 }
965
966
967
968
969
970
971 @Test
972 @Alerts({"", "inline"})
973 public void nobr() throws Exception {
974 test("nobr");
975 }
976
977
978
979
980
981
982 @Test
983 @Alerts({"", "none"})
984 public void noembed() throws Exception {
985 test("noembed");
986 }
987
988
989
990
991
992
993 @Test
994 @Alerts({"", "none"})
995 public void noframes() throws Exception {
996 test("noframes");
997 }
998
999
1000
1001
1002
1003
1004 @Test
1005 @Alerts({"", "inline"})
1006 public void nolayer() throws Exception {
1007 test("nolayer");
1008 }
1009
1010
1011
1012
1013
1014
1015 @Test
1016 @Alerts(DEFAULT = {"", "none"},
1017 CHROME = {"", "inline"},
1018 EDGE = {"", "inline"})
1019 public void noscript() throws Exception {
1020 test("noscript");
1021 }
1022
1023
1024
1025
1026
1027
1028 @Test
1029 @Alerts({"", "inline"})
1030 public void object() throws Exception {
1031 test("object");
1032 }
1033
1034
1035
1036
1037
1038
1039 @Test
1040 @Alerts({"", "block"})
1041 public void ol() throws Exception {
1042 test("ol");
1043 }
1044
1045
1046
1047
1048
1049
1050 @Test
1051 @Alerts({"", "block"})
1052 public void optgroup() throws Exception {
1053 test("optgroup");
1054 }
1055
1056
1057
1058
1059
1060
1061 @Test
1062 @Alerts({"", "block"})
1063 public void option() throws Exception {
1064 test("option");
1065 }
1066
1067
1068
1069
1070
1071
1072 @Test
1073 @Alerts({"", "inline"})
1074 public void output() throws Exception {
1075 test("output");
1076 }
1077
1078
1079
1080
1081
1082
1083 @Test
1084 @Alerts({"", "block"})
1085 public void p() throws Exception {
1086 test("p");
1087 }
1088
1089
1090
1091
1092
1093
1094 @Test
1095 @Alerts({"", "none"})
1096 public void param() throws Exception {
1097 test("param");
1098 }
1099
1100
1101
1102
1103
1104
1105 @Test
1106 @Alerts({"", "block"})
1107 public void plaintext() throws Exception {
1108 test("plaintext");
1109 }
1110
1111
1112
1113
1114
1115
1116 @Test
1117 @Alerts({"", "block"})
1118 public void pre() throws Exception {
1119 test("pre");
1120 }
1121
1122
1123
1124
1125
1126
1127 @Test
1128 @Alerts({"", "inline-block"})
1129 public void progress() throws Exception {
1130 test("progress");
1131 }
1132
1133
1134
1135
1136
1137
1138 @Test
1139 @Alerts(DEFAULT = {"", "inline"},
1140 FF = {"", "ruby-base"},
1141 FF_ESR = {"", "ruby-base"})
1142 public void rb() throws Exception {
1143 test("rb");
1144 }
1145
1146
1147
1148
1149
1150
1151 @Test
1152 @Alerts({"", "inline"})
1153 public void rbc() throws Exception {
1154 test("rbc");
1155 }
1156
1157
1158
1159
1160
1161
1162 @Test
1163 @Alerts({"", "none"})
1164 public void rp() throws Exception {
1165 test("rp");
1166 }
1167
1168
1169
1170
1171
1172
1173 @Test
1174 @Alerts(DEFAULT = {"", "inline"},
1175 FF = {"", "ruby-text"},
1176 FF_ESR = {"", "ruby-text"})
1177 public void rt() throws Exception {
1178 test("rt");
1179 }
1180
1181
1182
1183
1184
1185
1186 @Test
1187 @Alerts(DEFAULT = {"", "inline"},
1188 FF = {"", "ruby-text-container"},
1189 FF_ESR = {"", "ruby-text-container"})
1190 public void rtc() throws Exception {
1191 test("rtc");
1192 }
1193
1194
1195
1196
1197
1198
1199 @Test
1200 @Alerts({"", "ruby"})
1201 public void ruby() throws Exception {
1202 test("ruby");
1203 }
1204
1205
1206
1207
1208
1209
1210 @Test
1211 @Alerts({"", "inline"})
1212 public void s() throws Exception {
1213 test("s");
1214 }
1215
1216
1217
1218
1219
1220
1221 @Test
1222 @Alerts({"", "inline"})
1223 public void samp() throws Exception {
1224 test("samp");
1225 }
1226
1227
1228
1229
1230
1231
1232 @Test
1233 @Alerts({"", "none"})
1234 public void script() throws Exception {
1235 test("script");
1236 }
1237
1238
1239
1240
1241
1242
1243 @Test
1244 @Alerts({"", "block"})
1245 public void section() throws Exception {
1246 test("section");
1247 }
1248
1249
1250
1251
1252
1253
1254 @Test
1255 @Alerts({"", "inline-block"})
1256 public void select() throws Exception {
1257 test("select");
1258 }
1259
1260
1261
1262
1263
1264
1265 @Test
1266 @Alerts({"", "inline"})
1267 public void small() throws Exception {
1268 test("small");
1269 }
1270
1271
1272
1273
1274
1275
1276 @Test
1277 @Alerts({"", "inline"})
1278 public void source() throws Exception {
1279 test("source");
1280 }
1281
1282
1283
1284
1285
1286
1287 @Test
1288 @Alerts({"", "inline"})
1289 public void spacer() throws Exception {
1290 test("spacer");
1291 }
1292
1293
1294
1295
1296
1297
1298 @Test
1299 @Alerts({"", "inline"})
1300 public void span() throws Exception {
1301 test("span");
1302 }
1303
1304
1305
1306
1307
1308
1309 @Test
1310 @Alerts({"", "inline"})
1311 public void strike() throws Exception {
1312 test("strike");
1313 }
1314
1315
1316
1317
1318
1319
1320 @Test
1321 @Alerts({"", "inline"})
1322 public void strong() throws Exception {
1323 test("strong");
1324 }
1325
1326
1327
1328
1329
1330
1331 @Test
1332 @Alerts({"", "none"})
1333 public void style() throws Exception {
1334 test("style");
1335 }
1336
1337
1338
1339
1340
1341
1342 @Test
1343 @Alerts({"", "inline"})
1344 public void sub() throws Exception {
1345 test("sub");
1346 }
1347
1348
1349
1350
1351
1352
1353 @Test
1354 @Alerts({"", "block"})
1355 public void summary() throws Exception {
1356 test("summary");
1357 }
1358
1359
1360
1361
1362
1363
1364 @Test
1365 @Alerts({"", "inline"})
1366 public void sup() throws Exception {
1367 test("sup");
1368 }
1369
1370
1371
1372
1373
1374
1375 @Test
1376 @Alerts({"", "inline"})
1377 public void svg() throws Exception {
1378 test("svg");
1379 }
1380
1381
1382
1383
1384
1385
1386 @Test
1387 @Alerts({"", "table"})
1388 public void table() throws Exception {
1389 test("table");
1390 }
1391
1392
1393
1394
1395
1396
1397 @Test
1398 @Alerts({"", "table-column"})
1399 public void col() throws Exception {
1400 test("col");
1401 }
1402
1403
1404
1405
1406
1407
1408 @Test
1409 @Alerts({"", "table-column-group"})
1410 public void colgroup() throws Exception {
1411 test("colgroup");
1412 }
1413
1414
1415
1416
1417
1418
1419 @Test
1420 @Alerts({"", "table-row-group"})
1421 public void tbody() throws Exception {
1422 test("tbody");
1423 }
1424
1425
1426
1427
1428
1429
1430 @Test
1431 @Alerts({"", "table-cell"})
1432 public void td() throws Exception {
1433 test("td");
1434 }
1435
1436
1437
1438
1439
1440
1441 @Test
1442 @Alerts({"", "table-cell"})
1443 public void th() throws Exception {
1444 test("th");
1445 }
1446
1447
1448
1449
1450
1451
1452 @Test
1453 @Alerts({"", "table-row"})
1454 public void tr() throws Exception {
1455 test("tr");
1456 }
1457
1458
1459
1460
1461
1462
1463 @Test
1464 @Alerts({"", "inline-block"})
1465 public void textarea() throws Exception {
1466 test("textarea");
1467 }
1468
1469
1470
1471
1472
1473
1474 @Test
1475 @Alerts({"", "table-footer-group"})
1476 public void tfoot() throws Exception {
1477 test("tfoot");
1478 }
1479
1480
1481
1482
1483
1484
1485 @Test
1486 @Alerts({"", "table-header-group"})
1487 public void thead() throws Exception {
1488 test("thead");
1489 }
1490
1491
1492
1493
1494
1495
1496 @Test
1497 @Alerts({"", "inline"})
1498 public void tt() throws Exception {
1499 test("tt");
1500 }
1501
1502
1503
1504
1505
1506
1507 @Test
1508 @Alerts({"", "inline"})
1509 public void time() throws Exception {
1510 test("time");
1511 }
1512
1513
1514
1515
1516
1517
1518 @Test
1519 @Alerts({"", "none"})
1520 public void title() throws Exception {
1521 test("title");
1522 }
1523
1524
1525
1526
1527
1528
1529 @Test
1530 @Alerts({"", "inline"})
1531 public void track() throws Exception {
1532 test("track");
1533 }
1534
1535
1536
1537
1538
1539
1540 @Test
1541 @Alerts({"", "inline"})
1542 public void u() throws Exception {
1543 test("u");
1544 }
1545
1546
1547
1548
1549
1550
1551 @Test
1552 @Alerts({"", "block"})
1553 public void ul() throws Exception {
1554 test("ul");
1555 }
1556
1557
1558
1559
1560
1561
1562 @Test
1563 @Alerts({"", "inline"})
1564 public void var() throws Exception {
1565 test("var");
1566 }
1567
1568
1569
1570
1571
1572
1573 @Test
1574 @Alerts({"", "inline"})
1575 public void video() throws Exception {
1576 test("video");
1577 }
1578
1579
1580
1581
1582
1583
1584 @Test
1585 @Alerts({"", "inline"})
1586 public void wbr() throws Exception {
1587 test("wbr");
1588 }
1589
1590
1591
1592
1593
1594
1595 @Test
1596 @Alerts({"", "block"})
1597 public void xmp() throws Exception {
1598 test("xmp");
1599 }
1600
1601
1602
1603
1604
1605
1606 @Test
1607 @Alerts({"", "inline-block"})
1608 public void input() throws Exception {
1609 test("input");
1610 }
1611
1612
1613
1614
1615
1616
1617 @Test
1618 @Alerts({"", "inline"})
1619 public void data() throws Exception {
1620 test("data");
1621 }
1622
1623
1624
1625
1626
1627
1628 @Test
1629 @Alerts({"", "inline"})
1630 public void content() throws Exception {
1631 test("content");
1632 }
1633
1634
1635
1636
1637
1638
1639 @Test
1640 @Alerts({"", "inline"})
1641 public void picture() throws Exception {
1642 test("picture");
1643 }
1644
1645
1646
1647
1648
1649
1650 @Test
1651 @Alerts({"", "none"})
1652 public void template() throws Exception {
1653 test("template");
1654 }
1655
1656
1657
1658
1659
1660
1661 @Test
1662 @Alerts({"", "contents"})
1663 public void slot() throws Exception {
1664 test("slot");
1665 }
1666
1667
1668
1669
1670 @Test
1671 @Alerts({"", "inline"})
1672 public void arbitrary() throws Exception {
1673 test("abcdefg");
1674 }
1675 }