1 Test to make sure queryCommandState returns correct values.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
7 PASS queryCommandState("bold") returns false when selecting all of "hello"
8 PASS queryCommandState("bold") returns false when selecting all of "<i>hello</i>"
9 PASS queryCommandState("bold") returns true when selecting all of "<b>hello</b>"
10 PASS queryCommandState("bold") returns false when selecting all of "hello <b>world</b>"
11 PASS queryCommandState("bold") returns false when selecting all of "<b>hello</b> world"
12 PASS queryCommandState("bold") returns false when selecting second word of "hello <b>world</b> WebKit"
13 PASS queryCommandState("bold") returns false when selecting second word of "<b>hello</b> world <b>WebKit</b>"
14 PASS queryCommandState("bold") returns false when selecting second word of "<i>hello <b>hello</b> WebKit</i>"
15 PASS queryCommandState("bold") returns true when selecting second word of "<b>hello <i>hello</i> WebKit</b>"
16 PASS queryCommandState("bold") returns true when selecting second word of "<b><div>hello <i>hello</i> WebKit</div></b>"
17 PASS queryCommandState("bold") returns false when selecting all of "<b style="font-weight: normal;">hello</b>"
18 PASS queryCommandState("bold") returns true when selecting all of "<i style="font-weight: bold;">hello</i>"
19 PASS queryCommandState("bold") returns false when selecting all of "<b>hello</b> world <b>WebKit</b>"
20 PASS queryCommandState("bold") returns true when selecting all of "<b>hello</b><b> world</b>"
21 PASS queryCommandState("bold") returns true when selecting all of "<div><b>hello</b></div><p><b> WebKit</b></p>"
22 PASS queryCommandState("italic") returns false when selecting all of "hello"
23 PASS queryCommandState("italic") returns false when selecting all of "<b>hello</b>"
24 PASS queryCommandState("italic") returns true when selecting all of "<i>hello</i>"
25 PASS queryCommandState("italic") returns false when selecting all of "<i>hello</i> world"
26 PASS queryCommandState("italic") returns false when selecting all of "hello <i>world</i>"
27 PASS queryCommandState("italic") returns true when selecting all of "<i><div>hello world</div></i>"
28 PASS queryCommandState("italic") returns false when selecting all of "<div style="font-style: italic">hello <span style="font-style: normal;">hello</span></div>"
29 PASS queryCommandState("subscript") returns false when selecting all of "hello"
30 PASS queryCommandState("subscript") returns false when selecting all of "<sup>hello</sup>"
31 PASS queryCommandState("subscript") returns true when selecting all of "<sub>hello</sub>"
32 PASS queryCommandState("subscript") returns false when selecting all of "<sub>hello</sub> world"
33 PASS queryCommandState("subscript") returns false when selecting all of "hello <sub>world</sub>"
34 PASS queryCommandState("subscript") returns true when selecting all of "<div style="vertical-align: sub;">hello world</div>"
35 PASS queryCommandState("subscript") returns false when selecting second word of "hello <span style="vertical-align: sub;">world</span> WebKit"
36 PASS queryCommandState("superscript") returns false when selecting all of "hello"
37 PASS queryCommandState("superscript") returns false when selecting all of "<sub>hello</sub>"
38 PASS queryCommandState("superscript") returns true when selecting all of "<sup>hello</sup>"
39 PASS queryCommandState("superscript") returns false when selecting all of "<sup>hello</sup> world"
40 PASS queryCommandState("superscript") returns false when selecting all of "hello <sup>world</sup>"
41 PASS queryCommandState("superscript") returns false when selecting all of "<span style="vertical-align: super;">hello</span><span style="vertical-align: sub;">world</span>"
42 PASS queryCommandState("superscript") returns false when selecting all of "hello<span style="vertical-align: super;">world</span>"
43 PASS queryCommandState("underline") returns false when selecting all of "hello"
44 PASS queryCommandState("underline") returns false when selecting all of "<s>hello</s>"
45 PASS queryCommandState("underline") returns true when selecting all of "<u>hello</u>"
46 PASS queryCommandState("underline") returns false when selecting all of "<u>hello</u> world"
47 PASS queryCommandState("underline") returns false when selecting all of "hello <u>world</u>"
48 PASS queryCommandState("underline") returns true when selecting all of "<u><div>hello world</div></u>"
49 PASS queryCommandState("underline") returns true when selecting second word of "<u><s><div>hello world WebKit</div></s></u>"
50 PASS queryCommandState("underline") returns false when selecting second word of "<s><u>hello</u> world</s> WebKit"
51 PASS queryCommandState("underline") returns false when selecting second word of "<u><s>hello</s> world</u> WebKit"
52 PASS queryCommandState("underline") returns true when selecting second word of "<s>hello <u>world</s> WebKit</u>"
53 PASS queryCommandState("strikeThrough") returns false when selecting all of "hello"
54 PASS queryCommandState("strikeThrough") returns false when selecting all of "<u>hello</u>"
55 PASS queryCommandState("strikeThrough") returns true when selecting all of "<s>hello</s>"
56 PASS queryCommandState("strikeThrough") returns false when selecting all of "<s>hello</s> world"
57 PASS queryCommandState("strikeThrough") returns false when selecting all of "hello <s>world</s>"
58 PASS queryCommandState("strikeThrough") returns true when selecting all of "<s><div>hello world</div></s>"
59 PASS queryCommandState("strikeThrough") returns true when selecting second word of "<s><u><div>hello world WebKit</div></u></s>"
60 PASS queryCommandState("strikeThrough") returns false when selecting second word of "<u><s>hello</s> world</u> WebKit"
61 PASS queryCommandState("strikeThrough") returns true when selecting second word of "hello <s>world WebKit</s>"
62 PASS queryCommandState("strikeThrough") returns true when selecting first two words of "hello <s>world WebKit</s>"
65 PASS queryCommandState("bold") returns false when selecting all of "hello"
66 PASS queryCommandState("bold") returns false when selecting all of "<i>hello</i>"
67 PASS queryCommandState("bold") returns true when selecting all of "<b>hello</b>"
68 PASS queryCommandState("bold") returns false when selecting all of "hello <b>world</b>"
69 PASS queryCommandState("bold") returns true when selecting all of "<b>hello</b> world"
70 PASS queryCommandState("bold") returns true when selecting second word of "hello <b>world</b> WebKit"
71 PASS queryCommandState("bold") returns false when selecting second word of "<b>hello</b> world <b>WebKit</b>"
72 PASS queryCommandState("bold") returns true when selecting second word of "<i>hello <b>hello</b> WebKit</i>"
73 PASS queryCommandState("bold") returns true when selecting second word of "<b>hello <i>hello</i> WebKit</b>"
74 PASS queryCommandState("bold") returns true when selecting second word of "<b><div>hello <i>hello</i> WebKit</div></b>"
75 PASS queryCommandState("bold") returns false when selecting all of "<b style="font-weight: normal;">hello</b>"
76 PASS queryCommandState("bold") returns true when selecting all of "<i style="font-weight: bold;">hello</i>"
77 PASS queryCommandState("bold") returns true when selecting all of "<b>hello</b> world <b>WebKit</b>"
78 PASS queryCommandState("bold") returns true when selecting all of "<b>hello</b><b> world</b>"
79 PASS queryCommandState("bold") returns true when selecting all of "<div><b>hello</b></div><p><b> WebKit</b></p>"
80 PASS queryCommandState("italic") returns false when selecting all of "hello"
81 PASS queryCommandState("italic") returns false when selecting all of "<b>hello</b>"
82 PASS queryCommandState("italic") returns true when selecting all of "<i>hello</i>"
83 PASS queryCommandState("italic") returns true when selecting all of "<i>hello</i> world"
84 PASS queryCommandState("italic") returns false when selecting all of "hello <i>world</i>"
85 PASS queryCommandState("italic") returns true when selecting all of "<i><div>hello world</div></i>"
86 PASS queryCommandState("italic") returns true when selecting all of "<div style="font-style: italic">hello <span style="font-style: normal;">hello</span></div>"
87 PASS queryCommandState("subscript") returns false when selecting all of "hello"
88 PASS queryCommandState("subscript") returns false when selecting all of "<sup>hello</sup>"
89 PASS queryCommandState("subscript") returns true when selecting all of "<sub>hello</sub>"
90 PASS queryCommandState("subscript") returns true when selecting all of "<sub>hello</sub> world"
91 PASS queryCommandState("subscript") returns false when selecting all of "hello <sub>world</sub>"
92 PASS queryCommandState("subscript") returns true when selecting all of "<div style="vertical-align: sub;">hello world</div>"
93 PASS queryCommandState("subscript") returns true when selecting second word of "hello <span style="vertical-align: sub;">world</span> WebKit"
94 PASS queryCommandState("superscript") returns false when selecting all of "hello"
95 PASS queryCommandState("superscript") returns false when selecting all of "<sub>hello</sub>"
96 PASS queryCommandState("superscript") returns true when selecting all of "<sup>hello</sup>"
97 PASS queryCommandState("superscript") returns true when selecting all of "<sup>hello</sup> world"
98 PASS queryCommandState("superscript") returns false when selecting all of "hello <sup>world</sup>"
99 PASS queryCommandState("superscript") returns true when selecting all of "<span style="vertical-align: super;">hello</span><span style="vertical-align: sub;">world</span>"
100 PASS queryCommandState("superscript") returns false when selecting all of "hello<span style="vertical-align: super;">world</span>"
101 PASS queryCommandState("underline") returns false when selecting all of "hello"
102 PASS queryCommandState("underline") returns false when selecting all of "<s>hello</s>"
103 PASS queryCommandState("underline") returns true when selecting all of "<u>hello</u>"
104 PASS queryCommandState("underline") returns true when selecting all of "<u>hello</u> world"
105 PASS queryCommandState("underline") returns false when selecting all of "hello <u>world</u>"
106 PASS queryCommandState("underline") returns true when selecting all of "<u><div>hello world</div></u>"
107 PASS queryCommandState("underline") returns true when selecting second word of "<u><s><div>hello world WebKit</div></s></u>"
108 PASS queryCommandState("underline") returns false when selecting second word of "<s><u>hello</u> world</s> WebKit"
109 PASS queryCommandState("underline") returns true when selecting second word of "<u><s>hello</s> world</u> WebKit"
110 PASS queryCommandState("underline") returns true when selecting second word of "<s>hello <u>world</s> WebKit</u>"
111 PASS queryCommandState("strikeThrough") returns false when selecting all of "hello"
112 PASS queryCommandState("strikeThrough") returns false when selecting all of "<u>hello</u>"
113 PASS queryCommandState("strikeThrough") returns true when selecting all of "<s>hello</s>"
114 PASS queryCommandState("strikeThrough") returns true when selecting all of "<s>hello</s> world"
115 PASS queryCommandState("strikeThrough") returns false when selecting all of "hello <s>world</s>"
116 PASS queryCommandState("strikeThrough") returns true when selecting all of "<s><div>hello world</div></s>"
117 PASS queryCommandState("strikeThrough") returns true when selecting second word of "<s><u><div>hello world WebKit</div></u></s>"
118 PASS queryCommandState("strikeThrough") returns false when selecting second word of "<u><s>hello</s> world</u> WebKit"
119 PASS queryCommandState("strikeThrough") returns true when selecting second word of "hello <s>world WebKit</s>"
120 PASS queryCommandState("strikeThrough") returns false when selecting first two words of "hello <s>world WebKit</s>"
121 PASS successfullyParsed is true