summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/editing/data/insertimage.js
blob: d1874e6521216fcc2af1501ecba12761d31126b1 (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
var browserTests = [
["foo[]bar",
    [["insertimage","/img/lion.svg"]],
    "foo<img src=\"/img/lion.svg\">{}bar",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["<span>foo</span>{}<span>bar</span>",
    [["insertimage","/img/lion.svg"]],
    "<span>foo</span><img src=\"/img/lion.svg\">{}<span>bar</span>",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["<span>foo[</span><span>]bar</span>",
    [["insertimage","/img/lion.svg"]],
    "<span>foo<img src=\"/img/lion.svg\">{}</span><span>bar</span>",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["foo[bar]baz",
    [["insertimage",""]],
    "foo[bar]baz",
    [false],
    {"insertimage":[false,false,"",false,false,""]}],
["foo[bar]baz",
    [["insertimage","/img/lion.svg"]],
    "foo<img src=\"/img/lion.svg\">{}baz",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["foo<span style=color:#aBcDeF>[bar]</span>baz",
    [["insertimage","/img/lion.svg"]],
    "foo<span style=\"color:rgb(171, 205, 239)\"><img src=\"/img/lion.svg\">{}</span>baz",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["foo<span style=color:#aBcDeF>{bar}</span>baz",
    [["insertimage","/img/lion.svg"]],
    "foo<span style=\"color:rgb(171, 205, 239)\"><img src=\"/img/lion.svg\">{}</span>baz",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["foo{<span style=color:#aBcDeF>bar</span>}baz",
    [["insertimage","/img/lion.svg"]],
    "foo<span style=\"color:rgb(171, 205, 239)\"><img src=\"/img/lion.svg\">{}</span>baz",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["[foo<span style=color:#aBcDeF>bar]</span>baz",
    [["stylewithcss","true"],["insertimage","/img/lion.svg"]],
    "<img src=\"/img/lion.svg\">{}baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"insertimage":[false,false,"",false,false,""]}],
["[foo<span style=color:#aBcDeF>bar]</span>baz",
    [["stylewithcss","false"],["insertimage","/img/lion.svg"]],
    "<img src=\"/img/lion.svg\">{}baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"insertimage":[false,false,"",false,false,""]}],
["{foo<span style=color:#aBcDeF>bar}</span>baz",
    [["stylewithcss","true"],["insertimage","/img/lion.svg"]],
    "<img src=\"/img/lion.svg\">{}baz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"insertimage":[false,false,"",false,false,""]}],
["{foo<span style=color:#aBcDeF>bar}</span>baz",
    [["stylewithcss","false"],["insertimage","/img/lion.svg"]],
    "<img src=\"/img/lion.svg\">{}baz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"insertimage":[false,false,"",false,false,""]}],
["foo<span style=color:#aBcDeF>[bar</span>baz]",
    [["insertimage","/img/lion.svg"]],
    "foo<span style=\"color:rgb(171, 205, 239)\"><img src=\"/img/lion.svg\">{}</span>",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["foo<span style=color:#aBcDeF>{bar</span>baz}",
    [["insertimage","/img/lion.svg"]],
    "foo<span style=\"color:rgb(171, 205, 239)\"><img src=\"/img/lion.svg\">{}</span>",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["foo<span style=color:#aBcDeF>[bar</span><span style=color:#fEdCbA>baz]</span>quz",
    [["stylewithcss","true"],["insertimage","/img/lion.svg"]],
    "foo<span style=\"color:rgb(171, 205, 239)\"><img src=\"/img/lion.svg\">{}</span>quz",
    [true,true],
    {"stylewithcss":[false,false,"",false,true,""],"insertimage":[false,false,"",false,false,""]}],
["foo<span style=color:#aBcDeF>[bar</span><span style=color:#fEdCbA>baz]</span>quz",
    [["stylewithcss","false"],["insertimage","/img/lion.svg"]],
    "foo<span style=\"color:rgb(171, 205, 239)\"><img src=\"/img/lion.svg\">{}</span>quz",
    [true,true],
    {"stylewithcss":[false,true,"",false,false,""],"insertimage":[false,false,"",false,false,""]}],
["foo<b>[bar]</b>baz",
    [["insertimage","/img/lion.svg"]],
    "foo<b><img src=\"/img/lion.svg\">{}</b>baz",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["foo<b>{bar}</b>baz",
    [["insertimage","/img/lion.svg"]],
    "foo<b><img src=\"/img/lion.svg\">{}</b>baz",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["foo{<b>bar</b>}baz",
    [["insertimage","/img/lion.svg"]],
    "foo<b><img src=\"/img/lion.svg\">{}</b>baz",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["foo<span>[bar]</span>baz",
    [["insertimage","/img/lion.svg"]],
    "foo<span><img src=\"/img/lion.svg\">{}</span>baz",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["foo<span>{bar}</span>baz",
    [["insertimage","/img/lion.svg"]],
    "foo<span><img src=\"/img/lion.svg\">{}</span>baz",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["foo{<span>bar</span>}baz",
    [["insertimage","/img/lion.svg"]],
    "foo<span><img src=\"/img/lion.svg\">{}</span>baz",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["<b>foo[bar</b><i>baz]quz</i>",
    [["insertimage","/img/lion.svg"]],
    "<b>foo<img src=\"/img/lion.svg\">{}</b><i>quz</i>",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["<p>foo</p><p>[bar]</p><p>baz</p>",
    [["insertimage","/img/lion.svg"]],
    "<p>foo</p><p><img src=\"/img/lion.svg\">{}</p><p>baz</p>",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["<p>foo</p><p>{bar}</p><p>baz</p>",
    [["insertimage","/img/lion.svg"]],
    "<p>foo</p><p><img src=\"/img/lion.svg\">{}</p><p>baz</p>",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["<p>foo</p>{<p>bar</p>}<p>baz</p>",
    [["defaultparagraphseparator","div"],["insertimage","/img/lion.svg"]],
    "<p>foo</p><img src=\"/img/lion.svg\">{}<p>baz</p>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"div",false,false,"div"],"insertimage":[false,false,"",false,false,""]}],
["<p>foo</p>{<p>bar</p>}<p>baz</p>",
    [["defaultparagraphseparator","p"],["insertimage","/img/lion.svg"]],
    "<p>foo</p><img src=\"/img/lion.svg\">{}<p>baz</p>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"div",false,false,"p"],"insertimage":[false,false,"",false,false,""]}],
["<p>foo[bar<p>baz]quz",
    [["defaultparagraphseparator","div"],["insertimage","/img/lion.svg"]],
    "<p>foo<img src=\"/img/lion.svg\">{}quz</p>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"p",false,false,"div"],"insertimage":[false,false,"",false,false,""]}],
["<p>foo[bar<p>baz]quz",
    [["defaultparagraphseparator","p"],["insertimage","/img/lion.svg"]],
    "<p>foo<img src=\"/img/lion.svg\">{}quz</p>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"div",false,false,"p"],"insertimage":[false,false,"",false,false,""]}],
["<p>foo[bar<div>baz]quz</div>",
    [["defaultparagraphseparator","div"],["insertimage","/img/lion.svg"]],
    "<p>foo<img src=\"/img/lion.svg\">{}quz</p>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"p",false,false,"div"],"insertimage":[false,false,"",false,false,""]}],
["<p>foo[bar<div>baz]quz</div>",
    [["defaultparagraphseparator","p"],["insertimage","/img/lion.svg"]],
    "<p>foo<img src=\"/img/lion.svg\">{}quz</p>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"div",false,false,"p"],"insertimage":[false,false,"",false,false,""]}],
["<p>foo[bar<h1>baz]quz</h1>",
    [["insertimage","/img/lion.svg"]],
    "<p>foo<img src=\"/img/lion.svg\">{}quz</p>",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["<div>foo[bar</div><p>baz]quz",
    [["defaultparagraphseparator","div"],["insertimage","/img/lion.svg"]],
    "<div>foo<img src=\"/img/lion.svg\">{}quz</div>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"p",false,false,"div"],"insertimage":[false,false,"",false,false,""]}],
["<div>foo[bar</div><p>baz]quz",
    [["defaultparagraphseparator","p"],["insertimage","/img/lion.svg"]],
    "<div>foo<img src=\"/img/lion.svg\">{}quz</div>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"div",false,false,"p"],"insertimage":[false,false,"",false,false,""]}],
["<blockquote>foo[bar</blockquote><pre>baz]quz</pre>",
    [["insertimage","/img/lion.svg"]],
    "<blockquote>foo<img src=\"/img/lion.svg\">{}quz</blockquote>",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["<p><b>foo[bar</b><p>baz]quz",
    [["defaultparagraphseparator","div"],["insertimage","/img/lion.svg"]],
    "<p><b>foo</b><img src=\"/img/lion.svg\">{}quz</p>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"p",false,false,"div"],"insertimage":[false,false,"",false,false,""]}],
["<p><b>foo[bar</b><p>baz]quz",
    [["defaultparagraphseparator","p"],["insertimage","/img/lion.svg"]],
    "<p><b>foo</b><img src=\"/img/lion.svg\">{}quz</p>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"div",false,false,"p"],"insertimage":[false,false,"",false,false,""]}],
["<div><p>foo[bar</div><p>baz]quz",
    [["defaultparagraphseparator","div"],["insertimage","/img/lion.svg"]],
    "<div><p>foo<img src=\"/img/lion.svg\">{}quz</p></div>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"p",false,false,"div"],"insertimage":[false,false,"",false,false,""]}],
["<div><p>foo[bar</div><p>baz]quz",
    [["defaultparagraphseparator","p"],["insertimage","/img/lion.svg"]],
    "<div><p>foo<img src=\"/img/lion.svg\">{}quz</p></div>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"div",false,false,"p"],"insertimage":[false,false,"",false,false,""]}],
["<p>foo[bar<blockquote><p>baz]quz<p>qoz</blockquote",
    [["defaultparagraphseparator","div"],["insertimage","/img/lion.svg"]],
    "<p>foo<img src=\"/img/lion.svg\">{}quz</p><blockquote><p>qoz</p></blockquote>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"p",false,false,"div"],"insertimage":[false,false,"",false,false,""]}],
["<p>foo[bar<blockquote><p>baz]quz<p>qoz</blockquote",
    [["defaultparagraphseparator","p"],["insertimage","/img/lion.svg"]],
    "<p>foo<img src=\"/img/lion.svg\">{}quz</p><blockquote><p>qoz</p></blockquote>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"div",false,false,"p"],"insertimage":[false,false,"",false,false,""]}],
["<p>foo[bar<p style=color:blue>baz]quz",
    [["stylewithcss","true"],["defaultparagraphseparator","div"],["insertimage","/img/lion.svg"]],
    "<p>foo<img src=\"/img/lion.svg\">{}<span style=\"color:rgb(0, 0, 255)\">quz</span></p>",
    [true,true,true],
    {"stylewithcss":[false,false,"",false,true,""],"defaultparagraphseparator":[false,false,"p",false,false,"div"],"insertimage":[false,false,"",false,false,""]}],
["<p>foo[bar<p style=color:blue>baz]quz",
    [["stylewithcss","false"],["defaultparagraphseparator","div"],["insertimage","/img/lion.svg"]],
    "<p>foo<img src=\"/img/lion.svg\">{}<font color=\"#0000ff\">quz</font></p>",
    [true,true,true],
    {"stylewithcss":[false,true,"",false,false,""],"defaultparagraphseparator":[false,false,"div",false,false,"div"],"insertimage":[false,false,"",false,false,""]}],
["<p>foo[bar<p style=color:blue>baz]quz",
    [["stylewithcss","true"],["defaultparagraphseparator","p"],["insertimage","/img/lion.svg"]],
    "<p>foo<img src=\"/img/lion.svg\">{}<span style=\"color:rgb(0, 0, 255)\">quz</span></p>",
    [true,true,true],
    {"stylewithcss":[false,false,"",false,true,""],"defaultparagraphseparator":[false,false,"div",false,false,"p"],"insertimage":[false,false,"",false,false,""]}],
["<p>foo[bar<p style=color:blue>baz]quz",
    [["stylewithcss","false"],["defaultparagraphseparator","p"],["insertimage","/img/lion.svg"]],
    "<p>foo<img src=\"/img/lion.svg\">{}<font color=\"#0000ff\">quz</font></p>",
    [true,true,true],
    {"stylewithcss":[false,true,"",false,false,""],"defaultparagraphseparator":[false,false,"p",false,false,"p"],"insertimage":[false,false,"",false,false,""]}],
["<p>foo[bar<p><b>baz]quz</b>",
    [["defaultparagraphseparator","div"],["insertimage","/img/lion.svg"]],
    "<p>foo<img src=\"/img/lion.svg\">{}<b>quz</b></p>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"p",false,false,"div"],"insertimage":[false,false,"",false,false,""]}],
["<p>foo[bar<p><b>baz]quz</b>",
    [["defaultparagraphseparator","p"],["insertimage","/img/lion.svg"]],
    "<p>foo<img src=\"/img/lion.svg\">{}<b>quz</b></p>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"div",false,false,"p"],"insertimage":[false,false,"",false,false,""]}],
["<div><p>foo<p>[bar<p>baz]</div>",
    [["defaultparagraphseparator","div"],["insertimage","/img/lion.svg"]],
    "<div><p>foo</p><p><img src=\"/img/lion.svg\">{}</p></div>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"p",false,false,"div"],"insertimage":[false,false,"",false,false,""]}],
["<div><p>foo<p>[bar<p>baz]</div>",
    [["defaultparagraphseparator","p"],["insertimage","/img/lion.svg"]],
    "<div><p>foo</p><p><img src=\"/img/lion.svg\">{}</p></div>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"div",false,false,"p"],"insertimage":[false,false,"",false,false,""]}],
["foo[<br>]bar",
    [["insertimage","/img/lion.svg"]],
    "foo<img src=\"/img/lion.svg\">{}bar",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["<p>foo[</p><p>]bar</p>",
    [["defaultparagraphseparator","div"],["insertimage","/img/lion.svg"]],
    "<p>foo<img src=\"/img/lion.svg\">{}bar</p>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"p",false,false,"div"],"insertimage":[false,false,"",false,false,""]}],
["<p>foo[</p><p>]bar</p>",
    [["defaultparagraphseparator","p"],["insertimage","/img/lion.svg"]],
    "<p>foo<img src=\"/img/lion.svg\">{}bar</p>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"div",false,false,"p"],"insertimage":[false,false,"",false,false,""]}],
["<p>foo[</p><p>]bar<br>baz</p>",
    [["defaultparagraphseparator","div"],["insertimage","/img/lion.svg"]],
    "<p>foo<img src=\"/img/lion.svg\">{}bar<br>baz</p>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"p",false,false,"div"],"insertimage":[false,false,"",false,false,""]}],
["<p>foo[</p><p>]bar<br>baz</p>",
    [["defaultparagraphseparator","p"],["insertimage","/img/lion.svg"]],
    "<p>foo<img src=\"/img/lion.svg\">{}bar<br>baz</p>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"div",false,false,"p"],"insertimage":[false,false,"",false,false,""]}],
["foo[<p>]bar</p>",
    [["defaultparagraphseparator","div"],["insertimage","/img/lion.svg"]],
    "foo<img src=\"/img/lion.svg\">{}bar",
    [true,true],
    {"defaultparagraphseparator":[false,false,"p",false,false,"div"],"insertimage":[false,false,"",false,false,""]}],
["foo[<p>]bar</p>",
    [["defaultparagraphseparator","p"],["insertimage","/img/lion.svg"]],
    "foo<img src=\"/img/lion.svg\">{}bar",
    [true,true],
    {"defaultparagraphseparator":[false,false,"div",false,false,"p"],"insertimage":[false,false,"",false,false,""]}],
["foo[<p>]bar<br>baz</p>",
    [["insertimage","/img/lion.svg"]],
    "foo<img src=\"/img/lion.svg\">{}bar<p>baz</p>",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["foo[<p>]bar</p>baz",
    [["defaultparagraphseparator","div"],["insertimage","/img/lion.svg"]],
    "foo<img src=\"/img/lion.svg\">{}bar<br>baz",
    [true,true],
    {"defaultparagraphseparator":[false,false,"p",false,false,"div"],"insertimage":[false,false,"",false,false,""]}],
["foo[<p>]bar</p>baz",
    [["defaultparagraphseparator","p"],["insertimage","/img/lion.svg"]],
    "foo<img src=\"/img/lion.svg\">{}bar<br>baz",
    [true,true],
    {"defaultparagraphseparator":[false,false,"div",false,false,"p"],"insertimage":[false,false,"",false,false,""]}],
["<p>foo[</p>]bar",
    [["insertimage","/img/lion.svg"]],
    "<p>foo<img src=\"/img/lion.svg\">{}bar</p>",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["<p>foo[</p>]bar<br>baz",
    [["insertimage","/img/lion.svg"]],
    "<p>foo<img src=\"/img/lion.svg\">{}bar</p>baz",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["<p>foo[</p>]bar<p>baz</p>",
    [["insertimage","/img/lion.svg"]],
    "<p>foo<img src=\"/img/lion.svg\">{}bar</p><p>baz</p>",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["foo[<div><p>]bar</div>",
    [["defaultparagraphseparator","div"],["insertimage","/img/lion.svg"]],
    "foo<img src=\"/img/lion.svg\">{}bar",
    [true,true],
    {"defaultparagraphseparator":[false,false,"p",false,false,"div"],"insertimage":[false,false,"",false,false,""]}],
["foo[<div><p>]bar</div>",
    [["defaultparagraphseparator","p"],["insertimage","/img/lion.svg"]],
    "foo<img src=\"/img/lion.svg\">{}bar",
    [true,true],
    {"defaultparagraphseparator":[false,false,"div",false,false,"p"],"insertimage":[false,false,"",false,false,""]}],
["<div><p>foo[</p></div>]bar",
    [["insertimage","/img/lion.svg"]],
    "<div><p>foo<img src=\"/img/lion.svg\">{}bar</p></div>",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["foo[<div><p>]bar</p>baz</div>",
    [["defaultparagraphseparator","div"],["insertimage","/img/lion.svg"]],
    "foo<img src=\"/img/lion.svg\">{}bar<div>baz</div>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"p",false,false,"div"],"insertimage":[false,false,"",false,false,""]}],
["foo[<div><p>]bar</p>baz</div>",
    [["defaultparagraphseparator","p"],["insertimage","/img/lion.svg"]],
    "foo<img src=\"/img/lion.svg\">{}bar<div>baz</div>",
    [true,true],
    {"defaultparagraphseparator":[false,false,"div",false,false,"p"],"insertimage":[false,false,"",false,false,""]}],
["foo[<div>]bar<p>baz</p></div>",
    [["insertimage","/img/lion.svg"]],
    "foo<img src=\"/img/lion.svg\">{}bar<div><p>baz</p></div>",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["<div><p>foo</p>bar[</div>]baz",
    [["insertimage","/img/lion.svg"]],
    "<div><p>foo</p>bar<img src=\"/img/lion.svg\">{}baz</div>",
    [true],
    {"insertimage":[false,false,"",false,false,""]}],
["<div>foo<p>bar[</p></div>]baz",
    [["insertimage","/img/lion.svg"]],
    "<div>foo<p>bar<img src=\"/img/lion.svg\">{}baz</p></div>",
    [true],
    {"insertimage":[false,false,"",false,false,""]}]
]