summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/editing/data/superscript.js
blob: 310f471a97f1e016b3bdcc87124b13be3000f1dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
// For documentation of the format, see README in this directory.
var browserTests = [
["foo[]bar",
    [["superscript",""]],
    "foo[]bar",
    [true],
    {"superscript":[false,false,"",false,true,""]}],
// <sup> should be used instead of <span style="text-align: super"> because
// <sup> changes font-size too, thus, they are not equivalent.  Additionally,
// even if specifying `font-size`, it'd be removed by the other commands.
// Therefore, it's hard to maintain <sup> only with CSS.
// See also <https://bugzilla.mozilla.org/show_bug.cgi?id=394304#c2>.
["<p>[foo</p> <p>bar]</p>",
    [["stylewithcss","true"],["superscript",""]],
    "<p><sup>[foo</sup></p> <p><sup>bar]</sup></p>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["<p>[foo</p> <p>bar]</p>",
    [["stylewithcss","false"],["superscript",""]],
    "<p><sup>[foo</sup></p> <p><sup>bar]</sup></p>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["<span>[foo</span> <span>bar]</span>",
    [["stylewithcss","true"],["superscript",""]],
    "<sup><span>[foo</span> <span>bar]</span></sup>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["<span>[foo</span> <span>bar]</span>",
    [["stylewithcss","false"],["superscript",""]],
    "<sup><span>[foo</span> <span>bar]</span></sup>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>",
    [["stylewithcss","true"],["superscript",""]],
    "<p><sup>[foo</sup></p><p> <sup><span>bar</span></sup> </p><p><sup>baz]</sup></p>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>",
    [["stylewithcss","false"],["superscript",""]],
    "<p><sup>[foo</sup></p><p> <sup><span>bar</span></sup> </p><p><sup>baz]</sup></p>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["<p>[foo<p><br><p>bar]",
    [["stylewithcss","true"],["superscript",""]],
    "<p><sup>[foo</sup></p><p><sup><br></sup></p><p><sup>bar]</sup></p>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["<p>[foo<p><br><p>bar]",
    [["stylewithcss","false"],["superscript",""]],
    "<p><sup>[foo</sup></p><p><sup><br></sup></p><p><sup>bar]</sup></p>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["<b>foo[]bar</b>",
    [["superscript",""]],
    "<b>foo[]bar</b>",
    [true],
    {"superscript":[false,false,"",false,true,""]}],
["<i>foo[]bar</i>",
    [["superscript",""]],
    "<i>foo[]bar</i>",
    [true],
    {"superscript":[false,false,"",false,true,""]}],
["<span>foo</span>{}<span>bar</span>",
    [["superscript",""]],
    "<span>foo</span>{}<span>bar</span>",
    [true],
    {"superscript":[false,false,"",false,true,""]}],
["<span>foo[</span><span>]bar</span>",
    [["superscript",""]],
    "<span>foo[</span><span>]bar</span>",
    [true],
    {"superscript":[false,false,"",false,true,""]}],
["foo[bar]baz",
    [["stylewithcss","true"],["superscript",""]],
    "foo<sup>[bar]</sup>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["foo[bar]baz",
    [["stylewithcss","false"],["superscript",""]],
    "foo<sup>[bar]</sup>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["foo[bar<b>baz]qoz</b>quz",
    [["stylewithcss","true"],["superscript",""]],
    "foo<sup>[bar</sup><b><sup>baz]</sup>qoz</b>quz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["foo[bar<b>baz]qoz</b>quz",
    [["stylewithcss","false"],["superscript",""]],
    "foo<sup>[bar</sup><b><sup>baz]</sup>qoz</b>quz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["foo[bar<i>baz]qoz</i>quz",
    [["stylewithcss","true"],["superscript",""]],
    "foo<sup>[bar</sup><i><sup>baz]</sup>qoz</i>quz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["foo[bar<i>baz]qoz</i>quz",
    [["stylewithcss","false"],["superscript",""]],
    "foo<sup>[bar</sup><i><sup>baz]</sup>qoz</i>quz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["{<p><p> <p>foo</p>}",
    [["stylewithcss","true"],["superscript",""]],
    "{<p></p><p> </p><p><sup>foo</sup></p>}",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["{<p><p> <p>foo</p>}",
    [["stylewithcss","false"],["superscript",""]],
    "{<p></p><p> </p><p><sup>foo</sup></p>}",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>",
    [["stylewithcss","true"],["superscript",""]],
    "<table><tbody><tr><td>foo</td><td>b<sup>[a]</sup>r</td><td>baz</td></tr></tbody></table>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>",
    [["stylewithcss","false"],["superscript",""]],
    "<table><tbody><tr><td>foo</td><td>b<sup>[a]</sup>r</td><td>baz</td></tr></tbody></table>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>",
    [["stylewithcss","true"],["superscript",""]],
    "<table><tbody><tr><td>foo</td>{<td><sup>bar</sup></td>}<td>baz</td></tr></tbody></table>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>",
    [["stylewithcss","false"],["superscript",""]],
    "<table><tbody><tr><td>foo</td>{<td><sup>bar</sup></td>}<td>baz</td></tr></tbody></table>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>",
    [["stylewithcss","true"],["superscript",""]],
    "<table><tbody><tr>{<td><sup>foo</sup></td><td><sup>bar</sup></td>}<td>baz</td></tr></tbody></table>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>",
    [["stylewithcss","false"],["superscript",""]],
    "<table><tbody><tr>{<td><sup>foo</sup></td><td><sup>bar</sup></td>}<td>baz</td></tr></tbody></table>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>",
    [["stylewithcss","true"],["superscript",""]],
    "<table><tbody>{<tr><td><sup>foo</sup></td><td><sup>bar</sup></td><td><sup>baz</sup></td></tr>}</tbody></table>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>",
    [["stylewithcss","false"],["superscript",""]],
    "<table><tbody>{<tr><td><sup>foo</sup></td><td><sup>bar</sup></td><td><sup>baz</sup></td></tr>}</tbody></table>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>",
    [["stylewithcss","true"],["superscript",""]],
    "<table>{<tbody><tr><td><sup>foo</sup></td><td><sup>bar</sup></td><td><sup>baz</sup></td></tr></tbody>}</table>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>",
    [["stylewithcss","false"],["superscript",""]],
    "<table>{<tbody><tr><td><sup>foo</sup></td><td><sup>bar</sup></td><td><sup>baz</sup></td></tr></tbody>}</table>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["{<table><tr><td>foo<td>bar<td>baz</table>}",
    [["stylewithcss","true"],["superscript",""]],
    "{<table><tbody><tr><td><sup>foo</sup></td><td><sup>bar</sup></td><td><sup>baz</sup></td></tr></tbody></table>}",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["{<table><tr><td>foo<td>bar<td>baz</table>}",
    [["stylewithcss","false"],["superscript",""]],
    "{<table><tbody><tr><td><sup>foo</sup></td><td><sup>bar</sup></td><td><sup>baz</sup></td></tr></tbody></table>}",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["foo<sub>[bar]</sub>baz",
    [["stylewithcss","true"],["superscript",""]],
    "foo<sup>[bar]</sup>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["foo<sub>[bar]</sub>baz",
    [["stylewithcss","false"],["superscript",""]],
    "foo<sup>[bar]</sup>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["foo<sub>b[a]r</sub>baz",
    [["stylewithcss","true"],["superscript",""]],
    "foo<sub>b</sub><sup>[a]</sup><sub>r</sub>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["foo<sub>b[a]r</sub>baz",
    [["stylewithcss","false"],["superscript",""]],
    "foo<sub>b</sub><sup>[a]</sup><sub>r</sub>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["foo<sup>b[a]r</sup>baz",
    [["stylewithcss","true"],["superscript",""]],
    "foo<sup>b</sup>[a]<sup>r</sup>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,true,"",false,false,""]}],
["foo<sup>b[a]r</sup>baz",
    [["stylewithcss","false"],["superscript",""]],
    "foo<sup>b</sup>[a]<sup>r</sup>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,true,"",false,false,""]}],
// Although <sup> is not equivalent to `vertical-align: super` as mentioned
// above, they are obviously conflict.  Therefore, `vertical-align` style of
// ancestor and descendants elements of selection should be removed to make
// <sup> work.
["foo<span style=vertical-align:sub>[bar]</span>baz",
    [["stylewithcss","true"],["superscript",""]],
    "foo<sup>[bar]</sup>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["foo<span style=vertical-align:sub>[bar]</span>baz",
    [["stylewithcss","false"],["superscript",""]],
    "foo<sup>[bar]</sup>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["foo<span style=vertical-align:super>[bar]</span>baz",
    [["stylewithcss","true"],["superscript",""]],
    "foo<sup>[bar]</sup>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["foo<span style=vertical-align:super>[bar]</span>baz",
    [["stylewithcss","false"],["superscript",""]],
    "foo<sup>[bar]</sup>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["foo<sub><sub>[bar]</sub></sub>baz",
    [["stylewithcss","true"],["superscript",""]],
    "foo<sup>[bar]</sup>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["foo<sub><sub>[bar]</sub></sub>baz",
    [["stylewithcss","false"],["superscript",""]],
    "foo<sup>[bar]</sup>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["foo<sub><sub>b[a]r</sub></sub>baz",
    [["stylewithcss","true"],["superscript",""]],
    "foo<sub>b</sub><sup>[a]</sup><sub>r</sub>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["foo<sub><sub>b[a]r</sub></sub>baz",
    [["stylewithcss","false"],["superscript",""]],
    "foo<sub>b</sub><sup>[a]</sup><sub>r</sub>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["foo<sub>b<sub>[a]</sub>r</sub>baz",
    [["stylewithcss","true"],["superscript",""]],
    "foo<sub>b</sub><sup>[a]</sup><sub>r</sub>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["foo<sub>b<sub>[a]</sub>r</sub>baz",
    [["stylewithcss","false"],["superscript",""]],
    "foo<sub>b</sub><sup>[a]</sup><sub>r</sub>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
["foo<sup><sup>[bar]</sup></sup>baz",
    [["stylewithcss","true"],["superscript",""]],
    "foo[bar]baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,true,"",false,false,""]}],
["foo<sup><sup>[bar]</sup></sup>baz",
    [["stylewithcss","false"],["superscript",""]],
    "foo[bar]baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,true,"",false,false,""]}],
["foo<sup><sup>b[a]r</sup></sup>baz",
    [["superscript",""]],
    "foo<sup>b</sup>[a]<sup>r</sup>baz",
    [true],
    {"superscript":[false,true,"",false,false,""]}],
["foo<sup>b<sup>[a]</sup>r</sup>baz",
    [["superscript",""]],
    "foo<sup>b</sup>[a]<sup>r</sup>baz",
    [true],
    {"superscript":[false,true,"",false,false,""]}],
["foo<sub><sup>[bar]</sup></sub>baz",
    [["stylewithcss","true"],["superscript",""]],
    "foo<sup>[bar]</sup>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[true,false,"",false,true,""]}],
["foo<sub><sup>[bar]</sup></sub>baz",
    [["stylewithcss","false"],["superscript",""]],
    "foo<sup>[bar]</sup>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[true,false,"",false,true,""]}],
["foo<sub><sup>b[a]r</sup></sub>baz",
    [["stylewithcss","true"],["superscript",""]],
    "foo<sup>b[a]r</sup>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[true,false,"",false,true,""]}],
["foo<sub><sup>b[a]r</sup></sub>baz",
    [["stylewithcss","false"],["superscript",""]],
    "foo<sup>b[a]r</sup>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[true,false,"",false,true,""]}],
["foo<sub>b<sup>[a]</sup>r</sub>baz",
    [["stylewithcss","true"],["superscript",""]],
    "foo<sub>b</sub><sup>[a]</sup><sub>r</sub>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[true,false,"",false,true,""]}],
["foo<sub>b<sup>[a]</sup>r</sub>baz",
    [["stylewithcss","false"],["superscript",""]],
    "foo<sub>b</sub><sup>[a]</sup><sub>r</sub>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[true,false,"",false,true,""]}],
["foo<sup><sub>[bar]</sub></sup>baz",
    [["stylewithcss","true"],["superscript",""]],
    "foo<sup>[bar]</sup>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[true,false,"",false,true,""]}],
["foo<sup><sub>[bar]</sub></sup>baz",
    [["stylewithcss","false"],["superscript",""]],
    "foo<sup>[bar]</sup>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[true,false,"",false,true,""]}],
["foo<sup><sub>b[a]r</sub></sup>baz",
    [["stylewithcss","true"],["superscript",""]],
    "foo<sub>b</sub><sup>[a]</sup><sub>r</sub>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[true,false,"",false,true,""]}],
["foo<sup><sub>b[a]r</sub></sup>baz",
    [["stylewithcss","false"],["superscript",""]],
    "foo<sub>b</sub><sup>[a]</sup><sub>r</sub>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[true,false,"",false,true,""]}],
["foo<sup>b<sub>[a]</sub>r</sup>baz",
    [["stylewithcss","true"],["superscript",""]],
    "foo<sup>b[a]r</sup>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[true,false,"",false,true,""]}],
["foo<sup>b<sub>[a]</sub>r</sup>baz",
    [["stylewithcss","false"],["superscript",""]],
    "foo<sup>b[a]r</sup>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[true,false,"",false,true,""]}],
["fo[o<sup>b]ar</sup>baz",
    [["superscript",""]],
    "fo<sup>[ob]ar</sup>baz",
    [true],
    {"superscript":[true,false,"",false,true,""]}],
["foo<sup>ba[r</sup>b]az",
    [["superscript",""]],
    "foo<sup>ba[rb]</sup>az",
    [true],
    {"superscript":[true,false,"",false,true,""]}],
["fo[o<sup>bar</sup>b]az",
    [["superscript",""]],
    "fo<sup>[obarb]</sup>az",
    [true],
    {"superscript":[true,false,"",false,true,""]}],
["foo[<sup>b]ar</sup>baz",
    [["superscript",""]],
    "foo[b]<sup>ar</sup>baz",
    [true],
    {"superscript":[false,true,"",false,false,""]}],
["foo<sup>ba[r</sup>]baz",
    [["superscript",""]],
    "foo<sup>ba</sup>[r]baz",
    [true],
    {"superscript":[false,true,"",false,false,""]}],
["foo[<sup>bar</sup>]baz",
    [["stylewithcss","true"],["superscript",""]],
    "foo[bar]baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,true,"",false,false,""]}],
["foo[<sup>bar</sup>]baz",
    [["stylewithcss","false"],["superscript",""]],
    "foo[bar]baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,true,"",false,false,""]}],
["foo<sup>[bar]</sup>baz",
    [["stylewithcss","true"],["superscript",""]],
    "foo[bar]baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,true,"",false,false,""]}],
["foo<sup>[bar]</sup>baz",
    [["stylewithcss","false"],["superscript",""]],
    "foo[bar]baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,true,"",false,false,""]}],
["foo{<sup>bar</sup>}baz",
    [["stylewithcss","true"],["superscript",""]],
    "foo{bar}baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,true,"",false,false,""]}],
["foo{<sup>bar</sup>}baz",
    [["stylewithcss","false"],["superscript",""]],
    "foo{bar}baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,true,"",false,false,""]}],
// The selected text not in <sup> should be moved into the existing <sup>.
["<sup>fo[o</sup><sub>b]ar</sub>",
    [["superscript",""]],
    "<sup>fo[ob]</sup><sub>ar</sub>",
    [true],
    {"superscript":[true,false,"",false,true,""]}],
// In the following cases, the vertical-align style in the range should be
// removed first, then, apply <sup>.
["<sup>fo[o</sup><span style=vertical-align:super>b]ar</span>",
    [["stylewithcss","true"],["superscript",""]],
    "<sup>fo[ob]</sup><span style=\"vertical-align:super\">ar</span>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[true,false,"",false,true,""]}],
["<sup>fo[o</sup><span style=vertical-align:super>b]ar</span>",
    [["stylewithcss","false"],["superscript",""]],
    "<sup>fo[ob]</sup><span style=\"vertical-align:super\">ar</span>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[true,false,"",false,true,""]}],
["<sup>fo[o</sup><span style=vertical-align:bottom>b]ar</span>",
    [["stylewithcss","true"],["superscript",""]],
    "<sup>fo[ob]</sup><span style=\"vertical-align:bottom\">ar</span>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[true,false,"",false,true,""]}],
["<sup>fo[o</sup><span style=vertical-align:bottom>b]ar</span>",
    [["stylewithcss","false"],["superscript",""]],
    "<sup>fo[ob]</sup><span style=\"vertical-align:bottom\">ar</span>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[true,false,"",false,true,""]}],
// Even if a vertical-align value is not related to <sub>/<sup>, it should be
// removed to make new <sub> work cleanly.
["foo<span style=vertical-align:bottom>[bar]</span>baz",
    [["stylewithcss","true"],["superscript",""]],
    "foo<sup>[bar]</sup>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,false,"",false,true,""]}],
["foo<span style=vertical-align:bottom>[bar]</span>baz",
    [["stylewithcss","false"],["superscript",""]],
    "foo<sup>[bar]</sup>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,false,"",false,true,""]}],
// Remove <sup> when it becomes only having an invisible <br> element.
["foo<sup>[bar]<br></sup>",
    [["stylewithcss","true"],["superscript",""]],
    "foo[bar]<br>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"superscript":[false,true,"",false,false,""]}],
["foo<sup>[bar]<br></sup>",
    [["stylewithcss","false"],["superscript",""]],
    "foo[bar]<br>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"superscript":[false,true,"",false,false,""]}]
]