summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/editing/data/subscript.js
blob: 4129f4f0e810cc320de560b515b058e07da68b10 (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
// For documentation of the format, see README in this directory.
var browserTests = [
["foo[]bar",
    [["subscript",""]],
    "foo[]bar",
    [true],
    {"subscript":[false,false,"",false,true,""]}],
// <sub> should be used instead of <span style="text-align: sub"> because
// <sub> 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 <sub> only with CSS.
// See also <https://bugzilla.mozilla.org/show_bug.cgi?id=394304#c2>.
["<p>[foo</p> <p>bar]</p>",
    [["stylewithcss","true"],["subscript",""]],
    "<p><sub>[foo</sub></p> <p><sub>bar]</sub></p>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["<p>[foo</p> <p>bar]</p>",
    [["stylewithcss","false"],["subscript",""]],
    "<p><sub>[foo</sub></p> <p><sub>bar]</sub></p>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
["<span>[foo</span> <span>bar]</span>",
    [["stylewithcss","true"],["subscript",""]],
    "<sub><span>[foo</span> <span>bar]</span></sub>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["<span>[foo</span> <span>bar]</span>",
    [["stylewithcss","false"],["subscript",""]],
    "<sub><span>[foo</span> <span>bar]</span></sub>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
["<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>",
    [["stylewithcss","true"],["subscript",""]],
    "<p><sub>[foo</sub></p><p> <sub><span>bar</span></sub> </p><p><sub>baz]</sub></p>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>",
    [["stylewithcss","false"],["subscript",""]],
    "<p><sub>[foo</sub></p><p> <sub><span>bar</span></sub> </p><p><sub>baz]</sub></p>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
["<p>[foo<p><br><p>bar]",
    [["stylewithcss","true"],["subscript",""]],
    "<p><sub>[foo</sub></p><p><sub><br></sub></p><p><sub>bar]</sub></p>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["<p>[foo<p><br><p>bar]",
    [["stylewithcss","false"],["subscript",""]],
    "<p><sub>[foo</sub></p><p><sub><br></sub></p><p><sub>bar]</sub></p>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
["<b>foo[]bar</b>",
    [["subscript",""]],
    "<b>foo[]bar</b>",
    [true],
    {"subscript":[false,false,"",false,true,""]}],
["<i>foo[]bar</i>",
    [["subscript",""]],
    "<i>foo[]bar</i>",
    [true],
    {"subscript":[false,false,"",false,true,""]}],
["<span>foo</span>{}<span>bar</span>",
    [["subscript",""]],
    "<span>foo</span>{}<span>bar</span>",
    [true],
    {"subscript":[false,false,"",false,true,""]}],
["<span>foo[</span><span>]bar</span>",
    [["subscript",""]],
    "<span>foo[</span><span>]bar</span>",
    [true],
    {"subscript":[false,false,"",false,true,""]}],
["foo[bar]baz",
    [["stylewithcss","true"],["subscript",""]],
    "foo<sub>[bar]</sub>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["foo[bar]baz",
    [["stylewithcss","false"],["subscript",""]],
    "foo<sub>[bar]</sub>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
["foo[bar<b>baz]qoz</b>quz",
    [["stylewithcss","true"],["subscript",""]],
    "foo<sub>[bar</sub><b><sub>baz]</sub>qoz</b>quz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["foo[bar<b>baz]qoz</b>quz",
    [["stylewithcss","false"],["subscript",""]],
    "foo<sub>[bar</sub><b><sub>baz]</sub>qoz</b>quz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
["foo[bar<i>baz]qoz</i>quz",
    [["stylewithcss","true"],["subscript",""]],
    "foo<sub>[bar</sub><i><sub>baz]</sub>qoz</i>quz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["foo[bar<i>baz]qoz</i>quz",
    [["stylewithcss","false"],["subscript",""]],
    "foo<sub>[bar</sub><i><sub>baz]</sub>qoz</i>quz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
["{<p><p> <p>foo</p>}",
    [["stylewithcss","true"],["subscript",""]],
    "{<p></p><p> </p><p><sub>foo</sub></p>}",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["{<p><p> <p>foo</p>}",
    [["stylewithcss","false"],["subscript",""]],
    "{<p></p><p> </p><p><sub>foo</sub></p>}",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
["<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>",
    [["stylewithcss","true"],["subscript",""]],
    "<table><tbody><tr><td>foo</td><td>b<sub>[a]</sub>r</td><td>baz</td></tr></tbody></table>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>",
    [["stylewithcss","false"],["subscript",""]],
    "<table><tbody><tr><td>foo</td><td>b<sub>[a]</sub>r</td><td>baz</td></tr></tbody></table>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
["<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>",
    [["stylewithcss","true"],["subscript",""]],
    "<table><tbody><tr><td>foo</td>{<td><sub>bar</sub></td>}<td>baz</td></tr></tbody></table>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>",
    [["stylewithcss","false"],["subscript",""]],
    "<table><tbody><tr><td>foo</td>{<td><sub>bar</sub></td>}<td>baz</td></tr></tbody></table>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
["<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>",
    [["stylewithcss","true"],["subscript",""]],
    "<table><tbody><tr>{<td><sub>foo</sub></td><td><sub>bar</sub></td>}<td>baz</td></tr></tbody></table>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>",
    [["stylewithcss","false"],["subscript",""]],
    "<table><tbody><tr>{<td><sub>foo</sub></td><td><sub>bar</sub></td>}<td>baz</td></tr></tbody></table>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
["<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>",
    [["stylewithcss","true"],["subscript",""]],
    "<table><tbody>{<tr><td><sub>foo</sub></td><td><sub>bar</sub></td><td><sub>baz</sub></td></tr>}</tbody></table>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>",
    [["stylewithcss","false"],["subscript",""]],
    "<table><tbody>{<tr><td><sub>foo</sub></td><td><sub>bar</sub></td><td><sub>baz</sub></td></tr>}</tbody></table>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
["<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>",
    [["stylewithcss","true"],["subscript",""]],
    "<table>{<tbody><tr><td><sub>foo</sub></td><td><sub>bar</sub></td><td><sub>baz</sub></td></tr></tbody>}</table>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>",
    [["stylewithcss","false"],["subscript",""]],
    "<table>{<tbody><tr><td><sub>foo</sub></td><td><sub>bar</sub></td><td><sub>baz</sub></td></tr></tbody>}</table>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
["{<table><tr><td>foo<td>bar<td>baz</table>}",
    [["stylewithcss","true"],["subscript",""]],
    "{<table><tbody><tr><td><sub>foo</sub></td><td><sub>bar</sub></td><td><sub>baz</sub></td></tr></tbody></table>}",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["{<table><tr><td>foo<td>bar<td>baz</table>}",
    [["stylewithcss","false"],["subscript",""]],
    "{<table><tbody><tr><td><sub>foo</sub></td><td><sub>bar</sub></td><td><sub>baz</sub></td></tr></tbody></table>}",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
["foo<sub>b[a]r</sub>baz",
    [["stylewithcss","true"],["subscript",""]],
    "foo<sub>b</sub>[a]<sub>r</sub>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,true,"",false,false,""]}],
["foo<sub>b[a]r</sub>baz",
    [["stylewithcss","false"],["subscript",""]],
    "foo<sub>b</sub>[a]<sub>r</sub>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,true,"",false,false,""]}],
["foo<sup>[bar]</sup>baz",
    [["stylewithcss","true"],["subscript",""]],
    "foo<sub>[bar]</sub>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["foo<sup>[bar]</sup>baz",
    [["stylewithcss","false"],["subscript",""]],
    "foo<sub>[bar]</sub>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
["foo<sup>b[a]r</sup>baz",
    [["stylewithcss","true"],["subscript",""]],
    "foo<sup>b</sup><sub>[a]</sub><sup>r</sup>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["foo<sup>b[a]r</sup>baz",
    [["stylewithcss","false"],["subscript",""]],
    "foo<sup>b</sup><sub>[a]</sub><sup>r</sup>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
// Although <sub> is not equivalent to `vertical-align: sub` as mentioned above,
// they are obviously conflict.  Therefore, `vertical-align` style of ancestor
// and descendants elements of selection should be removed to make <sub> work.
["foo<span style=vertical-align:sub>[bar]</span>baz",
    [["stylewithcss","true"],["subscript",""]],
    "foo<sub>[bar]</sub>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["foo<span style=vertical-align:sub>[bar]</span>baz",
    [["stylewithcss","false"],["subscript",""]],
    "foo<sub>[bar]</sub>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
["foo<span style=vertical-align:super>[bar]</span>baz",
    [["stylewithcss","true"],["subscript",""]],
    "foo<sub>[bar]</sub>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["foo<span style=vertical-align:super>[bar]</span>baz",
    [["stylewithcss","false"],["subscript",""]],
    "foo<sub>[bar]</sub>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
["foo<sub><sub>[bar]</sub></sub>baz",
    [["stylewithcss","true"],["subscript",""]],
    "foo[bar]baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,true,"",false,false,""]}],
["foo<sub><sub>[bar]</sub></sub>baz",
    [["stylewithcss","false"],["subscript",""]],
    "foo[bar]baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,true,"",false,false,""]}],
["foo<sub><sub>b[a]r</sub></sub>baz",
    [["subscript",""]],
    "foo<sub>b</sub>[a]<sub>r</sub>baz",
    [true],
    {"subscript":[false,true,"",false,false,""]}],
["foo<sub>b<sub>[a]</sub>r</sub>baz",
    [["subscript",""]],
    "foo<sub>b</sub>[a]<sub>r</sub>baz",
    [true],
    {"subscript":[false,true,"",false,false,""]}],
["foo<sup><sup>[bar]</sup></sup>baz",
    [["stylewithcss","true"],["subscript",""]],
    "foo<sub>[bar]</sub>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["foo<sup><sup>[bar]</sup></sup>baz",
    [["stylewithcss","false"],["subscript",""]],
    "foo<sub>[bar]</sub>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
["foo<sup><sup>b[a]r</sup></sup>baz",
    [["stylewithcss","true"],["subscript",""]],
    "foo<sup>b</sup><sub>[a]</sub><sup>r</sup>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["foo<sup><sup>b[a]r</sup></sup>baz",
    [["stylewithcss","false"],["subscript",""]],
    "foo<sup>b</sup><sub>[a]</sub><sup>r</sup>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
["foo<sup>b<sup>[a]</sup>r</sup>baz",
    [["stylewithcss","true"],["subscript",""]],
    "foo<sup>b</sup><sub>[a]</sub><sup>r</sup>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["foo<sup>b<sup>[a]</sup>r</sup>baz",
    [["stylewithcss","false"],["subscript",""]],
    "foo<sup>b</sup><sub>[a]</sub><sup>r</sup>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
["foo<sub><sup>[bar]</sup></sub>baz",
    [["stylewithcss","true"],["subscript",""]],
    "foo<sub>[bar]</sub>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[true,false,"",false,true,""]}],
["foo<sub><sup>[bar]</sup></sub>baz",
    [["stylewithcss","false"],["subscript",""]],
    "foo<sub>[bar]</sub>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[true,false,"",false,true,""]}],
["foo<sub><sup>b[a]r</sup></sub>baz",
    [["stylewithcss","true"],["subscript",""]],
    "foo<sup>b</sup><sub>[a]</sub><sup>r</sup>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[true,false,"",false,true,""]}],
["foo<sub><sup>b[a]r</sup></sub>baz",
    [["stylewithcss","false"],["subscript",""]],
    "foo<sup>b</sup><sub>[a]</sub><sup>r</sup>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[true,false,"",false,true,""]}],
["foo<sub>b<sup>[a]</sup>r</sub>baz",
    [["stylewithcss","true"],["subscript",""]],
    "foo<sub>b[a]r</sub>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[true,false,"",false,true,""]}],
["foo<sub>b<sup>[a]</sup>r</sub>baz",
    [["stylewithcss","false"],["subscript",""]],
    "foo<sub>b[a]r</sub>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[true,false,"",false,true,""]}],
["foo<sup><sub>[bar]</sub></sup>baz",
    [["stylewithcss","true"],["subscript",""]],
    "foo<sub>[bar]</sub>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[true,false,"",false,true,""]}],
["foo<sup><sub>[bar]</sub></sup>baz",
    [["stylewithcss","false"],["subscript",""]],
    "foo<sub>[bar]</sub>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[true,false,"",false,true,""]}],
["foo<sup><sub>b[a]r</sub></sup>baz",
    [["stylewithcss","true"],["subscript",""]],
    "foo<sub>b[a]r</sub>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[true,false,"",false,true,""]}],
["foo<sup><sub>b[a]r</sub></sup>baz",
    [["stylewithcss","false"],["subscript",""]],
    "foo<sub>b[a]r</sub>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[true,false,"",false,true,""]}],
["foo<sup>b<sub>[a]</sub>r</sup>baz",
    [["stylewithcss","true"],["subscript",""]],
    "foo<sup>b</sup><sub>[a]</sub><sup>r</sup>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[true,false,"",false,true,""]}],
["foo<sup>b<sub>[a]</sub>r</sup>baz",
    [["stylewithcss","false"],["subscript",""]],
    "foo<sup>b</sup><sub>[a]</sub><sup>r</sup>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[true,false,"",false,true,""]}],
["fo[o<sub>b]ar</sub>baz",
    [["subscript",""]],
    "fo<sub>[ob]ar</sub>baz",
    [true],
    {"subscript":[true,false,"",false,true,""]}],
["foo<sub>ba[r</sub>b]az",
    [["subscript",""]],
    "foo<sub>ba[rb]</sub>az",
    [true],
    {"subscript":[true,false,"",false,true,""]}],
["fo[o<sub>bar</sub>b]az",
    [["subscript",""]],
    "fo<sub>[obarb]</sub>az",
    [true],
    {"subscript":[true,false,"",false,true,""]}],
["foo[<sub>b]ar</sub>baz",
    [["subscript",""]],
    "foo[b]<sub>ar</sub>baz",
    [true],
    {"subscript":[false,true,"",false,false,""]}],
["foo<sub>ba[r</sub>]baz",
    [["subscript",""]],
    "foo<sub>ba</sub>[r]baz",
    [true],
    {"subscript":[false,true,"",false,false,""]}],
["foo[<sub>bar</sub>]baz",
    [["stylewithcss","true"],["subscript",""]],
    "foo[bar]baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,true,"",false,false,""]}],
["foo[<sub>bar</sub>]baz",
    [["stylewithcss","false"],["subscript",""]],
    "foo[bar]baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,true,"",false,false,""]}],
["foo<sub>[bar]</sub>baz",
    [["stylewithcss","true"],["subscript",""]],
    "foo[bar]baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,true,"",false,false,""]}],
["foo<sub>[bar]</sub>baz",
    [["stylewithcss","false"],["subscript",""]],
    "foo[bar]baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,true,"",false,false,""]}],
["foo{<sub>bar</sub>}baz",
    [["stylewithcss","true"],["subscript",""]],
    "foo{bar}baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,true,"",false,false,""]}],
["foo{<sub>bar</sub>}baz",
    [["stylewithcss","false"],["subscript",""]],
    "foo{bar}baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,true,"",false,false,""]}],
// The selected text not in <sub> should be moved into the existing <sub>.
["<sub>fo[o</sub><sup>b]ar</sup>",
    [["subscript",""]],
    "<sub>fo[ob]</sub><sup>ar</sup>",
    [true],
    {"subscript":[true,false,"",false,true,""]}],
// In the following cases, the vertical-align style in the range should be
// removed first, then, apply <sub>.
["<sub>fo[o</sub><span style=vertical-align:sub>b]ar</span>",
    [["stylewithcss","true"],["subscript",""]],
    "<sub>fo[ob]</sub><span style=\"vertical-align:sub\">ar</span>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[true,false,"",false,true,""]}],
["<sub>fo[o</sub><span style=vertical-align:sub>b]ar</span>",
    [["stylewithcss","false"],["subscript",""]],
    "<sub>fo[ob]</sub><span style=\"vertical-align:sub\">ar</span>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[true,false,"",false,true,""]}],
["<sub>fo[o</sub><span style=vertical-align:top>b]ar</span>",
    [["stylewithcss","true"],["subscript",""]],
    "<sub>fo[ob]</sub><span style=\"vertical-align:top\">ar</span>",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[true,false,"",false,true,""]}],
["<sub>fo[o</sub><span style=vertical-align:top>b]ar</span>",
    [["stylewithcss","false"],["subscript",""]],
    "<sub>fo[ob]</sub><span style=\"vertical-align:top\">ar</span>",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[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:top>[bar]</span>baz",
    [["stylewithcss","true"],["subscript",""]],
    "foo<sub>[bar]</sub>baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"subscript":[false,false,"",false,true,""]}],
["foo<span style=vertical-align:top>[bar]</span>baz",
    [["stylewithcss","false"],["subscript",""]],
    "foo<sub>[bar]</sub>baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"subscript":[false,false,"",false,true,""]}],
]