dom/imptests/editing/tests.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 // For the original (development) tests, we want to make a bunch of changes to
michael@0 2 // the page as it loads. We don't want this for the conformance tests, so let
michael@0 3 // them opt out.
michael@0 4 if (typeof testsJsLibraryOnly == "undefined" || !testsJsLibraryOnly) {
michael@0 5 // Alert the reader of egregious Opera bug that will make the specced
michael@0 6 // implementation horribly buggy
michael@0 7 //@{
michael@0 8 (function() {
michael@0 9 var div = document.createElement("div");
michael@0 10 div.appendChild(document.createElement("br"));
michael@0 11 document.body.insertBefore(div, document.body.firstChild);
michael@0 12 var range = document.createRange();
michael@0 13 range.setStart(div, 1);
michael@0 14 div.insertBefore(document.createElement("p"), div.firstChild);
michael@0 15 if (range.startOffset > range.startContainer.childNodes.length) {
michael@0 16 var warningDiv = document.createElement("p");
michael@0 17 document.body.insertBefore(warningDiv, document.body.firstChild);
michael@0 18 warningDiv.style.fontWeight = "bold";
michael@0 19 warningDiv.style.fontSize = "2em";
michael@0 20 warningDiv.style.color = "red";
michael@0 21 warningDiv.innerHTML = 'Your browser suffers from an <a href="http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1028">egregious bug</a> in range mutation that will give incorrect results for the spec columns in many cases. To ensure that the spec column contains the output actually required by the spec, use a different browser.';
michael@0 22 }
michael@0 23 div.parentNode.removeChild(div);
michael@0 24 })();
michael@0 25 //@}
michael@0 26
michael@0 27 // Insert the toolbar thingie as soon as the script file is loaded
michael@0 28 //@{
michael@0 29 (function() {
michael@0 30 var toolbarDiv = document.createElement("div");
michael@0 31 toolbarDiv.id = "toolbar";
michael@0 32 // Note: this is completely not a hack at all.
michael@0 33 toolbarDiv.innerHTML = "<style id=alerts>body > div > table > tbody > tr:not(.alert):not(:first-child):not(.active) { display: none }</style>"
michael@0 34 + "<label><input id=alert-checkbox type=checkbox accesskey=a checked onclick='updateAlertRowStyle()'> Display rows without spec <u>a</u>lerts</label>"
michael@0 35 + "<label><input id=browser-checkbox type=checkbox accesskey=b checked onclick='localStorage[\"display-browser-tests\"] = event.target.checked'> Run <u>b</u>rowser tests as well as spec tests</label>";
michael@0 36
michael@0 37 document.body.appendChild(toolbarDiv);
michael@0 38 })();
michael@0 39 //@}
michael@0 40
michael@0 41 // Confusingly, we're storing a string here, not a boolean.
michael@0 42 document.querySelector("#alert-checkbox").checked = localStorage["display-alerts"] != "false";
michael@0 43 document.querySelector("#browser-checkbox").checked = localStorage["display-browser-tests"] != "false";
michael@0 44
michael@0 45 function updateAlertRowStyle() {
michael@0 46 //@{
michael@0 47 var checked = document.querySelector("#alert-checkbox").checked;
michael@0 48 document.querySelector("#alerts").disabled = checked;
michael@0 49 localStorage["display-alerts"] = checked;
michael@0 50 }
michael@0 51 //@}
michael@0 52 updateAlertRowStyle();
michael@0 53
michael@0 54 // Feature-test whether the browser wraps at <wbr> or not, and set word-wrap:
michael@0 55 // break-word where necessary if not. (IE and Opera don't wrap, Gecko and
michael@0 56 // WebKit do.) word-wrap: break-word will break anywhere at all, so it looks
michael@0 57 // significantly uglier.
michael@0 58 //@{
michael@0 59 (function() {
michael@0 60 var wordWrapTestDiv = document.createElement("div");
michael@0 61 wordWrapTestDiv.style.width = "5em";
michael@0 62 document.body.appendChild(wordWrapTestDiv);
michael@0 63 wordWrapTestDiv.innerHTML = "abc";
michael@0 64 var height1 = getComputedStyle(wordWrapTestDiv).height;
michael@0 65 wordWrapTestDiv.innerHTML = "abc<wbr>abc<wbr>abc<wbr>abc<wbr>abc<wbr>abc";
michael@0 66 var height2 = getComputedStyle(wordWrapTestDiv).height;
michael@0 67 document.body.removeChild(wordWrapTestDiv);
michael@0 68 if (height1 == height2) {
michael@0 69 document.body.className = (document.body.className + " wbr-workaround").trim();
michael@0 70 }
michael@0 71 })();
michael@0 72 //@}
michael@0 73 }
michael@0 74
michael@0 75 // Now for the meat of the file.
michael@0 76 var tests = {
michael@0 77 backcolor: [
michael@0 78 //@{ Same as hilitecolor (set below)
michael@0 79 ],
michael@0 80 //@}
michael@0 81 bold: [
michael@0 82 //@{
michael@0 83 'foo[]bar',
michael@0 84 '<p>[foo</p> <p>bar]</p>',
michael@0 85 '<span>[foo</span> <span>bar]</span>',
michael@0 86 '<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>',
michael@0 87 '<p>[foo<p><br><p>bar]',
michael@0 88 '<b>foo[]bar</b>',
michael@0 89 '<i>foo[]bar</i>',
michael@0 90 '<span>foo</span>{}<span>bar</span>',
michael@0 91 '<span>foo[</span><span>]bar</span>',
michael@0 92 'foo[bar]baz',
michael@0 93 'foo[bar<b>baz]qoz</b>quz',
michael@0 94 'foo[bar<i>baz]qoz</i>quz',
michael@0 95 '{<p><p> <p>foo</p>}',
michael@0 96
michael@0 97 'foo<span contenteditable=false>[bar]</span>baz',
michael@0 98 'fo[o<span contenteditable=false>bar</span>b]az',
michael@0 99 'foo<span contenteditable=false>ba[r</span>b]az',
michael@0 100 'fo[o<span contenteditable=false>b]ar</span>baz',
michael@0 101 'fo[<b>o</b><span contenteditable=false>bar</span><b>b</b>]az',
michael@0 102 '<span contenteditable=false>foo<span contenteditable=true>[bar]</span>baz</span>',
michael@0 103 '<span contenteditable=false>fo[o<span contenteditable=true>bar</span>b]az</span>',
michael@0 104 '<span contenteditable=false>foo<span contenteditable=true>ba[r</span>b]az</span>',
michael@0 105 '<span contenteditable=false>fo[o<span contenteditable=true>b]ar</span>baz</span>',
michael@0 106 '<span contenteditable=false>fo[<b>o<span contenteditable=true>bar</span>b</b>]az</span>',
michael@0 107
michael@0 108 '<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>',
michael@0 109 '<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 110 '<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 111 '<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>',
michael@0 112 '<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>',
michael@0 113 '{<table><tr><td>foo<td>bar<td>baz</table>}',
michael@0 114
michael@0 115 'foo<span style="font-weight: bold">[bar]</span>baz',
michael@0 116 'foo<b>[bar]</b>baz',
michael@0 117 'foo<b>bar</b>[baz]',
michael@0 118 '[foo]<b>bar</b>baz',
michael@0 119 '<b>foo</b>[bar]<b>baz</b>',
michael@0 120 'foo<strong>bar</strong>[baz]',
michael@0 121 '[foo]<strong>bar</strong>baz',
michael@0 122 '<strong>foo</strong>[bar]<strong>baz</strong>',
michael@0 123 '<b>foo</b>[bar]<strong>baz</strong>',
michael@0 124 '<strong>foo</strong>[bar]<b>baz</b>',
michael@0 125 'foo[<b>bar</b>]baz',
michael@0 126 'foo[<b>bar]</b>baz',
michael@0 127 'foo<b>[bar</b>]baz',
michael@0 128
michael@0 129 'foo{<b></b>}baz',
michael@0 130 'foo{<i></i>}baz',
michael@0 131 'foo{<b><i></i></b>}baz',
michael@0 132 'foo{<i><b></b></i>}baz',
michael@0 133
michael@0 134 'foo<strong>[bar]</strong>baz',
michael@0 135 'foo[<strong>bar</strong>]baz',
michael@0 136 'foo[<strong>bar]</strong>baz',
michael@0 137 'foo<strong>[bar</strong>]baz',
michael@0 138 'foo<span style="font-weight: bold">[bar]</span>baz',
michael@0 139 'foo[<span style="font-weight: bold">bar</span>]baz',
michael@0 140 'foo[<span style="font-weight: bold">bar]</span>baz',
michael@0 141 'foo<span style="font-weight: bold">[bar</span>]baz',
michael@0 142
michael@0 143 '<b>{<p>foo</p><p>bar</p>}<p>baz</p></b>',
michael@0 144 '<b><p>foo[<i>bar</i>}</p><p>baz</p></b>',
michael@0 145
michael@0 146 'foo [bar <b>baz] qoz</b> quz sic',
michael@0 147 'foo bar <b>baz [qoz</b> quz] sic',
michael@0 148
michael@0 149 '<b id=purple>bar [baz] qoz</b>',
michael@0 150
michael@0 151 'foo<span style="font-weight: 100">[bar]</span>baz',
michael@0 152 'foo<span style="font-weight: 200">[bar]</span>baz',
michael@0 153 'foo<span style="font-weight: 300">[bar]</span>baz',
michael@0 154 'foo<span style="font-weight: 400">[bar]</span>baz',
michael@0 155 'foo<span style="font-weight: 500">[bar]</span>baz',
michael@0 156 'foo<span style="font-weight: 600">[bar]</span>baz',
michael@0 157 'foo<span style="font-weight: 700">[bar]</span>baz',
michael@0 158 'foo<span style="font-weight: 800">[bar]</span>baz',
michael@0 159 'foo<span style="font-weight: 900">[bar]</span>baz',
michael@0 160 'foo<span style="font-weight: 400">[bar</span>]baz',
michael@0 161 'foo<span style="font-weight: 700">[bar</span>]baz',
michael@0 162 'foo[<span style="font-weight: 400">bar]</span>baz',
michael@0 163 'foo[<span style="font-weight: 700">bar]</span>baz',
michael@0 164 'foo[<span style="font-weight: 400">bar</span>]baz',
michael@0 165 'foo[<span style="font-weight: 700">bar</span>]baz',
michael@0 166 '<span style="font-weight: 100">foo[bar]baz</span>',
michael@0 167 '<span style="font-weight: 400">foo[bar]baz</span>',
michael@0 168 '<span style="font-weight: 700">foo[bar]baz</span>',
michael@0 169 '<span style="font-weight: 900">foo[bar]baz</span>',
michael@0 170 '{<span style="font-weight: 100">foobar]baz</span>',
michael@0 171 '{<span style="font-weight: 400">foobar]baz</span>',
michael@0 172 '{<span style="font-weight: 700">foobar]baz</span>',
michael@0 173 '{<span style="font-weight: 900">foobar]baz</span>',
michael@0 174 '<span style="font-weight: 100">foo[barbaz</span>}',
michael@0 175 '<span style="font-weight: 400">foo[barbaz</span>}',
michael@0 176 '<span style="font-weight: 700">foo[barbaz</span>}',
michael@0 177 '<span style="font-weight: 900">foo[barbaz</span>}',
michael@0 178
michael@0 179 '<h3>foo[bar]baz</h3>',
michael@0 180 '{<h3>foobar]baz</h3>',
michael@0 181 '<h3>foo[barbaz</h3>}',
michael@0 182 '<h3>[foobarbaz]</h3>',
michael@0 183 '{<h3>foobarbaz]</h3>',
michael@0 184 '<h3>[foobarbaz</h3>}',
michael@0 185 '{<h3>foobarbaz</h3>}',
michael@0 186
michael@0 187 '<b>foo<span style="font-weight: normal">bar<b>[baz]</b>quz</span>qoz</b>',
michael@0 188 '<b>foo<span style="font-weight: normal">[bar]</span>baz</b>',
michael@0 189
michael@0 190 '{<b>foo</b> <b>bar</b>}',
michael@0 191 '{<h3>foo</h3><b>bar</b>}',
michael@0 192
michael@0 193 '<i><b>foo</b></i>[bar]<i><b>baz</b></i>',
michael@0 194 '<i><b>foo</b></i>[bar]<b>baz</b>',
michael@0 195 '<b>foo</b>[bar]<i><b>baz</b></i>',
michael@0 196 '<font color=blue face=monospace><b>foo</b></font>[bar]',
michael@0 197
michael@0 198 'foo<span style="font-weight: normal"><b>{bar}</b></span>baz',
michael@0 199 '[foo<span class=notbold>bar</span>baz]',
michael@0 200 '<b><span class=notbold>[foo]</span></b>',
michael@0 201 '<b><span class=notbold>foo[bar]baz</span></b>',
michael@0 202
michael@0 203 '<p style="font-weight: bold">foo[bar]baz</p>',
michael@0 204
michael@0 205 // Tests for queryCommandIndeterm() and queryCommandState()
michael@0 206 'fo[o<b>b]ar</b>baz',
michael@0 207 'foo<b>ba[r</b>b]az',
michael@0 208 'fo[o<b>bar</b>b]az',
michael@0 209 'foo[<b>b]ar</b>baz',
michael@0 210 'foo<b>ba[r</b>]baz',
michael@0 211 'foo[<b>bar</b>]baz',
michael@0 212 'foo<b>[bar]</b>baz',
michael@0 213 'foo{<b>bar</b>}baz',
michael@0 214 'fo[o<span style=font-weight:bold>b]ar</span>baz',
michael@0 215 '<span style=font-weight:800>fo[o</span><span style=font-weight:900>b]ar</span>',
michael@0 216 '<span style=font-weight:700>fo[o</span><span style=font-weight:800>b]ar</span>',
michael@0 217 '<span style=font-weight:600>fo[o</span><span style=font-weight:700>b]ar</span>',
michael@0 218 '<span style=font-weight:500>fo[o</span><span style=font-weight:600>b]ar</span>',
michael@0 219 '<span style=font-weight:400>fo[o</span><span style=font-weight:500>b]ar</span>',
michael@0 220 '<span style=font-weight:300>fo[o</span><span style=font-weight:400>b]ar</span>',
michael@0 221 '<span style=font-weight:200>fo[o</span><span style=font-weight:300>b]ar</span>',
michael@0 222 '<span style=font-weight:100>fo[o</span><span style=font-weight:200>b]ar</span>',
michael@0 223 ],
michael@0 224 //@}
michael@0 225 createlink: [
michael@0 226 //@{
michael@0 227 'foo[]bar',
michael@0 228 '<p>[foo</p> <p>bar]</p>',
michael@0 229 '<span>[foo</span> <span>bar]</span>',
michael@0 230 '<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>',
michael@0 231 '<p>[foo<p><br><p>bar]',
michael@0 232 '<b>foo[]bar</b>',
michael@0 233 '<i>foo[]bar</i>',
michael@0 234 '<span>foo</span>{}<span>bar</span>',
michael@0 235 '<span>foo[</span><span>]bar</span>',
michael@0 236 'foo[bar]baz',
michael@0 237 'foo[bar<b>baz]qoz</b>quz',
michael@0 238 'foo[bar<i>baz]qoz</i>quz',
michael@0 239 '{<p><p> <p>foo</p>}',
michael@0 240
michael@0 241 '<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>',
michael@0 242 '<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 243 '<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 244 '<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>',
michael@0 245 '<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>',
michael@0 246 '{<table><tr><td>foo<td>bar<td>baz</table>}',
michael@0 247
michael@0 248 '<a href=http://www.google.com/>foo[bar]baz</a>',
michael@0 249 '<a href=http://www.google.com/>foo[barbaz</a>}',
michael@0 250 '{<a href=http://www.google.com/>foobar]baz</a>',
michael@0 251 '{<a href=http://www.google.com/>foobarbaz</a>}',
michael@0 252 '<a href=http://www.google.com/>[foobarbaz]</a>',
michael@0 253
michael@0 254 'foo<a href=http://www.google.com/>[bar]</a>baz',
michael@0 255 '[foo]<a href=http://www.google.com/>bar</a>baz',
michael@0 256 'foo<a href=http://www.google.com/>bar</a>[baz]',
michael@0 257 'foo[<a href=http://www.google.com/>bar</a>]baz',
michael@0 258 'foo<a href=http://www.google.com/>[bar</a>baz]',
michael@0 259 '[foo<a href=http://www.google.com/>bar]</a>baz',
michael@0 260 '[foo<a href=http://www.google.com/>bar</a>baz]',
michael@0 261
michael@0 262 '<a href=otherurl>foo[bar]baz</a>',
michael@0 263 '<a href=otherurl>foo[barbaz</a>}',
michael@0 264 '{<a href=otherurl>foobar]baz</a>',
michael@0 265 '{<a href=otherurl>foobarbaz</a>}',
michael@0 266 '<a href=otherurl>[foobarbaz]</a>',
michael@0 267
michael@0 268 'foo<a href=otherurl>[bar]</a>baz',
michael@0 269 'foo[<a href=otherurl>bar</a>]baz',
michael@0 270 'foo<a href=otherurl>[bar</a>baz]',
michael@0 271 '[foo<a href=otherurl>bar]</a>baz',
michael@0 272 '[foo<a href=otherurl>bar</a>baz]',
michael@0 273
michael@0 274 '<a href=otherurl><b>foo[bar]baz</b></a>',
michael@0 275 '<a href=otherurl><b>foo[barbaz</b></a>}',
michael@0 276 '{<a href=otherurl><b>foobar]baz</b></a>',
michael@0 277 '<a href=otherurl><b>[foobarbaz]</b></a>',
michael@0 278
michael@0 279 '<a name=abc>foo[bar]baz</a>',
michael@0 280 '<a name=abc><b>foo[bar]baz</b></a>',
michael@0 281
michael@0 282 ['', 'foo[bar]baz'],
michael@0 283 ],
michael@0 284 //@}
michael@0 285 // Opera requires this to be quoted, contrary to ES5 11.1.5 which allows
michael@0 286 // PropertyName to be any IdentifierName, and see 7.6 which defines
michael@0 287 // IdentifierName to include ReservedWord; Identifier excludes it.
michael@0 288 "delete": [
michael@0 289 //@{
michael@0 290 // Collapsed selection
michael@0 291 //
michael@0 292 // These three commented-out test call Firefox 5.0a2 to blow up, not
michael@0 293 // just throwing exceptions on the tests themselves but on many
michael@0 294 // subsequent tests too.
michael@0 295 //'[]foo',
michael@0 296 //'<span>[]foo</span>',
michael@0 297 //'<p>[]foo</p>',
michael@0 298 'foo[]bar',
michael@0 299 '<span>foo</span>{}<span>bar</span>',
michael@0 300 '<span>foo[</span><span>]bar</span>',
michael@0 301 'foo<span style=display:none>bar</span>[]baz',
michael@0 302 'foo<script>bar</script>[]baz',
michael@0 303
michael@0 304 'fo&ouml;[]bar',
michael@0 305 'foo&#x308;[]bar',
michael@0 306 'foo&#x308;&#x327;[]bar',
michael@0 307 '&ouml;[]bar',
michael@0 308 'o&#x308;[]bar',
michael@0 309 'o&#x308;&#x327;[]bar',
michael@0 310
michael@0 311 '&#x5e9;&#x5c1;&#x5b8;[]&#x5dc;&#x5d5;&#x5b9;&#x5dd;',
michael@0 312 '&#x5e9;&#x5c1;&#x5b8;&#x5dc;&#x5d5;&#x5b9;[]&#x5dd;',
michael@0 313
michael@0 314 '<p>foo</p><p>[]bar</p>',
michael@0 315 '<p>foo</p>[]bar',
michael@0 316 'foo<p>[]bar</p>',
michael@0 317 '<p>foo<br></p><p>[]bar</p>',
michael@0 318 '<p>foo<br></p>[]bar',
michael@0 319 'foo<br><p>[]bar</p>',
michael@0 320 '<p>foo<br><br></p><p>[]bar</p>',
michael@0 321 '<p>foo<br><br></p>[]bar',
michael@0 322 'foo<br><br><p>[]bar</p>',
michael@0 323
michael@0 324 '<div><p>foo</p></div><p>[]bar</p>',
michael@0 325 '<p>foo</p><div><p>[]bar</p></div>',
michael@0 326 '<div><p>foo</p></div><div><p>[]bar</p></div>',
michael@0 327 '<div><p>foo</p></div>[]bar',
michael@0 328 'foo<div><p>[]bar</p></div>',
michael@0 329
michael@0 330 '<div>foo</div><div>[]bar</div>',
michael@0 331 '<pre>foo</pre>[]bar',
michael@0 332
michael@0 333 'foo<br>[]bar',
michael@0 334 'foo<br><b>[]bar</b>',
michael@0 335 'foo<hr>[]bar',
michael@0 336 '<p>foo<hr><p>[]bar',
michael@0 337 '<p>foo</p><br><p>[]bar</p>',
michael@0 338 '<p>foo</p><br><br><p>[]bar</p>',
michael@0 339 '<p>foo</p><img src=/img/lion.svg><p>[]bar',
michael@0 340 'foo<img src=/img/lion.svg>[]bar',
michael@0 341
michael@0 342 '<a>foo</a>[]bar',
michael@0 343 '<a href=/>foo</a>[]bar',
michael@0 344 '<a name=abc>foo</a>[]bar',
michael@0 345 '<a href=/ name=abc>foo</a>[]bar',
michael@0 346 '<span><a>foo</a></span>[]bar',
michael@0 347 '<span><a href=/>foo</a></span>[]bar',
michael@0 348 '<span><a name=abc>foo</a></span>[]bar',
michael@0 349 '<span><a href=/ name=abc>foo</a></span>[]bar',
michael@0 350 'foo<a>[]bar</a>',
michael@0 351 'foo<a href=/>[]bar</a>',
michael@0 352 'foo<a name=abc>[]bar</a>',
michael@0 353 'foo<a href=/ name=abc>[]bar</a>',
michael@0 354
michael@0 355 'foo &nbsp;[]',
michael@0 356 '&nbsp;[] foo',
michael@0 357 'foo &nbsp;[]bar',
michael@0 358 'foo&nbsp; []bar',
michael@0 359 'foo&nbsp;&nbsp;[]bar',
michael@0 360 'foo []bar',
michael@0 361 'foo []&nbsp; bar',
michael@0 362 'foo &nbsp;[] bar',
michael@0 363 'foo &nbsp; []bar',
michael@0 364 'foo []<span>&nbsp;</span> bar',
michael@0 365 'foo <span>&nbsp;</span>[] bar',
michael@0 366 'foo <span>&nbsp;</span> []bar',
michael@0 367 '<b>foo </b>&nbsp;[]bar',
michael@0 368 '<b>foo&nbsp;</b> []bar',
michael@0 369 '<b>foo&nbsp;</b>&nbsp;[]bar',
michael@0 370 '<b>foo </b> []bar',
michael@0 371 '<p>foo </p><p>[] bar</p>',
michael@0 372
michael@0 373 '<pre>foo &nbsp;[]</pre>',
michael@0 374 '<pre>&nbsp;[] foo</pre>',
michael@0 375 '<pre>foo &nbsp;[]bar</pre>',
michael@0 376 '<pre>foo&nbsp; []bar</pre>',
michael@0 377 '<pre>foo []bar</pre>',
michael@0 378
michael@0 379 '<div style=white-space:pre>foo &nbsp;[]</div>',
michael@0 380 '<div style=white-space:pre>&nbsp;[] foo</div>',
michael@0 381 '<div style=white-space:pre>foo &nbsp;[]bar</div>',
michael@0 382 '<div style=white-space:pre>foo&nbsp; []bar</div>',
michael@0 383 '<div style=white-space:pre>foo []bar</div>',
michael@0 384
michael@0 385 '<div style=white-space:pre-wrap>foo &nbsp;[]</div>',
michael@0 386 '<div style=white-space:pre-wrap>&nbsp;[] foo</div>',
michael@0 387 '<div style=white-space:pre-wrap>foo &nbsp;[]bar</div>',
michael@0 388 '<div style=white-space:pre-wrap>foo&nbsp; []bar</div>',
michael@0 389 '<div style=white-space:pre-wrap>foo []bar</div>',
michael@0 390
michael@0 391 '<div style=white-space:pre-line>foo &nbsp;[]</div>',
michael@0 392 '<div style=white-space:pre-line>&nbsp;[] foo</div>',
michael@0 393 '<div style=white-space:pre-line>foo &nbsp;[]bar</div>',
michael@0 394 '<div style=white-space:pre-line>foo&nbsp; []bar</div>',
michael@0 395 '<div style=white-space:pre-line>foo []bar</div>',
michael@0 396
michael@0 397 '<div style=white-space:nowrap>foo &nbsp;[]</div>',
michael@0 398 '<div style=white-space:nowrap>&nbsp;[] foo</div>',
michael@0 399 '<div style=white-space:nowrap>foo &nbsp;[]bar</div>',
michael@0 400 '<div style=white-space:nowrap>foo&nbsp; []bar</div>',
michael@0 401 '<div style=white-space:nowrap>foo []bar</div>',
michael@0 402
michael@0 403 // Tables with collapsed selection
michael@0 404 'foo<table><tr><td>[]bar</table>baz',
michael@0 405 'foo<table><tr><td>bar</table>[]baz',
michael@0 406 '<p>foo<table><tr><td>[]bar</table><p>baz',
michael@0 407 '<p>foo<table><tr><td>bar</table><p>[]baz',
michael@0 408 '<table><tr><td>foo<td>[]bar</table>',
michael@0 409 '<table><tr><td>foo<tr><td>[]bar</table>',
michael@0 410
michael@0 411 'foo<br><table><tr><td>[]bar</table>baz',
michael@0 412 'foo<table><tr><td>bar<br></table>[]baz',
michael@0 413 '<p>foo<br><table><tr><td>[]bar</table><p>baz',
michael@0 414 '<p>foo<table><tr><td>bar<br></table><p>[]baz',
michael@0 415 '<table><tr><td>foo<br><td>[]bar</table>',
michael@0 416 '<table><tr><td>foo<br><tr><td>[]bar</table>',
michael@0 417
michael@0 418 'foo<br><br><table><tr><td>[]bar</table>baz',
michael@0 419 'foo<table><tr><td>bar<br><br></table>[]baz',
michael@0 420 '<p>foo<br><br><table><tr><td>[]bar</table><p>baz',
michael@0 421 '<p>foo<table><tr><td>bar<br><br></table><p>[]baz',
michael@0 422 '<table><tr><td>foo<br><br><td>[]bar</table>',
michael@0 423 '<table><tr><td>foo<br><br><tr><td>[]bar</table>',
michael@0 424
michael@0 425 'foo<hr><table><tr><td>[]bar</table>baz',
michael@0 426 'foo<table><tr><td>bar<hr></table>[]baz',
michael@0 427 '<table><tr><td>foo<hr><td>[]bar</table>',
michael@0 428 '<table><tr><td>foo<hr><tr><td>[]bar</table>',
michael@0 429
michael@0 430 // Lists with collapsed selection
michael@0 431 'foo<ol><li>[]bar<li>baz</ol>',
michael@0 432 'foo<br><ol><li>[]bar<li>baz</ol>',
michael@0 433 'foo<br><br><ol><li>[]bar<li>baz</ol>',
michael@0 434 '<ol><li>foo<li>[]bar</ol>',
michael@0 435 '<ol><li>foo<br><li>[]bar</ol>',
michael@0 436 '<ol><li>foo<br><br><li>[]bar</ol>',
michael@0 437 '<ol><li>foo<li>[]bar<br>baz</ol>',
michael@0 438 '<ol><li>foo<br>bar<li>[]baz</ol>',
michael@0 439
michael@0 440 '<ol><li><p>foo</p>{}bar</ol>',
michael@0 441
michael@0 442 '<ol><li><p>foo<li>[]bar</ol>',
michael@0 443 '<ol><li>foo<li><p>[]bar</ol>',
michael@0 444 '<ol><li><p>foo<li><p>[]bar</ol>',
michael@0 445
michael@0 446 '<ol><li>foo<ul><li>[]bar</ul></ol>',
michael@0 447 'foo<ol><ol><li>[]bar</ol></ol>',
michael@0 448 'foo<div><ol><li>[]bar</ol></div>',
michael@0 449
michael@0 450 'foo<dl><dt>[]bar<dd>baz</dl>',
michael@0 451 'foo<dl><dd>[]bar</dl>',
michael@0 452 '<dl><dt>foo<dd>[]bar</dl>',
michael@0 453 '<dl><dt>foo<dt>[]bar<dd>baz</dl>',
michael@0 454 '<dl><dt>foo<dd>bar<dd>[]baz</dl>',
michael@0 455
michael@0 456 '<ol><li>foo</ol>[]bar',
michael@0 457 '<ol><li>foo<br></ol>[]bar',
michael@0 458 '<ol><li>foo<br><br></ol>[]bar',
michael@0 459 '<ol><li><br></ol>[]bar',
michael@0 460 '<ol><li>foo<li><br></ol>[]bar',
michael@0 461
michael@0 462 '<ol><li>foo</ol><p>[]bar',
michael@0 463 '<ol><li>foo<br></ol><p>[]bar',
michael@0 464 '<ol><li>foo<br><br></ol><p>[]bar',
michael@0 465 '<ol><li><br></ol><p>[]bar',
michael@0 466 '<ol><li>foo<li><br></ol><p>[]bar',
michael@0 467
michael@0 468 '<ol><li>foo</ol>{}<br>',
michael@0 469 '<ol><li>foo<br></ol>{}<br>',
michael@0 470 '<ol><li>foo<br><br></ol>{}<br>',
michael@0 471 '<ol><li><br></ol>{}<br>',
michael@0 472 '<ol><li>foo<li><br></ol>{}<br>',
michael@0 473
michael@0 474 '<ol><li>foo</ol><p>{}<br>',
michael@0 475 '<ol><li>foo<br></ol><p>{}<br>',
michael@0 476 '<ol><li>foo<br><br></ol><p>{}<br>',
michael@0 477 '<ol><li><br></ol><p>{}<br>',
michael@0 478 '<ol><li>foo<li><br></ol><p>{}<br>',
michael@0 479
michael@0 480 // Indented stuff with collapsed selection
michael@0 481 'foo<blockquote>[]bar</blockquote>',
michael@0 482 'foo<blockquote><blockquote>[]bar</blockquote></blockquote>',
michael@0 483 'foo<blockquote><div>[]bar</div></blockquote>',
michael@0 484 'foo<blockquote style="color: blue">[]bar</blockquote>',
michael@0 485
michael@0 486 'foo<blockquote><blockquote><p>[]bar<p>baz</blockquote></blockquote>',
michael@0 487 'foo<blockquote><div><p>[]bar<p>baz</div></blockquote>',
michael@0 488 'foo<blockquote style="color: blue"><p>[]bar<p>baz</blockquote>',
michael@0 489
michael@0 490 'foo<blockquote><p><b>[]bar</b><p>baz</blockquote>',
michael@0 491 'foo<blockquote><p><strong>[]bar</strong><p>baz</blockquote>',
michael@0 492 'foo<blockquote><p><span>[]bar</span><p>baz</blockquote>',
michael@0 493
michael@0 494 'foo<blockquote><ol><li>[]bar</ol></blockquote><p>extra',
michael@0 495 'foo<blockquote>bar<ol><li>[]baz</ol>quz</blockquote><p>extra',
michael@0 496 'foo<blockquote><ol><li>bar</li><ol><li>[]baz</ol><li>quz</ol></blockquote><p>extra',
michael@0 497
michael@0 498 // Invisible stuff with collapsed selection
michael@0 499 'foo<span></span>[]bar',
michael@0 500 'foo<span><span></span></span>[]bar',
michael@0 501 'foo<quasit></quasit>[]bar',
michael@0 502 'foo<br><span></span>[]bar',
michael@0 503 '<span>foo<span></span></span>[]bar',
michael@0 504 'foo<span></span><span>[]bar</span>',
michael@0 505 'foo<div><div><p>[]bar</div></div>',
michael@0 506 'foo<div><div><p><!--abc-->[]bar</div></div>',
michael@0 507 'foo<div><div><!--abc--><p>[]bar</div></div>',
michael@0 508 'foo<div><!--abc--><div><p>[]bar</div></div>',
michael@0 509 'foo<!--abc--><div><div><p>[]bar</div></div>',
michael@0 510 '<div><div><p>foo</div></div>[]bar',
michael@0 511 '<div><div><p>foo</div></div><!--abc-->[]bar',
michael@0 512 '<div><div><p>foo</div><!--abc--></div>[]bar',
michael@0 513 '<div><div><p>foo</p><!--abc--></div></div>[]bar',
michael@0 514 '<div><div><p>foo<!--abc--></div></div>[]bar',
michael@0 515 '<div><div><p>foo</p></div></div><div><div><div>[]bar</div></div></div>',
michael@0 516 '<div><div><p>foo<!--abc--></p></div></div><div><div><div>[]bar</div></div></div>',
michael@0 517 '<div><div><p>foo</p><!--abc--></div></div><div><div><div>[]bar</div></div></div>',
michael@0 518 '<div><div><p>foo</p></div><!--abc--></div><div><div><div>[]bar</div></div></div>',
michael@0 519 '<div><div><p>foo</p></div></div><!--abc--><div><div><div>[]bar</div></div></div>',
michael@0 520 '<div><div><p>foo</p></div></div><div><!--abc--><div><div>[]bar</div></div></div>',
michael@0 521 '<div><div><p>foo</p></div></div><div><div><!--abc--><div>[]bar</div></div></div>',
michael@0 522 '<div><div><p>foo</p></div></div><div><div><div><!--abc-->[]bar</div></div></div>',
michael@0 523
michael@0 524 // Styled stuff with collapsed selection
michael@0 525 '<p style=color:blue>foo<p>[]bar',
michael@0 526 '<p style=color:blue>foo<p style=color:brown>[]bar',
michael@0 527 '<p style=color:blue>foo<p style=color:rgba(0,0,255,1)>[]bar',
michael@0 528 '<p style=color:transparent>foo<p style=color:rgba(0,0,0,0)>[]bar',
michael@0 529 '<p>foo<p style=color:brown>[]bar',
michael@0 530 '<p><font color=blue>foo</font><p>[]bar',
michael@0 531 '<p><font color=blue>foo</font><p><font color=brown>[]bar</font>',
michael@0 532 '<p>foo<p><font color=brown>[]bar</font>',
michael@0 533 '<p><span style=color:blue>foo</font><p>[]bar',
michael@0 534 '<p><span style=color:blue>foo</font><p><span style=color:brown>[]bar</font>',
michael@0 535 '<p>foo<p><span style=color:brown>[]bar</font>',
michael@0 536
michael@0 537 '<p style=background-color:aqua>foo<p>[]bar',
michael@0 538 '<p style=background-color:aqua>foo<p style=background-color:tan>[]bar',
michael@0 539 '<p>foo<p style=background-color:tan>[]bar',
michael@0 540 '<p><span style=background-color:aqua>foo</font><p>[]bar',
michael@0 541 '<p><span style=background-color:aqua>foo</font><p><span style=background-color:tan>[]bar</font>',
michael@0 542 '<p>foo<p><span style=background-color:tan>[]bar</font>',
michael@0 543
michael@0 544 '<p style=text-decoration:underline>foo<p>[]bar',
michael@0 545 '<p style=text-decoration:underline>foo<p style=text-decoration:line-through>[]bar',
michael@0 546 '<p>foo<p style=text-decoration:line-through>[]bar',
michael@0 547 '<p><u>foo</u><p>[]bar',
michael@0 548 '<p><u>foo</u><p><s>[]bar</s>',
michael@0 549 '<p>foo<p><s>[]bar</s>',
michael@0 550
michael@0 551 '<p style=color:blue>foo</p>[]bar',
michael@0 552 'foo<p style=color:brown>[]bar',
michael@0 553 '<div style=color:blue><p style=color:green>foo</div>[]bar',
michael@0 554 '<div style=color:blue><p style=color:green>foo</div><p style=color:brown>[]bar',
michael@0 555 '<p style=color:blue>foo<div style=color:brown><p style=color:green>[]bar',
michael@0 556
michael@0 557 // Uncollapsed selection
michael@0 558 'foo[bar]baz',
michael@0 559 '<p>foo<span style=color:#aBcDeF>[bar]</span>baz',
michael@0 560 '<p>foo<span style=color:#aBcDeF>{bar}</span>baz',
michael@0 561 '<p>foo{<span style=color:#aBcDeF>bar</span>}baz',
michael@0 562 '<p>[foo<span style=color:#aBcDeF>bar]</span>baz',
michael@0 563 '<p>{foo<span style=color:#aBcDeF>bar}</span>baz',
michael@0 564 '<p>foo<span style=color:#aBcDeF>[bar</span>baz]',
michael@0 565 '<p>foo<span style=color:#aBcDeF>{bar</span>baz}',
michael@0 566 '<p>foo<span style=color:#aBcDeF>[bar</span><span style=color:#fEdCbA>baz]</span>quz',
michael@0 567
michael@0 568 'foo<b>[bar]</b>baz',
michael@0 569 'foo<b>{bar}</b>baz',
michael@0 570 'foo{<b>bar</b>}baz',
michael@0 571 'foo<span>[bar]</span>baz',
michael@0 572 'foo<span>{bar}</span>baz',
michael@0 573 'foo{<span>bar</span>}baz',
michael@0 574 '<b>foo[bar</b><i>baz]quz</i>',
michael@0 575 '<p>foo</p><p>[bar]</p><p>baz</p>',
michael@0 576 '<p>foo</p><p>{bar}</p><p>baz</p>',
michael@0 577 '<p>foo</p><p>{bar</p>}<p>baz</p>',
michael@0 578 '<p>foo</p>{<p>bar}</p><p>baz</p>',
michael@0 579 '<p>foo</p>{<p>bar</p>}<p>baz</p>',
michael@0 580
michael@0 581 '<p>foo[bar<p>baz]quz',
michael@0 582 '<p>foo[bar<div>baz]quz</div>',
michael@0 583 '<p>foo[bar<h1>baz]quz</h1>',
michael@0 584 '<div>foo[bar</div><p>baz]quz',
michael@0 585 '<blockquote>foo[bar</blockquote><pre>baz]quz</pre>',
michael@0 586
michael@0 587 '<p><b>foo[bar</b><p>baz]quz',
michael@0 588 '<div><p>foo[bar</div><p>baz]quz',
michael@0 589 '<p>foo[bar<blockquote><p>baz]quz<p>qoz</blockquote',
michael@0 590 '<p>foo[bar<p style=color:blue>baz]quz',
michael@0 591 '<p>foo[bar<p><b>baz]quz</b>',
michael@0 592
michael@0 593 '<div><p>foo<p>[bar<p>baz]</div>',
michael@0 594
michael@0 595 'foo[<br>]bar',
michael@0 596 '<p>foo[</p><p>]bar</p>',
michael@0 597 '<p>foo[</p><p>]bar<br>baz</p>',
michael@0 598 'foo[<p>]bar</p>',
michael@0 599 'foo{<p>}bar</p>',
michael@0 600 'foo[<p>]bar<br>baz</p>',
michael@0 601 'foo[<p>]bar</p>baz',
michael@0 602 'foo{<p>bar</p>}baz',
michael@0 603 'foo<p>{bar</p>}baz',
michael@0 604 'foo{<p>bar}</p>baz',
michael@0 605 '<p>foo[</p>]bar',
michael@0 606 '<p>foo{</p>}bar',
michael@0 607 '<p>foo[</p>]bar<br>baz',
michael@0 608 '<p>foo[</p>]bar<p>baz</p>',
michael@0 609 'foo[<div><p>]bar</div>',
michael@0 610 '<div><p>foo[</p></div>]bar',
michael@0 611 'foo[<div><p>]bar</p>baz</div>',
michael@0 612 'foo[<div>]bar<p>baz</p></div>',
michael@0 613 '<div><p>foo</p>bar[</div>]baz',
michael@0 614 '<div>foo<p>bar[</p></div>]baz',
michael@0 615
michael@0 616 '<p>foo<br>{</p>]bar',
michael@0 617 '<p>foo<br><br>{</p>]bar',
michael@0 618 'foo<br>{<p>]bar</p>',
michael@0 619 'foo<br><br>{<p>]bar</p>',
michael@0 620 '<p>foo<br>{</p><p>}bar</p>',
michael@0 621 '<p>foo<br><br>{</p><p>}bar</p>',
michael@0 622
michael@0 623 '<table><tbody><tr><th>foo<th>[bar]<th>baz<tr><td>quz<td>qoz<td>qiz</table>',
michael@0 624 '<table><tbody><tr><th>foo<th>ba[r<th>b]az<tr><td>quz<td>qoz<td>qiz</table>',
michael@0 625 '<table><tbody><tr><th>fo[o<th>bar<th>b]az<tr><td>quz<td>qoz<td>qiz</table>',
michael@0 626 '<table><tbody><tr><th>foo<th>bar<th>ba[z<tr><td>q]uz<td>qoz<td>qiz</table>',
michael@0 627 '<table><tbody><tr><th>[foo<th>bar<th>baz]<tr><td>quz<td>qoz<td>qiz</table>',
michael@0 628 '<table><tbody><tr><th>[foo<th>bar<th>baz<tr><td>quz<td>qoz<td>qiz]</table>',
michael@0 629 '{<table><tbody><tr><th>foo<th>bar<th>baz<tr><td>quz<td>qoz<td>qiz</table>}',
michael@0 630 '<table><tbody><tr><td>foo<td>ba[r<tr><td>baz<td>quz<tr><td>q]oz<td>qiz</table>',
michael@0 631 '<p>fo[o<table><tr><td>b]ar</table><p>baz',
michael@0 632 '<p>foo<table><tr><td>ba[r</table><p>b]az',
michael@0 633 '<p>fo[o<table><tr><td>bar</table><p>b]az',
michael@0 634
michael@0 635 '<p>foo<ol><li>ba[r<li>b]az</ol><p>quz',
michael@0 636 '<p>foo<ol><li>bar<li>[baz]</ol><p>quz',
michael@0 637 '<p>fo[o<ol><li>b]ar<li>baz</ol><p>quz',
michael@0 638 '<p>foo<ol><li>bar<li>ba[z</ol><p>q]uz',
michael@0 639 '<p>fo[o<ol><li>bar<li>b]az</ol><p>quz',
michael@0 640 '<p>fo[o<ol><li>bar<li>baz</ol><p>q]uz',
michael@0 641
michael@0 642 '<ol><li>fo[o</ol><ol><li>b]ar</ol>',
michael@0 643 '<ol><li>fo[o</ol><ul><li>b]ar</ul>',
michael@0 644
michael@0 645 'foo[<ol><li>]bar</ol>',
michael@0 646 '<ol><li>foo[<li>]bar</ol>',
michael@0 647 'foo[<dl><dt>]bar<dd>baz</dl>',
michael@0 648 'foo[<dl><dd>]bar</dl>',
michael@0 649 '<dl><dt>foo[<dd>]bar</dl>',
michael@0 650 '<dl><dt>foo[<dt>]bar<dd>baz</dl>',
michael@0 651 '<dl><dt>foo<dd>bar[<dd>]baz</dl>',
michael@0 652
michael@0 653 '<b>foo [&nbsp;</b>bar]',
michael@0 654 'foo<b> [&nbsp;bar]</b>',
michael@0 655 '<b>[foo&nbsp;] </b>bar',
michael@0 656 '[foo<b>&nbsp;] bar</b>',
michael@0 657
michael@0 658 // Do we merge based on element names or the display property?
michael@0 659 '<p style=display:inline>fo[o<p style=display:inline>b]ar',
michael@0 660 '<span style=display:block>fo[o</span><span style=display:block>b]ar</span>',
michael@0 661 '<span style=display:inline-block>fo[o</span><span style=display:inline-block>b]ar</span>',
michael@0 662 '<span style=display:inline-table>fo[o</span><span style=display:inline-table>b]ar</span>',
michael@0 663 '<span style=display:none>fo[o</span><span style=display:none>b]ar</span>',
michael@0 664 '<quasit style=display:block>fo[o</quasit><quasit style=display:block>b]ar</quasit>',
michael@0 665
michael@0 666 // https://bugs.webkit.org/show_bug.cgi?id=35281
michael@0 667 // http://www.w3.org/Bugs/Public/show_bug.cgi?id=13976
michael@0 668 '<ol><li>foo</ol>{}<br><ol><li>bar</ol>',
michael@0 669 '<ol><li>foo</ol><p>{}<br></p><ol><li>bar</ol>',
michael@0 670 '<ol><li><p>foo</ol><p>{}<br></p><ol><li>bar</ol>',
michael@0 671 '<ol id=a><li>foo</ol>{}<br><ol><li>bar</ol>',
michael@0 672 '<ol><li>foo</ol>{}<br><ol id=b><li>bar</ol>',
michael@0 673 '<ol id=a><li>foo</ol>{}<br><ol id=b><li>bar</ol>',
michael@0 674 '<ol class=a><li>foo</ol>{}<br><ol class=b><li>bar</ol>',
michael@0 675 // Broken test: http://www.w3.org/Bugs/Public/show_bug.cgi?id=14727
michael@0 676 '!<ol><ol><li>foo</ol><li>{}<br><ol><li>bar</ol></ol>',
michael@0 677 '<ol><ol><li>foo</ol><li>{}<br></li><ol><li>bar</ol></ol>',
michael@0 678 '<ol><li>foo[</ol>bar]<ol><li>baz</ol>',
michael@0 679 '<ol><li>foo[</ol><p>bar]<ol><li>baz</ol>',
michael@0 680 '<ol><li><p>foo[</ol><p>bar]<ol><li>baz</ol>',
michael@0 681 '<ol><li>foo[]</ol><ol><li>bar</ol>',
michael@0 682 '<ol><li>foo</ol>[bar<ol><li>]baz</ol>',
michael@0 683 '<ol><li>foo</ol><p>[bar<ol><li>]baz</ol>',
michael@0 684 '<ol><li>foo</ol><p>[bar<ol><li><p>]baz</ol>',
michael@0 685 '<ol><li>foo</ol><ol><li>b[]ar</ol>',
michael@0 686 '<ol><ol><li>foo[</ol><li>bar</ol>baz]<ol><li>quz</ol>',
michael@0 687 '<ul><li>foo</ul>{}<br><ul><li>bar</ul>',
michael@0 688 '<ul><li>foo</ul><p>{}<br></p><ul><li>bar</ul>',
michael@0 689 '<ol><li>foo[<li>bar]</ol><ol><li>baz</ol><ol><li>quz</ol>',
michael@0 690 '<ol><li>foo</ol>{}<br><ul><li>bar</ul>',
michael@0 691 '<ol><li>foo</ol><p>{}<br></p><ul><li>bar</ul>',
michael@0 692 '<ul><li>foo</ul>{}<br><ol><li>bar</ol>',
michael@0 693 '<ul><li>foo</ul><p>{}<br></p><ol><li>bar</ol>',
michael@0 694
michael@0 695 // http://www.w3.org/Bugs/Public/show_bug.cgi?id=13831
michael@0 696 '<p><b>[foo]</b>',
michael@0 697 '<p><quasit>[foo]</quasit>',
michael@0 698 '<p><b><i>[foo]</i></b>',
michael@0 699 '<p><b>{foo}</b>',
michael@0 700 '<p>{<b>foo</b>}',
michael@0 701 '<p><b>f[]</b>',
michael@0 702 '<b>[foo]</b>',
michael@0 703 '<div><b>[foo]</b></div>',
michael@0 704 ],
michael@0 705 //@}
michael@0 706 fontname: [
michael@0 707 //@{
michael@0 708 'foo[]bar',
michael@0 709 '<p>[foo</p> <p>bar]</p>',
michael@0 710 '<span>[foo</span> <span>bar]</span>',
michael@0 711 '<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>',
michael@0 712 '<p>[foo<p><br><p>bar]',
michael@0 713 '<b>foo[]bar</b>',
michael@0 714 '<i>foo[]bar</i>',
michael@0 715 '<span>foo</span>{}<span>bar</span>',
michael@0 716 '<span>foo[</span><span>]bar</span>',
michael@0 717 'foo[bar]baz',
michael@0 718 'foo[bar<b>baz]qoz</b>quz',
michael@0 719 'foo[bar<i>baz]qoz</i>quz',
michael@0 720 '{<p><p> <p>foo</p>}',
michael@0 721
michael@0 722 '<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>',
michael@0 723 '<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 724 '<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 725 '<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>',
michael@0 726 '<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>',
michael@0 727 '{<table><tr><td>foo<td>bar<td>baz</table>}',
michael@0 728
michael@0 729 'foo<code>[bar]</code>baz',
michael@0 730 'foo<kbd>[bar]</kbd>baz',
michael@0 731 'foo<listing>[bar]</listing>baz',
michael@0 732 'foo<pre>[bar]</pre>baz',
michael@0 733 'foo<samp>[bar]</samp>baz',
michael@0 734 'foo<tt>[bar]</tt>baz',
michael@0 735
michael@0 736 'foo<code>b[a]r</code>baz',
michael@0 737 'foo<kbd>b[a]r</kbd>baz',
michael@0 738 'foo<listing>b[a]r</listing>baz',
michael@0 739 'foo<pre>b[a]r</pre>baz',
michael@0 740 'foo<samp>b[a]r</samp>baz',
michael@0 741 'foo<tt>b[a]r</tt>baz',
michael@0 742
michael@0 743 '[foo<code>bar</code>baz]',
michael@0 744 '[foo<kbd>bar</kbd>baz]',
michael@0 745 '[foo<listing>bar</listing>baz]',
michael@0 746 '[foo<pre>bar</pre>baz]',
michael@0 747 '[foo<samp>bar</samp>baz]',
michael@0 748 '[foo<tt>bar</tt>baz]',
michael@0 749
michael@0 750 '[foo<code>ba]r</code>baz',
michael@0 751 '[foo<kbd>ba]r</kbd>baz',
michael@0 752 '[foo<listing>ba]r</listing>baz',
michael@0 753 '[foo<pre>ba]r</pre>baz',
michael@0 754 '[foo<samp>ba]r</samp>baz',
michael@0 755 '[foo<tt>ba]r</tt>baz',
michael@0 756
michael@0 757 'foo<code>b[ar</code>baz]',
michael@0 758 'foo<kbd>b[ar</kbd>baz]',
michael@0 759 'foo<listing>b[ar</listing>baz]',
michael@0 760 'foo<pre>b[ar</pre>baz]',
michael@0 761 'foo<samp>b[ar</samp>baz]',
michael@0 762 'foo<tt>b[ar</tt>baz]',
michael@0 763
michael@0 764 'foo<span style="font-family: sans-serif">[bar]</span>baz',
michael@0 765 'foo<span style="font-family: sans-serif">b[a]r</span>baz',
michael@0 766 'foo<span style="font-family: monospace">[bar]</span>baz',
michael@0 767 'foo<span style="font-family: monospace">b[a]r</span>baz',
michael@0 768
michael@0 769 'foo<tt contenteditable=false>ba[r</tt>b]az',
michael@0 770 'fo[o<tt contenteditable=false>b]ar</tt>baz',
michael@0 771 'foo<tt>{}<br></tt>bar',
michael@0 772 'foo<tt>{<br></tt>}bar',
michael@0 773 'foo<tt>{<br></tt>b]ar',
michael@0 774
michael@0 775 // Tests for queryCommandIndeterm() and queryCommandState()
michael@0 776 'fo[o<span style=font-family:monospace>b]ar</span>baz',
michael@0 777 'foo<span style=font-family:monospace>ba[r</span>b]az',
michael@0 778 'fo[o<span style=font-family:monospace>bar</span>b]az',
michael@0 779 'foo[<span style=font-family:monospace>b]ar</span>baz',
michael@0 780 'foo<span style=font-family:monospace>ba[r</span>]baz',
michael@0 781 'foo[<span style=font-family:monospace>bar</span>]baz',
michael@0 782 'foo<span style=font-family:monospace>[bar]</span>baz',
michael@0 783 'foo{<span style=font-family:monospace>bar</span>}baz',
michael@0 784 'fo[o<code>b]ar</code>',
michael@0 785 'fo[o<kbd>b]ar</kbd>',
michael@0 786 'fo[o<listing>b]ar</listing>',
michael@0 787 'fo[o<pre>b]ar</pre>',
michael@0 788 'fo[o<samp>b]ar</samp>',
michael@0 789 'fo[o<tt>b]ar</tt>',
michael@0 790 '<tt>fo[o</tt><code>b]ar</code>',
michael@0 791 '<pre>fo[o</pre><samp>b]ar</samp>',
michael@0 792 '<span style=font-family:monospace>fo[o</span><kbd>b]ar</kbd>',
michael@0 793 ],
michael@0 794 //@}
michael@0 795 fontsize: [
michael@0 796 //@{
michael@0 797 'foo[]bar',
michael@0 798 '<p>[foo</p> <p>bar]</p>',
michael@0 799 '<span>[foo</span> <span>bar]</span>',
michael@0 800 '<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>',
michael@0 801 '<p>[foo<p><br><p>bar]',
michael@0 802 '<b>foo[]bar</b>',
michael@0 803 '<i>foo[]bar</i>',
michael@0 804 '<span>foo</span>{}<span>bar</span>',
michael@0 805 '<span>foo[</span><span>]bar</span>',
michael@0 806 'foo[bar]baz',
michael@0 807 'foo[bar<b>baz]qoz</b>quz',
michael@0 808 'foo[bar<i>baz]qoz</i>quz',
michael@0 809 '{<p><p> <p>foo</p>}',
michael@0 810
michael@0 811 ["1", 'foo[bar]baz'],
michael@0 812 ["0", 'foo[bar]baz'],
michael@0 813 ["-5", 'foo[bar]baz'],
michael@0 814 ["6", 'foo[bar]baz'],
michael@0 815 ["7", 'foo[bar]baz'],
michael@0 816 ["8", 'foo[bar]baz'],
michael@0 817 ["100", 'foo[bar]baz'],
michael@0 818 ["2em", 'foo[bar]baz'],
michael@0 819 ["20pt", 'foo[bar]baz'],
michael@0 820 ["xx-large", 'foo[bar]baz'],
michael@0 821 [" 1 ", 'foo[bar]baz'],
michael@0 822 ["1.", 'foo[bar]baz'],
michael@0 823 ["1.0", 'foo[bar]baz'],
michael@0 824 ["1.0e2", 'foo[bar]baz'],
michael@0 825 ["1.1", 'foo[bar]baz'],
michael@0 826 ["1.9", 'foo[bar]baz'],
michael@0 827 ["+0", 'foo[bar]baz'],
michael@0 828 ["+1", 'foo[bar]baz'],
michael@0 829 ["+9", 'foo[bar]baz'],
michael@0 830 ["-0", 'foo[bar]baz'],
michael@0 831 ["-1", 'foo[bar]baz'],
michael@0 832 ["-9", 'foo[bar]baz'],
michael@0 833 ["", 'foo[bar]baz'],
michael@0 834
michael@0 835 '<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>',
michael@0 836 '<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 837 '<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 838 '<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>',
michael@0 839 '<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>',
michael@0 840 '{<table><tr><td>foo<td>bar<td>baz</table>}',
michael@0 841
michael@0 842 'foo<font size=1>[bar]</font>baz',
michael@0 843 '<font size=1>foo[bar]baz</font>',
michael@0 844 'foo<font size=3>[bar]</font>baz',
michael@0 845 '<font size=3>foo[bar]baz</font>',
michael@0 846 'foo<font size=4>[bar]</font>baz',
michael@0 847 '<font size=4>foo[bar]baz</font>',
michael@0 848 'foo<font size=+1>[bar]</font>baz',
michael@0 849 '<font size=+1>foo[bar]baz</font>',
michael@0 850 '<font size=4>foo<font size=1>b[a]r</font>baz</font>',
michael@0 851
michael@0 852 'foo<span style="font-size: xx-small">[bar]</span>baz',
michael@0 853 '<span style="font-size: xx-small">foo[bar]baz</span>',
michael@0 854 'foo<span style="font-size: medium">[bar]</span>baz',
michael@0 855 '<span style="font-size: medium">foo[bar]baz</span>',
michael@0 856 'foo<span style="font-size: large">[bar]</span>baz',
michael@0 857 '<span style="font-size: large">foo[bar]baz</span>',
michael@0 858 '<span style="font-size: large">foo<span style="font-size: xx-small">b[a]r</span>baz</span>',
michael@0 859
michael@0 860 'foo<span style="font-size: 2em">[bar]</span>baz',
michael@0 861 '<span style="font-size: 2em">foo[bar]baz</span>',
michael@0 862
michael@0 863 '<p style="font-size: xx-small">foo[bar]baz</p>',
michael@0 864 '<p style="font-size: medium">foo[bar]baz</p>',
michael@0 865 '<p style="font-size: large">foo[bar]baz</p>',
michael@0 866 '<p style="font-size: 2em">foo[bar]baz</p>',
michael@0 867
michael@0 868 ["3", '<p style="font-size: xx-small">foo[bar]baz</p>'],
michael@0 869 ["3", '<p style="font-size: medium">foo[bar]baz</p>'],
michael@0 870 ["3", '<p style="font-size: large">foo[bar]baz</p>'],
michael@0 871 ["3", '<p style="font-size: 2em">foo[bar]baz</p>'],
michael@0 872
michael@0 873 // Minor algorithm bug: this changes the size of the "b" and "r" in
michael@0 874 // "bar" when we pull down styles
michael@0 875 ["3", '<font size=6>foo <span style="font-size: 2em">b[a]r</span> baz</font>'],
michael@0 876
michael@0 877 ["3", 'foo<big>[bar]</big>baz'],
michael@0 878 ["3", 'foo<big>b[a]r</big>baz'],
michael@0 879 ["3", 'foo<small>[bar]</small>baz'],
michael@0 880 ["3", 'foo<small>b[a]r</small>baz'],
michael@0 881
michael@0 882 // Tests for queryCommandIndeterm() and queryCommandState()
michael@0 883 'fo[o<font size=2>b]ar</font>baz',
michael@0 884 'foo<font size=2>ba[r</font>b]az',
michael@0 885 'fo[o<font size=2>bar</font>b]az',
michael@0 886 'foo[<font size=2>b]ar</font>baz',
michael@0 887 'foo<font size=2>ba[r</font>]baz',
michael@0 888 'foo[<font size=2>bar</font>]baz',
michael@0 889 'foo<font size=2>[bar]</font>baz',
michael@0 890 'foo{<font size=2>bar</font>}baz',
michael@0 891 '<font size=1>fo[o</font><span style=font-size:xx-small>b]ar</span>',
michael@0 892 '<font size=2>fo[o</font><span style=font-size:small>b]ar</span>',
michael@0 893 '<font size=3>fo[o</font><span style=font-size:medium>b]ar</span>',
michael@0 894 '<font size=4>fo[o</font><span style=font-size:large>b]ar</span>',
michael@0 895 '<font size=5>fo[o</font><span style=font-size:x-large>b]ar</span>',
michael@0 896 '<font size=6>fo[o</font><span style=font-size:xx-large>b]ar</span>',
michael@0 897
michael@0 898 // http://www.w3.org/Bugs/Public/show_bug.cgi?id=13829
michael@0 899 ["!6", '<span style=background-color:aqua>[foo]</span>'],
michael@0 900 ["!6", '<span style=background-color:aqua>foo[bar]baz</span>'],
michael@0 901 ["!6", '[foo<span style=background-color:aqua>bar</span>baz]'],
michael@0 902 ],
michael@0 903 //@}
michael@0 904 forecolor: [
michael@0 905 //@{
michael@0 906 'foo[]bar',
michael@0 907 '<p>[foo</p> <p>bar]</p>',
michael@0 908 '<span>[foo</span> <span>bar]</span>',
michael@0 909 '<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>',
michael@0 910 '<p>[foo<p><br><p>bar]',
michael@0 911 '<b>foo[]bar</b>',
michael@0 912 '<i>foo[]bar</i>',
michael@0 913 '<span>foo</span>{}<span>bar</span>',
michael@0 914 '<span>foo[</span><span>]bar</span>',
michael@0 915 'foo[bar]baz',
michael@0 916 'foo[bar<b>baz]qoz</b>quz',
michael@0 917 'foo[bar<i>baz]qoz</i>quz',
michael@0 918 '{<p><p> <p>foo</p>}',
michael@0 919
michael@0 920 ['blue', 'foo[bar]baz'],
michael@0 921 ['f', 'foo[bar]baz'],
michael@0 922 ['#f', 'foo[bar]baz'],
michael@0 923 ['00f', 'foo[bar]baz'],
michael@0 924 ['#00f', 'foo[bar]baz'],
michael@0 925 ['0000ff', 'foo[bar]baz'],
michael@0 926 ['#0000ff', 'foo[bar]baz'],
michael@0 927 ['000000fff', 'foo[bar]baz'],
michael@0 928 ['#000000fff', 'foo[bar]baz'],
michael@0 929 ['rgb(0, 0, 255)', 'foo[bar]baz'],
michael@0 930 ['rgb(0%, 0%, 100%)', 'foo[bar]baz'],
michael@0 931 ['rgb( 0 ,0 ,255)', 'foo[bar]baz'],
michael@0 932 ['rgba(0, 0, 255, 0.0)', 'foo[bar]baz'],
michael@0 933 ['rgb(15, -10, 375)', 'foo[bar]baz'],
michael@0 934 ['rgba(0, 0, 0, 1)', 'foo[bar]baz'],
michael@0 935 ['rgba(255, 255, 255, 1)', 'foo[bar]baz'],
michael@0 936 ['rgba(0, 0, 255, 0.5)', 'foo[bar]baz'],
michael@0 937 ['hsl(240, 100%, 50%)', 'foo[bar]baz'],
michael@0 938 ['cornsilk', 'foo[bar]baz'],
michael@0 939 ['potato quiche', 'foo[bar]baz'],
michael@0 940 ['transparent', 'foo[bar]baz'],
michael@0 941 ['currentColor', 'foo[bar]baz'],
michael@0 942
michael@0 943 '<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>',
michael@0 944 '<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 945 '<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 946 '<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>',
michael@0 947 '<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>',
michael@0 948 '{<table><tr><td>foo<td>bar<td>baz</table>}',
michael@0 949
michael@0 950 'foo<font color=blue>[bar]</font>baz',
michael@0 951 'foo{<font color=blue>bar</font>}baz',
michael@0 952 '<span style="color: blue">foo<span style="color: brown">[bar]</span>baz</span>',
michael@0 953 '<span style="color: #00f">foo<span style="color: brown">[bar]</span>baz</span>',
michael@0 954 '<span style="color: #0000ff">foo<span style="color: brown">[bar]</span>baz</span>',
michael@0 955 '<span style="color: rgb(0, 0, 255)">foo<span style="color: brown">[bar]</span>baz</span>',
michael@0 956 '<font color=blue>foo<font color=brown>[bar]</font>baz</font>',
michael@0 957 '<span style="color: rgb(0, 0, 255)">foo<span style="color: brown">b[ar]</span>baz</span>',
michael@0 958 'foo<span id=purple>ba[r</span>ba]z',
michael@0 959 '<span style="color: rgb(0, 0, 255)">foo<span id=purple>b[a]r</span>baz</span>',
michael@0 960
michael@0 961 ['blue', '<a href=http://www.google.com>foo[bar]baz</a>'],
michael@0 962 ['#0000ff', '<a href=http://www.google.com>foo[bar]baz</a>'],
michael@0 963 ['rgb(0,0,255)', '<a href=http://www.google.com>foo[bar]baz</a>'],
michael@0 964
michael@0 965 // Tests for queryCommandValue()
michael@0 966 '<font color="blue">[foo]</font>',
michael@0 967 '<font color="0000ff">[foo]</font>',
michael@0 968 '<font color="#0000ff">[foo]</font>',
michael@0 969 '<span style="color: blue">[foo]</span>',
michael@0 970 '<span style="color: #0000ff">[foo]</span>',
michael@0 971 '<span style="color: rgb(0, 0, 255)">[foo]</span>',
michael@0 972 '<span style="color: rgb(0%, 0%, 100%)">[foo]</span>',
michael@0 973 '<span style="color: rgb( 0 ,0 ,255)">[foo]</span>',
michael@0 974 '<span style="color: rgba(0, 0, 255, 0.0)">[foo]</span>',
michael@0 975 '<span style="color: rgb(15, -10, 375)">[foo]</span>',
michael@0 976 '<span style="color: rgba(0, 0, 0, 1)">[foo]</span>',
michael@0 977 '<span style="color: rgba(255, 255, 255, 1)">[foo]</span>',
michael@0 978 '<span style="color: rgba(0, 0, 255, 0.5)">[foo]</span>',
michael@0 979 '<span style="color: hsl(240, 100%, 50%)">[foo]</span>',
michael@0 980 '<span style="color: cornsilk">[foo]</span>',
michael@0 981 '<span style="color: transparent">[foo]</span>',
michael@0 982 '<span style="color: currentColor">[foo]</span>',
michael@0 983
michael@0 984 // Tests for queryCommandIndeterm() and queryCommandState()
michael@0 985 'fo[o<font color=brown>b]ar</font>baz',
michael@0 986 'foo<font color=brown>ba[r</font>b]az',
michael@0 987 'fo[o<font color=brown>bar</font>b]az',
michael@0 988 'foo[<font color=brown>b]ar</font>baz',
michael@0 989 'foo<font color=brown>ba[r</font>]baz',
michael@0 990 'foo[<font color=brown>bar</font>]baz',
michael@0 991 'foo<font color=brown>[bar]</font>baz',
michael@0 992 'foo{<font color=brown>bar</font>}baz',
michael@0 993 '<font color=brown>fo[o</font><span style=color:brown>b]ar</span>',
michael@0 994 '<span style=color:brown>fo[o</span><span style=color:#0000ff>b]ar</span>',
michael@0 995 ],
michael@0 996 //@}
michael@0 997 formatblock: [
michael@0 998 //@{
michael@0 999 'foo[]bar<p>extra',
michael@0 1000 '<span>foo</span>{}<span>bar</span><p>extra',
michael@0 1001 '<span>foo[</span><span>]bar</span><p>extra',
michael@0 1002 'foo[bar]baz<p>extra',
michael@0 1003 'foo]bar[baz<p>extra',
michael@0 1004 '{<p><p> <p>foo</p>}',
michael@0 1005 'foo[bar<i>baz]qoz</i>quz<p>extra',
michael@0 1006
michael@0 1007 '<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>',
michael@0 1008 '<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 1009 '<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 1010 '<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>',
michael@0 1011 '<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>',
michael@0 1012 '{<table><tr><td>foo<td>bar<td>baz</table>}',
michael@0 1013
michael@0 1014 '<div>[foobar]</div>',
michael@0 1015 '<p>[foobar]</p>',
michael@0 1016 '<blockquote>[foobar]</blockquote>',
michael@0 1017 '<h1>[foobar]</h1>',
michael@0 1018 '<h2>[foobar]</h2>',
michael@0 1019 '<h3>[foobar]</h3>',
michael@0 1020 '<h4>[foobar]</h4>',
michael@0 1021 '<h5>[foobar]</h5>',
michael@0 1022 '<h6>[foobar]</h6>',
michael@0 1023 '<dl><dt>[foo]<dd>bar</dl>',
michael@0 1024 '<dl><dt>foo<dd>[bar]</dl>',
michael@0 1025 '<dl><dt>[foo<dd>bar]</dl>',
michael@0 1026 '<ol><li>[foobar]</ol>',
michael@0 1027 '<ul><li>[foobar]</ul>',
michael@0 1028 '<address>[foobar]</address>',
michael@0 1029 '<pre>[foobar]</pre>',
michael@0 1030 '<article>[foobar]</article>',
michael@0 1031 '<ins>[foobar]</ins>',
michael@0 1032 '<del>[foobar]</del>',
michael@0 1033 '<quasit>[foobar]</quasit>',
michael@0 1034 '<quasit style="display: block">[foobar]</quasit>',
michael@0 1035
michael@0 1036 ['<p>', 'foo[]bar<p>extra'],
michael@0 1037 ['<p>', '<span>foo</span>{}<span>bar</span><p>extra'],
michael@0 1038 ['<p>', '<span>foo[</span><span>]bar</span><p>extra'],
michael@0 1039 ['<p>', 'foo[bar]baz<p>extra'],
michael@0 1040 ['<p>', 'foo]bar[baz<p>extra'],
michael@0 1041 ['<p>', '{<p><p> <p>foo</p>}'],
michael@0 1042 ['<p>', 'foo[bar<i>baz]qoz</i>quz<p>extra'],
michael@0 1043
michael@0 1044 ['<p>', '<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>'],
michael@0 1045 ['<p>', '<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>'],
michael@0 1046 ['<p>', '<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>'],
michael@0 1047 ['<p>', '<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>'],
michael@0 1048 ['<p>', '<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>'],
michael@0 1049 ['<p>', '{<table><tr><td>foo<td>bar<td>baz</table>}'],
michael@0 1050
michael@0 1051 ['<p>', '<div>[foobar]</div>'],
michael@0 1052 ['<p>', '<p>[foobar]</p>'],
michael@0 1053 ['<p>', '<blockquote>[foobar]</blockquote>'],
michael@0 1054 ['<p>', '<h1>[foobar]</h1>'],
michael@0 1055 ['<p>', '<h2>[foobar]</h2>'],
michael@0 1056 ['<p>', '<h3>[foobar]</h3>'],
michael@0 1057 ['<p>', '<h4>[foobar]</h4>'],
michael@0 1058 ['<p>', '<h5>[foobar]</h5>'],
michael@0 1059 ['<p>', '<h6>[foobar]</h6>'],
michael@0 1060 ['<p>', '<dl><dt>[foo]<dd>bar</dl>'],
michael@0 1061 ['<p>', '<dl><dt>foo<dd>[bar]</dl>'],
michael@0 1062 ['<p>', '<dl><dt>[foo<dd>bar]</dl>'],
michael@0 1063 ['<p>', '<ol><li>[foobar]</ol>'],
michael@0 1064 ['<p>', '<ul><li>[foobar]</ul>'],
michael@0 1065 ['<p>', '<address>[foobar]</address>'],
michael@0 1066 ['<p>', '<pre>[foobar]</pre>'],
michael@0 1067 ['<p>', '<listing>[foobar]</listing>'],
michael@0 1068 ['<p>', '<xmp>[foobar]</xmp>'],
michael@0 1069 ['<p>', '<article>[foobar]</article>'],
michael@0 1070 ['<p>', '<ins>[foobar]</ins>'],
michael@0 1071 ['<p>', '<del>[foobar]</del>'],
michael@0 1072 ['<p>', '<quasit>[foobar]</quasit>'],
michael@0 1073 ['<p>', '<quasit style="display: block">[foobar]</quasit>'],
michael@0 1074
michael@0 1075 ['<blockquote>', '<blockquote>[foo]</blockquote><p>extra'],
michael@0 1076 ['<blockquote>', '<blockquote><p>[foo]<p>bar</blockquote><p>extra'],
michael@0 1077 ['<blockquote>', '[foo]<blockquote>bar</blockquote><p>extra'],
michael@0 1078 ['<blockquote>', '<p>[foo<p>bar]<p>baz'],
michael@0 1079 ['<blockquote>', '<section>[foo]</section>'],
michael@0 1080 ['<blockquote>', '<section><p>[foo]</section>'],
michael@0 1081 ['<blockquote>', '<section><hgroup><h1>[foo]</h1><h2>bar</h2></hgroup><p>baz</section>'],
michael@0 1082 ['<article>', '<section>[foo]</section>'],
michael@0 1083
michael@0 1084 ['<address>', '<div>[foobar]</div>'],
michael@0 1085 ['<article>', '<div>[foobar]</div>'],
michael@0 1086 ['<blockquote>', '<div>[foobar]</div>'],
michael@0 1087 ['<dd>', '<div>[foobar]</div>'],
michael@0 1088 ['<del>', '<div>[foobar]</div>'],
michael@0 1089 ['<dl>', '<div>[foobar]</div>'],
michael@0 1090 ['<dt>', '<div>[foobar]</div>'],
michael@0 1091 ['<h1>', '<div>[foobar]</div>'],
michael@0 1092 ['<h2>', '<div>[foobar]</div>'],
michael@0 1093 ['<h3>', '<div>[foobar]</div>'],
michael@0 1094 ['<h4>', '<div>[foobar]</div>'],
michael@0 1095 ['<h5>', '<div>[foobar]</div>'],
michael@0 1096 ['<h6>', '<div>[foobar]</div>'],
michael@0 1097 ['<ins>', '<div>[foobar]</div>'],
michael@0 1098 ['<li>', '<div>[foobar]</div>'],
michael@0 1099 ['<ol>', '<div>[foobar]</div>'],
michael@0 1100 ['<p>', '<div>[foobar]</div>'],
michael@0 1101 ['<pre>', '<div>[foobar]</div>'],
michael@0 1102 ['<ul>', '<div>[foobar]</div>'],
michael@0 1103 ['<quasit>', '<div>[foobar]</div>'],
michael@0 1104
michael@0 1105 ['<address>', '<p>[foobar]</p>'],
michael@0 1106 ['<article>', '<p>[foobar]</p>'],
michael@0 1107 ['<aside>', '<p>[foobar]</p>'],
michael@0 1108 ['<blockquote>', '<p>[foobar]</p>'],
michael@0 1109 ['<body>', '<p>[foobar]</p>'],
michael@0 1110 ['<dd>', '<p>[foobar]</p>'],
michael@0 1111 ['<del>', '<p>[foobar]</p>'],
michael@0 1112 ['<details>', '<p>[foobar]</p>'],
michael@0 1113 ['<dir>', '<p>[foobar]</p>'],
michael@0 1114 ['<div>', '<p>[foobar]</p>'],
michael@0 1115 ['<dl>', '<p>[foobar]</p>'],
michael@0 1116 ['<dt>', '<p>[foobar]</p>'],
michael@0 1117 ['<fieldset>', '<p>[foobar]</p>'],
michael@0 1118 ['<figcaption>', '<p>[foobar]</p>'],
michael@0 1119 ['<figure>', '<p>[foobar]</p>'],
michael@0 1120 ['<footer>', '<p>[foobar]</p>'],
michael@0 1121 ['<form>', '<p>[foobar]</p>'],
michael@0 1122 ['<h1>', '<p>[foobar]</p>'],
michael@0 1123 ['<h2>', '<p>[foobar]</p>'],
michael@0 1124 ['<h3>', '<p>[foobar]</p>'],
michael@0 1125 ['<h4>', '<p>[foobar]</p>'],
michael@0 1126 ['<h5>', '<p>[foobar]</p>'],
michael@0 1127 ['<h6>', '<p>[foobar]</p>'],
michael@0 1128 ['<header>', '<p>[foobar]</p>'],
michael@0 1129 ['<head>', '<p>[foobar]</p>'],
michael@0 1130 ['<hgroup>', '<p>[foobar]</p>'],
michael@0 1131 ['<hr>', '<p>[foobar]</p>'],
michael@0 1132 ['<html>', '<p>[foobar]</p>'],
michael@0 1133 ['<ins>', '<p>[foobar]</p>'],
michael@0 1134 ['<li>', '<p>[foobar]</p>'],
michael@0 1135 ['<listing>', '<p>[foobar]</p>'],
michael@0 1136 ['<menu>', '<p>[foobar]</p>'],
michael@0 1137 ['<nav>', '<p>[foobar]</p>'],
michael@0 1138 ['<ol>', '<p>[foobar]</p>'],
michael@0 1139 ['<p>', '<p>[foobar]</p>'],
michael@0 1140 ['<plaintext>', '<p>[foobar]</p>'],
michael@0 1141 ['<pre>', '<p>[foobar]</p>'],
michael@0 1142 ['<section>', '<p>[foobar]</p>'],
michael@0 1143 ['<ul>', '<p>[foobar]</p>'],
michael@0 1144 ['<xmp>', '<p>[foobar]</p>'],
michael@0 1145 ['<quasit>', '<p>[foobar]</p>'],
michael@0 1146
michael@0 1147 ['<address>', '<p>[foo<p>bar]'],
michael@0 1148 ['<article>', '<p>[foo<p>bar]'],
michael@0 1149 ['<aside>', '<p>[foo<p>bar]'],
michael@0 1150 ['<blockquote>', '<p>[foo<p>bar]'],
michael@0 1151 ['<body>', '<p>[foo<p>bar]'],
michael@0 1152 ['<dd>', '<p>[foo<p>bar]'],
michael@0 1153 ['<del>', '<p>[foo<p>bar]'],
michael@0 1154 ['<details>', '<p>[foo<p>bar]'],
michael@0 1155 ['<dir>', '<p>[foo<p>bar]'],
michael@0 1156 ['<div>', '<p>[foo<p>bar]'],
michael@0 1157 ['<dl>', '<p>[foo<p>bar]'],
michael@0 1158 ['<dt>', '<p>[foo<p>bar]'],
michael@0 1159 ['<fieldset>', '<p>[foo<p>bar]'],
michael@0 1160 ['<figcaption>', '<p>[foo<p>bar]'],
michael@0 1161 ['<figure>', '<p>[foo<p>bar]'],
michael@0 1162 ['<footer>', '<p>[foo<p>bar]'],
michael@0 1163 ['<form>', '<p>[foo<p>bar]'],
michael@0 1164 ['<h1>', '<p>[foo<p>bar]'],
michael@0 1165 ['<h2>', '<p>[foo<p>bar]'],
michael@0 1166 ['<h3>', '<p>[foo<p>bar]'],
michael@0 1167 ['<h4>', '<p>[foo<p>bar]'],
michael@0 1168 ['<h5>', '<p>[foo<p>bar]'],
michael@0 1169 ['<h6>', '<p>[foo<p>bar]'],
michael@0 1170 ['<header>', '<p>[foo<p>bar]'],
michael@0 1171 ['<head>', '<p>[foo<p>bar]'],
michael@0 1172 ['<hgroup>', '<p>[foo<p>bar]'],
michael@0 1173 ['<hr>', '<p>[foo<p>bar]'],
michael@0 1174 ['<html>', '<p>[foo<p>bar]'],
michael@0 1175 ['<ins>', '<p>[foo<p>bar]'],
michael@0 1176 ['<li>', '<p>[foo<p>bar]'],
michael@0 1177 ['<listing>', '<p>[foo<p>bar]'],
michael@0 1178 ['<menu>', '<p>[foo<p>bar]'],
michael@0 1179 ['<nav>', '<p>[foo<p>bar]'],
michael@0 1180 ['<ol>', '<p>[foo<p>bar]'],
michael@0 1181 ['<p>', '<p>[foo<p>bar]'],
michael@0 1182 ['<plaintext>', '<p>[foo<p>bar]'],
michael@0 1183 ['<pre>', '<p>[foo<p>bar]'],
michael@0 1184 ['<section>', '<p>[foo<p>bar]'],
michael@0 1185 ['<ul>', '<p>[foo<p>bar]'],
michael@0 1186 ['<xmp>', '<p>[foo<p>bar]'],
michael@0 1187 ['<quasit>', '<p>[foo<p>bar]'],
michael@0 1188
michael@0 1189 ['p', '<div>[foobar]</div>'],
michael@0 1190
michael@0 1191 '<ol><li>[foo]<li>bar</ol>',
michael@0 1192
michael@0 1193 ['<p>', '<h1>[foo]<br>bar</h1>'],
michael@0 1194 ['<p>', '<h1>foo<br>[bar]</h1>'],
michael@0 1195 ['<p>', '<h1>[foo<br>bar]</h1>'],
michael@0 1196 ['<address>', '<h1>[foo]<br>bar</h1>'],
michael@0 1197 ['<address>', '<h1>foo<br>[bar]</h1>'],
michael@0 1198 ['<address>', '<h1>[foo<br>bar]</h1>'],
michael@0 1199 ['<pre>', '<h1>[foo]<br>bar</h1>'],
michael@0 1200 ['<pre>', '<h1>foo<br>[bar]</h1>'],
michael@0 1201 ['<pre>', '<h1>[foo<br>bar]</h1>'],
michael@0 1202 ['<h2>', '<h1>[foo]<br>bar</h1>'],
michael@0 1203 ['<h2>', '<h1>foo<br>[bar]</h1>'],
michael@0 1204 ['<h2>', '<h1>[foo<br>bar]</h1>'],
michael@0 1205
michael@0 1206 ['<h1>', '<p>[foo]<br>bar</p>'],
michael@0 1207 ['<h1>', '<p>foo<br>[bar]</p>'],
michael@0 1208 ['<h1>', '<p>[foo<br>bar]</p>'],
michael@0 1209 ['<address>', '<p>[foo]<br>bar</p>'],
michael@0 1210 ['<address>', '<p>foo<br>[bar]</p>'],
michael@0 1211 ['<address>', '<p>[foo<br>bar]</p>'],
michael@0 1212 ['<pre>', '<p>[foo]<br>bar</p>'],
michael@0 1213 ['<pre>', '<p>foo<br>[bar]</p>'],
michael@0 1214 ['<pre>', '<p>[foo<br>bar]</p>'],
michael@0 1215
michael@0 1216 ['<p>', '<address>[foo]<br>bar</address>'],
michael@0 1217 ['<p>', '<address>foo<br>[bar]</address>'],
michael@0 1218 ['<p>', '<address>[foo<br>bar]</address>'],
michael@0 1219 ['<pre>', '<address>[foo]<br>bar</address>'],
michael@0 1220 ['<pre>', '<address>foo<br>[bar]</address>'],
michael@0 1221 ['<pre>', '<address>[foo<br>bar]</address>'],
michael@0 1222 ['<h1>', '<address>[foo]<br>bar</address>'],
michael@0 1223 ['<h1>', '<address>foo<br>[bar]</address>'],
michael@0 1224 ['<h1>', '<address>[foo<br>bar]</address>'],
michael@0 1225
michael@0 1226 ['<p>', '<pre>[foo]<br>bar</pre>'],
michael@0 1227 ['<p>', '<pre>foo<br>[bar]</pre>'],
michael@0 1228 ['<p>', '<pre>[foo<br>bar]</pre>'],
michael@0 1229 ['<address>', '<pre>[foo]<br>bar</pre>'],
michael@0 1230 ['<address>', '<pre>foo<br>[bar]</pre>'],
michael@0 1231 ['<address>', '<pre>[foo<br>bar]</pre>'],
michael@0 1232 ['<h1>', '<pre>[foo]<br>bar</pre>'],
michael@0 1233 ['<h1>', '<pre>foo<br>[bar]</pre>'],
michael@0 1234 ['<h1>', '<pre>[foo<br>bar]</pre>'],
michael@0 1235
michael@0 1236 ['<h1>', '<p>[foo</p>bar]'],
michael@0 1237 ['<h1>', '[foo<p>bar]</p>'],
michael@0 1238 ['<p>', '<div>[foo<p>bar]</p></div>'],
michael@0 1239 ['<p>', '<xmp>[foo]</xmp>'],
michael@0 1240 ['<div>', '<xmp>[foo]</xmp>'],
michael@0 1241
michael@0 1242 '<div><ol><li>[foo]</ol></div>',
michael@0 1243 '<div><table><tr><td>[foo]</table></div>',
michael@0 1244 '<p>[foo<h1>bar]</h1>',
michael@0 1245 '<h1>[foo</h1><h2>bar]</h2>',
michael@0 1246 '<div>[foo</div>bar]',
michael@0 1247
michael@0 1248 // https://bugs.webkit.org/show_bug.cgi?id=47054
michael@0 1249 ['<p>', '<div style=color:blue>[foo]</div>'],
michael@0 1250 // https://bugs.webkit.org/show_bug.cgi?id=47574
michael@0 1251 ['<h1>', '{<p>foo</p>ba]r'],
michael@0 1252 ['<pre>', '&#10;[foo<p>bar]</p>'],
michael@0 1253 // From https://bugs.webkit.org/show_bug.cgi?id=47300
michael@0 1254 // http://www.w3.org/Bugs/Public/show_bug.cgi?id=14009
michael@0 1255 ['!<p>', '{<pre>&#10;foo&#10;&#10;bar&#10;</pre>}'],
michael@0 1256 ],
michael@0 1257 //@}
michael@0 1258 forwarddelete: [
michael@0 1259 //@{
michael@0 1260 // Collapsed selection
michael@0 1261 'foo[]',
michael@0 1262 '<span>foo[]</span>',
michael@0 1263 '<p>foo[]</p>',
michael@0 1264 'foo[]bar',
michael@0 1265 '<span>foo</span>{}<span>bar</span>',
michael@0 1266 '<span>foo[</span><span>]bar</span>',
michael@0 1267 'foo[]<span style=display:none>bar</span>baz',
michael@0 1268 'foo[]<script>bar</script>baz',
michael@0 1269 'fo[]&ouml;bar',
michael@0 1270 'fo[]o&#x308;bar',
michael@0 1271 'fo[]o&#x308;&#x327;bar',
michael@0 1272 '[]&ouml;bar',
michael@0 1273 '[]o&#x308;bar',
michael@0 1274 '[]o&#x308;&#x327;bar',
michael@0 1275
michael@0 1276 '[]&#x5e9;&#x5c1;&#x5b8;&#x5dc;&#x5d5;&#x5b9;&#x5dd;',
michael@0 1277 '&#x5e9;&#x5c1;&#x5b8;&#x5dc;[]&#x5d5;&#x5b9;&#x5dd;',
michael@0 1278
michael@0 1279 '<p>foo[]</p><p>bar</p>',
michael@0 1280 '<p>foo[]</p>bar',
michael@0 1281 'foo[]<p>bar</p>',
michael@0 1282 '<p>foo[]<br></p><p>bar</p>',
michael@0 1283 '<p>foo[]<br></p>bar',
michael@0 1284 'foo[]<br><p>bar</p>',
michael@0 1285
michael@0 1286 '<p>{}<br></p>foo',
michael@0 1287 '<p>{}<span><br></span></p>foo',
michael@0 1288 'foo{}<p><br>',
michael@0 1289 'foo{}<p><span><br></span>',
michael@0 1290 'foo{}<br><p><br>',
michael@0 1291 'foo{}<span><br></span><p><br>',
michael@0 1292 'foo{}<br><p><span><br></span>',
michael@0 1293 'foo{}<span><br></span><p><span><br></span>',
michael@0 1294 'foo{}<p>',
michael@0 1295 '<table><tr><td>{}</table>foo',
michael@0 1296 '<table><tr><td>{}<br></table>foo',
michael@0 1297 '<table><tr><td>{}<span><br></span></table>foo',
michael@0 1298
michael@0 1299 '<div><p>foo[]</p></div><p>bar</p>',
michael@0 1300 '<p>foo[]</p><div><p>bar</p></div>',
michael@0 1301 '<div><p>foo[]</p></div><div><p>bar</p></div>',
michael@0 1302 '<div><p>foo[]</p></div>bar',
michael@0 1303 'foo[]<div><p>bar</p></div>',
michael@0 1304
michael@0 1305 '<div>foo[]</div><div>bar</div>',
michael@0 1306 '<pre>foo[]</pre>bar',
michael@0 1307
michael@0 1308 'foo[]<br>bar',
michael@0 1309 '<b>foo[]</b><br>bar',
michael@0 1310 'foo[]<hr>bar',
michael@0 1311 '<p>foo[]<hr><p>bar',
michael@0 1312 '<p>foo[]</p><br><p>bar</p>',
michael@0 1313 '<p>foo[]</p><br><br><p>bar</p>',
michael@0 1314 '<p>foo[]</p><img src=/img/lion.svg><p>bar',
michael@0 1315 'foo[]<img src=/img/lion.svg>bar',
michael@0 1316
michael@0 1317 'foo[]<a>bar</a>',
michael@0 1318 'foo[]<a href=/>bar</a>',
michael@0 1319 'foo[]<a name=abc>bar</a>',
michael@0 1320 'foo[]<a href=/ name=abc>bar</a>',
michael@0 1321 'foo[]<span><a>bar</a></span>',
michael@0 1322 'foo[]<span><a href=/>bar</a></span>',
michael@0 1323 'foo[]<span><a name=abc>bar</a></span>',
michael@0 1324 'foo[]<span><a href=/ name=abc>bar</a></span>',
michael@0 1325 '<a>foo[]</a>bar',
michael@0 1326 '<a href=/>foo[]</a>bar',
michael@0 1327 '<a name=abc>foo[]</a>bar',
michael@0 1328 '<a href=/ name=abc>foo[]</a>bar',
michael@0 1329
michael@0 1330 'foo []&nbsp;',
michael@0 1331 '[]&nbsp; foo',
michael@0 1332 'foo[] &nbsp;bar',
michael@0 1333 'foo[]&nbsp; bar',
michael@0 1334 'foo[]&nbsp;&nbsp;bar',
michael@0 1335 'foo[] bar',
michael@0 1336 'foo[] &nbsp; bar',
michael@0 1337 'foo []&nbsp; bar',
michael@0 1338 'foo &nbsp;[] bar',
michael@0 1339 'foo[] <span>&nbsp;</span> bar',
michael@0 1340 'foo []<span>&nbsp;</span> bar',
michael@0 1341 'foo <span>&nbsp;</span>[] bar',
michael@0 1342 '<b>foo[] </b>&nbsp;bar',
michael@0 1343 '<b>foo[]&nbsp;</b> bar',
michael@0 1344 '<b>foo[]&nbsp;</b>&nbsp;bar',
michael@0 1345 '<b>foo[] </b> bar',
michael@0 1346
michael@0 1347 '<pre>foo []&nbsp;</pre>',
michael@0 1348 '<pre>[]&nbsp; foo</pre>',
michael@0 1349 '<pre>foo[] &nbsp;bar</pre>',
michael@0 1350 '<pre>foo[]&nbsp; bar</pre>',
michael@0 1351 '<pre>foo[] bar</pre>',
michael@0 1352
michael@0 1353 '<div style=white-space:pre>foo []&nbsp;</div>',
michael@0 1354 '<div style=white-space:pre>[]&nbsp; foo</div>',
michael@0 1355 '<div style=white-space:pre>foo[] &nbsp;bar</div>',
michael@0 1356 '<div style=white-space:pre>foo[]&nbsp; bar</div>',
michael@0 1357 '<div style=white-space:pre>foo[] bar</div>',
michael@0 1358
michael@0 1359 '<div style=white-space:pre-wrap>foo []&nbsp;</div>',
michael@0 1360 '<div style=white-space:pre-wrap>[]&nbsp; foo</div>',
michael@0 1361 '<div style=white-space:pre-wrap>foo[] &nbsp;bar</div>',
michael@0 1362 '<div style=white-space:pre-wrap>foo[]&nbsp; bar</div>',
michael@0 1363 '<div style=white-space:pre-wrap>foo[] bar</div>',
michael@0 1364
michael@0 1365 '<div style=white-space:pre-line>foo []&nbsp;</div>',
michael@0 1366 '<div style=white-space:pre-line>[]&nbsp; foo</div>',
michael@0 1367 '<div style=white-space:pre-line>foo[] &nbsp;bar</div>',
michael@0 1368 '<div style=white-space:pre-line>foo[]&nbsp; bar</div>',
michael@0 1369 '<div style=white-space:pre-line>foo[] bar</div>',
michael@0 1370
michael@0 1371 '<div style=white-space:nowrap>foo []&nbsp;</div>',
michael@0 1372 '<div style=white-space:nowrap>[]&nbsp; foo</div>',
michael@0 1373 '<div style=white-space:nowrap>foo[] &nbsp;bar</div>',
michael@0 1374 '<div style=white-space:nowrap>foo[]&nbsp; bar</div>',
michael@0 1375 '<div style=white-space:nowrap>foo[] bar</div>',
michael@0 1376
michael@0 1377 // Tables with collapsed selection
michael@0 1378 'foo[]<table><tr><td>bar</table>baz',
michael@0 1379 'foo<table><tr><td>bar[]</table>baz',
michael@0 1380 '<p>foo[]<table><tr><td>bar</table><p>baz',
michael@0 1381 '<table><tr><td>foo[]<td>bar</table>',
michael@0 1382 '<table><tr><td>foo[]<tr><td>bar</table>',
michael@0 1383
michael@0 1384 'foo[]<br><table><tr><td>bar</table>baz',
michael@0 1385 'foo<table><tr><td>bar[]<br></table>baz',
michael@0 1386 '<p>foo[]<br><table><tr><td>bar</table><p>baz',
michael@0 1387 '<p>foo<table><tr><td>bar[]<br></table><p>baz',
michael@0 1388 '<table><tr><td>foo[]<br><td>bar</table>',
michael@0 1389 '<table><tr><td>foo[]<br><tr><td>bar</table>',
michael@0 1390
michael@0 1391 'foo<table><tr><td>bar[]</table><br>baz',
michael@0 1392 'foo[]<table><tr><td><hr>bar</table>baz',
michael@0 1393 '<table><tr><td>foo[]<td><hr>bar</table>',
michael@0 1394 '<table><tr><td>foo[]<tr><td><hr>bar</table>',
michael@0 1395
michael@0 1396 // Lists with collapsed selection
michael@0 1397 'foo[]<ol><li>bar<li>baz</ol>',
michael@0 1398 'foo[]<br><ol><li>bar<li>baz</ol>',
michael@0 1399 '<ol><li>foo[]<li>bar</ol>',
michael@0 1400 '<ol><li>foo[]<br><li>bar</ol>',
michael@0 1401 '<ol><li>foo[]<li>bar<br>baz</ol>',
michael@0 1402
michael@0 1403 '<ol><li><p>foo[]<li>bar</ol>',
michael@0 1404 '<ol><li>foo[]<li><p>bar</ol>',
michael@0 1405 '<ol><li><p>foo[]<li><p>bar</ol>',
michael@0 1406
michael@0 1407 '<ol><li>foo[]<ul><li>bar</ul></ol>',
michael@0 1408 'foo[]<ol><ol><li>bar</ol></ol>',
michael@0 1409 'foo[]<div><ol><li>bar</ol></div>',
michael@0 1410
michael@0 1411 'foo[]<dl><dt>bar<dd>baz</dl>',
michael@0 1412 'foo[]<dl><dd>bar</dl>',
michael@0 1413 '<dl><dt>foo[]<dd>bar</dl>',
michael@0 1414 '<dl><dt>foo[]<dt>bar<dd>baz</dl>',
michael@0 1415 '<dl><dt>foo<dd>bar[]<dd>baz</dl>',
michael@0 1416
michael@0 1417 '<ol><li>foo[]</ol>bar',
michael@0 1418 '<ol><li>foo[]<br></ol>bar',
michael@0 1419 '<ol><li>{}<br></ol>bar',
michael@0 1420 '<ol><li>foo<li>{}<br></ol>bar',
michael@0 1421
michael@0 1422 '<ol><li>foo[]</ol><p>bar',
michael@0 1423 '<ol><li>foo[]<br></ol><p>bar',
michael@0 1424 '<ol><li>{}<br></ol><p>bar',
michael@0 1425 '<ol><li>foo<li>{}<br></ol><p>bar',
michael@0 1426
michael@0 1427 '<ol><li>foo[]</ol><br>',
michael@0 1428 '<ol><li>foo[]<br></ol><br>',
michael@0 1429 '<ol><li>{}<br></ol><br>',
michael@0 1430 '<ol><li>foo<li>{}<br></ol><br>',
michael@0 1431
michael@0 1432 '<ol><li>foo[]</ol><p><br>',
michael@0 1433 '<ol><li>foo[]<br></ol><p><br>',
michael@0 1434 '<ol><li>{}<br></ol><p><br>',
michael@0 1435 '<ol><li>foo<li>{}<br></ol><p><br>',
michael@0 1436
michael@0 1437 // Indented stuff with collapsed selection
michael@0 1438 'foo[]<blockquote>bar</blockquote>',
michael@0 1439 'foo[]<blockquote><blockquote>bar</blockquote></blockquote>',
michael@0 1440 'foo[]<blockquote><div>bar</div></blockquote>',
michael@0 1441 'foo[]<blockquote style="color: blue">bar</blockquote>',
michael@0 1442
michael@0 1443 'foo[]<blockquote><blockquote><p>bar<p>baz</blockquote></blockquote>',
michael@0 1444 'foo[]<blockquote><div><p>bar<p>baz</div></blockquote>',
michael@0 1445 'foo[]<blockquote style="color: blue"><p>bar<p>baz</blockquote>',
michael@0 1446
michael@0 1447 'foo[]<blockquote><p><b>bar</b><p>baz</blockquote>',
michael@0 1448 'foo[]<blockquote><p><strong>bar</strong><p>baz</blockquote>',
michael@0 1449 'foo[]<blockquote><p><span>bar</span><p>baz</blockquote>',
michael@0 1450
michael@0 1451 'foo[]<blockquote><ol><li>bar</ol></blockquote><p>extra',
michael@0 1452 'foo[]<blockquote>bar<ol><li>baz</ol>quz</blockquote><p>extra',
michael@0 1453 'foo<blockquote><ol><li>bar[]</li><ol><li>baz</ol><li>quz</ol></blockquote><p>extra',
michael@0 1454
michael@0 1455 // Invisible stuff with collapsed selection
michael@0 1456 'foo[]<span></span>bar',
michael@0 1457 'foo[]<span><span></span></span>bar',
michael@0 1458 'foo[]<quasit></quasit>bar',
michael@0 1459 'foo[]<span></span><br>bar',
michael@0 1460 '<span>foo[]<span></span></span>bar',
michael@0 1461 'foo[]<span></span><span>bar</span>',
michael@0 1462 'foo[]<div><div><p>bar</div></div>',
michael@0 1463 'foo[]<div><div><p><!--abc-->bar</div></div>',
michael@0 1464 'foo[]<div><div><!--abc--><p>bar</div></div>',
michael@0 1465 'foo[]<div><!--abc--><div><p>bar</div></div>',
michael@0 1466 'foo[]<!--abc--><div><div><p>bar</div></div>',
michael@0 1467 '<div><div><p>foo[]</div></div>bar',
michael@0 1468 '<div><div><p>foo[]</div></div><!--abc-->bar',
michael@0 1469 '<div><div><p>foo[]</div><!--abc--></div>bar',
michael@0 1470 '<div><div><p>foo[]</p><!--abc--></div></div>bar',
michael@0 1471 '<div><div><p>foo[]<!--abc--></div></div>bar',
michael@0 1472 '<div><div><p>foo[]</p></div></div><div><div><div>bar</div></div></div>',
michael@0 1473 '<div><div><p>foo[]<!--abc--></p></div></div><div><div><div>bar</div></div></div>',
michael@0 1474 '<div><div><p>foo[]</p><!--abc--></div></div><div><div><div>bar</div></div></div>',
michael@0 1475 '<div><div><p>foo[]</p></div><!--abc--></div><div><div><div>bar</div></div></div>',
michael@0 1476 '<div><div><p>foo[]</p></div></div><!--abc--><div><div><div>bar</div></div></div>',
michael@0 1477 '<div><div><p>foo[]</p></div></div><div><!--abc--><div><div>bar</div></div></div>',
michael@0 1478 '<div><div><p>foo[]</p></div></div><div><div><!--abc--><div>bar</div></div></div>',
michael@0 1479 '<div><div><p>foo[]</p></div></div><div><div><div><!--abc-->bar</div></div></div>',
michael@0 1480
michael@0 1481 // Styled stuff with collapsed selection
michael@0 1482 '<p style=color:blue>foo[]<p>bar',
michael@0 1483 '<p style=color:blue>foo[]<p style=color:brown>bar',
michael@0 1484 '<p>foo[]<p style=color:brown>bar',
michael@0 1485 '<p><font color=blue>foo[]</font><p>bar',
michael@0 1486 '<p><font color=blue>foo[]</font><p><font color=brown>bar</font>',
michael@0 1487 '<p>foo[]<p><font color=brown>bar</font>',
michael@0 1488 '<p><span style=color:blue>foo[]</font><p>bar',
michael@0 1489 '<p><span style=color:blue>foo[]</font><p><span style=color:brown>bar</font>',
michael@0 1490 '<p>foo[]<p><span style=color:brown>bar</font>',
michael@0 1491
michael@0 1492 '<p style=background-color:aqua>foo[]<p>bar',
michael@0 1493 '<p style=background-color:aqua>foo[]<p style=background-color:tan>bar',
michael@0 1494 '<p>foo[]<p style=background-color:tan>bar',
michael@0 1495 '<p><span style=background-color:aqua>foo[]</font><p>bar',
michael@0 1496 '<p><span style=background-color:aqua>foo[]</font><p><span style=background-color:tan>bar</font>',
michael@0 1497 '<p>foo[]<p><span style=background-color:tan>bar</font>',
michael@0 1498
michael@0 1499 '<p style=text-decoration:underline>foo[]<p>bar',
michael@0 1500 '<p style=text-decoration:underline>foo[]<p style=text-decoration:line-through>bar',
michael@0 1501 '<p>foo[]<p style=text-decoration:line-through>bar',
michael@0 1502 '<p><u>foo[]</u><p>bar',
michael@0 1503 '<p><u>foo[]</u><p><s>bar</s>',
michael@0 1504 '<p>foo[]<p><s>bar</s>',
michael@0 1505
michael@0 1506 '<p style=color:blue>foo[]</p>bar',
michael@0 1507 'foo[]<p style=color:brown>bar',
michael@0 1508 '<div style=color:blue><p style=color:green>foo[]</div>bar',
michael@0 1509 '<div style=color:blue><p style=color:green>foo[]</div><p style=color:brown>bar',
michael@0 1510 '<p style=color:blue>foo[]<div style=color:brown><p style=color:green>bar',
michael@0 1511
michael@0 1512 // Uncollapsed selection (should be same as delete command)
michael@0 1513 'foo[bar]baz',
michael@0 1514 '<p>foo<span style=color:#aBcDeF>[bar]</span>baz',
michael@0 1515 '<p>foo<span style=color:#aBcDeF>{bar}</span>baz',
michael@0 1516 '<p>foo{<span style=color:#aBcDeF>bar</span>}baz',
michael@0 1517 '<p>[foo<span style=color:#aBcDeF>bar]</span>baz',
michael@0 1518 '<p>{foo<span style=color:#aBcDeF>bar}</span>baz',
michael@0 1519 '<p>foo<span style=color:#aBcDeF>[bar</span>baz]',
michael@0 1520 '<p>foo<span style=color:#aBcDeF>{bar</span>baz}',
michael@0 1521 '<p>foo<span style=color:#aBcDeF>[bar</span><span style=color:#fEdCbA>baz]</span>quz',
michael@0 1522
michael@0 1523 'foo<b>[bar]</b>baz',
michael@0 1524 'foo<b>{bar}</b>baz',
michael@0 1525 'foo{<b>bar</b>}baz',
michael@0 1526 'foo<span>[bar]</span>baz',
michael@0 1527 'foo<span>{bar}</span>baz',
michael@0 1528 'foo{<span>bar</span>}baz',
michael@0 1529 '<b>foo[bar</b><i>baz]quz</i>',
michael@0 1530 '<p>foo</p><p>[bar]</p><p>baz</p>',
michael@0 1531 '<p>foo</p><p>{bar}</p><p>baz</p>',
michael@0 1532 '<p>foo</p><p>{bar</p>}<p>baz</p>',
michael@0 1533 '<p>foo</p>{<p>bar}</p><p>baz</p>',
michael@0 1534 '<p>foo</p>{<p>bar</p>}<p>baz</p>',
michael@0 1535
michael@0 1536 '<p>foo[bar<p>baz]quz',
michael@0 1537 '<p>foo[bar<div>baz]quz</div>',
michael@0 1538 '<p>foo[bar<h1>baz]quz</h1>',
michael@0 1539 '<div>foo[bar</div><p>baz]quz',
michael@0 1540 '<blockquote>foo[bar</blockquote><pre>baz]quz</pre>',
michael@0 1541
michael@0 1542 '<p><b>foo[bar</b><p>baz]quz',
michael@0 1543 '<div><p>foo[bar</div><p>baz]quz',
michael@0 1544 '<p>foo[bar<blockquote><p>baz]quz<p>qoz</blockquote',
michael@0 1545 '<p>foo[bar<p style=color:blue>baz]quz',
michael@0 1546 '<p>foo[bar<p><b>baz]quz</b>',
michael@0 1547
michael@0 1548 '<div><p>foo<p>[bar<p>baz]</div>',
michael@0 1549
michael@0 1550 'foo[<br>]bar',
michael@0 1551 '<p>foo[</p><p>]bar</p>',
michael@0 1552 '<p>foo[</p><p>]bar<br>baz</p>',
michael@0 1553 'foo[<p>]bar</p>',
michael@0 1554 'foo{<p>}bar</p>',
michael@0 1555 'foo[<p>]bar<br>baz</p>',
michael@0 1556 'foo[<p>]bar</p>baz',
michael@0 1557 'foo{<p>bar</p>}baz',
michael@0 1558 'foo<p>{bar</p>}baz',
michael@0 1559 'foo{<p>bar}</p>baz',
michael@0 1560 '<p>foo[</p>]bar',
michael@0 1561 '<p>foo{</p>}bar',
michael@0 1562 '<p>foo[</p>]bar<br>baz',
michael@0 1563 '<p>foo[</p>]bar<p>baz</p>',
michael@0 1564 'foo[<div><p>]bar</div>',
michael@0 1565 '<div><p>foo[</p></div>]bar',
michael@0 1566 'foo[<div><p>]bar</p>baz</div>',
michael@0 1567 'foo[<div>]bar<p>baz</p></div>',
michael@0 1568 '<div><p>foo</p>bar[</div>]baz',
michael@0 1569 '<div>foo<p>bar[</p></div>]baz',
michael@0 1570
michael@0 1571 '<p>foo<br>{</p>]bar',
michael@0 1572 '<p>foo<br><br>{</p>]bar',
michael@0 1573 'foo<br>{<p>]bar</p>',
michael@0 1574 'foo<br><br>{<p>]bar</p>',
michael@0 1575 '<p>foo<br>{</p><p>}bar</p>',
michael@0 1576 '<p>foo<br><br>{</p><p>}bar</p>',
michael@0 1577
michael@0 1578 '<table><tbody><tr><th>foo<th>[bar]<th>baz<tr><td>quz<td>qoz<td>qiz</table>',
michael@0 1579 '<table><tbody><tr><th>foo<th>ba[r<th>b]az<tr><td>quz<td>qoz<td>qiz</table>',
michael@0 1580 '<table><tbody><tr><th>fo[o<th>bar<th>b]az<tr><td>quz<td>qoz<td>qiz</table>',
michael@0 1581 '<table><tbody><tr><th>foo<th>bar<th>ba[z<tr><td>q]uz<td>qoz<td>qiz</table>',
michael@0 1582 '<table><tbody><tr><th>[foo<th>bar<th>baz]<tr><td>quz<td>qoz<td>qiz</table>',
michael@0 1583 '<table><tbody><tr><th>[foo<th>bar<th>baz<tr><td>quz<td>qoz<td>qiz]</table>',
michael@0 1584 '{<table><tbody><tr><th>foo<th>bar<th>baz<tr><td>quz<td>qoz<td>qiz</table>}',
michael@0 1585 '<table><tbody><tr><td>foo<td>ba[r<tr><td>baz<td>quz<tr><td>q]oz<td>qiz</table>',
michael@0 1586 '<p>fo[o<table><tr><td>b]ar</table><p>baz',
michael@0 1587 '<p>foo<table><tr><td>ba[r</table><p>b]az',
michael@0 1588 '<p>fo[o<table><tr><td>bar</table><p>b]az',
michael@0 1589
michael@0 1590 '<p>foo<ol><li>ba[r<li>b]az</ol><p>quz',
michael@0 1591 '<p>foo<ol><li>bar<li>[baz]</ol><p>quz',
michael@0 1592 '<p>fo[o<ol><li>b]ar<li>baz</ol><p>quz',
michael@0 1593 '<p>foo<ol><li>bar<li>ba[z</ol><p>q]uz',
michael@0 1594 '<p>fo[o<ol><li>bar<li>b]az</ol><p>quz',
michael@0 1595 '<p>fo[o<ol><li>bar<li>baz</ol><p>q]uz',
michael@0 1596
michael@0 1597 '<ol><li>fo[o</ol><ol><li>b]ar</ol>',
michael@0 1598 '<ol><li>fo[o</ol><ul><li>b]ar</ul>',
michael@0 1599
michael@0 1600 'foo[<ol><li>]bar</ol>',
michael@0 1601 '<ol><li>foo[<li>]bar</ol>',
michael@0 1602 'foo[<dl><dt>]bar<dd>baz</dl>',
michael@0 1603 'foo[<dl><dd>]bar</dl>',
michael@0 1604 '<dl><dt>foo[<dd>]bar</dl>',
michael@0 1605 '<dl><dt>foo[<dt>]bar<dd>baz</dl>',
michael@0 1606 '<dl><dt>foo<dd>bar[<dd>]baz</dl>',
michael@0 1607
michael@0 1608 // https://bugs.webkit.org/show_bug.cgi?id=35281
michael@0 1609 // http://www.w3.org/Bugs/Public/show_bug.cgi?id=13976
michael@0 1610 '<ol><li>foo</ol>{}<br><ol><li>bar</ol>',
michael@0 1611 '<ol><li>foo</ol><p>{}<br></p><ol><li>bar</ol>',
michael@0 1612 '<ol><li><p>foo</ol><p>{}<br></p><ol><li>bar</ol>',
michael@0 1613 '<ol id=a><li>foo</ol>{}<br><ol><li>bar</ol>',
michael@0 1614 '<ol><li>foo</ol>{}<br><ol id=b><li>bar</ol>',
michael@0 1615 '<ol id=a><li>foo</ol>{}<br><ol id=b><li>bar</ol>',
michael@0 1616 '<ol class=a><li>foo</ol>{}<br><ol class=b><li>bar</ol>',
michael@0 1617 '<ol><ol><li>foo</ol><li>{}<br><ol><li>bar</ol></ol>',
michael@0 1618 '<ol><ol><li>foo</ol><li>{}<br></li><ol><li>bar</ol></ol>',
michael@0 1619 '<ol><li>foo[</ol>bar]<ol><li>baz</ol>',
michael@0 1620 '<ol><li>foo[</ol><p>bar]<ol><li>baz</ol>',
michael@0 1621 '<ol><li><p>foo[</ol><p>bar]<ol><li>baz</ol>',
michael@0 1622 '<ol><li>fo[]o</ol><ol><li>bar</ol>',
michael@0 1623 '<ol><li>foo</ol>[bar<ol><li>]baz</ol>',
michael@0 1624 '<ol><li>foo</ol><p>[bar<ol><li>]baz</ol>',
michael@0 1625 '<ol><li>foo</ol><p>[bar<ol><li><p>]baz</ol>',
michael@0 1626 '<ol><li>foo</ol><ol><li>[]bar</ol>',
michael@0 1627 '<ol><ol><li>foo[</ol><li>bar</ol>baz]<ol><li>quz</ol>',
michael@0 1628 '<ul><li>foo</ul>{}<br><ul><li>bar</ul>',
michael@0 1629 '<ul><li>foo</ul><p>{}<br></p><ul><li>bar</ul>',
michael@0 1630 '<ol><li>foo[<li>bar]</ol><ol><li>baz</ol><ol><li>quz</ol>',
michael@0 1631 '<ol><li>foo</ol>{}<br><ul><li>bar</ul>',
michael@0 1632 '<ol><li>foo</ol><p>{}<br></p><ul><li>bar</ul>',
michael@0 1633 '<ul><li>foo</ul>{}<br><ol><li>bar</ol>',
michael@0 1634 '<ul><li>foo</ul><p>{}<br></p><ol><li>bar</ol>',
michael@0 1635
michael@0 1636 // http://www.w3.org/Bugs/Public/show_bug.cgi?id=13831
michael@0 1637 '<p><b>[foo]</b>',
michael@0 1638 '<p><quasit>[foo]</quasit>',
michael@0 1639 '<p><b><i>[foo]</i></b>',
michael@0 1640 '<p><b>{foo}</b>',
michael@0 1641 '<p>{<b>foo</b>}',
michael@0 1642 '<p><b>[]f</b>',
michael@0 1643 '<b>[foo]</b>',
michael@0 1644 '<div><b>[foo]</b></div>',
michael@0 1645 ],
michael@0 1646 //@}
michael@0 1647 hilitecolor: [
michael@0 1648 //@{
michael@0 1649 'foo[]bar',
michael@0 1650 '<p>[foo</p> <p>bar]</p>',
michael@0 1651 '<span>[foo</span> <span>bar]</span>',
michael@0 1652 '<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>',
michael@0 1653 '<p>[foo<p><br><p>bar]',
michael@0 1654 '<b>foo[]bar</b>',
michael@0 1655 '<i>foo[]bar</i>',
michael@0 1656 '<span>foo</span>{}<span>bar</span>',
michael@0 1657 '<span>foo[</span><span>]bar</span>',
michael@0 1658 'foo[bar]baz',
michael@0 1659 'foo[bar<b>baz]qoz</b>quz',
michael@0 1660 'foo[bar<i>baz]qoz</i>quz',
michael@0 1661 '{<p><p> <p>foo</p>}',
michael@0 1662
michael@0 1663 '<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>',
michael@0 1664 '<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 1665 '<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 1666 '<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>',
michael@0 1667 '<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>',
michael@0 1668 '{<table><tr><td>foo<td>bar<td>baz</table>}',
michael@0 1669
michael@0 1670 '<p style="background-color: rgb(0, 255, 255)">foo[bar]baz</p>',
michael@0 1671 '<p style="background-color: #00ffff">foo[bar]baz</p>',
michael@0 1672 '<p style="background-color: aqua">foo[bar]baz</p>',
michael@0 1673 '{<p style="background-color: aqua">foo</p><p>bar</p>}',
michael@0 1674 '<span style="background-color: aqua">foo<span style="background-color: tan">[bar]</span>baz</span>',
michael@0 1675 '<span style="background-color: #00ffff">foo<span style="background-color: tan">[bar]</span>baz</span>',
michael@0 1676 '<span style="background-color: #0ff">foo<span style="background-color: tan">[bar]</span>baz</span>',
michael@0 1677 '<span style="background-color: rgb(0, 255, 255)">foo<span style="background-color: tan">[bar]</span>baz</span>',
michael@0 1678 '<span style="background-color: aqua">foo<span style="background-color: tan">b[ar]</span>baz</span>',
michael@0 1679 '<p style="background-color: aqua">foo<span style="background-color: tan">b[ar]</span>baz</p>',
michael@0 1680 '<div style="background-color: aqua"><p style="background-color: tan">b[ar]</p></div>',
michael@0 1681 '<span style="display: block; background-color: aqua"><span style="display: block; background-color: tan">b[ar]</span></span>',
michael@0 1682
michael@0 1683 // Tests for queryCommandIndeterm() and queryCommandState()
michael@0 1684 'fo[o<span style=background-color:tan>b]ar</span>baz',
michael@0 1685 'foo<span style=background-color:tan>ba[r</span>b]az',
michael@0 1686 'fo[o<span style=background-color:tan>bar</span>b]az',
michael@0 1687 'foo[<span style=background-color:tan>b]ar</span>baz',
michael@0 1688 'foo<span style=background-color:tan>ba[r</span>]baz',
michael@0 1689 'foo[<span style=background-color:tan>bar</span>]baz',
michael@0 1690 'foo<span style=background-color:tan>[bar]</span>baz',
michael@0 1691 'foo{<span style=background-color:tan>bar</span>}baz',
michael@0 1692 '<span style=background-color:tan>fo[o</span><span style=background-color:yellow>b]ar</span>',
michael@0 1693 '<span style=background-color:tan>fo[o</span><span style=background-color:tan>b]ar</span>',
michael@0 1694 '<span style=background-color:tan>fo[o<span style=background-color:transparent>b]ar</span></span>',
michael@0 1695
michael@0 1696 // http://www.w3.org/Bugs/Public/show_bug.cgi?id=13829
michael@0 1697 '!<font size=6>[foo]</font>',
michael@0 1698 '!<span style=font-size:xx-large>[foo]</span>',
michael@0 1699 '!<font size=6>foo[bar]baz</font>',
michael@0 1700 '!<span style=font-size:xx-large>foo[bar]baz</span>',
michael@0 1701 '![foo<font size=6>bar</font>baz]',
michael@0 1702 '![foo<span style=font-size:xx-large>bar</span>baz]',
michael@0 1703 ],
michael@0 1704 //@}
michael@0 1705 indent: [
michael@0 1706 //@{
michael@0 1707 // All these have a trailing unselected paragraph, because otherwise
michael@0 1708 // Gecko is unhappy: it throws exceptions in non-CSS mode, and in CSS
michael@0 1709 // mode it adds the indentation invisibly to the wrapper div in many
michael@0 1710 // cases.
michael@0 1711 'foo[]bar<p>extra',
michael@0 1712 '<span>foo</span>{}<span>bar</span><p>extra',
michael@0 1713 '<span>foo[</span><span>]bar</span><p>extra',
michael@0 1714 'foo[bar]baz<p>extra',
michael@0 1715 '<p dir=rtl>פו[בר]בז<p dir=rtl>נוםף',
michael@0 1716 '<p dir=rtl>פו[ברבז<p>Foobar]baz<p>Extra',
michael@0 1717 '<p>Foo[barbaz<p dir=rtl>פובר]בז<p>Extra',
michael@0 1718 '<div><p>Foo[barbaz<p dir=rtl>פובר]בז</div><p>Extra',
michael@0 1719 'foo]bar[baz<p>extra',
michael@0 1720 '{<p><p> <p>foo</p>}<p>extra',
michael@0 1721 'foo[bar<i>baz]qoz</i>quz<p>extra',
michael@0 1722 '[]foo<p>extra',
michael@0 1723 'foo[]<p>extra',
michael@0 1724 '<p>[]foo<p>extra',
michael@0 1725 '<p>foo[]<p>extra',
michael@0 1726 '<p>{}<br>foo</p><p>extra',
michael@0 1727 '<p>foo<br>{}</p><p>extra',
michael@0 1728 '<span>{}<br>foo</span>bar<p>extra',
michael@0 1729 '<span>foo<br>{}</span>bar<p>extra',
michael@0 1730 '<p>foo</p>{}<p>bar</p>',
michael@0 1731
michael@0 1732 '<table><tbody><tr><td>foo<td>b[a]r<td>baz</table><p>extra',
michael@0 1733 '<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 1734 '<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 1735 '<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 1736 '<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 1737 '{<table><tr><td>foo<td>bar<td>baz</table>}<p>extra',
michael@0 1738
michael@0 1739 '<p>foo[bar]</p><p>baz</p><p>extra',
michael@0 1740 '<p>[foobar</p><p>ba]z</p><p>extra',
michael@0 1741 'foo[bar]<br>baz<p>extra',
michael@0 1742 'foo[bar]<br><br><br><br>baz<p>extra',
michael@0 1743 'foobar<br>[ba]z<p>extra',
michael@0 1744 'foobar<br><br><br><br>[ba]z<p>extra',
michael@0 1745 'foo[bar<br>ba]z<p>extra',
michael@0 1746 '<div>foo<p>[bar]</p>baz</div><p>extra',
michael@0 1747
michael@0 1748 // These mimic existing indentation in various browsers, to see how
michael@0 1749 // they cope with indenting twice. This is spec, Gecko non-CSS, and
michael@0 1750 // Opera:
michael@0 1751 '<blockquote><p>foo[bar]</p><p>baz</p></blockquote><p>extra',
michael@0 1752 '<blockquote><p>foo[bar</p><p>b]az</p></blockquote><p>extra',
michael@0 1753 '<blockquote><p>foo[bar]</p></blockquote><p>baz</p><p>extra',
michael@0 1754 '<blockquote><p>foo[bar</p></blockquote><p>b]az</p><p>extra',
michael@0 1755 '<p>[foo]<blockquote><p>bar</blockquote><p>extra',
michael@0 1756 '<p>[foo<blockquote><p>b]ar</blockquote><p>extra',
michael@0 1757 '<p>foo<blockquote><p>bar</blockquote><p>[baz]<p>extra',
michael@0 1758 '<p>foo<blockquote><p>[bar</blockquote><p>baz]<p>extra',
michael@0 1759 '<p>[foo<blockquote><p>bar</blockquote><p>baz]<p>extra',
michael@0 1760 '<blockquote><p>foo</blockquote><p>[bar]<blockquote><p>baz</blockquote><p>extra',
michael@0 1761
michael@0 1762 '<blockquote>foo[bar]<br>baz</blockquote><p>extra',
michael@0 1763 '<blockquote>foo[bar<br>b]az</blockquote><p>extra',
michael@0 1764 '<blockquote>foo[bar]</blockquote>baz<p>extra',
michael@0 1765 '<blockquote>foo[bar</blockquote>b]az<p>extra',
michael@0 1766 '[foo]<blockquote>bar</blockquote><p>extra',
michael@0 1767 '[foo<blockquote>b]ar</blockquote><p>extra',
michael@0 1768 'foo<blockquote>bar</blockquote>[baz]<p>extra',
michael@0 1769 '[foo<blockquote>bar</blockquote>baz]<p>extra',
michael@0 1770 '<blockquote>foo</blockquote>[bar]<blockquote>baz</blockquote><p>extra',
michael@0 1771
michael@0 1772 // IE:
michael@0 1773 '<blockquote style="margin-right: 0" dir="ltr"><p>foo[bar]</p><p>baz</p></blockquote><p>extra',
michael@0 1774 '<blockquote style="margin-right: 0" dir="ltr"><p>foo[bar</p><p>b]az</p></blockquote><p>extra',
michael@0 1775 '<blockquote style="margin-right: 0" dir="ltr"><p>foo[bar]</p></blockquote><p>baz</p><p>extra',
michael@0 1776 '<blockquote style="margin-right: 0" dir="ltr"><p>foo[bar</p></blockquote><p>b]az</p><p>extra',
michael@0 1777 '<p>[foo]<blockquote style="margin-right: 0" dir="ltr"><p>bar</blockquote><p>extra',
michael@0 1778 '<p>[foo<blockquote style="margin-right: 0" dir="ltr"><p>b]ar</blockquote><p>extra',
michael@0 1779 '<p>foo<blockquote style="margin-right: 0" dir="ltr"><p>bar</blockquote><p>[baz]<p>extra',
michael@0 1780 '<p>foo<blockquote style="margin-right: 0" dir="ltr"><p>[bar</blockquote><p>baz]<p>extra',
michael@0 1781 '<p>[foo<blockquote style="margin-right: 0" dir="ltr"><p>bar</blockquote><p>baz]<p>extra',
michael@0 1782 '<blockquote style="margin-right: 0" dir="ltr"><p>foo</blockquote><p>[bar]<blockquote style="margin-right: 0" dir="ltr"><p>baz</blockquote><p>extra',
michael@0 1783
michael@0 1784 // Firefox CSS mode:
michael@0 1785 '<p style="margin-left: 40px">foo[bar]</p><p style="margin-left: 40px">baz</p><p>extra',
michael@0 1786 '<p style="margin-left: 40px">foo[bar</p><p style="margin-left: 40px">b]az</p><p>extra',
michael@0 1787 '<p style="margin-left: 40px">foo[bar]</p><p>baz</p><p>extra',
michael@0 1788 '<p style="margin-left: 40px">foo[bar</p><p>b]az</p><p>extra',
michael@0 1789 '<p>[foo]<p style="margin-left: 40px">bar<p>extra',
michael@0 1790 '<p>[foo<p style="margin-left: 40px">b]ar<p>extra',
michael@0 1791 '<p>foo<p style="margin-left: 40px">bar<p>[baz]<p>extra',
michael@0 1792 '<p>foo<p style="margin-left: 40px">[bar<p>baz]<p>extra',
michael@0 1793 '<p>[foo<p style="margin-left: 40px">bar<p>baz]<p>extra',
michael@0 1794 '<p style="margin-left: 40px">foo<p>[bar]<p style="margin-left: 40px">baz<p>extra',
michael@0 1795
michael@0 1796 // WebKit:
michael@0 1797 '<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px"><p>foo[bar]</p><p>baz</p></blockquote><p>extra',
michael@0 1798 '<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px"><p>foo[bar</p><p>b]az</p></blockquote><p>extra',
michael@0 1799 '<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px"><p>foo[bar]</p></blockquote><p>baz</p><p>extra',
michael@0 1800 '<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px"><p>foo[bar</p></blockquote><p>b]az</p><p>extra',
michael@0 1801 '<p>[foo]<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px"><p>bar</blockquote><p>extra',
michael@0 1802 '<p>[foo<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px"><p>b]ar</blockquote><p>extra',
michael@0 1803 '<p>foo<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px"><p>bar</blockquote><p>[baz]<p>extra',
michael@0 1804 '<p>foo<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px"><p>[bar</blockquote><p>baz]<p>extra',
michael@0 1805 '<p>[foo<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px"><p>bar</blockquote><p>baz]<p>extra',
michael@0 1806 '<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px"><p>foo</blockquote><p>[bar]<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px"><p>baz</blockquote><p>extra',
michael@0 1807
michael@0 1808 // MDC says "In Firefox, if the selection spans multiple lines at
michael@0 1809 // different levels of indentation, only the least indented lines in
michael@0 1810 // the selection will be indented." Let's test that.
michael@0 1811 '<blockquote>f[oo<blockquote>b]ar</blockquote></blockquote><p>extra',
michael@0 1812
michael@0 1813 // Lists!
michael@0 1814 '<ol><li>foo<li>[bar]<li>baz</ol>',
michael@0 1815 '<ol data-start=1 data-end=2><li>foo<li>bar<li>baz</ol>',
michael@0 1816 '<ol><li>foo</ol>[bar]',
michael@0 1817 '<ol><li>[foo]<br>bar<li>baz</ol>',
michael@0 1818 '<ol><li>foo<br>[bar]<li>baz</ol>',
michael@0 1819 '<ol><li><div>[foo]</div>bar<li>baz</ol>',
michael@0 1820 '<ol><li>foo<ol><li>[bar]<li>baz</ol><li>quz</ol>',
michael@0 1821 '<ol><li>foo<ol><li>bar<li>[baz]</ol><li>quz</ol>',
michael@0 1822 '<ol><li>foo</li><ol><li>[bar]<li>baz</ol><li>quz</ol>',
michael@0 1823 '<ol><li>foo</li><ol data-start=0 data-end=1><li>bar<li>baz</ol><li>quz</ol>',
michael@0 1824 '<ol><li>foo</li><ol><li>bar<li>[baz]</ol><li>quz</ol>',
michael@0 1825 '<ol><li>foo</li><ol data-start=1 data-end=2><li>bar<li>baz</ol><li>quz</ol>',
michael@0 1826 '<ol><li>foo<ol><li>b[a]r</ol><li>baz</ol>',
michael@0 1827 '<ol><li>foo</li><ol><li>b[a]r</ol><li>baz</ol>',
michael@0 1828 '<ol><li>foo{<ol><li>bar</ol>}<li>baz</ol>',
michael@0 1829 '<ol><li>foo</li>{<ol><li>bar</ol>}<li>baz</ol>',
michael@0 1830 '<ol><li>[foo]<ol><li>bar</ol><li>baz</ol>',
michael@0 1831 '<ol><li>[foo]</li><ol><li>bar</ol><li>baz</ol>',
michael@0 1832 '<ol><li>foo<li>[bar]<ol><li>baz</ol><li>quz</ol>',
michael@0 1833 '<ol><li>foo<li>[bar]</li><ol><li>baz</ol><li>quz</ol>',
michael@0 1834 '<ol><li>foo<ol><li>bar<li>baz</ol><li>[quz]</ol>',
michael@0 1835 '<ol><li>foo</li><ol><li>bar<li>baz</ol><li>[quz]</ol>',
michael@0 1836
michael@0 1837 // Lists with id's:
michael@0 1838 // http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-July/020721.html
michael@0 1839 '<ol><ol id=u1><li id=i1>foo</ol><li id=i2>[bar]</li><ol id=u3><li id=i3>baz</ol></ol>',
michael@0 1840 '<ol><ol><li id=i1>foo</ol><li id=i2>[bar]</li><ol id=u3><li id=i3>baz</ol></ol>',
michael@0 1841 '<ol><ol id=u1><li id=i1>foo</ol><li id=i2>[bar]</li><ol><li id=i3>baz</ol></ol>',
michael@0 1842 '<ol><li id=i2>[bar]</li><ol id=u3><li id=i3>baz</ol></ol>',
michael@0 1843 '<ol><ol id=u1><li id=i1>foo</ol><li id=i2>[bar]</ol>',
michael@0 1844
michael@0 1845 // Try indenting multiple items at once.
michael@0 1846 '<ol><li>foo<li>b[ar<li>baz]</ol>',
michael@0 1847 '<ol><li>[foo<ol><li>bar]</ol><li>baz</ol>',
michael@0 1848 '<ol><li>[foo</li><ol><li>bar]</ol><li>baz</ol>',
michael@0 1849 '<ol><li>foo<ol><li>b[ar</ol><li>b]az</ol>',
michael@0 1850 '<ol><li>foo</li><ol><li>b[ar</ol><li>b]az</ol>',
michael@0 1851 '<ol><li>[foo<ol><li>bar</ol><li>baz]</ol><p>extra',
michael@0 1852 '<ol><li>[foo</li><ol><li>bar</ol><li>baz]</ol><p>extra',
michael@0 1853
michael@0 1854 // We probably can't actually get this DOM . . .
michael@0 1855 '<ol><li>[foo]<ol><li>bar</ol>baz</ol>',
michael@0 1856 '<ol><li>foo<ol><li>[bar]</ol>baz</ol>',
michael@0 1857 '<ol><li>foo<ol><li>bar</ol>[baz]</ol>',
michael@0 1858 '<ol><li>[foo<ol><li>bar]</ol>baz</ol>',
michael@0 1859
michael@0 1860 'foo<!--bar-->[baz]<p>extra',
michael@0 1861 '[foo]<!--bar-->baz<p>extra',
michael@0 1862 '<p>foo<!--bar-->{}<p>extra',
michael@0 1863 '<p>{}<!--foo-->bar<p>extra',
michael@0 1864
michael@0 1865 // Whitespace nodes
michael@0 1866 '<blockquote><p>foo</blockquote> <p>[bar]',
michael@0 1867 '<p>[foo]</p> <blockquote><p>bar</blockquote>',
michael@0 1868 '<blockquote><p>foo</blockquote> <p>[bar]</p> <blockquote><p>baz</blockquote>',
michael@0 1869 '<ol><li>foo</li><ol><li>bar</li> </ol><li>[baz]</ol>',
michael@0 1870 '<ol><li>foo</li><ol><li>bar</li></ol> <li>[baz]</ol>',
michael@0 1871 '<ol><li>foo</li><ol><li>bar</li> </ol> <li>[baz]</ol>',
michael@0 1872 '<ol><li>foo<ol><li>bar</li> </ol></li><li>[baz]</ol>',
michael@0 1873 '<ol><li>foo<ol><li>bar</li></ol></li> <li>[baz]</ol>',
michael@0 1874 '<ol><li>foo<ol><li>bar</li> </ol></li> <li>[baz]</ol>',
michael@0 1875 '<ol><li>foo<li>[bar]</li> <ol><li>baz</ol></ol>',
michael@0 1876 '<ol><li>foo<li>[bar]</li><ol> <li>baz</ol></ol>',
michael@0 1877 '<ol><li>foo<li>[bar]</li> <ol> <li>baz</ol></ol>',
michael@0 1878 '<ol><li>foo<li>[bar] <ol><li>baz</ol></ol>',
michael@0 1879 '<ol><li>foo<li>[bar]<ol> <li>baz</ol></ol>',
michael@0 1880 '<ol><li>foo<li>[bar] <ol> <li>baz</ol></ol>',
michael@0 1881
michael@0 1882 // https://bugs.webkit.org/show_bug.cgi?id=32003
michael@0 1883 '<ul><li>a<br>{<br>}</li><li>b</li></ul>',
michael@0 1884 ],
michael@0 1885 //@}
michael@0 1886 inserthorizontalrule: [
michael@0 1887 //@{
michael@0 1888 'foo[]bar',
michael@0 1889 '<span>foo</span>{}<span>bar</span>',
michael@0 1890 '<span>foo[</span><span>]bar</span>',
michael@0 1891 '<p>foo[bar<p>baz]quz',
michael@0 1892 '<div><b>foo</b>{}<b>bar</b></div>',
michael@0 1893 '<div><b>foo[</b><b>]bar</b></div>',
michael@0 1894 '<div><b>foo</b>{<b>bar</b>}<b>baz</b></div>',
michael@0 1895 '<b>foo[]bar</b>',
michael@0 1896 '<b id=abc>foo[]bar</b>',
michael@0 1897 ["abc", 'foo[bar]baz'],
michael@0 1898 'foo[bar]baz',
michael@0 1899
michael@0 1900 'foo<b>[bar]</b>baz',
michael@0 1901 'foo<b>{bar}</b>baz',
michael@0 1902 'foo{<b>bar</b>}baz',
michael@0 1903 '<p>foo<p>[bar]<p>baz',
michael@0 1904 '<p>foo<p>{bar}<p>baz',
michael@0 1905 '<p>foo{<p>bar</p>}<p>baz',
michael@0 1906
michael@0 1907 '<p>foo[bar]baz</p>',
michael@0 1908 '<p id=abc>foo[bar]baz</p>',
michael@0 1909 '<h1>foo[bar]baz</h1>',
michael@0 1910 '<p>foo<b>b[a]r</b>baz</p>',
michael@0 1911
michael@0 1912 '<a>foo[bar]baz</a>',
michael@0 1913 '<a href=/>foo[bar]baz</a>',
michael@0 1914 '<abbr>foo[bar]baz</abbr>',
michael@0 1915 '<address>foo[bar]baz</address>',
michael@0 1916 '<article>foo[bar]baz</article>',
michael@0 1917 '<aside>foo[bar]baz</aside>',
michael@0 1918 '<b>foo[bar]baz</b>',
michael@0 1919 '<bdi>foo[bar]baz</bdi>',
michael@0 1920 '<bdo dir=rtl>foo[bar]baz</bdo>',
michael@0 1921 '<blockquote>foo[bar]baz</blockquote>',
michael@0 1922 '<table><caption>foo[bar]baz</caption><tr><td>quz</table>',
michael@0 1923 '<cite>foo[bar]baz</cite>',
michael@0 1924 '<code>foo[bar]baz</code>',
michael@0 1925 '<dl><dd>foo[bar]baz</dd></dl>',
michael@0 1926 '<del>foo[bar]baz</del>',
michael@0 1927 '<details>foo[bar]baz</details>',
michael@0 1928 '<dfn>foo[bar]baz</dfn>',
michael@0 1929 '<div>foo[bar]baz</div>',
michael@0 1930 '<dl><dt>foo[bar]baz</dt></dl>',
michael@0 1931 '<em>foo[bar]baz</em>',
michael@0 1932 '<figure><figcaption>foo[bar]baz</figcaption>quz</figure>',
michael@0 1933 '<figure>foo[bar]baz</figure>',
michael@0 1934 '<footer>foo[bar]baz</footer>',
michael@0 1935 '<h1>foo[bar]baz</h1>',
michael@0 1936 '<h2>foo[bar]baz</h2>',
michael@0 1937 '<h3>foo[bar]baz</h3>',
michael@0 1938 '<h4>foo[bar]baz</h4>',
michael@0 1939 '<h5>foo[bar]baz</h5>',
michael@0 1940 '<h6>foo[bar]baz</h6>',
michael@0 1941 '<header>foo[bar]baz</header>',
michael@0 1942 '<hgroup>foo[bar]baz</hgroup>',
michael@0 1943 '<hgroup><h1>foo[bar]baz</h1></hgroup>',
michael@0 1944 '<i>foo[bar]baz</i>',
michael@0 1945 '<ins>foo[bar]baz</ins>',
michael@0 1946 '<kbd>foo[bar]baz</kbd>',
michael@0 1947 '<mark>foo[bar]baz</mark>',
michael@0 1948 '<nav>foo[bar]baz</nav>',
michael@0 1949 '<ol><li>foo[bar]baz</li></ol>',
michael@0 1950 '<p>foo[bar]baz</p>',
michael@0 1951 '<pre>foo[bar]baz</pre>',
michael@0 1952 '<q>foo[bar]baz</q>',
michael@0 1953 '<ruby>foo[bar]baz<rt>quz</rt></ruby>',
michael@0 1954 '<ruby>foo<rt>bar[baz]quz</rt></ruby>',
michael@0 1955 '<ruby>foo<rp>bar[baz]quz</rp><rt>qoz</rt><rp>qiz</rp></ruby>',
michael@0 1956 '<s>foo[bar]baz</s>',
michael@0 1957 '<samp>foo[bar]baz</samp>',
michael@0 1958 '<section>foo[bar]baz</section>',
michael@0 1959 '<small>foo[bar]baz</small>',
michael@0 1960 '<span>foo[bar]baz</span>',
michael@0 1961 '<strong>foo[bar]baz</strong>',
michael@0 1962 '<sub>foo[bar]baz</sub>',
michael@0 1963 '<sup>foo[bar]baz</sup>',
michael@0 1964 '<table><tr><td>foo[bar]baz</td></table>',
michael@0 1965 '<table><tr><th>foo[bar]baz</th></table>',
michael@0 1966 '<u>foo[bar]baz</u>',
michael@0 1967 '<ul><li>foo[bar]baz</li></ul>',
michael@0 1968 '<var>foo[bar]baz</var>',
michael@0 1969
michael@0 1970 '<acronym>foo[bar]baz</acronym>',
michael@0 1971 '<big>foo[bar]baz</big>',
michael@0 1972 '<blink>foo[bar]baz</blink>',
michael@0 1973 '<center>foo[bar]baz</center>',
michael@0 1974 '<dir>foo[bar]baz</dir>',
michael@0 1975 '<dir><li>foo[bar]baz</li></dir>',
michael@0 1976 '<font>foo[bar]baz</font>',
michael@0 1977 '<listing>foo[bar]baz</listing>',
michael@0 1978 '<marquee>foo[bar]baz</marquee>',
michael@0 1979 '<nobr>foo[bar]baz</nobr>',
michael@0 1980 '<strike>foo[bar]baz</strike>',
michael@0 1981 '<tt>foo[bar]baz</tt>',
michael@0 1982 '<xmp>foo[bar]baz</xmp>',
michael@0 1983
michael@0 1984 '<quasit>foo[bar]baz</quasit>',
michael@0 1985
michael@0 1986 '<table><tr><td>fo[o<td>b]ar</table>',
michael@0 1987 'fo[o<span contenteditable=false>bar</span>b]az',
michael@0 1988 ],
michael@0 1989 //@}
michael@0 1990 inserthtml: [
michael@0 1991 //@{
michael@0 1992 'foo[]bar',
michael@0 1993 'foo[bar]baz',
michael@0 1994 'foo<span style=color:#aBcDeF>[bar]</span>baz',
michael@0 1995 'foo<span style=color:#aBcDeF>{bar}</span>baz',
michael@0 1996 'foo{<span style=color:#aBcDeF>bar</span>}baz',
michael@0 1997 '[foo<span style=color:#aBcDeF>bar]</span>baz',
michael@0 1998 '{foo<span style=color:#aBcDeF>bar}</span>baz',
michael@0 1999 'foo<span style=color:#aBcDeF>[bar</span>baz]',
michael@0 2000 'foo<span style=color:#aBcDeF>{bar</span>baz}',
michael@0 2001 'foo<span style=color:#aBcDeF>[bar</span><span style=color:#fEdCbA>baz]</span>quz',
michael@0 2002
michael@0 2003 ['', 'foo[bar]baz'],
michael@0 2004 ['\0', 'foo[bar]baz'],
michael@0 2005 ['\x07', 'foo[bar]baz'],
michael@0 2006 // The following line makes Firefox 7.0a2 go into an infinite loop on
michael@0 2007 // my machine.
michael@0 2008 //['\ud800', 'foo[bar]baz'],
michael@0 2009
michael@0 2010 ['<b>', 'foo[bar]baz'],
michael@0 2011 ['<b>abc', 'foo[bar]baz'],
michael@0 2012 ['<p>abc', '<p>foo[bar]baz'],
michael@0 2013 ['<li>abc', '<p>foo[bar]baz'],
michael@0 2014 ['<p>abc', '<ol>{<li>foo</li>}<li>bar</ol>'],
michael@0 2015 ['<p>abc', '<ol><li>foo</li>{<li>bar</li>}<li>baz</ol>'],
michael@0 2016 ['<p>abc', '<ol><li>[foo]</li><li>bar</ol>'],
michael@0 2017
michael@0 2018 ['abc', '<xmp>f[o]o</xmp>'],
michael@0 2019 ['<b>abc</b>', '<xmp>f[o]o</xmp>'],
michael@0 2020 ['abc', '<script>f[o]o</script>bar'],
michael@0 2021 ['<b>abc</b>', '<script>f[o]o</script>bar'],
michael@0 2022
michael@0 2023 ['<a>abc</a>', '<a>f[o]o</a>'],
michael@0 2024 ['<a href=/>abc</a>', '<a href=.>f[o]o</a>'],
michael@0 2025 ['<hr>', '<p>f[o]o'],
michael@0 2026 ['<hr>', '<b>f[o]o</b>'],
michael@0 2027 ['<h2>abc</h2>', '<h1>f[o]o</h1>'],
michael@0 2028 ['<td>abc</td>', '<table><tr><td>f[o]o</table>'],
michael@0 2029 ['<td>abc</td>', 'f[o]o'],
michael@0 2030
michael@0 2031 ['<dt>abc</dt>', '<dl><dt>f[o]o<dd>bar</dl>'],
michael@0 2032 ['<dt>abc</dt>', '<dl><dt>foo<dd>b[a]r</dl>'],
michael@0 2033 ['<dd>abc</dd>', '<dl><dt>f[o]o<dd>bar</dl>'],
michael@0 2034 ['<dd>abc</dd>', '<dl><dt>foo<dd>b[a]r</dl>'],
michael@0 2035 ['<dt>abc</dt>', 'f[o]o'],
michael@0 2036 ['<dt>abc</dt>', '<ol><li>f[o]o</ol>'],
michael@0 2037 ['<dd>abc</dd>', 'f[o]o'],
michael@0 2038 ['<dd>abc</dd>', '<ol><li>f[o]o</ol>'],
michael@0 2039
michael@0 2040 ['<li>abc</li>', '<dir><li>f[o]o</dir>'],
michael@0 2041 ['<li>abc</li>', '<ol><li>f[o]o</ol>'],
michael@0 2042 ['<li>abc</li>', '<ul><li>f[o]o</ul>'],
michael@0 2043 ['<dir><li>abc</dir>', '<dir><li>f[o]o</dir>'],
michael@0 2044 ['<dir><li>abc</dir>', '<ol><li>f[o]o</ol>'],
michael@0 2045 ['<dir><li>abc</dir>', '<ul><li>f[o]o</ul>'],
michael@0 2046 ['<ol><li>abc</ol>', '<dir><li>f[o]o</dir>'],
michael@0 2047 ['<ol><li>abc</ol>', '<ol><li>f[o]o</ol>'],
michael@0 2048 ['<ol><li>abc</ol>', '<ul><li>f[o]o</ul>'],
michael@0 2049 ['<ul><li>abc</ul>', '<dir><li>f[o]o</dir>'],
michael@0 2050 ['<ul><li>abc</ul>', '<ol><li>f[o]o</ol>'],
michael@0 2051 ['<ul><li>abc</ul>', '<ul><li>f[o]o</ul>'],
michael@0 2052 ['<li>abc</li>', 'f[o]o'],
michael@0 2053
michael@0 2054 ['<nobr>abc</nobr>', '<nobr>f[o]o</nobr>'],
michael@0 2055 ['<nobr>abc</nobr>', 'f[o]o'],
michael@0 2056
michael@0 2057 ['<p>abc', '<font color=blue>foo[]bar</font>'],
michael@0 2058 ['<p>abc', '<span style=color:blue>foo[]bar</span>'],
michael@0 2059 ['<p>abc', '<span style=font-variant:small-caps>foo[]bar</span>'],
michael@0 2060 [' ', '<p>[foo]</p>'],
michael@0 2061 ['<span style=display:none></span>', '<p>[foo]</p>'],
michael@0 2062 ['<!--abc-->', '<p>[foo]</p>'],
michael@0 2063
michael@0 2064 ['abc', '<p>{}<br></p>'],
michael@0 2065 ['<!--abc-->', '<p>{}<br></p>'],
michael@0 2066 ['abc', '<p><!--foo-->{}<span><br></span><!--bar--></p>'],
michael@0 2067 ['<!--abc-->', '<p><!--foo-->{}<span><br></span><!--bar--></p>'],
michael@0 2068 ['abc', '<p>{}<span><!--foo--><br><!--bar--></span></p>'],
michael@0 2069 ['<!--abc-->', '<p>{}<span><!--foo--><br><!--bar--></span></p>'],
michael@0 2070
michael@0 2071 ['abc', '<p><br>{}</p>'],
michael@0 2072 ['<!--abc-->', '<p><br>{}</p>'],
michael@0 2073 ['abc', '<p><!--foo--><span><br></span>{}<!--bar--></p>'],
michael@0 2074 ['<!--abc-->', '<p><!--foo--><span><br></span>{}<!--bar--></p>'],
michael@0 2075 ['abc', '<p><span><!--foo--><br><!--bar--></span>{}</p>'],
michael@0 2076 ['<!--abc-->', '<p><span><!--foo--><br><!--bar--></span>{}</p>'],
michael@0 2077 ],
michael@0 2078 //@}
michael@0 2079 insertimage: [
michael@0 2080 //@{
michael@0 2081 'foo[]bar',
michael@0 2082 '<span>foo</span>{}<span>bar</span>',
michael@0 2083 '<span>foo[</span><span>]bar</span>',
michael@0 2084 ["", 'foo[bar]baz'],
michael@0 2085 'foo[bar]baz',
michael@0 2086 'foo<span style=color:#aBcDeF>[bar]</span>baz',
michael@0 2087 'foo<span style=color:#aBcDeF>{bar}</span>baz',
michael@0 2088 'foo{<span style=color:#aBcDeF>bar</span>}baz',
michael@0 2089 '[foo<span style=color:#aBcDeF>bar]</span>baz',
michael@0 2090 '{foo<span style=color:#aBcDeF>bar}</span>baz',
michael@0 2091 'foo<span style=color:#aBcDeF>[bar</span>baz]',
michael@0 2092 'foo<span style=color:#aBcDeF>{bar</span>baz}',
michael@0 2093 'foo<span style=color:#aBcDeF>[bar</span><span style=color:#fEdCbA>baz]</span>quz',
michael@0 2094
michael@0 2095 'foo<b>[bar]</b>baz',
michael@0 2096 'foo<b>{bar}</b>baz',
michael@0 2097 'foo{<b>bar</b>}baz',
michael@0 2098 'foo<span>[bar]</span>baz',
michael@0 2099 'foo<span>{bar}</span>baz',
michael@0 2100 'foo{<span>bar</span>}baz',
michael@0 2101 '<b>foo[bar</b><i>baz]quz</i>',
michael@0 2102 '<p>foo</p><p>[bar]</p><p>baz</p>',
michael@0 2103 '<p>foo</p><p>{bar}</p><p>baz</p>',
michael@0 2104 '<p>foo</p>{<p>bar</p>}<p>baz</p>',
michael@0 2105
michael@0 2106 '<p>foo[bar<p>baz]quz',
michael@0 2107 '<p>foo[bar<div>baz]quz</div>',
michael@0 2108 '<p>foo[bar<h1>baz]quz</h1>',
michael@0 2109 '<div>foo[bar</div><p>baz]quz',
michael@0 2110 '<blockquote>foo[bar</blockquote><pre>baz]quz</pre>',
michael@0 2111
michael@0 2112 '<p><b>foo[bar</b><p>baz]quz',
michael@0 2113 '<div><p>foo[bar</div><p>baz]quz',
michael@0 2114 '<p>foo[bar<blockquote><p>baz]quz<p>qoz</blockquote',
michael@0 2115 '<p>foo[bar<p style=color:blue>baz]quz',
michael@0 2116 '<p>foo[bar<p><b>baz]quz</b>',
michael@0 2117
michael@0 2118 '<div><p>foo<p>[bar<p>baz]</div>',
michael@0 2119
michael@0 2120 'foo[<br>]bar',
michael@0 2121 '<p>foo[</p><p>]bar</p>',
michael@0 2122 '<p>foo[</p><p>]bar<br>baz</p>',
michael@0 2123 'foo[<p>]bar</p>',
michael@0 2124 'foo[<p>]bar<br>baz</p>',
michael@0 2125 'foo[<p>]bar</p>baz',
michael@0 2126 '<p>foo[</p>]bar',
michael@0 2127 '<p>foo[</p>]bar<br>baz',
michael@0 2128 '<p>foo[</p>]bar<p>baz</p>',
michael@0 2129 'foo[<div><p>]bar</div>',
michael@0 2130 '<div><p>foo[</p></div>]bar',
michael@0 2131 'foo[<div><p>]bar</p>baz</div>',
michael@0 2132 'foo[<div>]bar<p>baz</p></div>',
michael@0 2133 '<div><p>foo</p>bar[</div>]baz',
michael@0 2134 '<div>foo<p>bar[</p></div>]baz',
michael@0 2135 ],
michael@0 2136 //@}
michael@0 2137 insertlinebreak: [
michael@0 2138 //@{ Same as insertparagraph (set below)
michael@0 2139 ],
michael@0 2140 //@}
michael@0 2141 insertorderedlist: [
michael@0 2142 //@{
michael@0 2143 'foo[]bar',
michael@0 2144 'foo[bar]baz',
michael@0 2145 'foo<br>[bar]',
michael@0 2146 'f[oo<br>b]ar<br>baz',
michael@0 2147 '<p>[foo]<br>bar</p>',
michael@0 2148 '[foo<ol><li>bar]</ol>baz',
michael@0 2149 'foo<ol><li>[bar</ol>baz]',
michael@0 2150 '[foo<ul><li>bar]</ul>baz',
michael@0 2151 'foo<ul><li>[bar</ul>baz]',
michael@0 2152 'foo<ul><li>[bar</ul><ol><li>baz]</ol>quz',
michael@0 2153 'foo<ol><li>[bar</ol><ul><li>baz]</ul>quz',
michael@0 2154
michael@0 2155 '<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>',
michael@0 2156 '<table><tbody><tr><td>fo[o<td>b]ar<td>baz</table>',
michael@0 2157 '{<table><tr><td>foo<td>bar<td>baz</table>}',
michael@0 2158
michael@0 2159 '<p>foo<p>[bar]<p>baz',
michael@0 2160 '<p>foo<blockquote>[bar]</blockquote><p>baz',
michael@0 2161 '<dl><dt>foo<dd>[bar]<dt>baz<dd>quz</dl>',
michael@0 2162 '<dl><dt>foo<dd>bar<dt>[baz]<dd>quz</dl>',
michael@0 2163
michael@0 2164 '<p>[foo<p>bar]<p>baz',
michael@0 2165 '<p>[foo<blockquote>bar]</blockquote><p>baz',
michael@0 2166 '<dl><dt>[foo<dd>bar]<dt>baz<dd>quz</dl>',
michael@0 2167 '<dl><dt>foo<dd>[bar<dt>baz]<dd>quz</dl>',
michael@0 2168
michael@0 2169 '<p>[foo<blockquote><p>bar]<p>baz</blockquote>',
michael@0 2170
michael@0 2171
michael@0 2172 // Various <ol> stuff
michael@0 2173 '<ol><li>foo<li>[bar]<li>baz</ol>',
michael@0 2174 '<ol><li>foo</ol>[bar]',
michael@0 2175 '[foo]<ol><li>bar</ol>',
michael@0 2176 '<ol><li>foo</ol>[bar]<ol><li>baz</ol>',
michael@0 2177 '<ol><ol><li>[foo]</ol></ol>',
michael@0 2178 '<ol><li>[foo]<br>bar<li>baz</ol>',
michael@0 2179 '<ol><li>foo<br>[bar]<li>baz</ol>',
michael@0 2180 '<ol><li><div>[foo]</div>bar<li>baz</ol>',
michael@0 2181 '<ol><li>foo<ol><li>[bar]<li>baz</ol><li>quz</ol>',
michael@0 2182 '<ol><li>foo<ol><li>bar<li>[baz]</ol><li>quz</ol>',
michael@0 2183 '<ol><li>foo</li><ol><li>[bar]<li>baz</ol><li>quz</ol>',
michael@0 2184 '<ol><li>foo</li><ol><li>bar<li>[baz]</ol><li>quz</ol>',
michael@0 2185 '<ol><li>[foo]<ol><li>bar</ol><li>baz</ol>',
michael@0 2186 '<ol><li>[foo]</li><ol><li>bar</ol><li>baz</ol>',
michael@0 2187 '<ol><li>foo<li>[bar]<ol><li>baz</ol><li>quz</ol>',
michael@0 2188 '<ol><li>foo<li>[bar]</li><ol><li>baz</ol><li>quz</ol>',
michael@0 2189 '<ol><li>foo<ol><li>bar<li>baz</ol><li>[quz]</ol>',
michael@0 2190 '<ol><li>foo</li><ol><li>bar<li>baz</ol><li>[quz]</ol>',
michael@0 2191
michael@0 2192 // Multiple items at once.
michael@0 2193 '<ol><li>foo<li>[bar<li>baz]</ol>',
michael@0 2194 '<ol><li>[foo<ol><li>bar]</ol><li>baz</ol>',
michael@0 2195 '<ol><li>foo<ol><li>b[ar</ol><li>b]az</ol>',
michael@0 2196 '<ol><li>[foo<ol><li>bar</ol><li>baz]</ol><p>extra',
michael@0 2197
michael@0 2198 // We probably can't actually get this DOM . . .
michael@0 2199 '<ol><li>[foo]<ol><li>bar</ol>baz</ol>',
michael@0 2200 '<ol><li>foo<ol><li>[bar]</ol>baz</ol>',
michael@0 2201 '<ol><li>foo<ol><li>bar</ol>[baz]</ol>',
michael@0 2202 '<ol><li>[foo<ol><li>bar]</ol>baz</ol>',
michael@0 2203
michael@0 2204
michael@0 2205 // Same stuff but with <ul>
michael@0 2206 '<ul><li>foo<li>[bar]<li>baz</ul>',
michael@0 2207 '<ul><li>foo</ul>[bar]',
michael@0 2208 '[foo]<ul><li>bar</ul>',
michael@0 2209 '<ul><li>foo</ul>[bar]<ul><li>baz</ul>',
michael@0 2210 '<ul><ul><li>[foo]</ul></ul>',
michael@0 2211 '<ul><li>[foo]<br>bar<li>baz</ul>',
michael@0 2212 '<ul><li>foo<br>[bar]<li>baz</ul>',
michael@0 2213 '<ul><li><div>[foo]</div>bar<li>baz</ul>',
michael@0 2214 '<ul><li>foo<ul><li>[bar]<li>baz</ul><li>quz</ul>',
michael@0 2215 '<ul><li>foo<ul><li>bar<li>[baz]</ul><li>quz</ul>',
michael@0 2216 '<ul><li>foo</li><ul><li>[bar]<li>baz</ul><li>quz</ul>',
michael@0 2217 '<ul><li>foo</li><ul><li>bar<li>[baz]</ul><li>quz</ul>',
michael@0 2218 '<ul><li>[foo]<ul><li>bar</ul><li>baz</ul>',
michael@0 2219 '<ul><li>[foo]</li><ul><li>bar</ul><li>baz</ul>',
michael@0 2220 '<ul><li>foo<li>[bar]<ul><li>baz</ul><li>quz</ul>',
michael@0 2221 '<ul><li>foo<li>[bar]</li><ul><li>baz</ul><li>quz</ul>',
michael@0 2222 '<ul><li>foo<ul><li>bar<li>baz</ul><li>[quz]</ul>',
michael@0 2223 '<ul><li>foo</li><ul><li>bar<li>baz</ul><li>[quz]</ul>',
michael@0 2224
michael@0 2225 // Multiple items at once.
michael@0 2226 '<ul><li>foo<li>[bar<li>baz]</ul>',
michael@0 2227 '<ul><li>[foo<ul><li>bar]</ul><li>baz</ul>',
michael@0 2228 '<ul><li>foo<ul><li>b[ar</ul><li>b]az</ul>',
michael@0 2229 '<ul><li>[foo<ul><li>bar</ul><li>baz]</ul><p>extra',
michael@0 2230
michael@0 2231 // We probably can't actually get this DOM . . .
michael@0 2232 '<ul><li>[foo]<ul><li>bar</ul>baz</ul>',
michael@0 2233 '<ul><li>foo<ul><li>[bar]</ul>baz</ul>',
michael@0 2234 '<ul><li>foo<ul><li>bar</ul>[baz]</ul>',
michael@0 2235 '<ul><li>[foo<ul><li>bar]</ul>baz</ul>',
michael@0 2236
michael@0 2237
michael@0 2238 // Mix of <ol> and <ul>
michael@0 2239 'foo<ol><li>bar</ol><ul><li>[baz]</ul>quz',
michael@0 2240 'foo<ol><li>bar</ol><ul><li>[baz</ul>quz]',
michael@0 2241 'foo<ul><li>[bar]</ul><ol><li>baz</ol>quz',
michael@0 2242 '[foo<ul><li>bar]</ul><ol><li>baz</ol>quz',
michael@0 2243
michael@0 2244 // Interaction with indentation
michael@0 2245 '[foo]<blockquote>bar</blockquote>baz',
michael@0 2246 'foo<blockquote>[bar]</blockquote>baz',
michael@0 2247 '[foo<blockquote>bar]</blockquote>baz',
michael@0 2248 '<ol><li>foo</ol><blockquote>[bar]</blockquote>baz',
michael@0 2249 '[foo]<blockquote><ol><li>bar</ol></blockquote>baz',
michael@0 2250 'foo<blockquote>[bar]<br>baz</blockquote>',
michael@0 2251 '[foo<blockquote>bar]<br>baz</blockquote>',
michael@0 2252 '<ol><li>foo</ol><blockquote>[bar]<br>baz</blockquote>',
michael@0 2253
michael@0 2254 '<p>[foo]<blockquote><p>bar</blockquote><p>baz',
michael@0 2255 '<p>foo<blockquote><p>[bar]</blockquote><p>baz',
michael@0 2256 '<p>[foo<blockquote><p>bar]</blockquote><p>baz',
michael@0 2257 '<ol><li>foo</ol><blockquote><p>[bar]</blockquote><p>baz',
michael@0 2258
michael@0 2259 // Attributes
michael@0 2260 '<ul id=abc><li>foo<li>[bar]<li>baz</ul>',
michael@0 2261 '<ul style=color:blue><li>foo<li>[bar]<li>baz</ul>',
michael@0 2262 '<ul style=text-indent:1em><li>foo<li>[bar]<li>baz</ul>',
michael@0 2263 '<ul id=abc><li>[foo]<li>bar<li>baz</ul>',
michael@0 2264 '<ul style=color:blue><li>[foo]<li>bar<li>baz</ul>',
michael@0 2265 '<ul style=text-indent:1em><li>[foo]<li>bar<li>baz</ul>',
michael@0 2266 '<ul id=abc><li>foo<li>bar<li>[baz]</ul>',
michael@0 2267 '<ul style=color:blue><li>foo<li>bar<li>[baz]</ul>',
michael@0 2268 '<ul style=text-indent:1em><li>foo<li>bar<li>[baz]</ul>',
michael@0 2269
michael@0 2270 // Whitespace nodes
michael@0 2271 '<ol><li>foo</ol> <p>[bar]',
michael@0 2272 '<p>[foo]</p> <ol><li>bar</ol>',
michael@0 2273 '<ol><li>foo</ol> <p>[bar]</p> <ol><li>baz</ol>',
michael@0 2274
michael@0 2275 // This caused an infinite loop at one point due to a bug in "fix
michael@0 2276 // disallowed ancestors". Disabled because I'm not sure how we want it
michael@0 2277 // to behave:
michael@0 2278 // http://www.w3.org/Bugs/Public/show_bug.cgi?id=14578
michael@0 2279 '!<span contenteditable=true>foo[]</span>',
michael@0 2280 ],
michael@0 2281 //@}
michael@0 2282 insertparagraph: [
michael@0 2283 //@{
michael@0 2284 'foo[bar]baz',
michael@0 2285 'fo[o<table><tr><td>b]ar</table>',
michael@0 2286 '<table><tr><td>[foo<td>bar]<tr><td>baz<td>quz</table>',
michael@0 2287 '<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<tr><td>baz<td>quz</table>',
michael@0 2288 '<table><tr><td>fo[o</table>b]ar',
michael@0 2289 '<table><tr><td>fo[o<td>b]ar<td>baz</table>',
michael@0 2290 '{<table><tr><td>foo</table>}',
michael@0 2291 '<table><tr><td>[foo]</table>',
michael@0 2292 '<ol><li>[foo]<li>bar</ol>',
michael@0 2293 '<ol><li>f[o]o<li>bar</ol>',
michael@0 2294
michael@0 2295 '[]foo',
michael@0 2296 'foo[]',
michael@0 2297 '<span>foo[]</span>',
michael@0 2298 'foo[]<br>',
michael@0 2299 'foo[]bar',
michael@0 2300 '<address>[]foo</address>',
michael@0 2301 '<address>foo[]</address>',
michael@0 2302 '<address>foo[]<br></address>',
michael@0 2303 '<address>foo[]bar</address>',
michael@0 2304 '<div>[]foo</div>',
michael@0 2305 '<div>foo[]</div>',
michael@0 2306 '<div>foo[]<br></div>',
michael@0 2307 '<div>foo[]bar</div>',
michael@0 2308 '<dl><dt>[]foo<dd>bar</dl>',
michael@0 2309 '<dl><dt>foo[]<dd>bar</dl>',
michael@0 2310 '<dl><dt>foo[]<br><dd>bar</dl>',
michael@0 2311 '<dl><dt>foo[]bar<dd>baz</dl>',
michael@0 2312 '<dl><dt>foo<dd>[]bar</dl>',
michael@0 2313 '<dl><dt>foo<dd>bar[]</dl>',
michael@0 2314 '<dl><dt>foo<dd>bar[]<br></dl>',
michael@0 2315 '<dl><dt>foo<dd>bar[]baz</dl>',
michael@0 2316 '<h1>[]foo</h1>',
michael@0 2317 '<h1>foo[]</h1>',
michael@0 2318 '<h1>foo[]<br></h1>',
michael@0 2319 '<h1>foo[]bar</h1>',
michael@0 2320 '<ol><li>[]foo</ol>',
michael@0 2321 '<ol><li>foo[]</ol>',
michael@0 2322 '<ol><li>foo[]<br></ol>',
michael@0 2323 '<ol><li>foo[]bar</ol>',
michael@0 2324 '<p>[]foo</p>',
michael@0 2325 '<p>foo[]</p>',
michael@0 2326 '<p>foo[]<br></p>',
michael@0 2327 '<p>foo[]bar</p>',
michael@0 2328 '<pre>[]foo</pre>',
michael@0 2329 '<pre>foo[]</pre>',
michael@0 2330 '<pre>foo[]<br></pre>',
michael@0 2331 '<pre>foo[]bar</pre>',
michael@0 2332
michael@0 2333 '<pre>foo[]<br><br></pre>',
michael@0 2334 '<pre>foo<br>{}<br></pre>',
michael@0 2335 '<pre>foo&#10;[]</pre>',
michael@0 2336 '<pre>foo[]&#10;</pre>',
michael@0 2337 '<pre>foo&#10;[]&#10;</pre>',
michael@0 2338
michael@0 2339 '<xmp>foo[]bar</xmp>',
michael@0 2340 '<script>foo[]bar</script>baz',
michael@0 2341 '<div style=display:none>foo[]bar</div>baz',
michael@0 2342 '<listing>foo[]bar</listing>',
michael@0 2343
michael@0 2344 '<ol><li>{}<br></li></ol>',
michael@0 2345 'foo<ol><li>{}<br></li></ol>',
michael@0 2346 '<ol><li>{}<br></li></ol>foo',
michael@0 2347 '<ol><li>foo<li>{}<br></ol>',
michael@0 2348 '<ol><li>{}<br><li>bar</ol>',
michael@0 2349 '<ol><li>foo</li><ul><li>{}<br></ul></ol>',
michael@0 2350
michael@0 2351 '<dl><dt>{}<br></dt></dl>',
michael@0 2352 '<dl><dt>foo<dd>{}<br></dl>',
michael@0 2353 '<dl><dt>{}<br><dd>bar</dl>',
michael@0 2354 '<dl><dt>foo<dd>bar<dl><dt>{}<br><dd>baz</dl></dl>',
michael@0 2355 '<dl><dt>foo<dd>bar<dl><dt>baz<dd>{}<br></dl></dl>',
michael@0 2356
michael@0 2357 '<h1>foo[bar</h1><p>baz]quz</p>',
michael@0 2358 '<p>foo[bar</p><h1>baz]quz</h1>',
michael@0 2359 '<p>foo</p>{}<br>',
michael@0 2360 '{}<br><p>foo</p>',
michael@0 2361 '<p>foo</p>{}<br><h1>bar</h1>',
michael@0 2362 '<h1>foo</h1>{}<br><p>bar</p>',
michael@0 2363 '<h1>foo</h1>{}<br><h2>bar</h2>',
michael@0 2364 '<p>foo</p><h1>[bar]</h1><p>baz</p>',
michael@0 2365 '<p>foo</p>{<h1>bar</h1>}<p>baz</p>',
michael@0 2366
michael@0 2367 '<table><tr><td>foo[]bar</table>',
michael@0 2368 '<table><tr><td><p>foo[]bar</table>',
michael@0 2369
michael@0 2370 '<blockquote>[]foo</blockquote>',
michael@0 2371 '<blockquote>foo[]</blockquote>',
michael@0 2372 '<blockquote>foo[]<br></blockquote>',
michael@0 2373 '<blockquote>foo[]bar</blockquote>',
michael@0 2374 '<blockquote><p>[]foo</blockquote>',
michael@0 2375 '<blockquote><p>foo[]</blockquote>',
michael@0 2376 '<blockquote><p>foo[]bar</blockquote>',
michael@0 2377 '<blockquote><p>foo[]<p>bar</blockquote>',
michael@0 2378 '<blockquote><p>foo[]bar<p>baz</blockquote>',
michael@0 2379
michael@0 2380 '<span>foo[]bar</span>',
michael@0 2381 '<span>foo[]bar</span>baz',
michael@0 2382 '<b>foo[]bar</b>',
michael@0 2383 '<b>foo[]bar</b>baz',
michael@0 2384 '<b>foo[]</b>bar',
michael@0 2385 'foo<b>[]bar</b>',
michael@0 2386 '<b>foo[]</b><i>bar</i>',
michael@0 2387 '<b id=x class=y>foo[]bar</b>',
michael@0 2388 '<i><b>foo[]bar</b>baz</i>',
michael@0 2389
michael@0 2390 '<p><b>foo[]bar</b></p>',
michael@0 2391 '<p><b>[]foo</b></p>',
michael@0 2392 '<p><b id=x class=y>foo[]bar</b></p>',
michael@0 2393 '<div><b>foo[]bar</b></div>',
michael@0 2394
michael@0 2395 '<a href=foo>foo[]bar</a>',
michael@0 2396 '<a href=foo>foo[]bar</a>baz',
michael@0 2397 '<a href=foo>foo[]</a>bar',
michael@0 2398 'foo<a href=foo>[]bar</a>',
michael@0 2399
michael@0 2400 '<p>foo[]<!--bar-->',
michael@0 2401 '<p><!--foo-->[]bar',
michael@0 2402
michael@0 2403 '<p>foo<span style=color:#aBcDeF>[bar]</span>baz',
michael@0 2404 '<p>foo<span style=color:#aBcDeF>{bar}</span>baz',
michael@0 2405 '<p>foo{<span style=color:#aBcDeF>bar</span>}baz',
michael@0 2406 '<p>[foo<span style=color:#aBcDeF>bar]</span>baz',
michael@0 2407 '<p>{foo<span style=color:#aBcDeF>bar}</span>baz',
michael@0 2408 '<p>foo<span style=color:#aBcDeF>[bar</span>baz]',
michael@0 2409 '<p>foo<span style=color:#aBcDeF>{bar</span>baz}',
michael@0 2410 '<p>foo<span style=color:#aBcDeF>[bar</span><span style=color:#fEdCbA>baz]</span>quz',
michael@0 2411
michael@0 2412 // https://bugs.webkit.org/show_bug.cgi?id=5036
michael@0 2413 '<ul contenteditable><li>{}<br></ul>',
michael@0 2414 '<ul contenteditable><li>foo[]</ul>',
michael@0 2415 '<div contenteditable=false><ul contenteditable><li>{}<br></ul></div>',
michael@0 2416 '<div contenteditable=false><ul contenteditable><li>foo[]</ul></div>',
michael@0 2417
michael@0 2418 // http://www.w3.org/Bugs/Public/show_bug.cgi?id=13841
michael@0 2419 // https://bugs.webkit.org/show_bug.cgi?id=23507
michael@0 2420 '<address><p>foo[]</address>',
michael@0 2421 '<dl><dt><p>foo[]</dl>',
michael@0 2422 '<dl><dd><p>foo[]</dl>',
michael@0 2423 '<ol><li><p>foo[]</ol>',
michael@0 2424 '<ul><li><p>foo[]</ul>',
michael@0 2425 '<address><div>foo[]</address>',
michael@0 2426 '<dl><dt><div>foo[]</dl>',
michael@0 2427 '<dl><dd><div>foo[]</dl>',
michael@0 2428 '<ol><li><div>foo[]</ol>',
michael@0 2429 '<ul><li><div>foo[]</ul>',
michael@0 2430 '<div><p>foo[]</div>',
michael@0 2431 '<div><div>foo[]</div>',
michael@0 2432
michael@0 2433 '<address><p>[]foo</address>',
michael@0 2434 '<dl><dt><p>[]foo</dl>',
michael@0 2435 '<dl><dd><p>[]foo</dl>',
michael@0 2436 '<ol><li><p>[]foo</ol>',
michael@0 2437 '<ul><li><p>[]foo</ul>',
michael@0 2438 '<address><div>[]foo</address>',
michael@0 2439 '<dl><dt><div>[]foo</dl>',
michael@0 2440 '<dl><dd><div>[]foo</dl>',
michael@0 2441 '<ol><li><div>[]foo</ol>',
michael@0 2442 '<ul><li><div>[]foo</ul>',
michael@0 2443 '<div><p>[]foo</div>',
michael@0 2444 '<div><div>[]foo</div>',
michael@0 2445
michael@0 2446 '<address><p>foo[]bar</address>',
michael@0 2447 '<dl><dt><p>foo[]bar</dl>',
michael@0 2448 '<dl><dd><p>foo[]bar</dl>',
michael@0 2449 '<ol><li><p>foo[]bar</ol>',
michael@0 2450 '<ul><li><p>foo[]bar</ul>',
michael@0 2451 '<address><div>foo[]bar</address>',
michael@0 2452 '<dl><dt><div>foo[]bar</dl>',
michael@0 2453 '<dl><dd><div>foo[]bar</dl>',
michael@0 2454 '<ol><li><div>foo[]bar</ol>',
michael@0 2455 '<ul><li><div>foo[]bar</ul>',
michael@0 2456 '<div><p>foo[]bar</div>',
michael@0 2457 '<div><div>foo[]bar</div>',
michael@0 2458
michael@0 2459 '<ol><li class=a id=x><p class=b id=y>foo[]</ol>',
michael@0 2460 '<div class=a id=x><div class=b id=y>foo[]</div></div>',
michael@0 2461 '<div class=a id=x><p class=b id=y>foo[]</div>',
michael@0 2462 '<ol><li class=a id=x><p class=b id=y>[]foo</ol>',
michael@0 2463 '<div class=a id=x><div class=b id=y>[]foo</div></div>',
michael@0 2464 '<div class=a id=x><p class=b id=y>[]foo</div>',
michael@0 2465 '<ol><li class=a id=x><p class=b id=y>foo[]bar</ol>',
michael@0 2466 '<div class=a id=x><div class=b id=y>foo[]bar</div></div>',
michael@0 2467 '<div class=a id=x><p class=b id=y>foo[]bar</div>',
michael@0 2468 ],
michael@0 2469 //@}
michael@0 2470 inserttext: [
michael@0 2471 //@{
michael@0 2472 'foo[bar]baz',
michael@0 2473 ['', 'foo[bar]baz'],
michael@0 2474
michael@0 2475 ['\t', 'foo[]bar'],
michael@0 2476 ['&', 'foo[]bar'],
michael@0 2477 ['\n', 'foo[]bar'],
michael@0 2478 ['abc\ndef', 'foo[]bar'],
michael@0 2479 ['\x07', 'foo[]bar'],
michael@0 2480
michael@0 2481 ['<b>hi</b>', 'foo[]bar'],
michael@0 2482 ['<', 'foo[]bar'],
michael@0 2483 ['&amp;', 'foo[]bar'],
michael@0 2484
michael@0 2485 // http://www.w3.org/Bugs/Public/show_bug.cgi?id=14254
michael@0 2486 ['!\r', 'foo[]bar'],
michael@0 2487 ['!\r\n', 'foo[]bar'],
michael@0 2488 ['!\0', 'foo[]bar'],
michael@0 2489 ['!\ud800', 'foo[]bar'],
michael@0 2490
michael@0 2491 // Whitespace tests! The following two bugs are relevant to some of
michael@0 2492 // these:
michael@0 2493 // http://www.w3.org/Bugs/Public/show_bug.cgi?id=14119
michael@0 2494 // https://bugzilla.mozilla.org/show_bug.cgi?id=681626
michael@0 2495 [' ', 'foo[]bar'],
michael@0 2496 [' ', 'foo []bar'],
michael@0 2497 [' ', 'foo[] bar'],
michael@0 2498 [' ', 'foo &nbsp;[]bar'],
michael@0 2499 [' ', 'foo []&nbsp;bar'],
michael@0 2500 [' ', 'foo[] &nbsp;bar'],
michael@0 2501 [' ', 'foo&nbsp; []bar'],
michael@0 2502 [' ', 'foo&nbsp;[] bar'],
michael@0 2503 [' ', 'foo[]&nbsp; bar'],
michael@0 2504 [' ', 'foo&nbsp;&nbsp;[]bar'],
michael@0 2505 [' ', 'foo&nbsp;[]&nbsp;bar'],
michael@0 2506 [' ', 'foo[]&nbsp;&nbsp;bar'],
michael@0 2507 [' ', 'foo []&nbsp; bar'],
michael@0 2508 [' ', 'foo []bar'],
michael@0 2509 [' ', 'foo []&nbsp;&nbsp; &nbsp; bar'],
michael@0 2510
michael@0 2511 [' ', '[]foo'],
michael@0 2512 [' ', '{}foo'],
michael@0 2513 [' ', 'foo[]'],
michael@0 2514 [' ', 'foo{}'],
michael@0 2515 [' ', 'foo&nbsp;[]'],
michael@0 2516 [' ', 'foo&nbsp;{}'],
michael@0 2517 [' ', 'foo&nbsp;&nbsp;[]'],
michael@0 2518 [' ', 'foo&nbsp;&nbsp;{}'],
michael@0 2519 [' ', '<b>foo[]</b>bar'],
michael@0 2520 [' ', 'foo[]<b>bar</b>'],
michael@0 2521
michael@0 2522 [' ', 'foo[] '],
michael@0 2523 [' ', ' foo [] '],
michael@0 2524 [' ', 'foo[]<span> </span>'],
michael@0 2525 [' ', 'foo[]<span> </span> '],
michael@0 2526 [' ', ' []foo'],
michael@0 2527 [' ', ' [] foo '],
michael@0 2528 [' ', '<span> </span>[]foo'],
michael@0 2529 [' ', ' <span> </span>[]foo'],
michael@0 2530
michael@0 2531 [' ', '{}<br>'],
michael@0 2532 [' ', '<p>{}<br>'],
michael@0 2533
michael@0 2534 [' ', '<p>foo[]<p>bar'],
michael@0 2535 [' ', '<p>foo&nbsp;[]<p>bar'],
michael@0 2536 [' ', '<p>foo[]<p>&nbsp;bar'],
michael@0 2537
michael@0 2538 // Some of the same tests as above, repeated with various values of
michael@0 2539 // white-space.
michael@0 2540 [' ', '<pre>foo[]bar</pre>'],
michael@0 2541 [' ', '<pre>foo []bar</pre>'],
michael@0 2542 [' ', '<pre>foo[] bar</pre>'],
michael@0 2543 [' ', '<pre>foo &nbsp;[]bar</pre>'],
michael@0 2544 [' ', '<pre>[]foo</pre>'],
michael@0 2545 [' ', '<pre>foo[]</pre>'],
michael@0 2546 [' ', '<pre>foo&nbsp;[]</pre>'],
michael@0 2547 [' ', '<pre> foo [] </pre>'],
michael@0 2548
michael@0 2549 [' ', '<div style=white-space:pre>foo[]bar</div>'],
michael@0 2550 [' ', '<div style=white-space:pre>foo []bar</div>'],
michael@0 2551 [' ', '<div style=white-space:pre>foo[] bar</div>'],
michael@0 2552 [' ', '<div style=white-space:pre>foo &nbsp;[]bar</div>'],
michael@0 2553 [' ', '<div style=white-space:pre>[]foo</div>'],
michael@0 2554 [' ', '<div style=white-space:pre>foo[]</div>'],
michael@0 2555 [' ', '<div style=white-space:pre>foo&nbsp;[]</div>'],
michael@0 2556 [' ', '<div style=white-space:pre> foo [] </div>'],
michael@0 2557
michael@0 2558 [' ', '<div style=white-space:pre-wrap>foo[]bar</div>'],
michael@0 2559 [' ', '<div style=white-space:pre-wrap>foo []bar</div>'],
michael@0 2560 [' ', '<div style=white-space:pre-wrap>foo[] bar</div>'],
michael@0 2561 [' ', '<div style=white-space:pre-wrap>foo &nbsp;[]bar</div>'],
michael@0 2562 [' ', '<div style=white-space:pre-wrap>[]foo</div>'],
michael@0 2563 [' ', '<div style=white-space:pre-wrap>foo[]</div>'],
michael@0 2564 [' ', '<div style=white-space:pre-wrap>foo&nbsp;[]</div>'],
michael@0 2565 [' ', '<div style=white-space:pre-wrap> foo [] </div>'],
michael@0 2566
michael@0 2567 [' ', '<div style=white-space:pre-line>foo[]bar</div>'],
michael@0 2568 [' ', '<div style=white-space:pre-line>foo []bar</div>'],
michael@0 2569 [' ', '<div style=white-space:pre-line>foo[] bar</div>'],
michael@0 2570 [' ', '<div style=white-space:pre-line>foo &nbsp;[]bar</div>'],
michael@0 2571 [' ', '<div style=white-space:pre-line>[]foo</div>'],
michael@0 2572 [' ', '<div style=white-space:pre-line>foo[]</div>'],
michael@0 2573 [' ', '<div style=white-space:pre-line>foo&nbsp;[]</div>'],
michael@0 2574 [' ', '<div style=white-space:pre-line> foo [] </div>'],
michael@0 2575
michael@0 2576 [' ', '<div style=white-space:nowrap>foo[]bar</div>'],
michael@0 2577 [' ', '<div style=white-space:nowrap>foo []bar</div>'],
michael@0 2578 [' ', '<div style=white-space:nowrap>foo[] bar</div>'],
michael@0 2579 [' ', '<div style=white-space:nowrap>foo &nbsp;[]bar</div>'],
michael@0 2580 [' ', '<div style=white-space:nowrap>[]foo</div>'],
michael@0 2581 [' ', '<div style=white-space:nowrap>foo[]</div>'],
michael@0 2582 [' ', '<div style=white-space:nowrap>foo&nbsp;[]</div>'],
michael@0 2583 [' ', '<div style=white-space:nowrap> foo [] </div>'],
michael@0 2584
michael@0 2585 // End whitespace tests
michael@0 2586
michael@0 2587 // Autolinking tests
michael@0 2588 [' ', 'http://a[]'],
michael@0 2589 [' ', 'ftp://a[]'],
michael@0 2590 [' ', 'quasit://a[]'],
michael@0 2591 [' ', '.x-++-.://a[]'],
michael@0 2592 [' ', '(http://a)[]'],
michael@0 2593 [' ', '&lt;http://a>[]'],
michael@0 2594 // http://www.w3.org/Bugs/Public/show_bug.cgi?id=14744
michael@0 2595 ['! ', '&#x5b;http://a&#x5d;[]'],
michael@0 2596 ['! ', '&#x7b;http://a&#x7d;[]'],
michael@0 2597 [' ', 'http://a![]'],
michael@0 2598 [' ', '!"#$%&amp;\'()*+,-./:;&lt;=>?\^_`|~http://a!"#$%&amp;\'()*+,-./:;&lt;=>?\^_`|~[]'],
michael@0 2599 [' ', 'http://a!"\'(),-.:;&lt;>`[]'],
michael@0 2600 [' ', 'http://a#$%&amp;*+/=?\^_|~[]'],
michael@0 2601 [' ', 'mailto:a[]'],
michael@0 2602 [' ', 'a@b[]'],
michael@0 2603 [' ', 'a@[]'],
michael@0 2604 [' ', '@b[]'],
michael@0 2605 [' ', '#@x[]'],
michael@0 2606 [' ', 'a@.[]'],
michael@0 2607 [' ', '!"#$%&amp;\'()*+,-./:;&lt;=>?\^_`|~a@b!"#$%&amp;\'()*+,-./:;&lt;=>?\^_`|~[]'],
michael@0 2608 [' ', '<b>a@b</b>{}'],
michael@0 2609 [' ', '<b>a</b><i>@</i><u>b</u>{}'],
michael@0 2610 [' ', 'a@b<b>[]c</b>'],
michael@0 2611 [' ', '<p>a@b</p><p>[]c</p>'],
michael@0 2612 ['a', 'http://a[]'],
michael@0 2613 ['\t', 'http://a[]'],
michael@0 2614 // http://www.w3.org/Bugs/Public/show_bug.cgi?id=14254
michael@0 2615 ['!\r', 'http://a[]'],
michael@0 2616 // http://www.w3.org/Bugs/Public/show_bug.cgi?id=14745
michael@0 2617 ['!\n', 'http://a[]'],
michael@0 2618 ['\f', 'http://a[]'],
michael@0 2619 ['\u00A0', 'http://a[]'],
michael@0 2620
michael@0 2621 [' ', 'foo[]'],
michael@0 2622
michael@0 2623 'foo[]bar',
michael@0 2624 'foo&nbsp;[]',
michael@0 2625 'foo\xa0[]',
michael@0 2626 '<p>foo[]',
michael@0 2627 '<p>foo</p>{}',
michael@0 2628 '<p>[]foo',
michael@0 2629 '<p>{}foo',
michael@0 2630 '{}<p>foo',
michael@0 2631 '<p>foo</p>{}<p>bar</p>',
michael@0 2632 '<b>foo[]</b>bar',
michael@0 2633 '<b>foo</b>[]bar',
michael@0 2634 'foo<b>{}</b>bar',
michael@0 2635 '<a>foo[]</a>bar',
michael@0 2636 '<a>foo</a>[]bar',
michael@0 2637 '<a href=/>foo[]</a>bar',
michael@0 2638 '<a href=/>foo</a>[]bar',
michael@0 2639 '<p>fo[o<p>b]ar',
michael@0 2640 '<p>fo[o<p>bar<p>b]az',
michael@0 2641 '{}<br>',
michael@0 2642 '<p>{}<br>',
michael@0 2643 '<p><span>{}<br></span>',
michael@0 2644 '<p>foo<span style=color:#aBcDeF>[bar]</span>baz',
michael@0 2645 '<p>foo<span style=color:#aBcDeF>{bar}</span>baz',
michael@0 2646 '<p>foo{<span style=color:#aBcDeF>bar</span>}baz',
michael@0 2647 '<p>[foo<span style=color:#aBcDeF>bar]</span>baz',
michael@0 2648 '<p>{foo<span style=color:#aBcDeF>bar}</span>baz',
michael@0 2649 '<p>foo<span style=color:#aBcDeF>[bar</span>baz]',
michael@0 2650 '<p>foo<span style=color:#aBcDeF>{bar</span>baz}',
michael@0 2651 '<p>foo<span style=color:#aBcDeF>[bar</span><span style=color:#fEdCbA>baz]</span>quz',
michael@0 2652
michael@0 2653
michael@0 2654 // These are like the corresponding tests in the multitest section, but
michael@0 2655 // because the selection isn't collapsed, we don't need to do
michael@0 2656 // multitests to set overrides.
michael@0 2657 'foo<b>[bar]</b>baz',
michael@0 2658 'foo<i>[bar]</i>baz',
michael@0 2659 'foo<s>[bar]</s>baz',
michael@0 2660 'foo<sub>[bar]</sub>baz',
michael@0 2661 'foo<sup>[bar]</sup>baz',
michael@0 2662 'foo<u>[bar]</u>baz',
michael@0 2663 'foo<a href=http://www.google.com>[bar]</a>baz',
michael@0 2664 'foo<font face=sans-serif>[bar]</font>baz',
michael@0 2665 'foo<font size=4>[bar]</font>baz',
michael@0 2666 'foo<font color=#0000FF>[bar]</font>baz',
michael@0 2667 'foo<span style=background-color:#00FFFF>[bar]</span>baz',
michael@0 2668 'foo<a href=http://www.google.com><font color=blue>[bar]</font></a>baz',
michael@0 2669 'foo<font color=blue><a href=http://www.google.com>[bar]</a></font>baz',
michael@0 2670 'foo<a href=http://www.google.com><font color=brown>[bar]</font></a>baz',
michael@0 2671 'foo<font color=brown><a href=http://www.google.com>[bar]</a></font>baz',
michael@0 2672 'foo<a href=http://www.google.com><font color=black>[bar]</font></a>baz',
michael@0 2673 'foo<a href=http://www.google.com><u>[bar]</u></a>baz',
michael@0 2674 'foo<u><a href=http://www.google.com>[bar]</a></u>baz',
michael@0 2675 'foo<sub><font size=2>[bar]</font></sub>baz',
michael@0 2676 'foo<font size=2><sub>[bar]</sub></font>baz',
michael@0 2677 'foo<sub><font size=3>[bar]</font></sub>baz',
michael@0 2678 'foo<font size=3><sub>[bar]</sub></font>baz',
michael@0 2679
michael@0 2680 // Now repeat but with different selections.
michael@0 2681 '[foo<b>bar]</b>baz',
michael@0 2682 '[foo<i>bar]</i>baz',
michael@0 2683 '[foo<s>bar]</s>baz',
michael@0 2684 '[foo<sub>bar]</sub>baz',
michael@0 2685 '[foo<sup>bar]</sup>baz',
michael@0 2686 '[foo<u>bar]</u>baz',
michael@0 2687 '[foo<a href=http://www.google.com>bar]</a>baz',
michael@0 2688 '[foo<font face=sans-serif>bar]</font>baz',
michael@0 2689 '[foo<font size=4>bar]</font>baz',
michael@0 2690 '[foo<font color=#0000FF>bar]</font>baz',
michael@0 2691 '[foo<span style=background-color:#00FFFF>bar]</span>baz',
michael@0 2692 '[foo<a href=http://www.google.com><font color=blue>bar]</font></a>baz',
michael@0 2693 '[foo<font color=blue><a href=http://www.google.com>bar]</a></font>baz',
michael@0 2694 '[foo<a href=http://www.google.com><font color=brown>bar]</font></a>baz',
michael@0 2695 '[foo<font color=brown><a href=http://www.google.com>bar]</a></font>baz',
michael@0 2696 '[foo<a href=http://www.google.com><font color=black>bar]</font></a>baz',
michael@0 2697 '[foo<a href=http://www.google.com><u>bar]</u></a>baz',
michael@0 2698 '[foo<u><a href=http://www.google.com>bar]</a></u>baz',
michael@0 2699 '[foo<sub><font size=2>bar]</font></sub>baz',
michael@0 2700 '[foo<font size=2><sub>bar]</sub></font>baz',
michael@0 2701 '[foo<sub><font size=3>bar]</font></sub>baz',
michael@0 2702 '[foo<font size=3><sub>bar]</sub></font>baz',
michael@0 2703
michael@0 2704 'foo<b>[bar</b>baz]',
michael@0 2705 'foo<i>[bar</i>baz]',
michael@0 2706 'foo<s>[bar</s>baz]',
michael@0 2707 'foo<sub>[bar</sub>baz]',
michael@0 2708 'foo<sup>[bar</sup>baz]',
michael@0 2709 'foo<u>[bar</u>baz]',
michael@0 2710 'foo<a href=http://www.google.com>[bar</a>baz]',
michael@0 2711 'foo<font face=sans-serif>[bar</font>baz]',
michael@0 2712 'foo<font size=4>[bar</font>baz]',
michael@0 2713 'foo<font color=#0000FF>[bar</font>baz]',
michael@0 2714 'foo<span style=background-color:#00FFFF>[bar</span>baz]',
michael@0 2715 'foo<a href=http://www.google.com><font color=blue>[bar</font></a>baz]',
michael@0 2716 'foo<font color=blue><a href=http://www.google.com>[bar</a></font>baz]',
michael@0 2717 'foo<a href=http://www.google.com><font color=brown>[bar</font></a>baz]',
michael@0 2718 'foo<font color=brown><a href=http://www.google.com>[bar</a></font>baz]',
michael@0 2719 'foo<a href=http://www.google.com><font color=black>[bar</font></a>baz]',
michael@0 2720 'foo<a href=http://www.google.com><u>[bar</u></a>baz]',
michael@0 2721 'foo<u><a href=http://www.google.com>[bar</a></u>baz]',
michael@0 2722 'foo<sub><font size=2>[bar</font></sub>baz]',
michael@0 2723 'foo<font size=2><sub>[bar</sub></font>baz]',
michael@0 2724 'foo<sub><font size=3>[bar</font></sub>baz]',
michael@0 2725 'foo<font size=3><sub>[bar</sub></font>baz]',
michael@0 2726
michael@0 2727 // https://bugs.webkit.org/show_bug.cgi?id=19702
michael@0 2728 '<blockquote><font color=blue>[foo]</font></blockquote>',
michael@0 2729 ],
michael@0 2730 //@}
michael@0 2731 insertunorderedlist: [
michael@0 2732 //@{
michael@0 2733 'foo[]bar',
michael@0 2734 'foo[bar]baz',
michael@0 2735 'foo<br>[bar]',
michael@0 2736 'f[oo<br>b]ar<br>baz',
michael@0 2737 '<p>[foo]<br>bar</p>',
michael@0 2738 '[foo<ol><li>bar]</ol>baz',
michael@0 2739 'foo<ol><li>[bar</ol>baz]',
michael@0 2740 '[foo<ul><li>bar]</ul>baz',
michael@0 2741 'foo<ul><li>[bar</ul>baz]',
michael@0 2742 'foo<ul><li>[bar</ul><ol><li>baz]</ol>quz',
michael@0 2743 'foo<ol><li>[bar</ol><ul><li>baz]</ul>quz',
michael@0 2744
michael@0 2745 '<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>',
michael@0 2746 '<table><tbody><tr><td>fo[o<td>b]ar<td>baz</table>',
michael@0 2747 '{<table><tr><td>foo<td>bar<td>baz</table>}',
michael@0 2748
michael@0 2749 '<p>foo<p>[bar]<p>baz',
michael@0 2750 '<p>foo<blockquote>[bar]</blockquote><p>baz',
michael@0 2751 '<dl><dt>foo<dd>[bar]<dt>baz<dd>quz</dl>',
michael@0 2752 '<dl><dt>foo<dd>bar<dt>[baz]<dd>quz</dl>',
michael@0 2753
michael@0 2754 '<p>[foo<p>bar]<p>baz',
michael@0 2755 '<p>[foo<blockquote>bar]</blockquote><p>baz',
michael@0 2756 '<dl><dt>[foo<dd>bar]<dt>baz<dd>quz</dl>',
michael@0 2757 '<dl><dt>foo<dd>[bar<dt>baz]<dd>quz</dl>',
michael@0 2758
michael@0 2759 '<p>[foo<blockquote><p>bar]<p>baz</blockquote>',
michael@0 2760
michael@0 2761
michael@0 2762 // Various <ol> stuff
michael@0 2763 '<ol><li>foo<li>[bar]<li>baz</ol>',
michael@0 2764 '<ol><li>foo</ol>[bar]',
michael@0 2765 '[foo]<ol><li>bar</ol>',
michael@0 2766 '<ol><li>foo</ol>[bar]<ol><li>baz</ol>',
michael@0 2767 '<ol><ol><li>[foo]</ol></ol>',
michael@0 2768 '<ol><li>[foo]<br>bar<li>baz</ol>',
michael@0 2769 '<ol><li>foo<br>[bar]<li>baz</ol>',
michael@0 2770 '<ol><li><div>[foo]</div>bar<li>baz</ol>',
michael@0 2771 '<ol><li>foo<ol><li>[bar]<li>baz</ol><li>quz</ol>',
michael@0 2772 '<ol><li>foo<ol><li>bar<li>[baz]</ol><li>quz</ol>',
michael@0 2773 '<ol><li>foo</li><ol><li>[bar]<li>baz</ol><li>quz</ol>',
michael@0 2774 '<ol><li>foo</li><ol><li>bar<li>[baz]</ol><li>quz</ol>',
michael@0 2775 '<ol><li>[foo]<ol><li>bar</ol><li>baz</ol>',
michael@0 2776 '<ol><li>[foo]</li><ol><li>bar</ol><li>baz</ol>',
michael@0 2777 '<ol><li>foo<li>[bar]<ol><li>baz</ol><li>quz</ol>',
michael@0 2778 '<ol><li>foo<li>[bar]</li><ol><li>baz</ol><li>quz</ol>',
michael@0 2779 '<ol><li>foo<ol><li>bar<li>baz</ol><li>[quz]</ol>',
michael@0 2780 '<ol><li>foo</li><ol><li>bar<li>baz</ol><li>[quz]</ol>',
michael@0 2781
michael@0 2782 // Multiple items at once.
michael@0 2783 '<ol><li>foo<li>[bar<li>baz]</ol>',
michael@0 2784 '<ol><li>[foo<ol><li>bar]</ol><li>baz</ol>',
michael@0 2785 '<ol><li>foo<ol><li>b[ar</ol><li>b]az</ol>',
michael@0 2786 '<ol><li>[foo<ol><li>bar</ol><li>baz]</ol><p>extra',
michael@0 2787
michael@0 2788 // We probably can't actually get this DOM . . .
michael@0 2789 '<ol><li>[foo]<ol><li>bar</ol>baz</ol>',
michael@0 2790 '<ol><li>foo<ol><li>[bar]</ol>baz</ol>',
michael@0 2791 '<ol><li>foo<ol><li>bar</ol>[baz]</ol>',
michael@0 2792 '<ol><li>[foo<ol><li>bar]</ol>baz</ol>',
michael@0 2793
michael@0 2794
michael@0 2795 // Same stuff but with <ul>
michael@0 2796 '<ul><li>foo<li>[bar]<li>baz</ul>',
michael@0 2797 '<ul><li>foo</ul>[bar]',
michael@0 2798 '[foo]<ul><li>bar</ul>',
michael@0 2799 '<ul><li>foo</ul>[bar]<ul><li>baz</ul>',
michael@0 2800 '<ul><ul><li>[foo]</ul></ul>',
michael@0 2801 '<ul><li>[foo]<br>bar<li>baz</ul>',
michael@0 2802 '<ul><li>foo<br>[bar]<li>baz</ul>',
michael@0 2803 '<ul><li><div>[foo]</div>bar<li>baz</ul>',
michael@0 2804 '<ul><li>foo<ul><li>[bar]<li>baz</ul><li>quz</ul>',
michael@0 2805 '<ul><li>foo<ul><li>bar<li>[baz]</ul><li>quz</ul>',
michael@0 2806 '<ul><li>foo</li><ul><li>[bar]<li>baz</ul><li>quz</ul>',
michael@0 2807 '<ul><li>foo</li><ul><li>bar<li>[baz]</ul><li>quz</ul>',
michael@0 2808 '<ul><li>[foo]<ul><li>bar</ul><li>baz</ul>',
michael@0 2809 '<ul><li>[foo]</li><ul><li>bar</ul><li>baz</ul>',
michael@0 2810 '<ul><li>foo<li>[bar]<ul><li>baz</ul><li>quz</ul>',
michael@0 2811 '<ul><li>foo<li>[bar]</li><ul><li>baz</ul><li>quz</ul>',
michael@0 2812 '<ul><li>foo<ul><li>bar<li>baz</ul><li>[quz]</ul>',
michael@0 2813 '<ul><li>foo</li><ul><li>bar<li>baz</ul><li>[quz]</ul>',
michael@0 2814
michael@0 2815 // Multiple items at once.
michael@0 2816 '<ul><li>foo<li>[bar<li>baz]</ul>',
michael@0 2817 '<ul><li>[foo<ul><li>bar]</ul><li>baz</ul>',
michael@0 2818 '<ul><li>foo<ul><li>b[ar</ul><li>b]az</ul>',
michael@0 2819 '<ul><li>[foo<ul><li>bar</ul><li>baz]</ul><p>extra',
michael@0 2820
michael@0 2821 // We probably can't actually get this DOM . . .
michael@0 2822 '<ul><li>[foo]<ul><li>bar</ul>baz</ul>',
michael@0 2823 '<ul><li>foo<ul><li>[bar]</ul>baz</ul>',
michael@0 2824 '<ul><li>foo<ul><li>bar</ul>[baz]</ul>',
michael@0 2825 '<ul><li>[foo<ul><li>bar]</ul>baz</ul>',
michael@0 2826
michael@0 2827
michael@0 2828 // Mix of <ol> and <ul>
michael@0 2829 'foo<ol><li>bar</ol><ul><li>[baz]</ul>quz',
michael@0 2830 'foo<ol><li>bar</ol><ul><li>[baz</ul>quz]',
michael@0 2831 'foo<ul><li>[bar]</ul><ol><li>baz</ol>quz',
michael@0 2832 '[foo<ul><li>bar]</ul><ol><li>baz</ol>quz',
michael@0 2833
michael@0 2834 // Interaction with indentation
michael@0 2835 '[foo]<blockquote>bar</blockquote>baz',
michael@0 2836 'foo<blockquote>[bar]</blockquote>baz',
michael@0 2837 '[foo<blockquote>bar]</blockquote>baz',
michael@0 2838 '<ol><li>foo</ol><blockquote>[bar]</blockquote>baz',
michael@0 2839 '[foo]<blockquote><ol><li>bar</ol></blockquote>baz',
michael@0 2840 'foo<blockquote>[bar]<br>baz</blockquote>',
michael@0 2841 '[foo<blockquote>bar]<br>baz</blockquote>',
michael@0 2842 '<ol><li>foo</ol><blockquote>[bar]<br>baz</blockquote>',
michael@0 2843
michael@0 2844 '<p>[foo]<blockquote><p>bar</blockquote><p>baz',
michael@0 2845 '<p>foo<blockquote><p>[bar]</blockquote><p>baz',
michael@0 2846 '<p>[foo<blockquote><p>bar]</blockquote><p>baz',
michael@0 2847 '<ol><li>foo</ol><blockquote><p>[bar]</blockquote><p>baz',
michael@0 2848
michael@0 2849 // Attributes
michael@0 2850 '<ul id=abc><li>foo<li>[bar]<li>baz</ul>',
michael@0 2851 '<ul style=color:blue><li>foo<li>[bar]<li>baz</ul>',
michael@0 2852 '<ul style=text-indent:1em><li>foo<li>[bar]<li>baz</ul>',
michael@0 2853 '<ul id=abc><li>[foo]<li>bar<li>baz</ul>',
michael@0 2854 '<ul style=color:blue><li>[foo]<li>bar<li>baz</ul>',
michael@0 2855 '<ul style=text-indent:1em><li>[foo]<li>bar<li>baz</ul>',
michael@0 2856 '<ul id=abc><li>foo<li>bar<li>[baz]</ul>',
michael@0 2857 '<ul style=color:blue><li>foo<li>bar<li>[baz]</ul>',
michael@0 2858 '<ul style=text-indent:1em><li>foo<li>bar<li>[baz]</ul>',
michael@0 2859
michael@0 2860 // Whitespace nodes
michael@0 2861 '<ul><li>foo</ul> <p>[bar]',
michael@0 2862 '<p>[foo]</p> <ul><li>bar</ul>',
michael@0 2863 '<ul><li>foo</ul> <p>[bar]</p> <ul><li>baz</ul>',
michael@0 2864
michael@0 2865 // https://bugs.webkit.org/show_bug.cgi?id=24167
michael@0 2866 '{<div style="font-size: 1.3em">1</div><div style="font-size: 1.1em">2</div>}',
michael@0 2867 ],
michael@0 2868 //@}
michael@0 2869 italic: [
michael@0 2870 //@{
michael@0 2871 'foo[]bar',
michael@0 2872 '<p>[foo</p> <p>bar]</p>',
michael@0 2873 '<span>[foo</span> <span>bar]</span>',
michael@0 2874 '<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>',
michael@0 2875 '<p>[foo<p><br><p>bar]',
michael@0 2876 '<b>foo[]bar</b>',
michael@0 2877 '<i>foo[]bar</i>',
michael@0 2878 '<span>foo</span>{}<span>bar</span>',
michael@0 2879 '<span>foo[</span><span>]bar</span>',
michael@0 2880 'foo[bar]baz',
michael@0 2881 'foo[bar<b>baz]qoz</b>quz',
michael@0 2882 'foo[bar<i>baz]qoz</i>quz',
michael@0 2883 '{<p><p> <p>foo</p>}',
michael@0 2884
michael@0 2885 '<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>',
michael@0 2886 '<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 2887 '<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 2888 '<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>',
michael@0 2889 '<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>',
michael@0 2890 '{<table><tr><td>foo<td>bar<td>baz</table>}',
michael@0 2891
michael@0 2892 'foo<span style="font-style: italic">[bar]</span>baz',
michael@0 2893 'foo<address>[bar]</address>baz',
michael@0 2894 'foo<cite>[bar]</cite>baz',
michael@0 2895 'foo<dfn>[bar]</dfn>baz',
michael@0 2896 'foo<em>[bar]</em>baz',
michael@0 2897 'foo<i>[bar]</i>baz',
michael@0 2898 'foo<var>[bar]</var>baz',
michael@0 2899
michael@0 2900 'foo{<address>bar</address>}baz',
michael@0 2901 'foo{<cite>bar</cite>}baz',
michael@0 2902 'foo{<dfn>bar</dfn>}baz',
michael@0 2903 'foo{<em>bar</em>}baz',
michael@0 2904 'foo{<i>bar</i>}baz',
michael@0 2905 'foo{<var>bar</var>}baz',
michael@0 2906
michael@0 2907 'foo<address>b[a]r</address>baz',
michael@0 2908 'foo<cite>b[a]r</cite>baz',
michael@0 2909 'foo<dfn>b[a]r</dfn>baz',
michael@0 2910 'foo<em>b[a]r</em>baz',
michael@0 2911 'foo<i>b[a]r</i>baz',
michael@0 2912 'foo<var>b[a]r</var>baz',
michael@0 2913
michael@0 2914 'fo[o<address>bar</address>b]az',
michael@0 2915 'fo[o<cite>bar</cite>b]az',
michael@0 2916 'fo[o<dfn>bar</dfn>b]az',
michael@0 2917 'fo[o<em>bar</em>b]az',
michael@0 2918 'fo[o<i>bar</i>b]az',
michael@0 2919 'fo[o<var>bar</var>b]az',
michael@0 2920
michael@0 2921 'foo[<address>bar</address>baz]',
michael@0 2922 'foo[<cite>bar</cite>baz]',
michael@0 2923 'foo[<dfn>bar</dfn>baz]',
michael@0 2924 'foo[<em>bar</em>baz]',
michael@0 2925 'foo[<i>bar</i>baz]',
michael@0 2926 'foo[<var>bar</var>baz]',
michael@0 2927
michael@0 2928 '[foo<address>bar</address>]baz',
michael@0 2929 '[foo<cite>bar</cite>]baz',
michael@0 2930 '[foo<dfn>bar</dfn>]baz',
michael@0 2931 '[foo<em>bar</em>]baz',
michael@0 2932 '[foo<i>bar</i>]baz',
michael@0 2933 '[foo<var>bar</var>]baz',
michael@0 2934
michael@0 2935 'foo<span style="font-style: italic">[bar]</span>baz',
michael@0 2936 'foo<span style="font-style: oblique">[bar]</span>baz',
michael@0 2937 'foo<span style="font-style: oblique">b[a]r</span>baz',
michael@0 2938
michael@0 2939 '<i>{<p>foo</p><p>bar</p>}<p>baz</p></i>',
michael@0 2940 '<i><p>foo[<b>bar</b>}</p><p>baz</p></i>',
michael@0 2941 'foo [bar <b>baz] qoz</b> quz sic',
michael@0 2942 'foo bar <b>baz [qoz</b> quz] sic',
michael@0 2943 'foo [bar <i>baz] qoz</i> quz sic',
michael@0 2944 'foo bar <i>baz [qoz</i> quz] sic',
michael@0 2945
michael@0 2946 // Tests for queryCommandIndeterm() and queryCommandState()
michael@0 2947 'fo[o<i>b]ar</i>baz',
michael@0 2948 'foo<i>ba[r</i>b]az',
michael@0 2949 'fo[o<i>bar</i>b]az',
michael@0 2950 'foo[<i>b]ar</i>baz',
michael@0 2951 'foo<i>ba[r</i>]baz',
michael@0 2952 'foo[<i>bar</i>]baz',
michael@0 2953 'foo<i>[bar]</i>baz',
michael@0 2954 'foo{<i>bar</i>}baz',
michael@0 2955 'fo[o<span style=font-style:italic>b]ar</span>baz',
michael@0 2956 'fo[o<span style=font-style:oblique>b]ar</span>baz',
michael@0 2957 '<span style=font-style:italic>fo[o</span><span style=font-style:oblique>b]ar</span>',
michael@0 2958 '<span style=font-style:oblique>fo[o</span><span style=font-style:italic>b]ar</span>',
michael@0 2959 '<i>fo[o</i><address>b]ar</address>',
michael@0 2960 ],
michael@0 2961 //@}
michael@0 2962 justifycenter: [
michael@0 2963 //@{
michael@0 2964 'foo[]bar<p>extra',
michael@0 2965 '<span>foo</span>{}<span>bar</span><p>extra',
michael@0 2966 '<span>foo[</span><span>]bar</span><p>extra',
michael@0 2967 'foo[bar]baz<p>extra',
michael@0 2968 'foo[bar<b>baz]qoz</b>quz<p>extra',
michael@0 2969 '<p>foo[]bar<p>extra',
michael@0 2970 '<p>foo[bar]baz<p>extra',
michael@0 2971 '<h1>foo[bar]baz</h1><p>extra',
michael@0 2972 '<pre>foo[bar]baz</pre><p>extra',
michael@0 2973 '<xmp>foo[bar]baz</xmp><p>extra',
michael@0 2974 '<center><p>[foo]<p>bar</center><p>extra',
michael@0 2975 '<center><p>[foo<p>bar]</center><p>extra',
michael@0 2976
michael@0 2977 '<table><tbody><tr><td>foo<td>b[a]r<td>baz</table><p>extra',
michael@0 2978 '<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 2979 '<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 2980 '<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 2981 '<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 2982 '{<table><tr><td>foo<td>bar<td>baz</table>}<p>extra',
michael@0 2983
michael@0 2984 '<table align=center><tbody><tr><td>foo<td>b[a]r<td>baz</table><p>extra',
michael@0 2985 '<table align=center><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 2986 '<table align=center><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 2987 '<table align=center><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 2988 '<table align=center data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 2989 '{<table align=center><tr><td>foo<td>bar<td>baz</table>}<p>extra',
michael@0 2990
michael@0 2991 '<table><tbody align=center><tr><td>foo<td>b[a]r<td>baz</table><p>extra',
michael@0 2992 '<table><tbody align=center><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 2993 '<table><tbody align=center><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 2994 '<table><tbody align=center data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 2995 '<table data-start=0 data-end=1><tbody align=center><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 2996 '{<table><tbody align=center><tr><td>foo<td>bar<td>baz</table>}<p>extra',
michael@0 2997
michael@0 2998 '<table><tbody><tr align=center><td>foo<td>b[a]r<td>baz</table><p>extra',
michael@0 2999 '<table><tbody><tr align=center data-start=1 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3000 '<table><tbody><tr align=center data-start=0 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3001 '<table><tbody data-start=0 data-end=1><tr align=center><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3002 '<table data-start=0 data-end=1><tbody><tr align=center><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3003 '{<table><tr align=center><td>foo<td>bar<td>baz</table>}<p>extra',
michael@0 3004
michael@0 3005 '<div align=center><p>[foo]<p>bar</div><p>extra',
michael@0 3006 '<div align=center><p>[foo<p>bar}</div><p>extra',
michael@0 3007 '<div style=text-align:center><p>[foo]<p>bar</div><p>extra',
michael@0 3008 '<div style=text-align:center><p>[foo<p>bar]</div><p>extra',
michael@0 3009
michael@0 3010 '<div align=justify><p>[foo]<p>bar</div><p>extra',
michael@0 3011 '<div align=justify><p>[foo<p>bar}</div><p>extra',
michael@0 3012 '<div style=text-align:justify><p>[foo]<p>bar</div><p>extra',
michael@0 3013 '<div style=text-align:justify><p>[foo<p>bar]</div><p>extra',
michael@0 3014
michael@0 3015 '<div align=left><p>[foo]<p>bar</div><p>extra',
michael@0 3016 '<div align=left><p>[foo<p>bar}</div><p>extra',
michael@0 3017 '<div style=text-align:left><p>[foo]<p>bar</div><p>extra',
michael@0 3018 '<div style=text-align:left><p>[foo<p>bar]</div><p>extra',
michael@0 3019
michael@0 3020 '<div align=right><p>[foo]<p>bar</div><p>extra',
michael@0 3021 '<div align=right><p>[foo<p>bar}</div><p>extra',
michael@0 3022 '<div style=text-align:right><p>[foo]<p>bar</div><p>extra',
michael@0 3023 '<div style=text-align:right><p>[foo<p>bar]</div><p>extra',
michael@0 3024
michael@0 3025 '<center>foo</center>[bar]<p>extra',
michael@0 3026 '[foo]<center>bar</center><p>extra',
michael@0 3027 '<center>foo</center>[bar]<center>baz</center><p>extra',
michael@0 3028 '<div align=center>foo</div>[bar]<p>extra',
michael@0 3029 '[foo]<div align=center>bar</div><p>extra',
michael@0 3030 '<div align=center>foo</div>[bar]<div align=center>baz</div><p>extra',
michael@0 3031 '<div align=center><p>foo</div><p>[bar]<p>extra',
michael@0 3032 '<p>[foo]<div align=center><p>bar</div><p>extra',
michael@0 3033 '<div align=center><p>foo</div><p>[bar]<div align=center><p>baz</div><p>extra',
michael@0 3034 '<div style=text-align:center>foo</div>[bar]<p>extra',
michael@0 3035 '[foo]<div style=text-align:center>bar</div><p>extra',
michael@0 3036 '<div style=text-align:center>foo</div>[bar]<div style=text-align:center>baz</div><p>extra',
michael@0 3037 '<div style=text-align:center><p>foo</div><p>[bar]<p>extra',
michael@0 3038 '<p>[foo]<div style=text-align:center><p>bar</div><p>extra',
michael@0 3039 '<div style=text-align:center><p>foo</div><p>[bar]<div style=text-align:center><p>baz</div><p>extra',
michael@0 3040 '<p align=center>foo<p>[bar]<p>extra',
michael@0 3041 '<p>[foo]<p align=center>bar<p>extra',
michael@0 3042 '<p align=center>foo<p>[bar]<p align=center>baz<p>extra',
michael@0 3043
michael@0 3044 '<center>[foo</center>bar]<p>extra',
michael@0 3045 '<center>fo[o</center>b]ar<p>extra',
michael@0 3046 '<div align=center>[foo</div>bar]<p>extra',
michael@0 3047 '<div align=center>fo[o</div>b]ar<p>extra',
michael@0 3048 '<div style=text-align:center>[foo</div>bar]<p>extra',
michael@0 3049 '<div style=text-align:center>fo[o</div>b]ar<p>extra',
michael@0 3050 '<span style=text-align:center>[foo]</span><p>extra',
michael@0 3051 '<span style=text-align:center>f[o]o</span><p>extra',
michael@0 3052
michael@0 3053 '<div style=text-align:center>[foo<div style=text-align:left contenteditable=false>bar</div>baz]</div><p>extra',
michael@0 3054
michael@0 3055 '<div align=nonsense><p>[foo]</div><p>extra',
michael@0 3056 '<div style=text-align:inherit><p>[foo]</div><p>extra',
michael@0 3057 '<quasit align=right><p>[foo]</p></quasit><p>extra',
michael@0 3058
michael@0 3059 '<div align=center>{<div align=left>foo</div>}</div>',
michael@0 3060 '<div align=left>{<div align=center>foo</div>}</div>',
michael@0 3061 '<div align=center>{<div align=left>foo</div>bar}</div>',
michael@0 3062 '<div align=left>{<div align=center>foo</div>bar}</div>',
michael@0 3063 '<div align=center>{<div align=left>foo</div><img src=/img/lion.svg>}</div>',
michael@0 3064 '<div align=left>{<div align=center>foo</div><img src=/img/lion.svg>}</div>',
michael@0 3065 '<div align=center>{<div align=left>foo</div><!-- bar -->}</div>',
michael@0 3066 '<div align=left>{<div align=center>foo</div><!-- bar -->}</div>',
michael@0 3067
michael@0 3068 '<div style=text-align:start>[foo]</div><p>extra',
michael@0 3069 '<div style=text-align:end>[foo]</div><p>extra',
michael@0 3070 '<div dir=rtl style=text-align:start>[foo]</div><p>extra',
michael@0 3071 '<div dir=rtl style=text-align:end>[foo]</div><p>extra',
michael@0 3072
michael@0 3073 // Whitespace nodes
michael@0 3074 '<div style=text-align:center><p>foo</div> <p>[bar]',
michael@0 3075 '<div align=center><p>foo</div> <p>[bar]',
michael@0 3076 '<center><p>foo</center> <p>[bar]',
michael@0 3077 '<p>[foo]</p> <div style=text-align:center><p>bar</div>',
michael@0 3078 '<p>[foo]</p> <div align=center><p>bar</div>',
michael@0 3079 '<p>[foo]</p> <center><p>bar</center>',
michael@0 3080 '<div style=text-align:center><p>foo</div> <p>[bar]</p> <div style=text-align:center><p>baz</div>',
michael@0 3081 '<div align=center><p>foo</div> <p>[bar]</p> <div align=center><p>baz</div>',
michael@0 3082 '<center><p>foo</center> <p>[bar]</p> <center><p>baz</center>',
michael@0 3083 ],
michael@0 3084 //@}
michael@0 3085 justifyfull: [
michael@0 3086 //@{
michael@0 3087 'foo[]bar<p>extra',
michael@0 3088 '<span>foo</span>{}<span>bar</span><p>extra',
michael@0 3089 '<span>foo[</span><span>]bar</span><p>extra',
michael@0 3090 'foo[bar]baz<p>extra',
michael@0 3091 'foo[bar<b>baz]qoz</b>quz<p>extra',
michael@0 3092 '<p>foo[]bar<p>extra',
michael@0 3093 '<p>foo[bar]baz<p>extra',
michael@0 3094 '<h1>foo[bar]baz</h1><p>extra',
michael@0 3095 '<pre>foo[bar]baz</pre><p>extra',
michael@0 3096 '<xmp>foo[bar]baz</xmp><p>extra',
michael@0 3097 '<center><p>[foo]<p>bar</center><p>extra',
michael@0 3098 '<center><p>[foo<p>bar]</center><p>extra',
michael@0 3099
michael@0 3100 '<table><tbody><tr><td>foo<td>b[a]r<td>baz</table><p>extra',
michael@0 3101 '<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3102 '<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3103 '<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3104 '<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3105 '{<table><tr><td>foo<td>bar<td>baz</table>}<p>extra',
michael@0 3106
michael@0 3107 '<table align=justify><tbody><tr><td>foo<td>b[a]r<td>baz</table><p>extra',
michael@0 3108 '<table align=justify><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3109 '<table align=justify><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3110 '<table align=justify><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3111 '<table align=justify data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3112 '{<table align=justify><tr><td>foo<td>bar<td>baz</table>}<p>extra',
michael@0 3113
michael@0 3114 '<table><tbody align=justify><tr><td>foo<td>b[a]r<td>baz</table><p>extra',
michael@0 3115 '<table><tbody align=justify><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3116 '<table><tbody align=justify><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3117 '<table><tbody align=justify data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3118 '<table data-start=0 data-end=1><tbody align=justify><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3119 '{<table><tbody align=justify><tr><td>foo<td>bar<td>baz</table>}<p>extra',
michael@0 3120
michael@0 3121 '<table><tbody><tr align=justify><td>foo<td>b[a]r<td>baz</table><p>extra',
michael@0 3122 '<table><tbody><tr align=justify data-start=1 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3123 '<table><tbody><tr align=justify data-start=0 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3124 '<table><tbody data-start=0 data-end=1><tr align=justify><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3125 '<table data-start=0 data-end=1><tbody><tr align=justify><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3126 '{<table><tr align=justify><td>foo<td>bar<td>baz</table>}<p>extra',
michael@0 3127
michael@0 3128 '<div align=center><p>[foo]<p>bar</div><p>extra',
michael@0 3129 '<div align=center><p>[foo<p>bar}</div><p>extra',
michael@0 3130 '<div style=text-align:center><p>[foo]<p>bar</div><p>extra',
michael@0 3131 '<div style=text-align:center><p>[foo<p>bar]</div><p>extra',
michael@0 3132
michael@0 3133 '<div align=justify><p>[foo]<p>bar</div><p>extra',
michael@0 3134 '<div align=justify><p>[foo<p>bar}</div><p>extra',
michael@0 3135 '<div style=text-align:justify><p>[foo]<p>bar</div><p>extra',
michael@0 3136 '<div style=text-align:justify><p>[foo<p>bar]</div><p>extra',
michael@0 3137
michael@0 3138 '<div align=left><p>[foo]<p>bar</div><p>extra',
michael@0 3139 '<div align=left><p>[foo<p>bar}</div><p>extra',
michael@0 3140 '<div style=text-align:left><p>[foo]<p>bar</div><p>extra',
michael@0 3141 '<div style=text-align:left><p>[foo<p>bar]</div><p>extra',
michael@0 3142
michael@0 3143 '<div align=right><p>[foo]<p>bar</div><p>extra',
michael@0 3144 '<div align=right><p>[foo<p>bar}</div><p>extra',
michael@0 3145 '<div style=text-align:right><p>[foo]<p>bar</div><p>extra',
michael@0 3146 '<div style=text-align:right><p>[foo<p>bar]</div><p>extra',
michael@0 3147
michael@0 3148 '<div align=justify>foo</div>[bar]<p>extra',
michael@0 3149 '[foo]<div align=justify>bar</div><p>extra',
michael@0 3150 '<div align=justify>foo</div>[bar]<div align=justify>baz</div><p>extra',
michael@0 3151 '<div align=justify><p>foo</div><p>[bar]<p>extra',
michael@0 3152 '<p>[foo]<div align=justify><p>bar</div><p>extra',
michael@0 3153 '<div align=justify><p>foo</div><p>[bar]<div align=justify><p>baz</div><p>extra',
michael@0 3154 '<div style=text-align:justify>foo</div>[bar]<p>extra',
michael@0 3155 '[foo]<div style=text-align:justify>bar</div><p>extra',
michael@0 3156 '<div style=text-align:justify>foo</div>[bar]<div style=text-align:justify>baz</div><p>extra',
michael@0 3157 '<div style=text-align:justify><p>foo</div><p>[bar]<p>extra',
michael@0 3158 '<p>[foo]<div style=text-align:justify><p>bar</div><p>extra',
michael@0 3159 '<div style=text-align:justify><p>foo</div><p>[bar]<div style=text-align:justify><p>baz</div><p>extra',
michael@0 3160 '<p align=justify>foo<p>[bar]<p>extra',
michael@0 3161 '<p>[foo]<p align=justify>bar<p>extra',
michael@0 3162 '<p align=justify>foo<p>[bar]<p align=justify>baz<p>extra',
michael@0 3163
michael@0 3164 '<div align=justify>[foo</div>bar]<p>extra',
michael@0 3165 '<div align=justify>fo[o</div>b]ar<p>extra',
michael@0 3166 '<div style=text-align:justify>[foo</div>bar]<p>extra',
michael@0 3167 '<div style=text-align:justify>fo[o</div>b]ar<p>extra',
michael@0 3168 '<span style=text-align:justify>[foo]</span><p>extra',
michael@0 3169 '<span style=text-align:justify>f[o]o</span><p>extra',
michael@0 3170
michael@0 3171 '<div style=text-align:justify>[foo<div style=text-align:left contenteditable=false>bar</div>baz]</div><p>extra',
michael@0 3172
michael@0 3173 '<div align=nonsense><p>[foo]</div><p>extra',
michael@0 3174 '<div style=text-align:inherit><p>[foo]</div><p>extra',
michael@0 3175 '<quasit align=center><p>[foo]</p></quasit><p>extra',
michael@0 3176
michael@0 3177 '<div style=text-align:start>[foo]</div><p>extra',
michael@0 3178 '<div style=text-align:end>[foo]</div><p>extra',
michael@0 3179 '<div dir=rtl style=text-align:start>[foo]</div><p>extra',
michael@0 3180 '<div dir=rtl style=text-align:end>[foo]</div><p>extra',
michael@0 3181
michael@0 3182 // Whitespace nodes
michael@0 3183 '<div style=text-align:justify><p>foo</div> <p>[bar]',
michael@0 3184 '<div align=justify><p>foo</div> <p>[bar]',
michael@0 3185 '<p>[foo]</p> <div style=text-align:justify><p>bar</div>',
michael@0 3186 '<p>[foo]</p> <div align=justify><p>bar</div>',
michael@0 3187 '<div style=text-align:justify><p>foo</div> <p>[bar]</p> <div style=text-align:justify><p>baz</div>',
michael@0 3188 '<div align=justify><p>foo</div> <p>[bar]</p> <div align=justify><p>baz</div>',
michael@0 3189 ],
michael@0 3190 //@}
michael@0 3191 justifyleft: [
michael@0 3192 //@{
michael@0 3193 'foo[]bar<p>extra',
michael@0 3194 '<span>foo</span>{}<span>bar</span><p>extra',
michael@0 3195 '<span>foo[</span><span>]bar</span><p>extra',
michael@0 3196 'foo[bar]baz<p>extra',
michael@0 3197 'foo[bar<b>baz]qoz</b>quz<p>extra',
michael@0 3198 '<p>foo[]bar<p>extra',
michael@0 3199 '<p>foo[bar]baz<p>extra',
michael@0 3200 '<h1>foo[bar]baz</h1><p>extra',
michael@0 3201 '<pre>foo[bar]baz</pre><p>extra',
michael@0 3202 '<xmp>foo[bar]baz</xmp><p>extra',
michael@0 3203 '<center><p>[foo]<p>bar</center><p>extra',
michael@0 3204 '<center><p>[foo<p>bar]</center><p>extra',
michael@0 3205
michael@0 3206 '<table><tbody><tr><td>foo<td>b[a]r<td>baz</table><p>extra',
michael@0 3207 '<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3208 '<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3209 '<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3210 '<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3211 '{<table><tr><td>foo<td>bar<td>baz</table>}<p>extra',
michael@0 3212
michael@0 3213 '<table align=left><tbody><tr><td>foo<td>b[a]r<td>baz</table><p>extra',
michael@0 3214 '<table align=left><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3215 '<table align=left><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3216 '<table align=left><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3217 '<table align=left data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3218 '{<table align=left><tr><td>foo<td>bar<td>baz</table>}<p>extra',
michael@0 3219
michael@0 3220 '<table><tbody align=left><tr><td>foo<td>b[a]r<td>baz</table><p>extra',
michael@0 3221 '<table><tbody align=left><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3222 '<table><tbody align=left><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3223 '<table><tbody align=left data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3224 '<table data-start=0 data-end=1><tbody align=left><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3225 '{<table><tbody align=left><tr><td>foo<td>bar<td>baz</table>}<p>extra',
michael@0 3226
michael@0 3227 '<table><tbody><tr align=left><td>foo<td>b[a]r<td>baz</table><p>extra',
michael@0 3228 '<table><tbody><tr align=left data-start=1 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3229 '<table><tbody><tr align=left data-start=0 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3230 '<table><tbody data-start=0 data-end=1><tr align=left><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3231 '<table data-start=0 data-end=1><tbody><tr align=left><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3232 '{<table><tr align=left><td>foo<td>bar<td>baz</table>}<p>extra',
michael@0 3233
michael@0 3234 '<div align=center><p>[foo]<p>bar</div><p>extra',
michael@0 3235 '<div align=center><p>[foo<p>bar}</div><p>extra',
michael@0 3236 '<div style=text-align:center><p>[foo]<p>bar</div><p>extra',
michael@0 3237 '<div style=text-align:center><p>[foo<p>bar]</div><p>extra',
michael@0 3238
michael@0 3239 '<div align=justify><p>[foo]<p>bar</div><p>extra',
michael@0 3240 '<div align=justify><p>[foo<p>bar}</div><p>extra',
michael@0 3241 '<div style=text-align:justify><p>[foo]<p>bar</div><p>extra',
michael@0 3242 '<div style=text-align:justify><p>[foo<p>bar]</div><p>extra',
michael@0 3243
michael@0 3244 '<div align=left><p>[foo]<p>bar</div><p>extra',
michael@0 3245 '<div align=left><p>[foo<p>bar}</div><p>extra',
michael@0 3246 '<div style=text-align:left><p>[foo]<p>bar</div><p>extra',
michael@0 3247 '<div style=text-align:left><p>[foo<p>bar]</div><p>extra',
michael@0 3248
michael@0 3249 '<div align=right><p>[foo]<p>bar</div><p>extra',
michael@0 3250 '<div align=right><p>[foo<p>bar}</div><p>extra',
michael@0 3251 '<div style=text-align:right><p>[foo]<p>bar</div><p>extra',
michael@0 3252 '<div style=text-align:right><p>[foo<p>bar]</div><p>extra',
michael@0 3253
michael@0 3254 '<div align=left>foo</div>[bar]<p>extra',
michael@0 3255 '[foo]<div align=left>bar</div><p>extra',
michael@0 3256 '<div align=left>foo</div>[bar]<div align=left>baz</div><p>extra',
michael@0 3257 '<div align=left><p>foo</div><p>[bar]<p>extra',
michael@0 3258 '<p>[foo]<div align=left><p>bar</div><p>extra',
michael@0 3259 '<div align=left><p>foo</div><p>[bar]<div align=left><p>baz</div><p>extra',
michael@0 3260 '<div style=text-align:left>foo</div>[bar]<p>extra',
michael@0 3261 '[foo]<div style=text-align:left>bar</div><p>extra',
michael@0 3262 '<div style=text-align:left>foo</div>[bar]<div style=text-align:left>baz</div><p>extra',
michael@0 3263 '<div style=text-align:left><p>foo</div><p>[bar]<p>extra',
michael@0 3264 '<p>[foo]<div style=text-align:left><p>bar</div><p>extra',
michael@0 3265 '<div style=text-align:left><p>foo</div><p>[bar]<div style=text-align:left><p>baz</div><p>extra',
michael@0 3266 '<p align=left>foo<p>[bar]<p>extra',
michael@0 3267 '<p>[foo]<p align=left>bar<p>extra',
michael@0 3268 '<p align=left>foo<p>[bar]<p align=left>baz<p>extra',
michael@0 3269
michael@0 3270 '<div align=left>[foo</div>bar]<p>extra',
michael@0 3271 '<div align=left>fo[o</div>b]ar<p>extra',
michael@0 3272 '<div style=text-align:left>[foo</div>bar]<p>extra',
michael@0 3273 '<div style=text-align:left>fo[o</div>b]ar<p>extra',
michael@0 3274 '<span style=text-align:left>[foo]</span><p>extra',
michael@0 3275 '<span style=text-align:left>f[o]o</span><p>extra',
michael@0 3276
michael@0 3277 '<div style=text-align:left>[foo<div style=text-align:left contenteditable=false>bar</div>baz]</div><p>extra',
michael@0 3278
michael@0 3279 '<div align=nonsense><p>[foo]</div><p>extra',
michael@0 3280 '<div style=text-align:inherit><p>[foo]</div><p>extra',
michael@0 3281 '<quasit align=center><p>[foo]</p></quasit><p>extra',
michael@0 3282
michael@0 3283 '<div style=text-align:start>[foo]</div><p>extra',
michael@0 3284 '<div style=text-align:end>[foo]</div><p>extra',
michael@0 3285 '<div dir=rtl style=text-align:start>[foo]</div><p>extra',
michael@0 3286 '<div dir=rtl style=text-align:end>[foo]</div><p>extra',
michael@0 3287
michael@0 3288 // Whitespace nodes
michael@0 3289 '<div style=text-align:left><p>foo</div> <p>[bar]',
michael@0 3290 '<div align=left><p>foo</div> <p>[bar]',
michael@0 3291 '<p>[foo]</p> <div style=text-align:left><p>bar</div>',
michael@0 3292 '<p>[foo]</p> <div align=left><p>bar</div>',
michael@0 3293 '<div style=text-align:left><p>foo</div> <p>[bar]</p> <div style=text-align:left><p>baz</div>',
michael@0 3294 '<div align=left><p>foo</div> <p>[bar]</p> <div align=left><p>baz</div>',
michael@0 3295 ],
michael@0 3296 //@}
michael@0 3297 justifyright: [
michael@0 3298 //@{
michael@0 3299 'foo[]bar<p>extra',
michael@0 3300 '<span>foo</span>{}<span>bar</span><p>extra',
michael@0 3301 '<span>foo[</span><span>]bar</span><p>extra',
michael@0 3302 'foo[bar]baz<p>extra',
michael@0 3303 'foo[bar<b>baz]qoz</b>quz<p>extra',
michael@0 3304 '<p>foo[]bar<p>extra',
michael@0 3305 '<p>foo[bar]baz<p>extra',
michael@0 3306 '<h1>foo[bar]baz</h1><p>extra',
michael@0 3307 '<pre>foo[bar]baz</pre><p>extra',
michael@0 3308 '<xmp>foo[bar]baz</xmp><p>extra',
michael@0 3309 '<center><p>[foo]<p>bar</center><p>extra',
michael@0 3310 '<center><p>[foo<p>bar]</center><p>extra',
michael@0 3311
michael@0 3312 '<table><tbody><tr><td>foo<td>b[a]r<td>baz</table><p>extra',
michael@0 3313 '<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3314 '<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3315 '<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3316 '<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3317 '{<table><tr><td>foo<td>bar<td>baz</table>}<p>extra',
michael@0 3318
michael@0 3319 '<table align=right><tbody><tr><td>foo<td>b[a]r<td>baz</table><p>extra',
michael@0 3320 '<table align=right><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3321 '<table align=right><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3322 '<table align=right><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3323 '<table align=right data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3324 '{<table align=right><tr><td>foo<td>bar<td>baz</table>}<p>extra',
michael@0 3325
michael@0 3326 '<table><tbody align=right><tr><td>foo<td>b[a]r<td>baz</table><p>extra',
michael@0 3327 '<table><tbody align=right><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3328 '<table><tbody align=right><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3329 '<table><tbody align=right data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3330 '<table data-start=0 data-end=1><tbody align=right><tr><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3331 '{<table><tbody align=right><tr><td>foo<td>bar<td>baz</table>}<p>extra',
michael@0 3332
michael@0 3333 '<table><tbody><tr align=right><td>foo<td>b[a]r<td>baz</table><p>extra',
michael@0 3334 '<table><tbody><tr align=right data-start=1 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3335 '<table><tbody><tr align=right data-start=0 data-end=2><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3336 '<table><tbody data-start=0 data-end=1><tr align=right><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3337 '<table data-start=0 data-end=1><tbody><tr align=right><td>foo<td>bar<td>baz</table><p>extra',
michael@0 3338 '{<table><tr align=right><td>foo<td>bar<td>baz</table>}<p>extra',
michael@0 3339
michael@0 3340 '<div align=center><p>[foo]<p>bar</div><p>extra',
michael@0 3341 '<div align=center><p>[foo<p>bar}</div><p>extra',
michael@0 3342 '<div style=text-align:center><p>[foo]<p>bar</div><p>extra',
michael@0 3343 '<div style=text-align:center><p>[foo<p>bar]</div><p>extra',
michael@0 3344
michael@0 3345 '<div align=justify><p>[foo]<p>bar</div><p>extra',
michael@0 3346 '<div align=justify><p>[foo<p>bar}</div><p>extra',
michael@0 3347 '<div style=text-align:justify><p>[foo]<p>bar</div><p>extra',
michael@0 3348 '<div style=text-align:justify><p>[foo<p>bar]</div><p>extra',
michael@0 3349
michael@0 3350 '<div align=left><p>[foo]<p>bar</div><p>extra',
michael@0 3351 '<div align=left><p>[foo<p>bar}</div><p>extra',
michael@0 3352 '<div style=text-align:left><p>[foo]<p>bar</div><p>extra',
michael@0 3353 '<div style=text-align:left><p>[foo<p>bar]</div><p>extra',
michael@0 3354
michael@0 3355 '<div align=right><p>[foo]<p>bar</div><p>extra',
michael@0 3356 '<div align=right><p>[foo<p>bar}</div><p>extra',
michael@0 3357 '<div style=text-align:right><p>[foo]<p>bar</div><p>extra',
michael@0 3358 '<div style=text-align:right><p>[foo<p>bar]</div><p>extra',
michael@0 3359
michael@0 3360 '<div align=right>foo</div>[bar]<p>extra',
michael@0 3361 '[foo]<div align=right>bar</div><p>extra',
michael@0 3362 '<div align=right>foo</div>[bar]<div align=right>baz</div><p>extra',
michael@0 3363 '<div align=right><p>foo</div><p>[bar]<p>extra',
michael@0 3364 '<p>[foo]<div align=right><p>bar</div><p>extra',
michael@0 3365 '<div align=right><p>foo</div><p>[bar]<div align=right><p>baz</div><p>extra',
michael@0 3366 '<div style=text-align:right>foo</div>[bar]<p>extra',
michael@0 3367 '[foo]<div style=text-align:right>bar</div><p>extra',
michael@0 3368 '<div style=text-align:right>foo</div>[bar]<div style=text-align:right>baz</div><p>extra',
michael@0 3369 '<div style=text-align:right><p>foo</div><p>[bar]<p>extra',
michael@0 3370 '<p>[foo]<div style=text-align:right><p>bar</div><p>extra',
michael@0 3371 '<div style=text-align:right><p>foo</div><p>[bar]<div style=text-align:right><p>baz</div><p>extra',
michael@0 3372 '<p align=right>foo<p>[bar]<p>extra',
michael@0 3373 '<p>[foo]<p align=right>bar<p>extra',
michael@0 3374 '<p align=right>foo<p>[bar]<p align=right>baz<p>extra',
michael@0 3375
michael@0 3376 '<div align=right>[foo</div>bar]<p>extra',
michael@0 3377 '<div align=right>fo[o</div>b]ar<p>extra',
michael@0 3378 '<div style=text-align:right>[foo</div>bar]<p>extra',
michael@0 3379 '<div style=text-align:right>fo[o</div>b]ar<p>extra',
michael@0 3380 '<span style=text-align:right>[foo]</span><p>extra',
michael@0 3381 '<span style=text-align:right>f[o]o</span><p>extra',
michael@0 3382
michael@0 3383 '<div style=text-align:right>[foo<div style=text-align:left contenteditable=false>bar</div>baz]</div><p>extra',
michael@0 3384
michael@0 3385 '<div align=nonsense><p>[foo]</div><p>extra',
michael@0 3386 '<div style=text-align:inherit><p>[foo]</div><p>extra',
michael@0 3387 '<quasit align=center><p>[foo]</p></quasit><p>extra',
michael@0 3388
michael@0 3389 '<div style=text-align:start>[foo]</div><p>extra',
michael@0 3390 '<div style=text-align:end>[foo]</div><p>extra',
michael@0 3391 '<div dir=rtl style=text-align:start>[foo]</div><p>extra',
michael@0 3392 '<div dir=rtl style=text-align:end>[foo]</div><p>extra',
michael@0 3393
michael@0 3394 // Whitespace nodes
michael@0 3395 '<div style=text-align:right><p>foo</div> <p>[bar]',
michael@0 3396 '<div align=right><p>foo</div> <p>[bar]',
michael@0 3397 '<p>[foo]</p> <div style=text-align:right><p>bar</div>',
michael@0 3398 '<p>[foo]</p> <div align=right><p>bar</div>',
michael@0 3399 '<div style=text-align:right><p>foo</div> <p>[bar]</p> <div style=text-align:right><p>baz</div>',
michael@0 3400 '<div align=right><p>foo</div> <p>[bar]</p> <div align=right><p>baz</div>',
michael@0 3401 ],
michael@0 3402 //@}
michael@0 3403 outdent: [
michael@0 3404 //@{
michael@0 3405 // These mimic existing indentation in various browsers, to see how
michael@0 3406 // they cope with outdenting various things. This is spec, Gecko
michael@0 3407 // non-CSS, and Opera:
michael@0 3408 '<blockquote><p>foo[bar]</p><p>baz</p></blockquote><p>extra',
michael@0 3409 '<blockquote><p>foo[bar</p><p>b]az</p></blockquote><p>extra',
michael@0 3410 '<blockquote><p>foo[bar]</p></blockquote><p>baz</p><p>extra',
michael@0 3411 '<blockquote><p>foo[bar</p></blockquote><p>b]az</p><p>extra',
michael@0 3412
michael@0 3413 // IE:
michael@0 3414 '<blockquote style="margin-right: 0px;" dir="ltr"><p>foo[bar]</p><p>baz</p></blockquote><p>extra',
michael@0 3415 '<blockquote style="margin-right: 0px;" dir="ltr"><p>foo[bar</p><p>b]az</p></blockquote><p>extra',
michael@0 3416 '<blockquote style="margin-right: 0px;" dir="ltr"><p>foo[bar]</p></blockquote><p>baz</p><p>extra',
michael@0 3417 '<blockquote style="margin-right: 0px;" dir="ltr"><p>foo[bar</p></blockquote><p>b]az</p><p>extra',
michael@0 3418
michael@0 3419 // Firefox CSS mode:
michael@0 3420 '<p style="margin-left: 40px">foo[bar]</p><p style="margin-left: 40px">baz</p><p>extra',
michael@0 3421 '<p style="margin-left: 40px">foo[bar</p><p style="margin-left: 40px">b]az</p><p>extra',
michael@0 3422 '<p style="margin-left: 40px">foo[bar]</p><p>baz</p><p>extra',
michael@0 3423 '<p style="margin-left: 40px">foo[bar</p><p>b]az</p><p>extra',
michael@0 3424
michael@0 3425 // WebKit:
michael@0 3426 '<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><p>foo[bar]</p><p>baz</p></blockquote><p>extra',
michael@0 3427 '<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><p>foo[bar</p><p>b]az</p></blockquote><p>extra',
michael@0 3428 '<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><p>foo[bar]</p></blockquote><p>baz</p><p>extra',
michael@0 3429 '<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><p>foo[bar</p></blockquote><p>b]az</p><p>extra',
michael@0 3430
michael@0 3431 // Now let's try nesting lots of stuff and see what happens.
michael@0 3432 '<blockquote><blockquote>foo[bar]baz</blockquote></blockquote>',
michael@0 3433 '<blockquote><blockquote data-abc=def>foo[bar]baz</blockquote></blockquote>',
michael@0 3434 '<blockquote data-abc=def><blockquote>foo[bar]baz</blockquote></blockquote>',
michael@0 3435 '<blockquote><div>foo[bar]baz</div></blockquote>',
michael@0 3436 '<blockquote><div id=abc>foo[bar]baz</div></blockquote>',
michael@0 3437 '<blockquote id=abc>foo[bar]baz</blockquote>',
michael@0 3438 '<blockquote style="color: blue">foo[bar]baz</blockquote>',
michael@0 3439
michael@0 3440 '<blockquote><blockquote><p>foo[bar]<p>baz</blockquote></blockquote>',
michael@0 3441 '<blockquote><blockquote data-abc=def><p>foo[bar]<p>baz</blockquote></blockquote>',
michael@0 3442 '<blockquote data-abc=def><blockquote><p>foo[bar]<p>baz</blockquote></blockquote>',
michael@0 3443 '<blockquote><div><p>foo[bar]<p>baz</div></blockquote>',
michael@0 3444 '<blockquote><div id=abc><p>foo[bar]<p>baz</div></blockquote>',
michael@0 3445 '<blockquote id=abc><p>foo[bar]<p>baz</blockquote>',
michael@0 3446 '<blockquote style="color: blue"><p>foo[bar]<p>baz</blockquote>',
michael@0 3447
michael@0 3448 '<blockquote><p><b>foo[bar]</b><p>baz</blockquote>',
michael@0 3449 '<blockquote><p><strong>foo[bar]</strong><p>baz</blockquote>',
michael@0 3450 '<blockquote><p><span>foo[bar]</span><p>baz</blockquote>',
michael@0 3451 '<blockquote><blockquote style="color: blue"><p>foo[bar]</blockquote><p>baz</blockquote>',
michael@0 3452 '<blockquote style="color: blue"><blockquote><p>foo[bar]</blockquote><p>baz</blockquote>',
michael@0 3453
michael@0 3454 // Lists!
michael@0 3455 '<ol><li>foo<li>[bar]<li>baz</ol>',
michael@0 3456 '<ol data-start=1 data-end=2><li>foo<li>bar<li>baz</ol>',
michael@0 3457 '<ol><li>foo</ol>[bar]',
michael@0 3458 '<ol><li>[foo]<br>bar<li>baz</ol>',
michael@0 3459 '<ol><li>foo<br>[bar]<li>baz</ol>',
michael@0 3460 '<ol><li><div>[foo]</div>bar<li>baz</ol>',
michael@0 3461 '<ol><li>foo<ol><li>[bar]<li>baz</ol><li>quz</ol>',
michael@0 3462 '<ol><li>foo<ol><li>bar<li>[baz]</ol><li>quz</ol>',
michael@0 3463 '<ol><li>foo</li><ol><li>[bar]<li>baz</ol><li>quz</ol>',
michael@0 3464 '<ol><li>foo</li><ol data-start=0 data-end=1><li>bar<li>baz</ol><li>quz</ol>',
michael@0 3465 '<ol><li>foo</li><ol><li>bar<li>[baz]</ol><li>quz</ol>',
michael@0 3466 '<ol><li>foo</li><ol data-start=1 data-end=2><li>bar<li>baz</ol><li>quz</ol>',
michael@0 3467 '<ol><li>foo<ol><li>b[a]r</ol><li>baz</ol>',
michael@0 3468 '<ol><li>foo</li><ol><li>b[a]r</ol><li>baz</ol>',
michael@0 3469 '<ol><li>foo{<ol><li>bar</ol>}<li>baz</ol>',
michael@0 3470 '<ol><li>foo</li>{<ol><li>bar</ol>}<li>baz</ol>',
michael@0 3471 '<ol><li>[foo]<ol><li>bar</ol><li>baz</ol>',
michael@0 3472 '<ol><li>[foo]</li><ol><li>bar</ol><li>baz</ol>',
michael@0 3473 '<ol><li>foo<li>[bar]<ol><li>baz</ol><li>quz</ol>',
michael@0 3474 '<ol><li>foo<li>[bar]</li><ol><li>baz</ol><li>quz</ol>',
michael@0 3475 '<ol><li>foo<ol><li>bar<li>baz</ol><li>[quz]</ol>',
michael@0 3476 '<ol><li>foo</li><ol><li>bar<li>baz</ol><li>[quz]</ol>',
michael@0 3477
michael@0 3478 // Try outdenting multiple items at once.
michael@0 3479 '<ol><li>foo<li>b[ar<li>baz]</ol>',
michael@0 3480 '<ol><li>[foo<ol><li>bar]</ol><li>baz</ol>',
michael@0 3481 '<ol><li>[foo</li><ol><li>bar]</ol><li>baz</ol>',
michael@0 3482 '<ol><li>foo<ol><li>b[ar</ol><li>b]az</ol>',
michael@0 3483 '<ol><li>foo</li><ol><li>b[ar</ol><li>b]az</ol>',
michael@0 3484 '<ol><li>[foo<ol><li>bar</ol><li>baz]</ol><p>extra',
michael@0 3485 '<ol><li>[foo</li><ol><li>bar</ol><li>baz]</ol><p>extra',
michael@0 3486
michael@0 3487 // We probably can't actually get this DOM . . .
michael@0 3488 '<ol><li>[foo]<ol><li>bar</ol>baz</ol>',
michael@0 3489 '<ol><li>foo<ol><li>[bar]</ol>baz</ol>',
michael@0 3490 '<ol><li>foo<ol><li>bar</ol>[baz]</ol>',
michael@0 3491 '<ol><li>[foo<ol><li>bar]</ol>baz</ol>',
michael@0 3492
michael@0 3493 // Attribute handling on lists
michael@0 3494 'foo<ol start=5><li>[bar]</ol>baz',
michael@0 3495 'foo<ol id=abc><li>[bar]</ol>baz',
michael@0 3496 'foo<ol style=color:blue><li>[bar]</ol>baz',
michael@0 3497 'foo<ol><li value=5>[bar]</ol>baz',
michael@0 3498 'foo<ol><li id=abc>[bar]</ol>baz',
michael@0 3499 'foo<ol><li style=color:blue>[bar]</ol>baz',
michael@0 3500 '<ol><li>foo</li><ol><li value=5>[bar]</ol></ol>',
michael@0 3501 '<ul><li>foo</li><ol><li value=5>[bar]</ol></ul>',
michael@0 3502 '<ol><li>foo</li><ol start=5><li>[bar]</ol><li>baz</ol>',
michael@0 3503 '<ol><li>foo</li><ol id=abc><li>[bar]</ol><li>baz</ol>',
michael@0 3504 '<ol><li>foo</li><ol style=color:blue><li>[bar]</ol><li>baz</ol>',
michael@0 3505 '<ol><li>foo</li><ol style=text-indent:1em><li>[bar]</ol><li>baz</ol>',
michael@0 3506 '<ol><li>foo</li><ol start=5><li>[bar<li>baz]</ol><li>quz</ol>',
michael@0 3507 '<ol><li>foo</li><ol id=abc><li>[bar<li>baz]</ol><li>quz</ol>',
michael@0 3508 '<ol><li>foo</li><ol style=color:blue><li>[bar<li>baz]</ol><li>quz</ol>',
michael@0 3509 '<ol><li>foo</li><ol style=text-indent:1em><li>[bar<li>baz]</ol><li>quz</ol>',
michael@0 3510
michael@0 3511 // List inside indentation element
michael@0 3512 '<blockquote><ol><li>[foo]</ol></blockquote><p>extra',
michael@0 3513 '<blockquote>foo<ol><li>[bar]</ol>baz</blockquote><p>extra',
michael@0 3514 '<blockquote><ol><li>foo</li><ol><li>[bar]</ol><li>baz</ol></blockquote><p>extra',
michael@0 3515
michael@0 3516 '<ol><li><h1>[foo]</h1></ol>',
michael@0 3517 '<ol><li><xmp>[foo]</xmp></li></ol>',
michael@0 3518 '<blockquote><ol><li>foo<div><ol><li>[bar]</ol></div><li>baz</ol></blockquote>',
michael@0 3519
michael@0 3520 // Whitespace nodes
michael@0 3521 '<blockquote> <p>[foo]</p></blockquote>',
michael@0 3522 '<blockquote><p>[foo]</p> </blockquote>',
michael@0 3523 '<blockquote> <p>[foo]</p> </blockquote>',
michael@0 3524 '<ol> <li>[foo]</li></ol>',
michael@0 3525 '<ol><li>[foo]</li> </ol>',
michael@0 3526 '<ol> <li>[foo]</li> </ol>',
michael@0 3527 '<ul> <li>[foo]</li></ul>',
michael@0 3528 '<ul><li>[foo]</li> </ul>',
michael@0 3529 '<ul> <li>[foo]</li> </ul>',
michael@0 3530 '<blockquote> <p>[foo]</p> <p>bar</p> <p>baz</p></blockquote>',
michael@0 3531 '<blockquote> <p>foo</p> <p>[bar]</p> <p>baz</p></blockquote>',
michael@0 3532 '<blockquote> <p>foo</p> <p>bar</p> <p>[baz]</p></blockquote>',
michael@0 3533 '<ol> <li>[foo]</li> <li>bar</li> <li>baz</li></ol>',
michael@0 3534 '<ol> <li>foo</li> <li>[bar]</li> <li>baz</li></ol>',
michael@0 3535 '<ol> <li>foo</li> <li>bar</li> <li>[baz]</li></ol>',
michael@0 3536 '<ul> <li>[foo]</li> <li>bar</li> <li>baz</li></ul>',
michael@0 3537 '<ul> <li>foo</li> <li>[bar]</li> <li>baz</li></ul>',
michael@0 3538 '<ul> <li>foo</li> <li>bar</li> <li>[baz]</li></ul>',
michael@0 3539
michael@0 3540 // https://bugs.webkit.org/show_bug.cgi?id=24249
michael@0 3541 '<ol><li>[]a<table><tr><td><br></table></ol>',
michael@0 3542 // https://bugs.webkit.org/show_bug.cgi?id=43447
michael@0 3543 '<blockquote><span>foo<br>[bar]</span></blockquote>',
michael@0 3544 ],
michael@0 3545 //@}
michael@0 3546 removeformat: [
michael@0 3547 //@{
michael@0 3548 'foo[]bar',
michael@0 3549 '<span>foo</span>{}<span>bar</span>',
michael@0 3550 '<span>foo[</span><span>]bar</span>',
michael@0 3551 '[foo<b>bar</b>baz]',
michael@0 3552 'foo[<b>bar</b>baz]',
michael@0 3553 'foo[<b>bar</b>]baz',
michael@0 3554 'foo<b>[bar]</b>baz',
michael@0 3555 'foo<b>b[a]r</b>baz',
michael@0 3556 '[foo<strong>bar</strong>baz]',
michael@0 3557 '[foo<span style="font-weight: bold">bar</span>baz]',
michael@0 3558 'foo<span style="font-weight: bold">b[a]r</span>baz',
michael@0 3559 '[foo<span style="font-variant: small-caps">bar</span>baz]',
michael@0 3560 'foo<span style="font-variant: small-caps">b[a]r</span>baz',
michael@0 3561 '[foo<b id=foo>bar</b>baz]',
michael@0 3562 'foo<b id=foo>b[a]r</b>baz',
michael@0 3563
michael@0 3564 // HTML has lots of inline elements, doesn't it?
michael@0 3565 '[foo<a>bar</a>baz]',
michael@0 3566 'foo<a>b[a]r</a>baz',
michael@0 3567 '[foo<a href=foo>bar</a>baz]',
michael@0 3568 'foo<a href=foo>b[a]r</a>baz',
michael@0 3569 '[foo<abbr>bar</abbr>baz]',
michael@0 3570 'foo<abbr>b[a]r</abbr>baz',
michael@0 3571 '[foo<acronym>bar</acronym>baz]',
michael@0 3572 'foo<acronym>b[a]r</acronym>baz',
michael@0 3573 '[foo<b>bar</b>baz]',
michael@0 3574 'foo<b>b[a]r</b>baz',
michael@0 3575 '[foo<bdi dir=rtl>bar</bdi>baz]',
michael@0 3576 'foo<bdi dir=rtl>b[a]r</bdi>baz',
michael@0 3577 '[foo<bdo dir=rtl>bar</bdo>baz]',
michael@0 3578 'foo<bdo dir=rtl>b[a]r</bdo>baz',
michael@0 3579 '[foo<big>bar</big>baz]',
michael@0 3580 'foo<big>b[a]r</big>baz',
michael@0 3581 '[foo<blink>bar</blink>baz]',
michael@0 3582 'foo<blink>b[a]r</blink>baz',
michael@0 3583 '[foo<cite>bar</cite>baz]',
michael@0 3584 'foo<cite>b[a]r</cite>baz',
michael@0 3585 '[foo<code>bar</code>baz]',
michael@0 3586 'foo<code>b[a]r</code>baz',
michael@0 3587 '[foo<del>bar</del>baz]',
michael@0 3588 'foo<del>b[a]r</del>baz',
michael@0 3589 '[foo<dfn>bar</dfn>baz]',
michael@0 3590 'foo<dfn>b[a]r</dfn>baz',
michael@0 3591 '[foo<em>bar</em>baz]',
michael@0 3592 'foo<em>b[a]r</em>baz',
michael@0 3593 '[foo<font>bar</font>baz]',
michael@0 3594 'foo<font>b[a]r</font>baz',
michael@0 3595 '[foo<font color=blue>bar</font>baz]',
michael@0 3596 'foo<font color=blue>b[a]r</font>baz',
michael@0 3597 '[foo<i>bar</i>baz]',
michael@0 3598 'foo<i>b[a]r</i>baz',
michael@0 3599 '[foo<ins>bar</ins>baz]',
michael@0 3600 'foo<ins>b[a]r</ins>baz',
michael@0 3601 '[foo<kbd>bar</kbd>baz]',
michael@0 3602 'foo<kbd>b[a]r</kbd>baz',
michael@0 3603 '[foo<mark>bar</mark>baz]',
michael@0 3604 'foo<mark>b[a]r</mark>baz',
michael@0 3605 '[foo<nobr>bar</nobr>baz]',
michael@0 3606 'foo<nobr>b[a]r</nobr>baz',
michael@0 3607 '[foo<q>bar</q>baz]',
michael@0 3608 'foo<q>b[a]r</q>baz',
michael@0 3609 '[foo<samp>bar</samp>baz]',
michael@0 3610 'foo<samp>b[a]r</samp>baz',
michael@0 3611 '[foo<s>bar</s>baz]',
michael@0 3612 'foo<s>b[a]r</s>baz',
michael@0 3613 '[foo<small>bar</small>baz]',
michael@0 3614 'foo<small>b[a]r</small>baz',
michael@0 3615 '[foo<span>bar</span>baz]',
michael@0 3616 'foo<span>b[a]r</span>baz',
michael@0 3617 '[foo<strike>bar</strike>baz]',
michael@0 3618 'foo<strike>b[a]r</strike>baz',
michael@0 3619 '[foo<strong>bar</strong>baz]',
michael@0 3620 'foo<strong>b[a]r</strong>baz',
michael@0 3621 '[foo<sub>bar</sub>baz]',
michael@0 3622 'foo<sub>b[a]r</sub>baz',
michael@0 3623 '[foo<sup>bar</sup>baz]',
michael@0 3624 'foo<sup>b[a]r</sup>baz',
michael@0 3625 '[foo<tt>bar</tt>baz]',
michael@0 3626 'foo<tt>b[a]r</tt>baz',
michael@0 3627 '[foo<u>bar</u>baz]',
michael@0 3628 'foo<u>b[a]r</u>baz',
michael@0 3629 '[foo<var>bar</var>baz]',
michael@0 3630 'foo<var>b[a]r</var>baz',
michael@0 3631
michael@0 3632 // Empty and replaced elements
michael@0 3633 '[foo<br>bar]',
michael@0 3634 '[foo<hr>bar]',
michael@0 3635 '[foo<wbr>bar]',
michael@0 3636 '[foo<img>bar]',
michael@0 3637 '[foo<img src=abc>bar]',
michael@0 3638 '[foo<video></video>bar]',
michael@0 3639 '[foo<video src=abc></video>bar]',
michael@0 3640 '[foo<svg><circle fill=blue r=20 cx=20 cy=20 /></svg>bar]',
michael@0 3641
michael@0 3642 // Unrecognized elements
michael@0 3643 '[foo<nonexistentelement>bar</nonexistentelement>baz]',
michael@0 3644 'foo<nonexistentelement>b[a]r</nonexistentelement>baz',
michael@0 3645 '[foo<nonexistentelement style="display: block">bar</nonexistentelement>baz]',
michael@0 3646 'foo<nonexistentelement style="display: block">b[a]r</nonexistentelement>baz',
michael@0 3647
michael@0 3648 // Random stuff
michael@0 3649 '[foo<span id=foo>bar</span>baz]',
michael@0 3650 'foo<span id=foo>b[a]r</span>baz',
michael@0 3651 '[foo<span class=foo>bar</span>baz]',
michael@0 3652 'foo<span class=foo>b[a]r</span>baz',
michael@0 3653 '[foo<b style="font-weight: normal">bar</b>baz]',
michael@0 3654 'foo<b style="font-weight: normal">b[a]r</b>baz',
michael@0 3655 '<p style="background-color: aqua">foo[bar]baz</p>',
michael@0 3656 '<p><span style="background-color: aqua">foo[bar]baz</span></p>',
michael@0 3657 '<p style="font-weight: bold">foo[bar]baz</p>',
michael@0 3658 '<b><p style="font-weight: bold">foo[bar]baz</p></b>',
michael@0 3659 '<p style="font-variant: small-caps">foo[bar]baz</p>',
michael@0 3660 '{<p style="font-variant: small-caps">foobarbaz</p>}',
michael@0 3661 '<p style="text-indent: 2em">foo[bar]baz</p>',
michael@0 3662 '{<p style="text-indent: 2em">foobarbaz</p>}',
michael@0 3663
michael@0 3664 // https://bugzilla.mozilla.org/show_bug.cgi?id=649138
michael@0 3665 // Chrome 15 dev fails this for some unclear reason.
michael@0 3666 '<table data-start=0 data-end=1><tr><td><b>foo</b></table>',
michael@0 3667 ],
michael@0 3668 //@}
michael@0 3669 strikethrough: [
michael@0 3670 //@{
michael@0 3671 'foo[]bar',
michael@0 3672 '<p>[foo</p> <p>bar]</p>',
michael@0 3673 '<span>[foo</span> <span>bar]</span>',
michael@0 3674 '<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>',
michael@0 3675 '<p>[foo<p><br><p>bar]',
michael@0 3676 '<b>foo[]bar</b>',
michael@0 3677 '<i>foo[]bar</i>',
michael@0 3678 '<span>foo</span>{}<span>bar</span>',
michael@0 3679 '<span>foo[</span><span>]bar</span>',
michael@0 3680 'foo[bar]baz',
michael@0 3681 'foo[bar<b>baz]qoz</b>quz',
michael@0 3682 'foo[bar<i>baz]qoz</i>quz',
michael@0 3683 '{<p><p> <p>foo</p>}',
michael@0 3684
michael@0 3685 '<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>',
michael@0 3686 '<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 3687 '<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 3688 '<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>',
michael@0 3689 '<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>',
michael@0 3690 '{<table><tr><td>foo<td>bar<td>baz</table>}',
michael@0 3691
michael@0 3692 'foo<u>[bar]</u>baz',
michael@0 3693 'foo<span style="text-decoration: underline">[bar]</span>baz',
michael@0 3694 '<u>foo[bar]baz</u>',
michael@0 3695 '<u>foo[b<span style="color:blue">ar]ba</span>z</u>',
michael@0 3696 '<u>foo[b<span style="color:blue" id=foo>ar]ba</span>z</u>',
michael@0 3697 '<u>foo[b<span style="font-size:3em">ar]ba</span>z</u>',
michael@0 3698 '<u>foo[b<i>ar]ba</i>z</u>',
michael@0 3699 '<p style="text-decoration: underline">foo[bar]baz</p>',
michael@0 3700
michael@0 3701 'foo<s>[bar]</s>baz',
michael@0 3702 'foo<span style="text-decoration: line-through">[bar]</span>baz',
michael@0 3703 '<s>foo[bar]baz</s>',
michael@0 3704 '<s>foo[b<span style="color:blue">ar]ba</span>z</s>',
michael@0 3705 '<s>foo[b<span style="color:blue" id=foo>ar]ba</span>z</s>',
michael@0 3706 '<s>foo[b<span style="font-size:3em">ar]ba</span>z</s>',
michael@0 3707 '<s>foo[b<i>ar]ba</i>z</s>',
michael@0 3708 '<p style="text-decoration: line-through">foo[bar]baz</p>',
michael@0 3709
michael@0 3710 'foo<strike>[bar]</strike>baz',
michael@0 3711 '<strike>foo[bar]baz</strike>',
michael@0 3712 '<strike>foo[b<span style="color:blue">ar]ba</span>z</strike>',
michael@0 3713 '<strike>foo[b<span style="color:blue" id=foo>ar]ba</span>z</strike>',
michael@0 3714 '<strike>foo[b<span style="font-size:3em">ar]ba</span>z</strike>',
michael@0 3715 '<strike>foo[b<i>ar]ba</i>z</strike>',
michael@0 3716
michael@0 3717 'foo<ins>[bar]</ins>baz',
michael@0 3718 '<ins>foo[bar]baz</ins>',
michael@0 3719 '<ins>foo[b<span style="color:blue">ar]ba</span>z</ins>',
michael@0 3720 '<ins>foo[b<span style="color:blue" id=foo>ar]ba</span>z</ins>',
michael@0 3721 '<ins>foo[b<span style="font-size:3em">ar]ba</span>z</ins>',
michael@0 3722 '<ins>foo[b<i>ar]ba</i>z</ins>',
michael@0 3723
michael@0 3724 'foo<del>[bar]</del>baz',
michael@0 3725 '<del>foo[bar]baz</del>',
michael@0 3726 '<del>foo[b<span style="color:blue">ar]ba</span>z</del>',
michael@0 3727 '<del>foo[b<span style="color:blue" id=foo>ar]ba</span>z</del>',
michael@0 3728 '<del>foo[b<span style="font-size:3em">ar]ba</span>z</del>',
michael@0 3729 '<del>foo[b<i>ar]ba</i>z</del>',
michael@0 3730
michael@0 3731 'foo<span style="text-decoration: underline line-through">[bar]</span>baz',
michael@0 3732 'foo<span style="text-decoration: underline line-through">b[a]r</span>baz',
michael@0 3733 'foo<s style="text-decoration: underline">[bar]</s>baz',
michael@0 3734 'foo<s style="text-decoration: underline">b[a]r</s>baz',
michael@0 3735 'foo<u style="text-decoration: line-through">[bar]</u>baz',
michael@0 3736 'foo<u style="text-decoration: line-through">b[a]r</u>baz',
michael@0 3737 'foo<s style="text-decoration: overline">[bar]</s>baz',
michael@0 3738 'foo<s style="text-decoration: overline">b[a]r</s>baz',
michael@0 3739 'foo<u style="text-decoration: overline">[bar]</u>baz',
michael@0 3740 'foo<u style="text-decoration: overline">b[a]r</u>baz',
michael@0 3741
michael@0 3742 '<p style="text-decoration: line-through">foo[bar]baz</p>',
michael@0 3743 '<p style="text-decoration: overline">foo[bar]baz</p>',
michael@0 3744
michael@0 3745 'foo<span class="underline">[bar]</span>baz',
michael@0 3746 'foo<span class="underline">b[a]r</span>baz',
michael@0 3747 'foo<span class="line-through">[bar]</span>baz',
michael@0 3748 'foo<span class="line-through">b[a]r</span>baz',
michael@0 3749 'foo<span class="underline-and-line-through">[bar]</span>baz',
michael@0 3750 'foo<span class="underline-and-line-through">b[a]r</span>baz',
michael@0 3751
michael@0 3752 // Tests for queryCommandIndeterm() and queryCommandState()
michael@0 3753 'fo[o<s>b]ar</s>baz',
michael@0 3754 'foo<s>ba[r</s>b]az',
michael@0 3755 'fo[o<s>bar</s>b]az',
michael@0 3756 'foo[<s>b]ar</s>baz',
michael@0 3757 'foo<s>ba[r</s>]baz',
michael@0 3758 'foo[<s>bar</s>]baz',
michael@0 3759 'foo<s>[bar]</s>baz',
michael@0 3760 'foo{<s>bar</s>}baz',
michael@0 3761 'fo[o<span style=text-decoration:line-through>b]ar</span>baz',
michael@0 3762 '<strike>fo[o</strike><s>b]ar</s>',
michael@0 3763 '<s>fo[o</s><del>b]ar</del>',
michael@0 3764 ],
michael@0 3765 //@}
michael@0 3766 subscript: [
michael@0 3767 //@{
michael@0 3768 'foo[]bar',
michael@0 3769 '<p>[foo</p> <p>bar]</p>',
michael@0 3770 '<span>[foo</span> <span>bar]</span>',
michael@0 3771 '<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>',
michael@0 3772 '<p>[foo<p><br><p>bar]',
michael@0 3773 '<b>foo[]bar</b>',
michael@0 3774 '<i>foo[]bar</i>',
michael@0 3775 '<span>foo</span>{}<span>bar</span>',
michael@0 3776 '<span>foo[</span><span>]bar</span>',
michael@0 3777 'foo[bar]baz',
michael@0 3778 'foo[bar<b>baz]qoz</b>quz',
michael@0 3779 'foo[bar<i>baz]qoz</i>quz',
michael@0 3780 '{<p><p> <p>foo</p>}',
michael@0 3781
michael@0 3782 '<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>',
michael@0 3783 '<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 3784 '<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 3785 '<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>',
michael@0 3786 '<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>',
michael@0 3787 '{<table><tr><td>foo<td>bar<td>baz</table>}',
michael@0 3788
michael@0 3789 'foo<sub>[bar]</sub>baz',
michael@0 3790 'foo<sub>b[a]r</sub>baz',
michael@0 3791 'foo<sup>[bar]</sup>baz',
michael@0 3792 'foo<sup>b[a]r</sup>baz',
michael@0 3793
michael@0 3794 'foo<span style=vertical-align:sub>[bar]</span>baz',
michael@0 3795 'foo<span style=vertical-align:super>[bar]</span>baz',
michael@0 3796
michael@0 3797 'foo<sub><sub>[bar]</sub></sub>baz',
michael@0 3798 'foo<sub><sub>b[a]r</sub></sub>baz',
michael@0 3799 'foo<sub>b<sub>[a]</sub>r</sub>baz',
michael@0 3800 'foo<sup><sup>[bar]</sup></sup>baz',
michael@0 3801 'foo<sup><sup>b[a]r</sup></sup>baz',
michael@0 3802 'foo<sup>b<sup>[a]</sup>r</sup>baz',
michael@0 3803 'foo<sub><sup>[bar]</sup></sub>baz',
michael@0 3804 'foo<sub><sup>b[a]r</sup></sub>baz',
michael@0 3805 'foo<sub>b<sup>[a]</sup>r</sub>baz',
michael@0 3806 'foo<sup><sub>[bar]</sub></sup>baz',
michael@0 3807 'foo<sup><sub>b[a]r</sub></sup>baz',
michael@0 3808 'foo<sup>b<sub>[a]</sub>r</sup>baz',
michael@0 3809
michael@0 3810 // Tests for queryCommandIndeterm() and queryCommandState()
michael@0 3811 'fo[o<sub>b]ar</sub>baz',
michael@0 3812 'foo<sub>ba[r</sub>b]az',
michael@0 3813 'fo[o<sub>bar</sub>b]az',
michael@0 3814 'foo[<sub>b]ar</sub>baz',
michael@0 3815 'foo<sub>ba[r</sub>]baz',
michael@0 3816 'foo[<sub>bar</sub>]baz',
michael@0 3817 'foo<sub>[bar]</sub>baz',
michael@0 3818 'foo{<sub>bar</sub>}baz',
michael@0 3819 '<sub>fo[o</sub><sup>b]ar</sup>',
michael@0 3820 '<sub>fo[o</sub><span style=vertical-align:sub>b]ar</span>',
michael@0 3821 'foo<span style=vertical-align:top>[bar]</span>baz',
michael@0 3822 '<sub>fo[o</sub><span style=vertical-align:top>b]ar</span>',
michael@0 3823 ],
michael@0 3824 //@}
michael@0 3825 superscript: [
michael@0 3826 //@{
michael@0 3827 'foo[]bar',
michael@0 3828 '<p>[foo</p> <p>bar]</p>',
michael@0 3829 '<span>[foo</span> <span>bar]</span>',
michael@0 3830 '<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>',
michael@0 3831 '<p>[foo<p><br><p>bar]',
michael@0 3832 '<b>foo[]bar</b>',
michael@0 3833 '<i>foo[]bar</i>',
michael@0 3834 '<span>foo</span>{}<span>bar</span>',
michael@0 3835 '<span>foo[</span><span>]bar</span>',
michael@0 3836 'foo[bar]baz',
michael@0 3837 'foo[bar<b>baz]qoz</b>quz',
michael@0 3838 'foo[bar<i>baz]qoz</i>quz',
michael@0 3839 '{<p><p> <p>foo</p>}',
michael@0 3840
michael@0 3841 '<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>',
michael@0 3842 '<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 3843 '<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 3844 '<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>',
michael@0 3845 '<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>',
michael@0 3846 '{<table><tr><td>foo<td>bar<td>baz</table>}',
michael@0 3847
michael@0 3848 'foo<sub>[bar]</sub>baz',
michael@0 3849 'foo<sub>b[a]r</sub>baz',
michael@0 3850 'foo<sup>[bar]</sup>baz',
michael@0 3851 'foo<sup>b[a]r</sup>baz',
michael@0 3852
michael@0 3853 'foo<span style=vertical-align:sub>[bar]</span>baz',
michael@0 3854 'foo<span style=vertical-align:super>[bar]</span>baz',
michael@0 3855
michael@0 3856 'foo<sub><sub>[bar]</sub></sub>baz',
michael@0 3857 'foo<sub><sub>b[a]r</sub></sub>baz',
michael@0 3858 'foo<sub>b<sub>[a]</sub>r</sub>baz',
michael@0 3859 'foo<sup><sup>[bar]</sup></sup>baz',
michael@0 3860 'foo<sup><sup>b[a]r</sup></sup>baz',
michael@0 3861 'foo<sup>b<sup>[a]</sup>r</sup>baz',
michael@0 3862 'foo<sub><sup>[bar]</sup></sub>baz',
michael@0 3863 'foo<sub><sup>b[a]r</sup></sub>baz',
michael@0 3864 'foo<sub>b<sup>[a]</sup>r</sub>baz',
michael@0 3865 'foo<sup><sub>[bar]</sub></sup>baz',
michael@0 3866 'foo<sup><sub>b[a]r</sub></sup>baz',
michael@0 3867 'foo<sup>b<sub>[a]</sub>r</sup>baz',
michael@0 3868
michael@0 3869 // Tests for queryCommandIndeterm() and queryCommandState()
michael@0 3870 'fo[o<sup>b]ar</sup>baz',
michael@0 3871 'foo<sup>ba[r</sup>b]az',
michael@0 3872 'fo[o<sup>bar</sup>b]az',
michael@0 3873 'foo[<sup>b]ar</sup>baz',
michael@0 3874 'foo<sup>ba[r</sup>]baz',
michael@0 3875 'foo[<sup>bar</sup>]baz',
michael@0 3876 'foo<sup>[bar]</sup>baz',
michael@0 3877 'foo{<sup>bar</sup>}baz',
michael@0 3878 '<sup>fo[o</sup><sub>b]ar</sub>',
michael@0 3879 '<sup>fo[o</sup><span style=vertical-align:super>b]ar</span>',
michael@0 3880 'foo<span style=vertical-align:bottom>[bar]</span>baz',
michael@0 3881 '<sup>fo[o</sup><span style=vertical-align:bottom>b]ar</span>',
michael@0 3882
michael@0 3883 // https://bugs.webkit.org/show_bug.cgi?id=28472
michael@0 3884 'foo<sup>[bar]<br></sup>',
michael@0 3885 ],
michael@0 3886 //@}
michael@0 3887 underline: [
michael@0 3888 //@{
michael@0 3889 'foo[]bar',
michael@0 3890 '<p>[foo</p> <p>bar]</p>',
michael@0 3891 '<span>[foo</span> <span>bar]</span>',
michael@0 3892 '<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>',
michael@0 3893 '<p>[foo<p><br><p>bar]',
michael@0 3894 '<b>foo[]bar</b>',
michael@0 3895 '<i>foo[]bar</i>',
michael@0 3896 '<span>foo</span>{}<span>bar</span>',
michael@0 3897 '<span>foo[</span><span>]bar</span>',
michael@0 3898 'foo[bar]baz',
michael@0 3899 'foo[bar<b>baz]qoz</b>quz',
michael@0 3900 'foo[bar<i>baz]qoz</i>quz',
michael@0 3901 '{<p><p> <p>foo</p>}',
michael@0 3902
michael@0 3903 '<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>',
michael@0 3904 '<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 3905 '<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>',
michael@0 3906 '<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>',
michael@0 3907 '<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>',
michael@0 3908 '{<table><tr><td>foo<td>bar<td>baz</table>}',
michael@0 3909
michael@0 3910 'foo<u>[bar]</u>baz',
michael@0 3911 'foo<span style="text-decoration: underline">[bar]</span>baz',
michael@0 3912 '<u>foo[bar]baz</u>',
michael@0 3913 '<u>foo[b<span style="color:blue">ar]ba</span>z</u>',
michael@0 3914 '<u>foo[b<span style="color:blue" id=foo>ar]ba</span>z</u>',
michael@0 3915 '<u>foo[b<span style="font-size:3em">ar]ba</span>z</u>',
michael@0 3916 '<u>foo[b<i>ar]ba</i>z</u>',
michael@0 3917 '<p style="text-decoration: underline">foo[bar]baz</p>',
michael@0 3918
michael@0 3919 'foo<s>[bar]</s>baz',
michael@0 3920 'foo<span style="text-decoration: line-through">[bar]</span>baz',
michael@0 3921 '<s>foo[bar]baz</s>',
michael@0 3922 '<s>foo[b<span style="color:blue">ar]ba</span>z</s>',
michael@0 3923 '<s>foo[b<span style="color:blue" id=foo>ar]ba</span>z</s>',
michael@0 3924 '<s>foo[b<span style="font-size:3em">ar]ba</span>z</s>',
michael@0 3925 '<s>foo[b<i>ar]ba</i>z</s>',
michael@0 3926 '<p style="text-decoration: line-through">foo[bar]baz</p>',
michael@0 3927
michael@0 3928 'foo<strike>[bar]</strike>baz',
michael@0 3929 '<strike>foo[bar]baz</strike>',
michael@0 3930 '<strike>foo[b<span style="color:blue">ar]ba</span>z</strike>',
michael@0 3931 '<strike>foo[b<span style="color:blue" id=foo>ar]ba</span>z</strike>',
michael@0 3932 '<strike>foo[b<span style="font-size:3em">ar]ba</span>z</strike>',
michael@0 3933 '<strike>foo[b<i>ar]ba</i>z</strike>',
michael@0 3934
michael@0 3935 'foo<ins>[bar]</ins>baz',
michael@0 3936 '<ins>foo[bar]baz</ins>',
michael@0 3937 '<ins>foo[b<span style="color:blue">ar]ba</span>z</ins>',
michael@0 3938 '<ins>foo[b<span style="color:blue" id=foo>ar]ba</span>z</ins>',
michael@0 3939 '<ins>foo[b<span style="font-size:3em">ar]ba</span>z</ins>',
michael@0 3940 '<ins>foo[b<i>ar]ba</i>z</ins>',
michael@0 3941
michael@0 3942 'foo<del>[bar]</del>baz',
michael@0 3943 '<del>foo[bar]baz</del>',
michael@0 3944 '<del>foo[b<span style="color:blue">ar]ba</span>z</del>',
michael@0 3945 '<del>foo[b<span style="color:blue" id=foo>ar]ba</span>z</del>',
michael@0 3946 '<del>foo[b<span style="font-size:3em">ar]ba</span>z</del>',
michael@0 3947 '<del>foo[b<i>ar]ba</i>z</del>',
michael@0 3948
michael@0 3949 'foo<span style="text-decoration: underline line-through">[bar]</span>baz',
michael@0 3950 'foo<span style="text-decoration: underline line-through">b[a]r</span>baz',
michael@0 3951 'foo<s style="text-decoration: underline">[bar]</s>baz',
michael@0 3952 'foo<s style="text-decoration: underline">b[a]r</s>baz',
michael@0 3953 'foo<u style="text-decoration: line-through">[bar]</u>baz',
michael@0 3954 'foo<u style="text-decoration: line-through">b[a]r</u>baz',
michael@0 3955 'foo<s style="text-decoration: overline">[bar]</s>baz',
michael@0 3956 'foo<s style="text-decoration: overline">b[a]r</s>baz',
michael@0 3957 'foo<u style="text-decoration: overline">[bar]</u>baz',
michael@0 3958 'foo<u style="text-decoration: overline">b[a]r</u>baz',
michael@0 3959
michael@0 3960 '<p style="text-decoration: line-through">foo[bar]baz</p>',
michael@0 3961 '<p style="text-decoration: overline">foo[bar]baz</p>',
michael@0 3962
michael@0 3963 'foo<span class="underline">[bar]</span>baz',
michael@0 3964 'foo<span class="underline">b[a]r</span>baz',
michael@0 3965 'foo<span class="line-through">[bar]</span>baz',
michael@0 3966 'foo<span class="line-through">b[a]r</span>baz',
michael@0 3967 'foo<span class="underline-and-line-through">[bar]</span>baz',
michael@0 3968 'foo<span class="underline-and-line-through">b[a]r</span>baz',
michael@0 3969
michael@0 3970 // Tests for queryCommandIndeterm() and queryCommandState()
michael@0 3971 'fo[o<u>b]ar</u>baz',
michael@0 3972 'foo<u>ba[r</u>b]az',
michael@0 3973 'fo[o<u>bar</u>b]az',
michael@0 3974 'foo[<u>b]ar</u>baz',
michael@0 3975 'foo<u>ba[r</u>]baz',
michael@0 3976 'foo[<u>bar</u>]baz',
michael@0 3977 'foo<u>[bar]</u>baz',
michael@0 3978 'foo{<u>bar</u>}baz',
michael@0 3979 'fo[o<span style=text-decoration:underline>b]ar</span>baz',
michael@0 3980 '<ins>fo[o</ins><u>b]ar</u>',
michael@0 3981 '<u>fo[o</u><ins>b]ar</ins>',
michael@0 3982 ],
michael@0 3983 //@}
michael@0 3984 unlink: [
michael@0 3985 //@{
michael@0 3986 'foo[]bar',
michael@0 3987 '<p>[foo</p> <p>bar]</p>',
michael@0 3988 '<span>[foo</span> <span>bar]</span>',
michael@0 3989 '<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>',
michael@0 3990 '<b>foo[]bar</b>',
michael@0 3991 '<i>foo[]bar</i>',
michael@0 3992 '<span>foo</span>{}<span>bar</span>',
michael@0 3993 '<span>foo[</span><span>]bar</span>',
michael@0 3994 'foo[bar]baz',
michael@0 3995 'foo[bar<b>baz]qoz</b>quz',
michael@0 3996 'foo[bar<i>baz]qoz</i>quz',
michael@0 3997 '{<p><p> <p>foo</p>}',
michael@0 3998
michael@0 3999 '<a href=http://www.google.com/>foo[bar]baz</a>',
michael@0 4000 '<a href=http://www.google.com/>foo[barbaz</a>}',
michael@0 4001 '{<a href=http://www.google.com/>foobar]baz</a>',
michael@0 4002 '{<a href=http://www.google.com/>foobarbaz</a>}',
michael@0 4003 '<a href=http://www.google.com/>[foobarbaz]</a>',
michael@0 4004
michael@0 4005 'foo<a href=http://www.google.com/>b[]ar</a>baz',
michael@0 4006 'foo<a href=http://www.google.com/>[bar]</a>baz',
michael@0 4007 'foo[<a href=http://www.google.com/>bar</a>]baz',
michael@0 4008 'foo<a href=http://www.google.com/>[bar</a>baz]',
michael@0 4009 '[foo<a href=http://www.google.com/>bar]</a>baz',
michael@0 4010 '[foo<a href=http://www.google.com/>bar</a>baz]',
michael@0 4011
michael@0 4012 '<a id=foo href=http://www.google.com/>foobar[]baz</a>',
michael@0 4013 '<a id=foo href=http://www.google.com/>foo[bar]baz</a>',
michael@0 4014 '<a id=foo href=http://www.google.com/>[foobarbaz]</a>',
michael@0 4015 'foo<a id=foo href=http://www.google.com/>[bar]</a>baz',
michael@0 4016 'foo[<a id=foo href=http://www.google.com/>bar</a>]baz',
michael@0 4017 '[foo<a id=foo href=http://www.google.com/>bar</a>baz]',
michael@0 4018
michael@0 4019 '<a name=foo>foobar[]baz</a>',
michael@0 4020 '<a name=foo>foo[bar]baz</a>',
michael@0 4021 '<a name=foo>[foobarbaz]</a>',
michael@0 4022 'foo<a name=foo>[bar]</a>baz',
michael@0 4023 'foo[<a name=foo>bar</a>]baz',
michael@0 4024 '[foo<a name=foo>bar</a>baz]',
michael@0 4025 ],
michael@0 4026 //@}
michael@0 4027 copy: ['!foo[bar]baz'],
michael@0 4028 cut: ['!foo[bar]baz'],
michael@0 4029 defaultparagraphseparator: [
michael@0 4030 //@{
michael@0 4031 ['', 'foo[bar]baz'],
michael@0 4032 ['div', 'foo[bar]baz'],
michael@0 4033 ['p', 'foo[bar]baz'],
michael@0 4034 ['DIV', 'foo[bar]baz'],
michael@0 4035 ['P', 'foo[bar]baz'],
michael@0 4036 [' div ', 'foo[bar]baz'],
michael@0 4037 [' p ', 'foo[bar]baz'],
michael@0 4038 ['<div>', 'foo[bar]baz'],
michael@0 4039 ['<p>', 'foo[bar]baz'],
michael@0 4040 ['li', 'foo[bar]baz'],
michael@0 4041 ['blockquote', 'foo[bar]baz'],
michael@0 4042 ],
michael@0 4043 //@}
michael@0 4044 paste: ['!foo[bar]baz'],
michael@0 4045 selectall: ['foo[bar]baz'],
michael@0 4046 stylewithcss: [
michael@0 4047 //@{
michael@0 4048 ['true', 'foo[bar]baz'],
michael@0 4049 ['TRUE', 'foo[bar]baz'],
michael@0 4050 ['TrUe', 'foo[bar]baz'],
michael@0 4051 ['true ', 'foo[bar]baz'],
michael@0 4052 [' true', 'foo[bar]baz'],
michael@0 4053 ['truer', 'foo[bar]baz'],
michael@0 4054 [' true ', 'foo[bar]baz'],
michael@0 4055 [' TrUe', 'foo[bar]baz'],
michael@0 4056 ['', 'foo[bar]baz'],
michael@0 4057 [' ', 'foo[bar]baz'],
michael@0 4058 ['false', 'foo[bar]baz'],
michael@0 4059 ['FALSE', 'foo[bar]baz'],
michael@0 4060 ['FaLsE', 'foo[bar]baz'],
michael@0 4061 [' false', 'foo[bar]baz'],
michael@0 4062 ['false ', 'foo[bar]baz'],
michael@0 4063 ['falser', 'foo[bar]baz'],
michael@0 4064 ['falsé', 'foo[bar]baz'],
michael@0 4065 ],
michael@0 4066 //@}
michael@0 4067 usecss: [
michael@0 4068 //@{
michael@0 4069 ['true', 'foo[bar]baz'],
michael@0 4070 ['TRUE', 'foo[bar]baz'],
michael@0 4071 ['TrUe', 'foo[bar]baz'],
michael@0 4072 ['true ', 'foo[bar]baz'],
michael@0 4073 [' true', 'foo[bar]baz'],
michael@0 4074 ['truer', 'foo[bar]baz'],
michael@0 4075 [' true ', 'foo[bar]baz'],
michael@0 4076 [' TrUe', 'foo[bar]baz'],
michael@0 4077 ['', 'foo[bar]baz'],
michael@0 4078 [' ', 'foo[bar]baz'],
michael@0 4079 ['false', 'foo[bar]baz'],
michael@0 4080 ['FALSE', 'foo[bar]baz'],
michael@0 4081 ['FaLsE', 'foo[bar]baz'],
michael@0 4082 [' false', 'foo[bar]baz'],
michael@0 4083 ['false ', 'foo[bar]baz'],
michael@0 4084 ['falser', 'foo[bar]baz'],
michael@0 4085 ['falsé', 'foo[bar]baz'],
michael@0 4086 ],
michael@0 4087 //@}
michael@0 4088 quasit: ['foo[bar]baz'],
michael@0 4089 multitest: [
michael@0 4090 //@{
michael@0 4091 // Insertion-affecting state. Test that insertText works right, and
michael@0 4092 // test that various block commands preserve (or don't preserve) the
michael@0 4093 // state.
michael@0 4094 ['foo[]bar', 'bold', 'inserttext'],
michael@0 4095 ['foo[]bar', 'bold', 'delete'],
michael@0 4096 ['foo[]bar', 'bold', 'delete', 'inserttext'],
michael@0 4097 ['foo[]bar', 'bold', 'formatblock'],
michael@0 4098 ['foo[]bar', 'bold', 'formatblock', 'inserttext'],
michael@0 4099 ['foo[]bar', 'bold', 'forwarddelete'],
michael@0 4100 ['foo[]bar', 'bold', 'forwarddelete', 'inserttext'],
michael@0 4101 ['foo[]bar', 'bold', 'indent'],
michael@0 4102 ['foo[]bar', 'bold', 'indent', 'inserttext'],
michael@0 4103 ['foo[]bar', 'bold', 'inserthorizontalrule'],
michael@0 4104 ['foo[]bar', 'bold', 'inserthorizontalrule', 'inserttext'],
michael@0 4105 ['foo[]bar', 'bold', 'inserthtml'],
michael@0 4106 ['foo[]bar', 'bold', 'inserthtml', 'inserttext'],
michael@0 4107 ['foo[]bar', 'bold', 'insertimage'],
michael@0 4108 ['foo[]bar', 'bold', 'insertimage', 'inserttext'],
michael@0 4109 ['foo[]bar', 'bold', 'insertlinebreak'],
michael@0 4110 ['foo[]bar', 'bold', 'insertlinebreak', 'inserttext'],
michael@0 4111 ['foo[]bar', 'bold', 'insertorderedlist'],
michael@0 4112 ['foo[]bar', 'bold', 'insertorderedlist', 'inserttext'],
michael@0 4113 ['foo[]bar', 'bold', 'insertparagraph'],
michael@0 4114 ['foo[]bar', 'bold', 'insertparagraph', 'inserttext'],
michael@0 4115 ['foo[]bar', 'bold', 'insertunorderedlist'],
michael@0 4116 ['foo[]bar', 'bold', 'insertunorderedlist', 'inserttext'],
michael@0 4117 ['foo[]bar', 'bold', 'justifycenter'],
michael@0 4118 ['foo[]bar', 'bold', 'justifycenter', 'inserttext'],
michael@0 4119 ['foo[]bar', 'bold', 'justifyfull'],
michael@0 4120 ['foo[]bar', 'bold', 'justifyfull', 'inserttext'],
michael@0 4121 ['foo[]bar', 'bold', 'justifyleft'],
michael@0 4122 ['foo[]bar', 'bold', 'justifyleft', 'inserttext'],
michael@0 4123 ['foo[]bar', 'bold', 'justifyright'],
michael@0 4124 ['foo[]bar', 'bold', 'justifyright', 'inserttext'],
michael@0 4125 ['foo[]bar', 'bold', 'outdent'],
michael@0 4126 ['foo[]bar', 'bold', 'outdent', 'inserttext'],
michael@0 4127
michael@0 4128 ['foo[]bar', 'italic', 'inserttext'],
michael@0 4129 ['foo[]bar', 'italic', 'delete'],
michael@0 4130 ['foo[]bar', 'italic', 'delete', 'inserttext'],
michael@0 4131 ['foo[]bar', 'italic', 'formatblock'],
michael@0 4132 ['foo[]bar', 'italic', 'formatblock', 'inserttext'],
michael@0 4133 ['foo[]bar', 'italic', 'forwarddelete'],
michael@0 4134 ['foo[]bar', 'italic', 'forwarddelete', 'inserttext'],
michael@0 4135 ['foo[]bar', 'italic', 'indent'],
michael@0 4136 ['foo[]bar', 'italic', 'indent', 'inserttext'],
michael@0 4137 ['foo[]bar', 'italic', 'inserthorizontalrule'],
michael@0 4138 ['foo[]bar', 'italic', 'inserthorizontalrule', 'inserttext'],
michael@0 4139 ['foo[]bar', 'italic', 'inserthtml'],
michael@0 4140 ['foo[]bar', 'italic', 'inserthtml', 'inserttext'],
michael@0 4141 ['foo[]bar', 'italic', 'insertimage'],
michael@0 4142 ['foo[]bar', 'italic', 'insertimage', 'inserttext'],
michael@0 4143 ['foo[]bar', 'italic', 'insertlinebreak'],
michael@0 4144 ['foo[]bar', 'italic', 'insertlinebreak', 'inserttext'],
michael@0 4145 ['foo[]bar', 'italic', 'insertorderedlist'],
michael@0 4146 ['foo[]bar', 'italic', 'insertorderedlist', 'inserttext'],
michael@0 4147 ['foo[]bar', 'italic', 'insertparagraph'],
michael@0 4148 ['foo[]bar', 'italic', 'insertparagraph', 'inserttext'],
michael@0 4149 ['foo[]bar', 'italic', 'insertunorderedlist'],
michael@0 4150 ['foo[]bar', 'italic', 'insertunorderedlist', 'inserttext'],
michael@0 4151 ['foo[]bar', 'italic', 'justifycenter'],
michael@0 4152 ['foo[]bar', 'italic', 'justifycenter', 'inserttext'],
michael@0 4153 ['foo[]bar', 'italic', 'justifyfull'],
michael@0 4154 ['foo[]bar', 'italic', 'justifyfull', 'inserttext'],
michael@0 4155 ['foo[]bar', 'italic', 'justifyleft'],
michael@0 4156 ['foo[]bar', 'italic', 'justifyleft', 'inserttext'],
michael@0 4157 ['foo[]bar', 'italic', 'justifyright'],
michael@0 4158 ['foo[]bar', 'italic', 'justifyright', 'inserttext'],
michael@0 4159 ['foo[]bar', 'italic', 'outdent'],
michael@0 4160 ['foo[]bar', 'italic', 'outdent', 'inserttext'],
michael@0 4161
michael@0 4162 ['foo[]bar', 'strikethrough', 'inserttext'],
michael@0 4163 ['foo[]bar', 'strikethrough', 'delete'],
michael@0 4164 ['foo[]bar', 'strikethrough', 'delete', 'inserttext'],
michael@0 4165 ['foo[]bar', 'strikethrough', 'formatblock'],
michael@0 4166 ['foo[]bar', 'strikethrough', 'formatblock', 'inserttext'],
michael@0 4167 ['foo[]bar', 'strikethrough', 'forwarddelete'],
michael@0 4168 ['foo[]bar', 'strikethrough', 'forwarddelete', 'inserttext'],
michael@0 4169 ['foo[]bar', 'strikethrough', 'indent'],
michael@0 4170 ['foo[]bar', 'strikethrough', 'indent', 'inserttext'],
michael@0 4171 ['foo[]bar', 'strikethrough', 'inserthorizontalrule'],
michael@0 4172 ['foo[]bar', 'strikethrough', 'inserthorizontalrule', 'inserttext'],
michael@0 4173 ['foo[]bar', 'strikethrough', 'inserthtml'],
michael@0 4174 ['foo[]bar', 'strikethrough', 'inserthtml', 'inserttext'],
michael@0 4175 ['foo[]bar', 'strikethrough', 'insertimage'],
michael@0 4176 ['foo[]bar', 'strikethrough', 'insertimage', 'inserttext'],
michael@0 4177 ['foo[]bar', 'strikethrough', 'insertlinebreak'],
michael@0 4178 ['foo[]bar', 'strikethrough', 'insertlinebreak', 'inserttext'],
michael@0 4179 ['foo[]bar', 'strikethrough', 'insertorderedlist'],
michael@0 4180 ['foo[]bar', 'strikethrough', 'insertorderedlist', 'inserttext'],
michael@0 4181 ['foo[]bar', 'strikethrough', 'insertparagraph'],
michael@0 4182 ['foo[]bar', 'strikethrough', 'insertparagraph', 'inserttext'],
michael@0 4183 ['foo[]bar', 'strikethrough', 'insertunorderedlist'],
michael@0 4184 ['foo[]bar', 'strikethrough', 'insertunorderedlist', 'inserttext'],
michael@0 4185 ['foo[]bar', 'strikethrough', 'justifycenter'],
michael@0 4186 ['foo[]bar', 'strikethrough', 'justifycenter', 'inserttext'],
michael@0 4187 ['foo[]bar', 'strikethrough', 'justifyfull'],
michael@0 4188 ['foo[]bar', 'strikethrough', 'justifyfull', 'inserttext'],
michael@0 4189 ['foo[]bar', 'strikethrough', 'justifyleft'],
michael@0 4190 ['foo[]bar', 'strikethrough', 'justifyleft', 'inserttext'],
michael@0 4191 ['foo[]bar', 'strikethrough', 'justifyright'],
michael@0 4192 ['foo[]bar', 'strikethrough', 'justifyright', 'inserttext'],
michael@0 4193 ['foo[]bar', 'strikethrough', 'outdent'],
michael@0 4194 ['foo[]bar', 'strikethrough', 'outdent', 'inserttext'],
michael@0 4195
michael@0 4196 ['foo[]bar', 'subscript', 'inserttext'],
michael@0 4197 ['foo[]bar', 'subscript', 'delete'],
michael@0 4198 ['foo[]bar', 'subscript', 'delete', 'inserttext'],
michael@0 4199 ['foo[]bar', 'subscript', 'formatblock'],
michael@0 4200 ['foo[]bar', 'subscript', 'formatblock', 'inserttext'],
michael@0 4201 ['foo[]bar', 'subscript', 'forwarddelete'],
michael@0 4202 ['foo[]bar', 'subscript', 'forwarddelete', 'inserttext'],
michael@0 4203 ['foo[]bar', 'subscript', 'indent'],
michael@0 4204 ['foo[]bar', 'subscript', 'indent', 'inserttext'],
michael@0 4205 ['foo[]bar', 'subscript', 'inserthorizontalrule'],
michael@0 4206 ['foo[]bar', 'subscript', 'inserthorizontalrule', 'inserttext'],
michael@0 4207 ['foo[]bar', 'subscript', 'inserthtml'],
michael@0 4208 ['foo[]bar', 'subscript', 'inserthtml', 'inserttext'],
michael@0 4209 ['foo[]bar', 'subscript', 'insertimage'],
michael@0 4210 ['foo[]bar', 'subscript', 'insertimage', 'inserttext'],
michael@0 4211 ['foo[]bar', 'subscript', 'insertlinebreak'],
michael@0 4212 ['foo[]bar', 'subscript', 'insertlinebreak', 'inserttext'],
michael@0 4213 ['foo[]bar', 'subscript', 'insertorderedlist'],
michael@0 4214 ['foo[]bar', 'subscript', 'insertorderedlist', 'inserttext'],
michael@0 4215 ['foo[]bar', 'subscript', 'insertparagraph'],
michael@0 4216 ['foo[]bar', 'subscript', 'insertparagraph', 'inserttext'],
michael@0 4217 ['foo[]bar', 'subscript', 'insertunorderedlist'],
michael@0 4218 ['foo[]bar', 'subscript', 'insertunorderedlist', 'inserttext'],
michael@0 4219 ['foo[]bar', 'subscript', 'justifycenter'],
michael@0 4220 ['foo[]bar', 'subscript', 'justifycenter', 'inserttext'],
michael@0 4221 ['foo[]bar', 'subscript', 'justifyfull'],
michael@0 4222 ['foo[]bar', 'subscript', 'justifyfull', 'inserttext'],
michael@0 4223 ['foo[]bar', 'subscript', 'justifyleft'],
michael@0 4224 ['foo[]bar', 'subscript', 'justifyleft', 'inserttext'],
michael@0 4225 ['foo[]bar', 'subscript', 'justifyright'],
michael@0 4226 ['foo[]bar', 'subscript', 'justifyright', 'inserttext'],
michael@0 4227 ['foo[]bar', 'subscript', 'outdent'],
michael@0 4228 ['foo[]bar', 'subscript', 'outdent', 'inserttext'],
michael@0 4229
michael@0 4230 ['foo[]bar', 'superscript', 'inserttext'],
michael@0 4231 ['foo[]bar', 'superscript', 'delete'],
michael@0 4232 ['foo[]bar', 'superscript', 'delete', 'inserttext'],
michael@0 4233 ['foo[]bar', 'superscript', 'formatblock'],
michael@0 4234 ['foo[]bar', 'superscript', 'formatblock', 'inserttext'],
michael@0 4235 ['foo[]bar', 'superscript', 'forwarddelete'],
michael@0 4236 ['foo[]bar', 'superscript', 'forwarddelete', 'inserttext'],
michael@0 4237 ['foo[]bar', 'superscript', 'indent'],
michael@0 4238 ['foo[]bar', 'superscript', 'indent', 'inserttext'],
michael@0 4239 ['foo[]bar', 'superscript', 'inserthorizontalrule'],
michael@0 4240 ['foo[]bar', 'superscript', 'inserthorizontalrule', 'inserttext'],
michael@0 4241 ['foo[]bar', 'superscript', 'inserthtml'],
michael@0 4242 ['foo[]bar', 'superscript', 'inserthtml', 'inserttext'],
michael@0 4243 ['foo[]bar', 'superscript', 'insertimage'],
michael@0 4244 ['foo[]bar', 'superscript', 'insertimage', 'inserttext'],
michael@0 4245 ['foo[]bar', 'superscript', 'insertlinebreak'],
michael@0 4246 ['foo[]bar', 'superscript', 'insertlinebreak', 'inserttext'],
michael@0 4247 ['foo[]bar', 'superscript', 'insertorderedlist'],
michael@0 4248 ['foo[]bar', 'superscript', 'insertorderedlist', 'inserttext'],
michael@0 4249 ['foo[]bar', 'superscript', 'insertparagraph'],
michael@0 4250 ['foo[]bar', 'superscript', 'insertparagraph', 'inserttext'],
michael@0 4251 ['foo[]bar', 'superscript', 'insertunorderedlist'],
michael@0 4252 ['foo[]bar', 'superscript', 'insertunorderedlist', 'inserttext'],
michael@0 4253 ['foo[]bar', 'superscript', 'justifycenter'],
michael@0 4254 ['foo[]bar', 'superscript', 'justifycenter', 'inserttext'],
michael@0 4255 ['foo[]bar', 'superscript', 'justifyfull'],
michael@0 4256 ['foo[]bar', 'superscript', 'justifyfull', 'inserttext'],
michael@0 4257 ['foo[]bar', 'superscript', 'justifyleft'],
michael@0 4258 ['foo[]bar', 'superscript', 'justifyleft', 'inserttext'],
michael@0 4259 ['foo[]bar', 'superscript', 'justifyright'],
michael@0 4260 ['foo[]bar', 'superscript', 'justifyright', 'inserttext'],
michael@0 4261 ['foo[]bar', 'superscript', 'outdent'],
michael@0 4262 ['foo[]bar', 'superscript', 'outdent', 'inserttext'],
michael@0 4263
michael@0 4264 ['foo[]bar', 'underline', 'inserttext'],
michael@0 4265 ['foo[]bar', 'underline', 'delete'],
michael@0 4266 ['foo[]bar', 'underline', 'delete', 'inserttext'],
michael@0 4267 ['foo[]bar', 'underline', 'formatblock'],
michael@0 4268 ['foo[]bar', 'underline', 'formatblock', 'inserttext'],
michael@0 4269 ['foo[]bar', 'underline', 'forwarddelete'],
michael@0 4270 ['foo[]bar', 'underline', 'forwarddelete', 'inserttext'],
michael@0 4271 ['foo[]bar', 'underline', 'indent'],
michael@0 4272 ['foo[]bar', 'underline', 'indent', 'inserttext'],
michael@0 4273 ['foo[]bar', 'underline', 'inserthorizontalrule'],
michael@0 4274 ['foo[]bar', 'underline', 'inserthorizontalrule', 'inserttext'],
michael@0 4275 ['foo[]bar', 'underline', 'inserthtml'],
michael@0 4276 ['foo[]bar', 'underline', 'inserthtml', 'inserttext'],
michael@0 4277 ['foo[]bar', 'underline', 'insertimage'],
michael@0 4278 ['foo[]bar', 'underline', 'insertimage', 'inserttext'],
michael@0 4279 ['foo[]bar', 'underline', 'insertlinebreak'],
michael@0 4280 ['foo[]bar', 'underline', 'insertlinebreak', 'inserttext'],
michael@0 4281 ['foo[]bar', 'underline', 'insertorderedlist'],
michael@0 4282 ['foo[]bar', 'underline', 'insertorderedlist', 'inserttext'],
michael@0 4283 ['foo[]bar', 'underline', 'insertparagraph'],
michael@0 4284 ['foo[]bar', 'underline', 'insertparagraph', 'inserttext'],
michael@0 4285 ['foo[]bar', 'underline', 'insertunorderedlist'],
michael@0 4286 ['foo[]bar', 'underline', 'insertunorderedlist', 'inserttext'],
michael@0 4287 ['foo[]bar', 'underline', 'justifycenter'],
michael@0 4288 ['foo[]bar', 'underline', 'justifycenter', 'inserttext'],
michael@0 4289 ['foo[]bar', 'underline', 'justifyfull'],
michael@0 4290 ['foo[]bar', 'underline', 'justifyfull', 'inserttext'],
michael@0 4291 ['foo[]bar', 'underline', 'justifyleft'],
michael@0 4292 ['foo[]bar', 'underline', 'justifyleft', 'inserttext'],
michael@0 4293 ['foo[]bar', 'underline', 'justifyright'],
michael@0 4294 ['foo[]bar', 'underline', 'justifyright', 'inserttext'],
michael@0 4295 ['foo[]bar', 'underline', 'outdent'],
michael@0 4296 ['foo[]bar', 'underline', 'outdent', 'inserttext'],
michael@0 4297
michael@0 4298 // Insertion-affecting value. Test that insertText works right, and
michael@0 4299 // test that various block commands preserve (or don't preserve) the
michael@0 4300 // value.
michael@0 4301 ['foo[]bar', 'backcolor', 'inserttext'],
michael@0 4302 ['foo[]bar', 'backcolor', 'delete'],
michael@0 4303 ['foo[]bar', 'backcolor', 'delete', 'inserttext'],
michael@0 4304 ['foo[]bar', 'backcolor', 'formatblock'],
michael@0 4305 ['foo[]bar', 'backcolor', 'formatblock', 'inserttext'],
michael@0 4306 ['foo[]bar', 'backcolor', 'forwarddelete'],
michael@0 4307 ['foo[]bar', 'backcolor', 'forwarddelete', 'inserttext'],
michael@0 4308 ['foo[]bar', 'backcolor', 'indent'],
michael@0 4309 ['foo[]bar', 'backcolor', 'indent', 'inserttext'],
michael@0 4310 ['foo[]bar', 'backcolor', 'inserthorizontalrule'],
michael@0 4311 ['foo[]bar', 'backcolor', 'inserthorizontalrule', 'inserttext'],
michael@0 4312 ['foo[]bar', 'backcolor', 'inserthtml'],
michael@0 4313 ['foo[]bar', 'backcolor', 'inserthtml', 'inserttext'],
michael@0 4314 ['foo[]bar', 'backcolor', 'insertimage'],
michael@0 4315 ['foo[]bar', 'backcolor', 'insertimage', 'inserttext'],
michael@0 4316 ['foo[]bar', 'backcolor', 'insertlinebreak'],
michael@0 4317 ['foo[]bar', 'backcolor', 'insertlinebreak', 'inserttext'],
michael@0 4318 ['foo[]bar', 'backcolor', 'insertorderedlist'],
michael@0 4319 ['foo[]bar', 'backcolor', 'insertorderedlist', 'inserttext'],
michael@0 4320 ['foo[]bar', 'backcolor', 'insertparagraph'],
michael@0 4321 ['foo[]bar', 'backcolor', 'insertparagraph', 'inserttext'],
michael@0 4322 ['foo[]bar', 'backcolor', 'insertunorderedlist'],
michael@0 4323 ['foo[]bar', 'backcolor', 'insertunorderedlist', 'inserttext'],
michael@0 4324 ['foo[]bar', 'backcolor', 'justifycenter'],
michael@0 4325 ['foo[]bar', 'backcolor', 'justifycenter', 'inserttext'],
michael@0 4326 ['foo[]bar', 'backcolor', 'justifyfull'],
michael@0 4327 ['foo[]bar', 'backcolor', 'justifyfull', 'inserttext'],
michael@0 4328 ['foo[]bar', 'backcolor', 'justifyleft'],
michael@0 4329 ['foo[]bar', 'backcolor', 'justifyleft', 'inserttext'],
michael@0 4330 ['foo[]bar', 'backcolor', 'justifyright'],
michael@0 4331 ['foo[]bar', 'backcolor', 'justifyright', 'inserttext'],
michael@0 4332 ['foo[]bar', 'backcolor', 'outdent'],
michael@0 4333 ['foo[]bar', 'backcolor', 'outdent', 'inserttext'],
michael@0 4334
michael@0 4335 ['foo[]bar', 'createlink', 'inserttext'],
michael@0 4336 ['foo[]bar', 'createlink', 'delete'],
michael@0 4337 ['foo[]bar', 'createlink', 'delete', 'inserttext'],
michael@0 4338 ['foo[]bar', 'createlink', 'formatblock'],
michael@0 4339 ['foo[]bar', 'createlink', 'formatblock', 'inserttext'],
michael@0 4340 ['foo[]bar', 'createlink', 'forwarddelete'],
michael@0 4341 ['foo[]bar', 'createlink', 'forwarddelete', 'inserttext'],
michael@0 4342 ['foo[]bar', 'createlink', 'indent'],
michael@0 4343 ['foo[]bar', 'createlink', 'indent', 'inserttext'],
michael@0 4344 ['foo[]bar', 'createlink', 'inserthorizontalrule'],
michael@0 4345 ['foo[]bar', 'createlink', 'inserthorizontalrule', 'inserttext'],
michael@0 4346 ['foo[]bar', 'createlink', 'inserthtml'],
michael@0 4347 ['foo[]bar', 'createlink', 'inserthtml', 'inserttext'],
michael@0 4348 ['foo[]bar', 'createlink', 'insertimage'],
michael@0 4349 ['foo[]bar', 'createlink', 'insertimage', 'inserttext'],
michael@0 4350 ['foo[]bar', 'createlink', 'insertlinebreak'],
michael@0 4351 ['foo[]bar', 'createlink', 'insertlinebreak', 'inserttext'],
michael@0 4352 ['foo[]bar', 'createlink', 'insertorderedlist'],
michael@0 4353 ['foo[]bar', 'createlink', 'insertorderedlist', 'inserttext'],
michael@0 4354 ['foo[]bar', 'createlink', 'insertparagraph'],
michael@0 4355 ['foo[]bar', 'createlink', 'insertparagraph', 'inserttext'],
michael@0 4356 ['foo[]bar', 'createlink', 'insertunorderedlist'],
michael@0 4357 ['foo[]bar', 'createlink', 'insertunorderedlist', 'inserttext'],
michael@0 4358 ['foo[]bar', 'createlink', 'justifycenter'],
michael@0 4359 ['foo[]bar', 'createlink', 'justifycenter', 'inserttext'],
michael@0 4360 ['foo[]bar', 'createlink', 'justifyfull'],
michael@0 4361 ['foo[]bar', 'createlink', 'justifyfull', 'inserttext'],
michael@0 4362 ['foo[]bar', 'createlink', 'justifyleft'],
michael@0 4363 ['foo[]bar', 'createlink', 'justifyleft', 'inserttext'],
michael@0 4364 ['foo[]bar', 'createlink', 'justifyright'],
michael@0 4365 ['foo[]bar', 'createlink', 'justifyright', 'inserttext'],
michael@0 4366 ['foo[]bar', 'createlink', 'outdent'],
michael@0 4367 ['foo[]bar', 'createlink', 'outdent', 'inserttext'],
michael@0 4368
michael@0 4369 ['foo[]bar', 'fontname', 'inserttext'],
michael@0 4370 ['foo[]bar', 'fontname', 'delete'],
michael@0 4371 ['foo[]bar', 'fontname', 'delete', 'inserttext'],
michael@0 4372 ['foo[]bar', 'fontname', 'formatblock'],
michael@0 4373 ['foo[]bar', 'fontname', 'formatblock', 'inserttext'],
michael@0 4374 ['foo[]bar', 'fontname', 'forwarddelete'],
michael@0 4375 ['foo[]bar', 'fontname', 'forwarddelete', 'inserttext'],
michael@0 4376 ['foo[]bar', 'fontname', 'indent'],
michael@0 4377 ['foo[]bar', 'fontname', 'indent', 'inserttext'],
michael@0 4378 ['foo[]bar', 'fontname', 'inserthorizontalrule'],
michael@0 4379 ['foo[]bar', 'fontname', 'inserthorizontalrule', 'inserttext'],
michael@0 4380 ['foo[]bar', 'fontname', 'inserthtml'],
michael@0 4381 ['foo[]bar', 'fontname', 'inserthtml', 'inserttext'],
michael@0 4382 ['foo[]bar', 'fontname', 'insertimage'],
michael@0 4383 ['foo[]bar', 'fontname', 'insertimage', 'inserttext'],
michael@0 4384 ['foo[]bar', 'fontname', 'insertlinebreak'],
michael@0 4385 ['foo[]bar', 'fontname', 'insertlinebreak', 'inserttext'],
michael@0 4386 ['foo[]bar', 'fontname', 'insertorderedlist'],
michael@0 4387 ['foo[]bar', 'fontname', 'insertorderedlist', 'inserttext'],
michael@0 4388 ['foo[]bar', 'fontname', 'insertparagraph'],
michael@0 4389 ['foo[]bar', 'fontname', 'insertparagraph', 'inserttext'],
michael@0 4390 ['foo[]bar', 'fontname', 'insertunorderedlist'],
michael@0 4391 ['foo[]bar', 'fontname', 'insertunorderedlist', 'inserttext'],
michael@0 4392 ['foo[]bar', 'fontname', 'justifycenter'],
michael@0 4393 ['foo[]bar', 'fontname', 'justifycenter', 'inserttext'],
michael@0 4394 ['foo[]bar', 'fontname', 'justifyfull'],
michael@0 4395 ['foo[]bar', 'fontname', 'justifyfull', 'inserttext'],
michael@0 4396 ['foo[]bar', 'fontname', 'justifyleft'],
michael@0 4397 ['foo[]bar', 'fontname', 'justifyleft', 'inserttext'],
michael@0 4398 ['foo[]bar', 'fontname', 'justifyright'],
michael@0 4399 ['foo[]bar', 'fontname', 'justifyright', 'inserttext'],
michael@0 4400 ['foo[]bar', 'fontname', 'outdent'],
michael@0 4401 ['foo[]bar', 'fontname', 'outdent', 'inserttext'],
michael@0 4402
michael@0 4403 ['foo[]bar', 'fontsize', 'inserttext'],
michael@0 4404 ['foo[]bar', 'fontsize', 'delete'],
michael@0 4405 ['foo[]bar', 'fontsize', 'delete', 'inserttext'],
michael@0 4406 ['foo[]bar', 'fontsize', 'formatblock'],
michael@0 4407 ['foo[]bar', 'fontsize', 'formatblock', 'inserttext'],
michael@0 4408 ['foo[]bar', 'fontsize', 'forwarddelete'],
michael@0 4409 ['foo[]bar', 'fontsize', 'forwarddelete', 'inserttext'],
michael@0 4410 ['foo[]bar', 'fontsize', 'indent'],
michael@0 4411 ['foo[]bar', 'fontsize', 'indent', 'inserttext'],
michael@0 4412 ['foo[]bar', 'fontsize', 'inserthorizontalrule'],
michael@0 4413 ['foo[]bar', 'fontsize', 'inserthorizontalrule', 'inserttext'],
michael@0 4414 ['foo[]bar', 'fontsize', 'inserthtml'],
michael@0 4415 ['foo[]bar', 'fontsize', 'inserthtml', 'inserttext'],
michael@0 4416 ['foo[]bar', 'fontsize', 'insertimage'],
michael@0 4417 ['foo[]bar', 'fontsize', 'insertimage', 'inserttext'],
michael@0 4418 ['foo[]bar', 'fontsize', 'insertlinebreak'],
michael@0 4419 ['foo[]bar', 'fontsize', 'insertlinebreak', 'inserttext'],
michael@0 4420 ['foo[]bar', 'fontsize', 'insertorderedlist'],
michael@0 4421 ['foo[]bar', 'fontsize', 'insertorderedlist', 'inserttext'],
michael@0 4422 ['foo[]bar', 'fontsize', 'insertparagraph'],
michael@0 4423 ['foo[]bar', 'fontsize', 'insertparagraph', 'inserttext'],
michael@0 4424 ['foo[]bar', 'fontsize', 'insertunorderedlist'],
michael@0 4425 ['foo[]bar', 'fontsize', 'insertunorderedlist', 'inserttext'],
michael@0 4426 ['foo[]bar', 'fontsize', 'justifycenter'],
michael@0 4427 ['foo[]bar', 'fontsize', 'justifycenter', 'inserttext'],
michael@0 4428 ['foo[]bar', 'fontsize', 'justifyfull'],
michael@0 4429 ['foo[]bar', 'fontsize', 'justifyfull', 'inserttext'],
michael@0 4430 ['foo[]bar', 'fontsize', 'justifyleft'],
michael@0 4431 ['foo[]bar', 'fontsize', 'justifyleft', 'inserttext'],
michael@0 4432 ['foo[]bar', 'fontsize', 'justifyright'],
michael@0 4433 ['foo[]bar', 'fontsize', 'justifyright', 'inserttext'],
michael@0 4434 ['foo[]bar', 'fontsize', 'outdent'],
michael@0 4435 ['foo[]bar', 'fontsize', 'outdent', 'inserttext'],
michael@0 4436
michael@0 4437 ['foo[]bar', 'forecolor', 'inserttext'],
michael@0 4438 ['foo[]bar', 'forecolor', 'delete'],
michael@0 4439 ['foo[]bar', 'forecolor', 'delete', 'inserttext'],
michael@0 4440 ['foo[]bar', 'forecolor', 'formatblock'],
michael@0 4441 ['foo[]bar', 'forecolor', 'formatblock', 'inserttext'],
michael@0 4442 ['foo[]bar', 'forecolor', 'forwarddelete'],
michael@0 4443 ['foo[]bar', 'forecolor', 'forwarddelete', 'inserttext'],
michael@0 4444 ['foo[]bar', 'forecolor', 'indent'],
michael@0 4445 ['foo[]bar', 'forecolor', 'indent', 'inserttext'],
michael@0 4446 ['foo[]bar', 'forecolor', 'inserthorizontalrule'],
michael@0 4447 ['foo[]bar', 'forecolor', 'inserthorizontalrule', 'inserttext'],
michael@0 4448 ['foo[]bar', 'forecolor', 'inserthtml'],
michael@0 4449 ['foo[]bar', 'forecolor', 'inserthtml', 'inserttext'],
michael@0 4450 ['foo[]bar', 'forecolor', 'insertimage'],
michael@0 4451 ['foo[]bar', 'forecolor', 'insertimage', 'inserttext'],
michael@0 4452 ['foo[]bar', 'forecolor', 'insertlinebreak'],
michael@0 4453 ['foo[]bar', 'forecolor', 'insertlinebreak', 'inserttext'],
michael@0 4454 ['foo[]bar', 'forecolor', 'insertorderedlist'],
michael@0 4455 ['foo[]bar', 'forecolor', 'insertorderedlist', 'inserttext'],
michael@0 4456 ['foo[]bar', 'forecolor', 'insertparagraph'],
michael@0 4457 ['foo[]bar', 'forecolor', 'insertparagraph', 'inserttext'],
michael@0 4458 ['foo[]bar', 'forecolor', 'insertunorderedlist'],
michael@0 4459 ['foo[]bar', 'forecolor', 'insertunorderedlist', 'inserttext'],
michael@0 4460 ['foo[]bar', 'forecolor', 'justifycenter'],
michael@0 4461 ['foo[]bar', 'forecolor', 'justifycenter', 'inserttext'],
michael@0 4462 ['foo[]bar', 'forecolor', 'justifyfull'],
michael@0 4463 ['foo[]bar', 'forecolor', 'justifyfull', 'inserttext'],
michael@0 4464 ['foo[]bar', 'forecolor', 'justifyleft'],
michael@0 4465 ['foo[]bar', 'forecolor', 'justifyleft', 'inserttext'],
michael@0 4466 ['foo[]bar', 'forecolor', 'justifyright'],
michael@0 4467 ['foo[]bar', 'forecolor', 'justifyright', 'inserttext'],
michael@0 4468 ['foo[]bar', 'forecolor', 'outdent'],
michael@0 4469 ['foo[]bar', 'forecolor', 'outdent', 'inserttext'],
michael@0 4470
michael@0 4471 ['foo[]bar', 'hilitecolor', 'inserttext'],
michael@0 4472 ['foo[]bar', 'hilitecolor', 'delete'],
michael@0 4473 ['foo[]bar', 'hilitecolor', 'delete', 'inserttext'],
michael@0 4474 ['foo[]bar', 'hilitecolor', 'formatblock'],
michael@0 4475 ['foo[]bar', 'hilitecolor', 'formatblock', 'inserttext'],
michael@0 4476 ['foo[]bar', 'hilitecolor', 'forwarddelete'],
michael@0 4477 ['foo[]bar', 'hilitecolor', 'forwarddelete', 'inserttext'],
michael@0 4478 ['foo[]bar', 'hilitecolor', 'indent'],
michael@0 4479 ['foo[]bar', 'hilitecolor', 'indent', 'inserttext'],
michael@0 4480 ['foo[]bar', 'hilitecolor', 'inserthorizontalrule'],
michael@0 4481 ['foo[]bar', 'hilitecolor', 'inserthorizontalrule', 'inserttext'],
michael@0 4482 ['foo[]bar', 'hilitecolor', 'inserthtml'],
michael@0 4483 ['foo[]bar', 'hilitecolor', 'inserthtml', 'inserttext'],
michael@0 4484 ['foo[]bar', 'hilitecolor', 'insertimage'],
michael@0 4485 ['foo[]bar', 'hilitecolor', 'insertimage', 'inserttext'],
michael@0 4486 ['foo[]bar', 'hilitecolor', 'insertlinebreak'],
michael@0 4487 ['foo[]bar', 'hilitecolor', 'insertlinebreak', 'inserttext'],
michael@0 4488 ['foo[]bar', 'hilitecolor', 'insertorderedlist'],
michael@0 4489 ['foo[]bar', 'hilitecolor', 'insertorderedlist', 'inserttext'],
michael@0 4490 ['foo[]bar', 'hilitecolor', 'insertparagraph'],
michael@0 4491 ['foo[]bar', 'hilitecolor', 'insertparagraph', 'inserttext'],
michael@0 4492 ['foo[]bar', 'hilitecolor', 'insertunorderedlist'],
michael@0 4493 ['foo[]bar', 'hilitecolor', 'insertunorderedlist', 'inserttext'],
michael@0 4494 ['foo[]bar', 'hilitecolor', 'justifycenter'],
michael@0 4495 ['foo[]bar', 'hilitecolor', 'justifycenter', 'inserttext'],
michael@0 4496 ['foo[]bar', 'hilitecolor', 'justifyfull'],
michael@0 4497 ['foo[]bar', 'hilitecolor', 'justifyfull', 'inserttext'],
michael@0 4498 ['foo[]bar', 'hilitecolor', 'justifyleft'],
michael@0 4499 ['foo[]bar', 'hilitecolor', 'justifyleft', 'inserttext'],
michael@0 4500 ['foo[]bar', 'hilitecolor', 'justifyright'],
michael@0 4501 ['foo[]bar', 'hilitecolor', 'justifyright', 'inserttext'],
michael@0 4502 ['foo[]bar', 'hilitecolor', 'outdent'],
michael@0 4503 ['foo[]bar', 'hilitecolor', 'outdent', 'inserttext'],
michael@0 4504
michael@0 4505 // Test things that interfere with each other
michael@0 4506 ['foo[]bar', 'superscript', 'subscript', 'inserttext'],
michael@0 4507 ['foo[]bar', 'subscript', 'superscript', 'inserttext'],
michael@0 4508
michael@0 4509 ['foo[]bar', 'createlink', ['forecolor', '#0000FF'], 'inserttext'],
michael@0 4510 ['foo[]bar', ['forecolor', '#0000FF'], 'createlink', 'inserttext'],
michael@0 4511 ['foo[]bar', 'createlink', ['forecolor', 'blue'], 'inserttext'],
michael@0 4512 ['foo[]bar', ['forecolor', 'blue'], 'createlink', 'inserttext'],
michael@0 4513 ['foo[]bar', 'createlink', ['forecolor', 'brown'], 'inserttext'],
michael@0 4514 ['foo[]bar', ['forecolor', 'brown'], 'createlink', 'inserttext'],
michael@0 4515 ['foo[]bar', 'createlink', ['forecolor', 'black'], 'inserttext'],
michael@0 4516 ['foo[]bar', ['forecolor', 'black'], 'createlink', 'inserttext'],
michael@0 4517 ['foo[]bar', 'createlink', 'underline', 'inserttext'],
michael@0 4518 ['foo[]bar', 'underline', 'createlink', 'inserttext'],
michael@0 4519 ['foo[]bar', 'createlink', 'underline', 'underline', 'inserttext'],
michael@0 4520 ['foo[]bar', 'underline', 'underline', 'createlink', 'inserttext'],
michael@0 4521
michael@0 4522 ['foo[]bar', 'subscript', ['fontsize', '2'], 'inserttext'],
michael@0 4523 ['foo[]bar', ['fontsize', '2'], 'subscript', 'inserttext'],
michael@0 4524 ['foo[]bar', 'subscript', ['fontsize', '3'], 'inserttext'],
michael@0 4525 ['foo[]bar', ['fontsize', '3'], 'subscript', 'inserttext'],
michael@0 4526
michael@0 4527 ['foo[]bar', ['hilitecolor', 'aqua'], ['backcolor', 'tan'], 'inserttext'],
michael@0 4528 ['foo[]bar', ['backcolor', 'tan'], ['hilitecolor', 'aqua'], 'inserttext'],
michael@0 4529
michael@0 4530
michael@0 4531 // The following are all just inserttext tests that we took from there,
michael@0 4532 // but we first backspace the selected text instead of letting
michael@0 4533 // inserttext handle it. This tests that deletion correctly sets
michael@0 4534 // overrides.
michael@0 4535 ['foo<b>[bar]</b>baz', 'delete', 'inserttext'],
michael@0 4536 ['foo<i>[bar]</i>baz', 'delete', 'inserttext'],
michael@0 4537 ['foo<s>[bar]</s>baz', 'delete', 'inserttext'],
michael@0 4538 ['foo<sub>[bar]</sub>baz', 'delete', 'inserttext'],
michael@0 4539 ['foo<sup>[bar]</sup>baz', 'delete', 'inserttext'],
michael@0 4540 ['foo<u>[bar]</u>baz', 'delete', 'inserttext'],
michael@0 4541 ['foo<a href=http://www.google.com>[bar]</a>baz', 'delete', 'inserttext'],
michael@0 4542 ['foo<font face=sans-serif>[bar]</font>baz', 'delete', 'inserttext'],
michael@0 4543 ['foo<font size=4>[bar]</font>baz', 'delete', 'inserttext'],
michael@0 4544 ['foo<font color=#0000FF>[bar]</font>baz', 'delete', 'inserttext'],
michael@0 4545 ['foo<span style=background-color:#00FFFF>[bar]</span>baz', 'delete', 'inserttext'],
michael@0 4546 ['foo<a href=http://www.google.com><font color=blue>[bar]</font></a>baz', 'delete', 'inserttext'],
michael@0 4547 ['foo<font color=blue><a href=http://www.google.com>[bar]</a></font>baz', 'delete', 'inserttext'],
michael@0 4548 ['foo<a href=http://www.google.com><font color=brown>[bar]</font></a>baz', 'delete', 'inserttext'],
michael@0 4549 ['foo<font color=brown><a href=http://www.google.com>[bar]</a></font>baz', 'delete', 'inserttext'],
michael@0 4550 ['foo<a href=http://www.google.com><font color=black>[bar]</font></a>baz', 'delete', 'inserttext'],
michael@0 4551 ['foo<a href=http://www.google.com><u>[bar]</u></a>baz', 'delete', 'inserttext'],
michael@0 4552 ['foo<u><a href=http://www.google.com>[bar]</a></u>baz', 'delete', 'inserttext'],
michael@0 4553 ['foo<sub><font size=2>[bar]</font></sub>baz', 'delete', 'inserttext'],
michael@0 4554 ['foo<font size=2><sub>[bar]</sub></font>baz', 'delete', 'inserttext'],
michael@0 4555 ['foo<sub><font size=3>[bar]</font></sub>baz', 'delete', 'inserttext'],
michael@0 4556 ['foo<font size=3><sub>[bar]</sub></font>baz', 'delete', 'inserttext'],
michael@0 4557
michael@0 4558 // Now repeat but with different selections.
michael@0 4559 ['[foo<b>bar]</b>baz', 'delete', 'inserttext'],
michael@0 4560 ['[foo<i>bar]</i>baz', 'delete', 'inserttext'],
michael@0 4561 ['[foo<s>bar]</s>baz', 'delete', 'inserttext'],
michael@0 4562 ['[foo<sub>bar]</sub>baz', 'delete', 'inserttext'],
michael@0 4563 ['[foo<sup>bar]</sup>baz', 'delete', 'inserttext'],
michael@0 4564 ['[foo<u>bar]</u>baz', 'delete', 'inserttext'],
michael@0 4565 ['[foo<a href=http://www.google.com>bar]</a>baz', 'delete', 'inserttext'],
michael@0 4566 ['[foo<font face=sans-serif>bar]</font>baz', 'delete', 'inserttext'],
michael@0 4567 ['[foo<font size=4>bar]</font>baz', 'delete', 'inserttext'],
michael@0 4568 ['[foo<font color=#0000FF>bar]</font>baz', 'delete', 'inserttext'],
michael@0 4569 ['[foo<span style=background-color:#00FFFF>bar]</span>baz', 'delete', 'inserttext'],
michael@0 4570 ['[foo<a href=http://www.google.com><font color=blue>bar]</font></a>baz', 'delete', 'inserttext'],
michael@0 4571 ['[foo<font color=blue><a href=http://www.google.com>bar]</a></font>baz', 'delete', 'inserttext'],
michael@0 4572 ['[foo<a href=http://www.google.com><font color=brown>bar]</font></a>baz', 'delete', 'inserttext'],
michael@0 4573 ['[foo<font color=brown><a href=http://www.google.com>bar]</a></font>baz', 'delete', 'inserttext'],
michael@0 4574 ['[foo<a href=http://www.google.com><font color=black>bar]</font></a>baz', 'delete', 'inserttext'],
michael@0 4575 ['[foo<a href=http://www.google.com><u>bar]</u></a>baz', 'delete', 'inserttext'],
michael@0 4576 ['[foo<u><a href=http://www.google.com>bar]</a></u>baz', 'delete', 'inserttext'],
michael@0 4577 ['[foo<sub><font size=2>bar]</font></sub>baz', 'delete', 'inserttext'],
michael@0 4578 ['[foo<font size=2><sub>bar]</sub></font>baz', 'delete', 'inserttext'],
michael@0 4579 ['[foo<sub><font size=3>bar]</font></sub>baz', 'delete', 'inserttext'],
michael@0 4580 ['[foo<font size=3><sub>bar]</sub></font>baz', 'delete', 'inserttext'],
michael@0 4581
michael@0 4582 ['foo<b>[bar</b>baz]', 'delete', 'inserttext'],
michael@0 4583 ['foo<i>[bar</i>baz]', 'delete', 'inserttext'],
michael@0 4584 ['foo<s>[bar</s>baz]', 'delete', 'inserttext'],
michael@0 4585 ['foo<sub>[bar</sub>baz]', 'delete', 'inserttext'],
michael@0 4586 ['foo<sup>[bar</sup>baz]', 'delete', 'inserttext'],
michael@0 4587 ['foo<u>[bar</u>baz]', 'delete', 'inserttext'],
michael@0 4588 ['foo<a href=http://www.google.com>[bar</a>baz]', 'delete', 'inserttext'],
michael@0 4589 ['foo<font face=sans-serif>[bar</font>baz]', 'delete', 'inserttext'],
michael@0 4590 ['foo<font size=4>[bar</font>baz]', 'delete', 'inserttext'],
michael@0 4591 ['foo<font color=#0000FF>[bar</font>baz]', 'delete', 'inserttext'],
michael@0 4592 ['foo<span style=background-color:#00FFFF>[bar</span>baz]', 'delete', 'inserttext'],
michael@0 4593 ['foo<a href=http://www.google.com><font color=blue>[bar</font></a>baz]', 'delete', 'inserttext'],
michael@0 4594 ['foo<font color=blue><a href=http://www.google.com>[bar</a></font>baz]', 'delete', 'inserttext'],
michael@0 4595 ['foo<a href=http://www.google.com><font color=brown>[bar</font></a>baz]', 'delete', 'inserttext'],
michael@0 4596 ['foo<font color=brown><a href=http://www.google.com>[bar</a></font>baz]', 'delete', 'inserttext'],
michael@0 4597 ['foo<a href=http://www.google.com><font color=black>[bar</font></a>baz]', 'delete', 'inserttext'],
michael@0 4598 ['foo<a href=http://www.google.com><u>[bar</u></a>baz]', 'delete', 'inserttext'],
michael@0 4599 ['foo<u><a href=http://www.google.com>[bar</a></u>baz]', 'delete', 'inserttext'],
michael@0 4600 ['foo<sub><font size=2>[bar</font></sub>baz]', 'delete', 'inserttext'],
michael@0 4601 ['foo<font size=2><sub>[bar</sub></font>baz]', 'delete', 'inserttext'],
michael@0 4602 ['foo<sub><font size=3>[bar</font></sub>baz]', 'delete', 'inserttext'],
michael@0 4603 ['foo<font size=3><sub>[bar</sub></font>baz]', 'delete', 'inserttext'],
michael@0 4604
michael@0 4605 // https://bugs.webkit.org/show_bug.cgi?id=19702
michael@0 4606 ['<blockquote><font color=blue>[foo]</font></blockquote>', 'delete', 'inserttext'],
michael@0 4607 ],
michael@0 4608 //@}
michael@0 4609 };
michael@0 4610 tests.backcolor = tests.hilitecolor;
michael@0 4611 tests.insertlinebreak = tests.insertparagraph;
michael@0 4612
michael@0 4613 // Tests that start with "!" are believed to have bogus results and should be
michael@0 4614 // skipped until the relevant bugs are fixed.
michael@0 4615 var badTests = {};
michael@0 4616 (function(){
michael@0 4617 for (var command in tests) {
michael@0 4618 badTests[command] = [];
michael@0 4619 for (var i = 0; i < tests[command].length; i++) {
michael@0 4620 var test = tests[command][i];
michael@0 4621 if (typeof test == "string" && test[0] == "!") {
michael@0 4622 test = test.slice(1);
michael@0 4623 tests[command][i] = test;
michael@0 4624 badTests[command].push(test);
michael@0 4625 }
michael@0 4626 if (typeof test == "object" && test[0][0] == "!") {
michael@0 4627 test = [test[0].slice(1)].concat(test.slice(1));
michael@0 4628 tests[command][i] = test;
michael@0 4629 badTests[command].push(test);
michael@0 4630 }
michael@0 4631 }
michael@0 4632 }
michael@0 4633 })();
michael@0 4634
michael@0 4635 var defaultValues = {
michael@0 4636 //@{
michael@0 4637 backcolor: "#00FFFF",
michael@0 4638 createlink: "http://www.google.com/",
michael@0 4639 fontname: "sans-serif",
michael@0 4640 fontsize: "4",
michael@0 4641 forecolor: "#0000FF",
michael@0 4642 formatblock: "<div>",
michael@0 4643 hilitecolor: "#00FFFF",
michael@0 4644 inserthorizontalrule: "",
michael@0 4645 inserthtml: "ab<b>c</b>d",
michael@0 4646 insertimage: "/img/lion.svg",
michael@0 4647 inserttext: "a",
michael@0 4648 defaultparagraphseparator: "p",
michael@0 4649 stylewithcss: "true",
michael@0 4650 usecss: "true",
michael@0 4651 };
michael@0 4652 //@}
michael@0 4653
michael@0 4654 var notes = {
michael@0 4655 //@{
michael@0 4656 fontname: 'Note that the body\'s font-family is "serif".',
michael@0 4657 };
michael@0 4658 //@}
michael@0 4659
michael@0 4660 var doubleTestingCommands = [
michael@0 4661 //@{
michael@0 4662 "backcolor",
michael@0 4663 "bold",
michael@0 4664 "fontname",
michael@0 4665 "fontsize",
michael@0 4666 "forecolor",
michael@0 4667 "italic",
michael@0 4668 "justifycenter",
michael@0 4669 "justifyfull",
michael@0 4670 "justifyleft",
michael@0 4671 "justifyright",
michael@0 4672 "strikethrough",
michael@0 4673 "stylewithcss",
michael@0 4674 "subscript",
michael@0 4675 "superscript",
michael@0 4676 "underline",
michael@0 4677 "usecss",
michael@0 4678 ];
michael@0 4679 //@}
michael@0 4680
michael@0 4681 function prettyPrint(value) {
michael@0 4682 //@{
michael@0 4683 // Partly stolen from testharness.js
michael@0 4684 if (typeof value != "string") {
michael@0 4685 return String(value);
michael@0 4686 }
michael@0 4687
michael@0 4688 value = value.replace(/\\/g, "\\\\")
michael@0 4689 .replace(/"/g, '\\"');
michael@0 4690
michael@0 4691 for (var i = 0; i < 32; i++) {
michael@0 4692 var replace = "\\";
michael@0 4693 switch (i) {
michael@0 4694 case 0: replace += "0"; break;
michael@0 4695 case 1: replace += "x01"; break;
michael@0 4696 case 2: replace += "x02"; break;
michael@0 4697 case 3: replace += "x03"; break;
michael@0 4698 case 4: replace += "x04"; break;
michael@0 4699 case 5: replace += "x05"; break;
michael@0 4700 case 6: replace += "x06"; break;
michael@0 4701 case 7: replace += "x07"; break;
michael@0 4702 case 8: replace += "b"; break;
michael@0 4703 case 9: replace += "t"; break;
michael@0 4704 case 10: replace += "n"; break;
michael@0 4705 case 11: replace += "v"; break;
michael@0 4706 case 12: replace += "f"; break;
michael@0 4707 case 13: replace += "r"; break;
michael@0 4708 case 14: replace += "x0e"; break;
michael@0 4709 case 15: replace += "x0f"; break;
michael@0 4710 case 16: replace += "x10"; break;
michael@0 4711 case 17: replace += "x11"; break;
michael@0 4712 case 18: replace += "x12"; break;
michael@0 4713 case 19: replace += "x13"; break;
michael@0 4714 case 20: replace += "x14"; break;
michael@0 4715 case 21: replace += "x15"; break;
michael@0 4716 case 22: replace += "x16"; break;
michael@0 4717 case 23: replace += "x17"; break;
michael@0 4718 case 24: replace += "x18"; break;
michael@0 4719 case 25: replace += "x19"; break;
michael@0 4720 case 26: replace += "x1a"; break;
michael@0 4721 case 27: replace += "x1b"; break;
michael@0 4722 case 28: replace += "x1c"; break;
michael@0 4723 case 29: replace += "x1d"; break;
michael@0 4724 case 30: replace += "x1e"; break;
michael@0 4725 case 31: replace += "x1f"; break;
michael@0 4726 }
michael@0 4727 value = value.replace(new RegExp(String.fromCharCode(i), "g"), replace);
michael@0 4728 }
michael@0 4729 return '"' + value + '"';
michael@0 4730 }
michael@0 4731 //@}
michael@0 4732
michael@0 4733 function doSetup(selector, idx) {
michael@0 4734 //@{
michael@0 4735 var table = document.querySelectorAll(selector)[idx];
michael@0 4736
michael@0 4737 var tr = document.createElement("tr");
michael@0 4738 table.firstChild.appendChild(tr);
michael@0 4739 tr.className = (tr.className + " active").trim();
michael@0 4740
michael@0 4741 return tr;
michael@0 4742 }
michael@0 4743 //@}
michael@0 4744
michael@0 4745 function queryOutputHelper(beforeIndeterm, beforeState, beforeValue,
michael@0 4746 afterIndeterm, afterState, afterValue,
michael@0 4747 command, value) {
michael@0 4748 //@{
michael@0 4749 var frag = document.createDocumentFragment();
michael@0 4750 var beforeDiv = document.createElement("div");
michael@0 4751 var afterDiv = document.createElement("div");
michael@0 4752 frag.appendChild(beforeDiv);
michael@0 4753 frag.appendChild(afterDiv);
michael@0 4754 beforeDiv.className = afterDiv.className = "extra-results";
michael@0 4755 beforeDiv.textContent = "Before: ";
michael@0 4756 afterDiv.textContent = "After: ";
michael@0 4757
michael@0 4758 beforeDiv.appendChild(document.createElement("span"));
michael@0 4759 afterDiv.appendChild(document.createElement("span"));
michael@0 4760 if ("indeterm" in commands[command]) {
michael@0 4761 // We only know it has to be either true or false.
michael@0 4762 if (beforeIndeterm !== true && beforeIndeterm !== false) {
michael@0 4763 beforeDiv.lastChild.className = "bad-result";
michael@0 4764 }
michael@0 4765 } else {
michael@0 4766 // It always has to be false.
michael@0 4767 beforeDiv.lastChild.className = beforeIndeterm === false
michael@0 4768 ? "good-result"
michael@0 4769 : "bad-result";
michael@0 4770 }
michael@0 4771 // After running the command, indeterminate must always be false, except if
michael@0 4772 // it's an exception, or if it's insert*list and the state was true to
michael@0 4773 // begin with. And we can't help strikethrough/underline.
michael@0 4774 if ((/^insert(un)?orderedlist$/.test(command) && beforeState)
michael@0 4775 || command == "strikethrough"
michael@0 4776 || command == "underline") {
michael@0 4777 if (afterIndeterm !== true && afterIndeterm !== false) {
michael@0 4778 afterDiv.lastChild.className = "bad-result";
michael@0 4779 }
michael@0 4780 } else {
michael@0 4781 afterDiv.lastChild.className =
michael@0 4782 afterIndeterm === false
michael@0 4783 ? "good-result"
michael@0 4784 : "bad-result";
michael@0 4785 }
michael@0 4786 beforeDiv.lastChild.textContent = "indeterm " + prettyPrint(beforeIndeterm);
michael@0 4787 afterDiv.lastChild.textContent = "indeterm " + prettyPrint(afterIndeterm);
michael@0 4788
michael@0 4789 beforeDiv.appendChild(document.createTextNode(", "));
michael@0 4790 afterDiv.appendChild(document.createTextNode(", "));
michael@0 4791
michael@0 4792 beforeDiv.appendChild(document.createElement("span"));
michael@0 4793 afterDiv.appendChild(document.createElement("span"));
michael@0 4794 if (/^insert(un)?orderedlist$/.test(command)) {
michael@0 4795 // If the before state is true, the after state could be either true or
michael@0 4796 // false. But if the before state is false, the after state has to be
michael@0 4797 // true.
michael@0 4798 if (beforeState !== true && beforeState !== false) {
michael@0 4799 beforeDiv.lastChild.className = "bad-result";
michael@0 4800 }
michael@0 4801 if (!beforeState) {
michael@0 4802 afterDiv.lastChild.className = afterState === true
michael@0 4803 ? "good-result"
michael@0 4804 : "bad-result";
michael@0 4805 } else if (afterState !== true && afterState !== false) {
michael@0 4806 afterDiv.lastChild.className = "bad-result";
michael@0 4807 }
michael@0 4808 } else if (/^justify(center|full|left|right)$/.test(command)) {
michael@0 4809 // We don't know about the before state, but the after state is always
michael@0 4810 // supposed to be true.
michael@0 4811 if (beforeState !== true && beforeState !== false) {
michael@0 4812 beforeDiv.lastChild.className = "bad-result";
michael@0 4813 }
michael@0 4814 afterDiv.lastChild.className = afterState === true
michael@0 4815 ? "good-result"
michael@0 4816 : "bad-result";
michael@0 4817 } else if (command == "strikethrough" || command == "underline") {
michael@0 4818 // The only thing we can say is the before/after states need to be
michael@0 4819 // either true or false.
michael@0 4820 if (beforeState !== true && beforeState !== false) {
michael@0 4821 beforeDiv.lastChild.className = "bad-result";
michael@0 4822 }
michael@0 4823 if (afterState !== true && afterState !== false) {
michael@0 4824 afterDiv.lastChild.className = "bad-result";
michael@0 4825 }
michael@0 4826 } else {
michael@0 4827 // The general rule is it must flip the state, unless there's no state
michael@0 4828 // defined, in which case it should always be false.
michael@0 4829 beforeDiv.lastChild.className =
michael@0 4830 afterDiv.lastChild.className =
michael@0 4831 ("state" in commands[command] && typeof beforeState == "boolean" && typeof afterState == "boolean" && beforeState === !afterState)
michael@0 4832 || (!("state" in commands[command]) && beforeState === false && afterState === false)
michael@0 4833 ? "good-result"
michael@0 4834 : "bad-result";
michael@0 4835 }
michael@0 4836 beforeDiv.lastChild.textContent = "state " + prettyPrint(beforeState);
michael@0 4837 afterDiv.lastChild.textContent = "state " + prettyPrint(afterState);
michael@0 4838
michael@0 4839 beforeDiv.appendChild(document.createTextNode(", "));
michael@0 4840 afterDiv.appendChild(document.createTextNode(", "));
michael@0 4841
michael@0 4842 beforeDiv.appendChild(document.createElement("span"));
michael@0 4843 afterDiv.appendChild(document.createElement("span"));
michael@0 4844
michael@0 4845 // Direct equality comparison doesn't make sense in a bunch of cases.
michael@0 4846 if (command == "backcolor" || command == "forecolor" || command == "hilitecolor") {
michael@0 4847 if (/^([0-9a-fA-F]{3}){1,2}$/.test(value)) {
michael@0 4848 value = "#" + value;
michael@0 4849 }
michael@0 4850 } else if (command == "fontsize") {
michael@0 4851 value = normalizeFontSize(value);
michael@0 4852 if (value !== null) {
michael@0 4853 value = String(cssSizeToLegacy(value));
michael@0 4854 }
michael@0 4855 } else if (command == "formatblock") {
michael@0 4856 value = value.replace(/^<(.*)>$/, "$1").toLowerCase();
michael@0 4857 } else if (command == "defaultparagraphseparator") {
michael@0 4858 value = value.toLowerCase();
michael@0 4859 if (value != "p" && value != "div") {
michael@0 4860 value = "";
michael@0 4861 }
michael@0 4862 }
michael@0 4863
michael@0 4864 if (((command == "backcolor" || command == "forecolor" || command == "hilitecolor") && value.toLowerCase() == "currentcolor")
michael@0 4865 || (command == "fontsize" && value === null)
michael@0 4866 || (command == "formatblock" && formattableBlockNames.indexOf(value.replace(/^<(.*)>$/, "$1").trim()) == -1)
michael@0 4867 || (command == "defaultparagraphseparator" && value == "")) {
michael@0 4868 afterDiv.lastChild.className = beforeValue === afterValue
michael@0 4869 ? "good-result"
michael@0 4870 : "bad-result";
michael@0 4871 } else if (/^justify(center|full|left|right)$/.test(command)) {
michael@0 4872 // We know there are only four correct values beforehand, and afterward
michael@0 4873 // the value has to be the one we set.
michael@0 4874 if (!/^(center|justify|left|right)$/.test(beforeValue)) {
michael@0 4875 beforeDiv.lastChild.className = "bad-result";
michael@0 4876 }
michael@0 4877 var expectedValue = command == "justifyfull"
michael@0 4878 ? "justify"
michael@0 4879 : command.replace("justify", "");
michael@0 4880 afterDiv.lastChild.className = afterValue === expectedValue
michael@0 4881 ? "good-result"
michael@0 4882 : "bad-result";
michael@0 4883 } else if (!("value" in commands[command])) {
michael@0 4884 // If it's not defined we want "".
michael@0 4885 beforeDiv.lastChild.className = beforeValue === ""
michael@0 4886 ? "good-result"
michael@0 4887 : "bad-result";
michael@0 4888 afterDiv.lastChild.className = afterValue === ""
michael@0 4889 ? "good-result"
michael@0 4890 : "bad-result";
michael@0 4891 } else {
michael@0 4892 // And in all other cases, the value afterwards has to be the one we
michael@0 4893 // set.
michael@0 4894 afterDiv.lastChild.className =
michael@0 4895 areEquivalentValues(command, afterValue, value)
michael@0 4896 ? "good-result"
michael@0 4897 : "bad-result";
michael@0 4898 }
michael@0 4899 beforeDiv.lastChild.textContent = "value " + prettyPrint(beforeValue);
michael@0 4900 afterDiv.lastChild.textContent = "value " + prettyPrint(afterValue);
michael@0 4901
michael@0 4902 return frag;
michael@0 4903 }
michael@0 4904 //@}
michael@0 4905
michael@0 4906 function normalizeTest(command, test, styleWithCss) {
michael@0 4907 //@{
michael@0 4908 // Our standard format for test processing is:
michael@0 4909 // [input HTML, [command1, value1], [command2, value2], ...]
michael@0 4910 // But this is verbose, so we actually use three different formats in the
michael@0 4911 // tests and multiTests arrays:
michael@0 4912 //
michael@0 4913 // 1) Plain string giving the input HTML. The command is implicit from the
michael@0 4914 // key of the tests array. If the command takes values, the value is given
michael@0 4915 // by defaultValues, otherwise it's "". Has to be converted to
michael@0 4916 // [input HTML, [command, value].
michael@0 4917 //
michael@0 4918 // 2) Two-element array [value, input HTML]. Has to be converted to
michael@0 4919 // [input HTML, [command, value]].
michael@0 4920 //
michael@0 4921 // 3) An element of multiTests. This just has to have values filled in.
michael@0 4922 //
michael@0 4923 // Optionally, a styleWithCss argument can be passed, either true or false.
michael@0 4924 // If it is, we'll prepend a styleWithCss invocation.
michael@0 4925 if (command == "multitest") {
michael@0 4926 if (typeof test == "string") {
michael@0 4927 test = JSON.parse(test);
michael@0 4928 }
michael@0 4929 for (var i = 1; i < test.length; i++) {
michael@0 4930 if (typeof test[i] == "string"
michael@0 4931 && test[i] in defaultValues) {
michael@0 4932 test[i] = [test[i], defaultValues[test[i]]];
michael@0 4933 } else if (typeof test[i] == "string") {
michael@0 4934 test[i] = [test[i], ""];
michael@0 4935 }
michael@0 4936 }
michael@0 4937 return test;
michael@0 4938 }
michael@0 4939
michael@0 4940 if (typeof test == "string") {
michael@0 4941 if (command in defaultValues) {
michael@0 4942 test = [test, [command, defaultValues[command]]];
michael@0 4943 } else {
michael@0 4944 test = [test, [command, ""]];
michael@0 4945 }
michael@0 4946 } else if (test.length == 2) {
michael@0 4947 test = [test[1], [command, String(test[0])]];
michael@0 4948 }
michael@0 4949
michael@0 4950 if (styleWithCss !== undefined) {
michael@0 4951 test.splice(1, 0, ["stylewithcss", String(styleWithCss)]);
michael@0 4952 }
michael@0 4953
michael@0 4954 return test;
michael@0 4955 }
michael@0 4956 //@}
michael@0 4957
michael@0 4958 function doInputCell(tr, test, command) {
michael@0 4959 //@{
michael@0 4960 var testHtml = test[0];
michael@0 4961
michael@0 4962 var msg = null;
michael@0 4963 if (command in defaultValues) {
michael@0 4964 // Single command with a value, possibly with a styleWithCss stuck
michael@0 4965 // before. We don't need to specify the command itself, since this
michael@0 4966 // presumably isn't in multiTests, so the command is already given by
michael@0 4967 // the section header.
michael@0 4968 msg = 'value: ' + prettyPrint(test[test.length - 1][1]);
michael@0 4969 } else if (command == "multitest") {
michael@0 4970 // Uses a different input format
michael@0 4971 msg = JSON.stringify(test);
michael@0 4972 }
michael@0 4973 var inputCell = document.createElement("td");
michael@0 4974 inputCell.innerHTML = "<div></div><div></div>";
michael@0 4975 inputCell.firstChild.innerHTML = testHtml;
michael@0 4976 inputCell.lastChild.textContent = inputCell.firstChild.innerHTML;
michael@0 4977 if (msg !== null) {
michael@0 4978 inputCell.lastChild.textContent += " (" + msg + ")";
michael@0 4979 }
michael@0 4980
michael@0 4981 tr.appendChild(inputCell);
michael@0 4982 }
michael@0 4983 //@}
michael@0 4984
michael@0 4985 function doSpecCell(tr, test, command) {
michael@0 4986 //@{
michael@0 4987 var specCell = document.createElement("td");
michael@0 4988 tr.appendChild(specCell);
michael@0 4989 try {
michael@0 4990 var points = setupCell(specCell, test[0]);
michael@0 4991 var range = document.createRange();
michael@0 4992 range.setStart(points[0], points[1]);
michael@0 4993 range.setEnd(points[2], points[3]);
michael@0 4994 // The points might be backwards
michael@0 4995 if (range.collapsed) {
michael@0 4996 range.setEnd(points[0], points[1]);
michael@0 4997 }
michael@0 4998 specCell.firstChild.contentEditable = "true";
michael@0 4999 specCell.firstChild.spellcheck = false;
michael@0 5000
michael@0 5001 if (command != "multitest") {
michael@0 5002 try { var beforeIndeterm = myQueryCommandIndeterm(command, range) }
michael@0 5003 catch(e) { beforeIndeterm = "Exception" }
michael@0 5004 try { var beforeState = myQueryCommandState(command, range) }
michael@0 5005 catch(e) { beforeState = "Exception" }
michael@0 5006 try { var beforeValue = myQueryCommandValue(command, range) }
michael@0 5007 catch(e) { beforeValue = "Exception" }
michael@0 5008 }
michael@0 5009
michael@0 5010 for (var i = 1; i < test.length; i++) {
michael@0 5011 myExecCommand(test[i][0], false, test[i][1], range);
michael@0 5012 }
michael@0 5013
michael@0 5014 if (command != "multitest") {
michael@0 5015 try { var afterIndeterm = myQueryCommandIndeterm(command, range) }
michael@0 5016 catch(e) { afterIndeterm = "Exception" }
michael@0 5017 try { var afterState = myQueryCommandState(command, range) }
michael@0 5018 catch(e) { afterState = "Exception" }
michael@0 5019 try { var afterValue = myQueryCommandValue(command, range) }
michael@0 5020 catch(e) { afterValue = "Exception" }
michael@0 5021 }
michael@0 5022
michael@0 5023 specCell.firstChild.contentEditable = "inherit";
michael@0 5024 specCell.firstChild.removeAttribute("spellcheck");
michael@0 5025 var compareDiv1 = specCell.firstChild.cloneNode(true);
michael@0 5026
michael@0 5027 // Now do various sanity checks, and throw if they're violated. First
michael@0 5028 // just count children:
michael@0 5029 if (specCell.childNodes.length != 2) {
michael@0 5030 throw "The cell didn't have two children. Did something spill outside the test div?";
michael@0 5031 }
michael@0 5032
michael@0 5033 // Now verify that the DOM serializes.
michael@0 5034 compareDiv1.normalize();
michael@0 5035 var compareDiv2 = compareDiv1.cloneNode(false);
michael@0 5036 compareDiv2.innerHTML = compareDiv1.innerHTML;
michael@0 5037 // Oddly, IE9 sometimes produces two nodes that return true for
michael@0 5038 // isEqualNode but have different innerHTML (omitting closing tags vs.
michael@0 5039 // not).
michael@0 5040 if (!compareDiv1.isEqualNode(compareDiv2)
michael@0 5041 && compareDiv1.innerHTML != compareDiv2.innerHTML) {
michael@0 5042 throw "DOM does not round-trip through serialization! "
michael@0 5043 + compareDiv1.innerHTML + " vs. " + compareDiv2.innerHTML;
michael@0 5044 }
michael@0 5045 if (!compareDiv1.isEqualNode(compareDiv2)) {
michael@0 5046 throw "DOM does not round-trip through serialization (although innerHTML is the same)! "
michael@0 5047 + compareDiv1.innerHTML;
michael@0 5048 }
michael@0 5049
michael@0 5050 // Check for attributes
michael@0 5051 if (specCell.firstChild.attributes.length) {
michael@0 5052 throw "Wrapper div has attributes! " +
michael@0 5053 specCell.innerHTML.replace(/<div><\/div>$/, "");
michael@0 5054 }
michael@0 5055
michael@0 5056 // Final sanity check: make sure everything isAllowedChild() of its
michael@0 5057 // parent.
michael@0 5058 getDescendants(specCell.firstChild).forEach(function(descendant) {
michael@0 5059 if (!isAllowedChild(descendant, descendant.parentNode)) {
michael@0 5060 throw "Something here is not an allowed child of its parent: " + descendant;
michael@0 5061 }
michael@0 5062 });
michael@0 5063
michael@0 5064 addBrackets(range);
michael@0 5065
michael@0 5066 specCell.lastChild.textContent = specCell.firstChild.innerHTML;
michael@0 5067 if (command != "multitest") {
michael@0 5068 specCell.lastChild.appendChild(queryOutputHelper(
michael@0 5069 beforeIndeterm, beforeState, beforeValue,
michael@0 5070 afterIndeterm, afterState, afterValue,
michael@0 5071 command, test[test.length - 1][1]));
michael@0 5072 if (specCell.querySelector(".bad-result")) {
michael@0 5073 specCell.parentNode.className = "alert";
michael@0 5074 }
michael@0 5075 }
michael@0 5076 } catch (e) {
michael@0 5077 specCell.firstChild.contentEditable = "inherit";
michael@0 5078 specCell.firstChild.removeAttribute("spellcheck");
michael@0 5079 specCell.lastChild.textContent = "Exception: " + formatException(e);
michael@0 5080
michael@0 5081 specCell.parentNode.className = "alert";
michael@0 5082 specCell.lastChild.className = "alert";
michael@0 5083
michael@0 5084 // Don't bother comparing to localStorage, this is always wrong no
michael@0 5085 // matter what.
michael@0 5086 return;
michael@0 5087 }
michael@0 5088
michael@0 5089 if (command != "multitest") {
michael@0 5090 // Old storage format
michael@0 5091 var key = "execcommand-" + command
michael@0 5092 + "-" + (test.length == 2 || test[1][1] == "false" ? "0" : "1")
michael@0 5093 + "-" + tr.firstChild.lastChild.textContent;
michael@0 5094 } else {
michael@0 5095 var key = "execcommand-" + JSON.stringify(test);
michael@0 5096 }
michael@0 5097
michael@0 5098 // Use getItem() instead of direct property access to work around Firefox
michael@0 5099 // bug: https://bugzilla.mozilla.org/show_bug.cgi?id=532062
michael@0 5100 var oldValue = localStorage.getItem(key);
michael@0 5101 var newValue = specCell.lastChild.firstChild.textContent;
michael@0 5102
michael@0 5103 // Ignore differences between {} and [].
michael@0 5104 if (oldValue === null
michael@0 5105 || oldValue.replace("{}", "[]") !== newValue.replace("{}", "[]")) {
michael@0 5106 specCell.parentNode.className = "alert";
michael@0 5107 var alertDiv = document.createElement("div");
michael@0 5108 specCell.lastChild.appendChild(alertDiv);
michael@0 5109 alertDiv.className = "alert";
michael@0 5110 if (oldValue === null) {
michael@0 5111 alertDiv.textContent = "Newly added test result";
michael@0 5112 } else if (oldValue.replace(/[\[\]{}]/g, "") == newValue.replace(/[\[\]{}]/g, "")) {
michael@0 5113 alertDiv.textContent = "Last run produced a different selection: " + oldValue;
michael@0 5114 } else {
michael@0 5115 alertDiv.textContent = "Last run produced different markup: " + oldValue;
michael@0 5116 }
michael@0 5117
michael@0 5118 var button = document.createElement("button");
michael@0 5119 alertDiv.appendChild(button);
michael@0 5120 button.textContent = "Store new result";
michael@0 5121 button.className = "store-new-result";
michael@0 5122 button.onclick = (function(key, val, alertDiv) { return function() {
michael@0 5123 localStorage[key] = val;
michael@0 5124 // Make it easier to do mass updates, and also to jump to the next
michael@0 5125 // new result
michael@0 5126 var buttons = document.getElementsByClassName("store-new-result");
michael@0 5127 for (var i = 0; i < buttons.length; i++) {
michael@0 5128 if (isDescendant(buttons[i], alertDiv)
michael@0 5129 && i + 1 < buttons.length) {
michael@0 5130 buttons[i + 1].focus();
michael@0 5131 break;
michael@0 5132 }
michael@0 5133 }
michael@0 5134 var td = alertDiv;
michael@0 5135 while (td.tagName != "TD") {
michael@0 5136 td = td.parentNode;
michael@0 5137 }
michael@0 5138 alertDiv.parentNode.removeChild(alertDiv);
michael@0 5139 if (!td.querySelector(".alert")) {
michael@0 5140 td.parentNode.className = (" " + td.parentNode.className + " ")
michael@0 5141 .replace(/ alert /g, "")
michael@0 5142 .replace(/^ | $/g, "");
michael@0 5143 }
michael@0 5144 } })(key, newValue, alertDiv);
michael@0 5145 }
michael@0 5146 }
michael@0 5147 //@}
michael@0 5148
michael@0 5149 function browserCellException(e, testDiv, browserCell) {
michael@0 5150 //@{
michael@0 5151 if (testDiv) {
michael@0 5152 testDiv.contenteditable = "inherit";
michael@0 5153 testDiv.removeAttribute("spellcheck");
michael@0 5154 }
michael@0 5155 browserCell.lastChild.className = "alert";
michael@0 5156 browserCell.lastChild.textContent = "Exception: " + formatException(e);
michael@0 5157 if (testDiv && testDiv.parentNode != browserCell) {
michael@0 5158 browserCell.insertBefore(testDiv, browserCell.firstChild);
michael@0 5159 }
michael@0 5160 }
michael@0 5161 //@}
michael@0 5162
michael@0 5163 function formatException(e) {
michael@0 5164 //@{
michael@0 5165 if (typeof e == "object" && "stack" in e) {
michael@0 5166 return e + " (stack: " + e.stack + ")";
michael@0 5167 }
michael@0 5168 return String(e);
michael@0 5169 }
michael@0 5170 //@}
michael@0 5171
michael@0 5172 function doSameCell(tr) {
michael@0 5173 //@{
michael@0 5174 tr.className = (" " + tr.className + " ").replace(" active ", "").trim();
michael@0 5175 if (tr.className == "") {
michael@0 5176 tr.removeAttribute("class");
michael@0 5177 }
michael@0 5178
michael@0 5179 var sameCell = document.createElement("td");
michael@0 5180 if (!document.querySelector("#browser-checkbox").checked) {
michael@0 5181 sameCell.className = "maybe";
michael@0 5182 sameCell.textContent = "?";
michael@0 5183 } else {
michael@0 5184 var exception = false;
michael@0 5185 try {
michael@0 5186 // Ad hoc normalization to avoid basically spurious mismatches. For
michael@0 5187 // now this includes ignoring where the selection goes.
michael@0 5188 var normalizedSpecCell = tr.childNodes[1].lastChild.firstChild.textContent
michael@0 5189 .replace(/[[\]{}]/g, "")
michael@0 5190 .replace(/ style="margin: 0 0 0 40px; border: none; padding: 0px;"/g, '')
michael@0 5191 .replace(/ style="margin-right: 0px;" dir="ltr"/g, '')
michael@0 5192 .replace(/ style="margin-left: 0px;" dir="rtl"/g, '')
michael@0 5193 .replace(/ style="margin-(left|right): 40px;"/g, '')
michael@0 5194 .replace(/: /g, ":")
michael@0 5195 .replace(/;? ?"/g, '"')
michael@0 5196 .replace(/<(\/?)strong/g, '<$1b')
michael@0 5197 .replace(/<(\/?)strike/g, '<$1s')
michael@0 5198 .replace(/<(\/?)em/g, '<$1i')
michael@0 5199 .replace(/#[0-9a-fA-F]{6}/g, function(match) { return match.toUpperCase(); });
michael@0 5200 var normalizedBrowserCell = tr.childNodes[2].lastChild.firstChild.textContent
michael@0 5201 .replace(/[[\]{}]/g, "")
michael@0 5202 .replace(/ style="margin: 0 0 0 40px; border: none; padding: 0px;"/g, '')
michael@0 5203 .replace(/ style="margin-right: 0px;" dir="ltr"/g, '')
michael@0 5204 .replace(/ style="margin-left: 0px;" dir="rtl"/g, '')
michael@0 5205 .replace(/ style="margin-(left|right): 40px;"/g, '')
michael@0 5206 .replace(/: /g, ":")
michael@0 5207 .replace(/;? ?"/g, '"')
michael@0 5208 .replace(/<(\/?)strong/g, '<$1b')
michael@0 5209 .replace(/<(\/?)strike/g, '<$1s')
michael@0 5210 .replace(/<(\/?)em/g, '<$1i')
michael@0 5211 .replace(/#[0-9a-fA-F]{6}/g, function(match) { return match.toUpperCase(); })
michael@0 5212 .replace(/ size="2" width="100%"/g, '');
michael@0 5213 if (navigator.userAgent.indexOf("MSIE") != -1) {
michael@0 5214 // IE produces <font style> instead of <span style>, so let's
michael@0 5215 // translate all <span>s to <font>s.
michael@0 5216 normalizedSpecCell = normalizedSpecCell
michael@0 5217 .replace(/<(\/?)span/g, '<$1font');
michael@0 5218 normalizedBrowserCell = normalizedBrowserCell
michael@0 5219 .replace(/<(\/?)span/g, '<$1font');
michael@0 5220 }
michael@0 5221 } catch (e) {
michael@0 5222 exception = true;
michael@0 5223 }
michael@0 5224 if (!exception && normalizedSpecCell == normalizedBrowserCell) {
michael@0 5225 sameCell.className = "yes";
michael@0 5226 sameCell.textContent = "\u2713";
michael@0 5227 } else {
michael@0 5228 sameCell.className = "no";
michael@0 5229 sameCell.textContent = "\u2717";
michael@0 5230 }
michael@0 5231 }
michael@0 5232 tr.appendChild(sameCell);
michael@0 5233
michael@0 5234 for (var i = 0; i <= 2; i++) {
michael@0 5235 // Insert <wbr> so IE doesn't stretch the screen. This is considerably
michael@0 5236 // more complicated than it has to be, thanks to Firefox's lack of
michael@0 5237 // support for outerHTML.
michael@0 5238 var div = tr.childNodes[i].lastChild;
michael@0 5239 if (div.firstChild) {
michael@0 5240 var text = div.firstChild.textContent;
michael@0 5241 div.removeChild(div.firstChild);
michael@0 5242 div.insertBefore(document.createElement("div"), div.firstChild);
michael@0 5243 div.firstChild.innerHTML = text
michael@0 5244 .replace(/&/g, "&amp;")
michael@0 5245 .replace(/</g, "&lt;")
michael@0 5246 .replace(/>/g, "><wbr>")
michael@0 5247 .replace(/&lt;/g, "<wbr>&lt;");
michael@0 5248 while (div.firstChild.hasChildNodes()) {
michael@0 5249 div.insertBefore(div.firstChild.lastChild, div.firstChild.nextSibling);
michael@0 5250 }
michael@0 5251 div.removeChild(div.firstChild);
michael@0 5252 }
michael@0 5253
michael@0 5254 // Add position: absolute span to not affect vertical layout
michael@0 5255 getDescendants(tr.childNodes[i].firstChild)
michael@0 5256 .filter(function(node) {
michael@0 5257 return node.nodeType == Node.TEXT_NODE
michael@0 5258 && /^(\{\}?|\})$/.test(node.data);
michael@0 5259 }).forEach(function(node) {
michael@0 5260 var span = document.createElement("span");
michael@0 5261 span.style.position = "absolute";
michael@0 5262 span.textContent = node.data;
michael@0 5263 node.parentNode.insertBefore(span, node);
michael@0 5264 node.parentNode.removeChild(node);
michael@0 5265 });
michael@0 5266 }
michael@0 5267 }
michael@0 5268 //@}
michael@0 5269
michael@0 5270 function doTearDown(command) {
michael@0 5271 //@{
michael@0 5272 getSelection().removeAllRanges();
michael@0 5273 }
michael@0 5274 //@}
michael@0 5275
michael@0 5276 function setupCell(cell, html) {
michael@0 5277 //@{
michael@0 5278 cell.innerHTML = "<div></div><div></div>";
michael@0 5279
michael@0 5280 return setupDiv(cell.firstChild, html);
michael@0 5281 }
michael@0 5282 //@}
michael@0 5283
michael@0 5284 function setupDiv(node, html) {
michael@0 5285 //@{
michael@0 5286 // A variety of checks to avoid simple errors. Not foolproof, of course.
michael@0 5287 var re = /\{|\[|data-start/g;
michael@0 5288 var markers = [];
michael@0 5289 var marker;
michael@0 5290 while (marker = re.exec(html)) {
michael@0 5291 markers.push(marker);
michael@0 5292 }
michael@0 5293 if (markers.length != 1) {
michael@0 5294 throw "Need exactly one start marker ([ or { or data-start), found " + markers.length;
michael@0 5295 }
michael@0 5296
michael@0 5297 var re = /\}|\]|data-end/g;
michael@0 5298 var markers = [];
michael@0 5299 var marker;
michael@0 5300 while (marker = re.exec(html)) {
michael@0 5301 markers.push(marker);
michael@0 5302 }
michael@0 5303 if (markers.length != 1) {
michael@0 5304 throw "Need exactly one end marker (] or } or data-end), found " + markers.length;
michael@0 5305 }
michael@0 5306
michael@0 5307 node.innerHTML = html;
michael@0 5308
michael@0 5309 var startNode, startOffset, endNode, endOffset;
michael@0 5310
michael@0 5311 // For braces that don't lie inside text nodes, we can't just set
michael@0 5312 // innerHTML, because that might disturb the DOM. For instance, if the
michael@0 5313 // brace is right before a <tr>, it could get moved outside the table
michael@0 5314 // entirely, which messes everything up pretty badly. So we instead
michael@0 5315 // allow using data attributes: data-start and data-end on the start and
michael@0 5316 // end nodes, with a numeric value indicating the offset. This format
michael@0 5317 // doesn't allow the parent div to be a start or end node, but in that case
michael@0 5318 // you can always use the curly braces.
michael@0 5319 if (node.querySelector("[data-start]")) {
michael@0 5320 startNode = node.querySelector("[data-start]");
michael@0 5321 startOffset = startNode.getAttribute("data-start");
michael@0 5322 startNode.removeAttribute("data-start");
michael@0 5323 }
michael@0 5324 if (node.querySelector("[data-end]")) {
michael@0 5325 endNode = node.querySelector("[data-end]");
michael@0 5326 endOffset = endNode.getAttribute("data-end");
michael@0 5327 endNode.removeAttribute("data-end");
michael@0 5328 }
michael@0 5329
michael@0 5330 var cur = node;
michael@0 5331 while (true) {
michael@0 5332 if (!cur || (cur != node && !(cur.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINS))) {
michael@0 5333 break;
michael@0 5334 }
michael@0 5335
michael@0 5336 if (cur.nodeType != Node.TEXT_NODE) {
michael@0 5337 cur = nextNode(cur);
michael@0 5338 continue;
michael@0 5339 }
michael@0 5340
michael@0 5341 var data = cur.data.replace(/\]/g, "");
michael@0 5342 var startIdx = data.indexOf("[");
michael@0 5343
michael@0 5344 data = cur.data.replace(/\[/g, "");
michael@0 5345 var endIdx = data.indexOf("]");
michael@0 5346
michael@0 5347 cur.data = cur.data.replace(/[\[\]]/g, "");
michael@0 5348
michael@0 5349 if (startIdx != -1) {
michael@0 5350 startNode = cur;
michael@0 5351 startOffset = startIdx;
michael@0 5352 }
michael@0 5353
michael@0 5354 if (endIdx != -1) {
michael@0 5355 endNode = cur;
michael@0 5356 endOffset = endIdx;
michael@0 5357 }
michael@0 5358
michael@0 5359 // These are only legal as the first or last
michael@0 5360 data = cur.data.replace(/\}/g, "");
michael@0 5361 var elStartIdx = data.indexOf("{");
michael@0 5362
michael@0 5363 data = cur.data.replace(/\{/g, "");
michael@0 5364 var elEndIdx = data.indexOf("}");
michael@0 5365
michael@0 5366 if (elStartIdx == 0) {
michael@0 5367 startNode = cur.parentNode;
michael@0 5368 startOffset = getNodeIndex(cur);
michael@0 5369 } else if (elStartIdx != -1) {
michael@0 5370 startNode = cur.parentNode;
michael@0 5371 startOffset = getNodeIndex(cur) + 1;
michael@0 5372 }
michael@0 5373 if (elEndIdx == 0) {
michael@0 5374 endNode = cur.parentNode;
michael@0 5375 endOffset = getNodeIndex(cur);
michael@0 5376 } else if (elEndIdx != -1) {
michael@0 5377 endNode = cur.parentNode;
michael@0 5378 endOffset = getNodeIndex(cur) + 1;
michael@0 5379 }
michael@0 5380
michael@0 5381 cur.data = cur.data.replace(/[{}]/g, "");
michael@0 5382 if (!cur.data.length) {
michael@0 5383 if (cur == startNode || cur == endNode) {
michael@0 5384 throw "You put a square bracket where there was no text node . . .";
michael@0 5385 }
michael@0 5386 var oldCur = cur;
michael@0 5387 cur = nextNode(cur);
michael@0 5388 oldCur.parentNode.removeChild(oldCur);
michael@0 5389 } else {
michael@0 5390 cur = nextNode(cur);
michael@0 5391 }
michael@0 5392 }
michael@0 5393
michael@0 5394 return [startNode, startOffset, endNode, endOffset];
michael@0 5395 }
michael@0 5396 //@}
michael@0 5397
michael@0 5398 function setSelection(startNode, startOffset, endNode, endOffset) {
michael@0 5399 //@{
michael@0 5400 if (navigator.userAgent.indexOf("Opera") != -1) {
michael@0 5401 // Yes, browser sniffing is evil, but I can't be bothered to debug
michael@0 5402 // Opera.
michael@0 5403 var range = document.createRange();
michael@0 5404 range.setStart(startNode, startOffset);
michael@0 5405 range.setEnd(endNode, endOffset);
michael@0 5406 if (range.collapsed) {
michael@0 5407 range.setEnd(startNode, startOffset);
michael@0 5408 }
michael@0 5409 getSelection().removeAllRanges();
michael@0 5410 getSelection().addRange(range);
michael@0 5411 } else if ("extend" in getSelection()) {
michael@0 5412 // WebKit behaves unreasonably for collapse(), so do that manually.
michael@0 5413 /*
michael@0 5414 var range = document.createRange();
michael@0 5415 range.setStart(startNode, startOffset);
michael@0 5416 getSelection().removeAllRanges();
michael@0 5417 getSelection().addRange(range);
michael@0 5418 */
michael@0 5419 getSelection().collapse(startNode, startOffset);
michael@0 5420 getSelection().extend(endNode, endOffset);
michael@0 5421 } else {
michael@0 5422 // IE9. Selections have no direction, so we just make the selection
michael@0 5423 // always forwards.
michael@0 5424 var range;
michael@0 5425 if (getSelection().rangeCount) {
michael@0 5426 range = getSelection().getRangeAt(0);
michael@0 5427 } else {
michael@0 5428 range = document.createRange();
michael@0 5429 }
michael@0 5430 range.setStart(startNode, startOffset);
michael@0 5431 range.setEnd(endNode, endOffset);
michael@0 5432 if (range.collapsed) {
michael@0 5433 // Phooey, we got them backwards.
michael@0 5434 range.setEnd(startNode, startOffset);
michael@0 5435 }
michael@0 5436 if (!getSelection().rangeCount) {
michael@0 5437 getSelection().addRange(range);
michael@0 5438 }
michael@0 5439 }
michael@0 5440 }
michael@0 5441 //@}
michael@0 5442
michael@0 5443 /**
michael@0 5444 * Add brackets at the start and end points of the given range, so that they're
michael@0 5445 * visible.
michael@0 5446 */
michael@0 5447 function addBrackets(range) {
michael@0 5448 //@{
michael@0 5449 // Handle the collapsed case specially, to avoid confusingly getting the
michael@0 5450 // markers backwards in some cases
michael@0 5451 if (range.startContainer.nodeType == Node.TEXT_NODE
michael@0 5452 || range.startContainer.nodeType == Node.COMMENT_NODE) {
michael@0 5453 if (range.collapsed) {
michael@0 5454 range.startContainer.insertData(range.startOffset, "[]");
michael@0 5455 } else {
michael@0 5456 range.startContainer.insertData(range.startOffset, "[");
michael@0 5457 }
michael@0 5458 } else {
michael@0 5459 var marker = range.collapsed ? "{}" : "{";
michael@0 5460 if (range.startOffset != range.startContainer.childNodes.length
michael@0 5461 && range.startContainer.childNodes[range.startOffset].nodeType == Node.TEXT_NODE) {
michael@0 5462 range.startContainer.childNodes[range.startOffset].insertData(0, marker);
michael@0 5463 } else if (range.startOffset != 0
michael@0 5464 && range.startContainer.childNodes[range.startOffset - 1].nodeType == Node.TEXT_NODE) {
michael@0 5465 range.startContainer.childNodes[range.startOffset - 1].appendData(marker);
michael@0 5466 } else {
michael@0 5467 // Seems to serialize as I'd want even for tables . . . IE doesn't
michael@0 5468 // allow undefined to be passed as the second argument (it throws
michael@0 5469 // an exception), so we have to explicitly check the number of
michael@0 5470 // children and pass null.
michael@0 5471 range.startContainer.insertBefore(document.createTextNode(marker),
michael@0 5472 range.startContainer.childNodes.length == range.startOffset
michael@0 5473 ? null
michael@0 5474 : range.startContainer.childNodes[range.startOffset]);
michael@0 5475 }
michael@0 5476 }
michael@0 5477 if (range.collapsed) {
michael@0 5478 return;
michael@0 5479 }
michael@0 5480 if (range.endContainer.nodeType == Node.TEXT_NODE
michael@0 5481 || range.endContainer.nodeType == Node.COMMENT_NODE) {
michael@0 5482 range.endContainer.insertData(range.endOffset, "]");
michael@0 5483 } else {
michael@0 5484 if (range.endOffset != range.endContainer.childNodes.length
michael@0 5485 && range.endContainer.childNodes[range.endOffset].nodeType == Node.TEXT_NODE) {
michael@0 5486 range.endContainer.childNodes[range.endOffset].insertData(0, "}");
michael@0 5487 } else if (range.endOffset != 0
michael@0 5488 && range.endContainer.childNodes[range.endOffset - 1].nodeType == Node.TEXT_NODE) {
michael@0 5489 range.endContainer.childNodes[range.endOffset - 1].appendData("}");
michael@0 5490 } else {
michael@0 5491 range.endContainer.insertBefore(document.createTextNode("}"),
michael@0 5492 range.endContainer.childNodes.length == range.endOffset
michael@0 5493 ? null
michael@0 5494 : range.endContainer.childNodes[range.endOffset]);
michael@0 5495 }
michael@0 5496 }
michael@0 5497 }
michael@0 5498 //@}
michael@0 5499
michael@0 5500 function normalizeSerializedStyle(wrapper) {
michael@0 5501 //@{
michael@0 5502 // Inline CSS attribute serialization has terrible interop, so we fix
michael@0 5503 // things up a bit to avoid spurious mismatches. This needs to be removed
michael@0 5504 // once CSSOM defines this stuff properly, but for now there's just no
michael@0 5505 // standard for any of it. This only normalizes descendants of wrapper,
michael@0 5506 // not wrapper itself.
michael@0 5507 [].forEach.call(wrapper.querySelectorAll("[style]"), function(node) {
michael@0 5508 if (node.style.color != "") {
michael@0 5509 var newColor = normalizeColor(node.style.color);
michael@0 5510 node.style.color = "";
michael@0 5511 node.style.color = newColor;
michael@0 5512 }
michael@0 5513 if (node.style.backgroundColor != "") {
michael@0 5514 var newBackgroundColor = normalizeColor(node.style.backgroundColor);
michael@0 5515 node.style.backgroundColor = "";
michael@0 5516 node.style.backgroundColor = newBackgroundColor;
michael@0 5517 }
michael@0 5518 node.setAttribute("style", node.getAttribute("style")
michael@0 5519 // Random spacing differences
michael@0 5520 .replace(/; ?$/, "")
michael@0 5521 .replace(/: /g, ":")
michael@0 5522 // Gecko likes "transparent"
michael@0 5523 .replace(/transparent/g, "rgba(0, 0, 0, 0)")
michael@0 5524 // WebKit likes to look overly precise
michael@0 5525 .replace(/, 0.496094\)/g, ", 0.5)")
michael@0 5526 // Gecko converts anything with full alpha to "transparent" which
michael@0 5527 // then becomes "rgba(0, 0, 0, 0)", so we have to make other
michael@0 5528 // browsers match
michael@0 5529 .replace(/rgba\([0-9]+, [0-9]+, [0-9]+, 0\)/g, "rgba(0, 0, 0, 0)")
michael@0 5530 );
michael@0 5531 });
michael@0 5532 }
michael@0 5533 //@}
michael@0 5534
michael@0 5535 /**
michael@0 5536 * Input is the same format as output of generateTest in gentest.html.
michael@0 5537 */
michael@0 5538 function runConformanceTest(browserTest) {
michael@0 5539 //@{
michael@0 5540 document.getElementById("test-container").innerHTML = "<div contenteditable></div><p>test";
michael@0 5541 var testName = JSON.stringify(browserTest[1]) + " " + format_value(browserTest[0]);
michael@0 5542 var testDiv = document.querySelector("div[contenteditable]");
michael@0 5543 var originalRootElement, newRootElement;
michael@0 5544 var exception = null;
michael@0 5545 var expectedExecCommandReturnValues = browserTest[3];
michael@0 5546 var expectedQueryResults = browserTest[4];
michael@0 5547 var actualQueryResults = {};
michael@0 5548 var actualQueryExceptions = {};
michael@0 5549
michael@0 5550 try {
michael@0 5551 var points = setupDiv(testDiv, browserTest[0]);
michael@0 5552
michael@0 5553 var range = document.createRange();
michael@0 5554 range.setStart(points[0], points[1]);
michael@0 5555 range.setEnd(points[2], points[3]);
michael@0 5556 // The points might be backwards
michael@0 5557 if (range.collapsed) {
michael@0 5558 range.setEnd(points[0], points[1]);
michael@0 5559 }
michael@0 5560 getSelection().removeAllRanges();
michael@0 5561 getSelection().addRange(range);
michael@0 5562
michael@0 5563 var originalRootElement = document.documentElement.cloneNode(true);
michael@0 5564 originalRootElement.querySelector("[contenteditable]").parentNode
michael@0 5565 .removeChild(originalRootElement.querySelector("[contenteditable]"));
michael@0 5566 originalRootElement.querySelector("#log").parentNode
michael@0 5567 .removeChild(originalRootElement.querySelector("#log"));
michael@0 5568
michael@0 5569 for (var command in expectedQueryResults) {
michael@0 5570 var results = [];
michael@0 5571 var exceptions = {};
michael@0 5572 try { results[0] = document.queryCommandIndeterm(command) }
michael@0 5573 catch(e) { exceptions[0] = e }
michael@0 5574 try { results[1] = document.queryCommandState(command) }
michael@0 5575 catch(e) { exceptions[1] = e }
michael@0 5576 try { results[2] = document.queryCommandValue(command) }
michael@0 5577 catch(e) { exceptions[2] = e }
michael@0 5578 actualQueryResults[command] = results;
michael@0 5579 actualQueryExceptions[command] = exceptions;
michael@0 5580 }
michael@0 5581 } catch(e) {
michael@0 5582 exception = e;
michael@0 5583 }
michael@0 5584
michael@0 5585 for (var i = 0; i < browserTest[1].length; i++) {
michael@0 5586 test(function() {
michael@0 5587 assert_equals(exception, null, "Setup must not throw an exception");
michael@0 5588
michael@0 5589 assert_equals(document.execCommand(browserTest[1][i][0], false, browserTest[1][i][1]),
michael@0 5590 expectedExecCommandReturnValues[i]);
michael@0 5591 }, testName + ": execCommand(" + format_value(browserTest[1][i][0]) + ", false, " + format_value(browserTest[1][i][1]) + ") return value");
michael@0 5592 }
michael@0 5593
michael@0 5594 if (exception === null) {
michael@0 5595 try {
michael@0 5596 for (var command in expectedQueryResults) {
michael@0 5597 var results = actualQueryResults[command];
michael@0 5598 var exceptions = actualQueryExceptions[command];
michael@0 5599 try { results[3] = document.queryCommandIndeterm(command) }
michael@0 5600 catch(e) { exceptions[3] = e }
michael@0 5601 try { results[4] = document.queryCommandState(command) }
michael@0 5602 catch(e) { exceptions[4] = e }
michael@0 5603 try { results[5] = document.queryCommandValue(command) }
michael@0 5604 catch(e) { exceptions[5] = e }
michael@0 5605 }
michael@0 5606
michael@0 5607 var newRootElement = document.documentElement.cloneNode(true);
michael@0 5608 newRootElement.querySelector("[contenteditable]").parentNode
michael@0 5609 .removeChild(newRootElement.querySelector("[contenteditable]"));
michael@0 5610 newRootElement.querySelector("#log").parentNode
michael@0 5611 .removeChild(newRootElement.querySelector("#log"));
michael@0 5612
michael@0 5613 normalizeSerializedStyle(testDiv);
michael@0 5614 } catch(e) {
michael@0 5615 exception = e;
michael@0 5616 }
michael@0 5617 }
michael@0 5618
michael@0 5619 test(function() {
michael@0 5620 assert_equals(exception, null, "Setup must not throw an exception");
michael@0 5621
michael@0 5622 // Now test for modifications to non-editable content. First just
michael@0 5623 // count children:
michael@0 5624 assert_equals(testDiv.parentNode.childNodes.length, 2,
michael@0 5625 "The parent div must have two children. Did something spill outside the test div?");
michael@0 5626
michael@0 5627 // Check for attributes
michael@0 5628 assert_equals(testDiv.attributes.length, 1,
michael@0 5629 'Wrapper div must have only one attribute (<div contenteditable="">), but has more (' +
michael@0 5630 formatStartTag(testDiv) + ")");
michael@0 5631
michael@0 5632 assert_equals(document.body.attributes.length, 0,
michael@0 5633 "Body element must have no attributes (<body>), but has more (" +
michael@0 5634 formatStartTag(document.body) + ")");
michael@0 5635
michael@0 5636 // Check that in general, nothing outside the test div was modified.
michael@0 5637 // TODO: Less verbose error reporting, the way some of the range tests
michael@0 5638 // do?
michael@0 5639 assert_equals(newRootElement.innerHTML, originalRootElement.innerHTML,
michael@0 5640 "Everything outside the editable div must be unchanged, but some change did occur");
michael@0 5641 }, testName + " checks for modifications to non-editable content");
michael@0 5642
michael@0 5643 test(function() {
michael@0 5644 assert_equals(exception, null, "Setup must not throw an exception");
michael@0 5645
michael@0 5646 assert_equals(testDiv.innerHTML,
michael@0 5647 browserTest[2].replace(/[\[\]{}]/g, ""),
michael@0 5648 "Unexpected innerHTML (after normalizing inline style)");
michael@0 5649 }, testName + " compare innerHTML");
michael@0 5650
michael@0 5651 for (var command in expectedQueryResults) {
michael@0 5652 var descriptions = [
michael@0 5653 'queryCommandIndeterm("' + command + '") before',
michael@0 5654 'queryCommandState("' + command + '") before',
michael@0 5655 'queryCommandValue("' + command + '") before',
michael@0 5656 'queryCommandIndeterm("' + command + '") after',
michael@0 5657 'queryCommandState("' + command + '") after',
michael@0 5658 'queryCommandValue("' + command + '") after',
michael@0 5659 ];
michael@0 5660 for (var i = 0; i < 6; i++) {
michael@0 5661 test(function() {
michael@0 5662 assert_equals(exception, null, "Setup must not throw an exception");
michael@0 5663
michael@0 5664 if (expectedQueryResults[command][i] === null) {
michael@0 5665 // Some ad hoc tests to verify that we have a real
michael@0 5666 // DOMException. FIXME: This should be made more rigorous,
michael@0 5667 // with clear steps specified for checking that something
michael@0 5668 // is really a DOMException.
michael@0 5669 assert_true(i in actualQueryExceptions[command],
michael@0 5670 "An exception must be thrown in this case");
michael@0 5671 var e = actualQueryExceptions[command][i];
michael@0 5672 assert_equals(typeof e, "object",
michael@0 5673 "typeof thrown object");
michael@0 5674 assert_idl_attribute(e, "code",
michael@0 5675 "Thrown object must be a DOMException");
michael@0 5676 assert_idl_attribute(e, "INVALID_ACCESS_ERR",
michael@0 5677 "Thrown object must be a DOMException");
michael@0 5678 assert_equals(e.code, e.INVALID_ACCESS_ERR,
michael@0 5679 "Thrown object must be an INVALID_ACCESS_ERR, so its .code and .INVALID_ACCESS_ERR attributes must be equal");
michael@0 5680 } else if ((i == 2 || i == 5)
michael@0 5681 && (command == "backcolor" || command == "forecolor" || command == "hilitecolor")
michael@0 5682 && typeof actualQueryResults[command][i] == "string") {
michael@0 5683 assert_false(i in actualQueryExceptions[command],
michael@0 5684 "An exception must not be thrown in this case");
michael@0 5685 // We don't return the format that the color should be in:
michael@0 5686 // that's up to CSSOM. Thus we normalize before comparing.
michael@0 5687 assert_equals(normalizeColor(actualQueryResults[command][i]),
michael@0 5688 expectedQueryResults[command][i],
michael@0 5689 "Wrong result returned (after color normalization)");
michael@0 5690 } else {
michael@0 5691 assert_false(i in actualQueryExceptions[command],
michael@0 5692 "An exception must not be thrown in this case");
michael@0 5693 assert_equals(actualQueryResults[command][i],
michael@0 5694 expectedQueryResults[command][i],
michael@0 5695 "Wrong result returned");
michael@0 5696 }
michael@0 5697 }, testName + " " + descriptions[i]);
michael@0 5698 }
michael@0 5699 }
michael@0 5700
michael@0 5701 // Silly Firefox
michael@0 5702 document.body.removeAttribute("bgcolor");
michael@0 5703 }
michael@0 5704 //@}
michael@0 5705
michael@0 5706 /**
michael@0 5707 * Return a string like '<body bgcolor="#FFFFFF">'.
michael@0 5708 */
michael@0 5709 function formatStartTag(el) {
michael@0 5710 //@{
michael@0 5711 var ret = "<" + el.tagName.toLowerCase();
michael@0 5712 for (var i = 0; i < el.attributes.length; i++) {
michael@0 5713 ret += " " + el.attributes[i].name + '="';
michael@0 5714 ret += el.attributes[i].value.replace(/\&/g, "&amp;")
michael@0 5715 .replace(/"/g, "&quot;");
michael@0 5716 ret += '"';
michael@0 5717 }
michael@0 5718 return ret + ">";
michael@0 5719 }
michael@0 5720 //@}
michael@0 5721
michael@0 5722 // vim: foldmarker=@{,@} foldmethod=marker

mercurial