tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

italic.js (34748B)


      1 // For documentation of the format, see README in this directory.
      2 var browserTests = [
      3 ["foo[]bar",
      4    [["italic",""]],
      5    "foo[]bar",
      6    [true],
      7    {"italic":[false,false,"",false,true,""]}],
      8 ["<p>[foo</p> <p>bar]</p>",
      9    [["stylewithcss","true"],["italic",""]],
     10    "<p><span style=\"font-style:italic\">[foo</span></p> <p><span style=\"font-style:italic\">bar]</span></p>",
     11    [true,true],
     12    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,false,"",false,true,""]}],
     13 ["<p>[foo</p> <p>bar]</p>",
     14    [["stylewithcss","false"],["italic",""]],
     15    "<p><i>[foo</i></p> <p><i>bar]</i></p>",
     16    [true,true],
     17    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,false,"",false,true,""]}],
     18 ["<span>[foo</span> <span>bar]</span>",
     19    [["stylewithcss","true"],["italic",""]],
     20    "<span style=\"font-style:italic\"><span>[foo</span> <span>bar]</span></span>",
     21    [true,true],
     22    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,false,"",false,true,""]}],
     23 ["<span>[foo</span> <span>bar]</span>",
     24    [["stylewithcss","false"],["italic",""]],
     25    "<i><span>[foo</span> <span>bar]</span></i>",
     26    [true,true],
     27    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,false,"",false,true,""]}],
     28 ["<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>",
     29    [["stylewithcss","true"],["italic",""]],
     30    "<p><span style=\"font-style:italic\">[foo</span></p><p> <span style=\"font-style:italic\"><span>bar</span></span> </p><p><span style=\"font-style:italic\">baz]</span></p>",
     31    [true,true],
     32    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,false,"",false,true,""]}],
     33 ["<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>",
     34    [["stylewithcss","false"],["italic",""]],
     35    "<p><i>[foo</i></p><p> <i><span>bar</span></i> </p><p><i>baz]</i></p>",
     36    [true,true],
     37    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,false,"",false,true,""]}],
     38 ["<p>[foo<p><br><p>bar]",
     39    [["stylewithcss","true"],["italic",""]],
     40    "<p><span style=\"font-style:italic\">[foo</span></p><p><span style=\"font-style:italic\"><br></span></p><p><span style=\"font-style:italic\">bar]</span></p>",
     41    [true,true],
     42    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,false,"",false,true,""]}],
     43 ["<p>[foo<p><br><p>bar]",
     44    [["stylewithcss","false"],["italic",""]],
     45    "<p><i>[foo</i></p><p><i><br></i></p><p><i>bar]</i></p>",
     46    [true,true],
     47    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,false,"",false,true,""]}],
     48 ["<b>foo[]bar</b>",
     49    [["italic",""]],
     50    "<b>foo[]bar</b>",
     51    [true],
     52    {"italic":[false,false,"",false,true,""]}],
     53 ["<i>foo[]bar</i>",
     54    [["italic",""]],
     55    "<i>foo[]bar</i>",
     56    [true],
     57    {"italic":[false,true,"",false,false,""]}],
     58 ["<span>foo</span>{}<span>bar</span>",
     59    [["italic",""]],
     60    "<span>foo</span>{}<span>bar</span>",
     61    [true],
     62    {"italic":[false,false,"",false,true,""]}],
     63 ["<span>foo[</span><span>]bar</span>",
     64    [["italic",""]],
     65    "<span>foo[</span><span>]bar</span>",
     66    [true],
     67    {"italic":[false,false,"",false,true,""]}],
     68 ["foo[bar]baz",
     69    [["stylewithcss","true"],["italic",""]],
     70    "foo<span style=\"font-style:italic\">[bar]</span>baz",
     71    [true,true],
     72    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,false,"",false,true,""]}],
     73 ["foo[bar]baz",
     74    [["stylewithcss","false"],["italic",""]],
     75    "foo<i>[bar]</i>baz",
     76    [true,true],
     77    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,false,"",false,true,""]}],
     78 ["foo[bar<b>baz]qoz</b>quz",
     79    [["stylewithcss","true"],["italic",""]],
     80    "foo<span style=\"font-style:italic\">[bar</span><b><span style=\"font-style:italic\">baz]</span>qoz</b>quz",
     81    [true,true],
     82    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,false,"",false,true,""]}],
     83 ["foo[bar<b>baz]qoz</b>quz",
     84    [["stylewithcss","false"],["italic",""]],
     85    "foo<i>[bar</i><b><i>baz]</i>qoz</b>quz",
     86    [true,true],
     87    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,false,"",false,true,""]}],
     88 ["foo[bar<i>baz]qoz</i>quz",
     89    [["italic",""]],
     90    "foo<i>[barbaz]qoz</i>quz",
     91    [true],
     92    {"italic":[true,false,"",false,true,""]}],
     93 ["{<p><p> <p>foo</p>}",
     94    [["stylewithcss","true"],["italic",""]],
     95    "{<p></p><p> </p><p><span style=\"font-style:italic\">foo</span></p>}",
     96    [true,true],
     97    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,false,"",false,true,""]}],
     98 ["{<p><p> <p>foo</p>}",
     99    [["stylewithcss","false"],["italic",""]],
    100    "{<p></p><p> </p><p><i>foo</i></p>}",
    101    [true,true],
    102    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,false,"",false,true,""]}],
    103 ["<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>",
    104    [["stylewithcss","true"],["italic",""]],
    105    "<table><tbody><tr><td>foo</td><td>b<span style=\"font-style:italic\">[a]</span>r</td><td>baz</td></tr></tbody></table>",
    106    [true,true],
    107    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,false,"",false,true,""]}],
    108 ["<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>",
    109    [["stylewithcss","false"],["italic",""]],
    110    "<table><tbody><tr><td>foo</td><td>b<i>[a]</i>r</td><td>baz</td></tr></tbody></table>",
    111    [true,true],
    112    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,false,"",false,true,""]}],
    113 ["<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>",
    114    [["stylewithcss","true"],["italic",""]],
    115    "<table><tbody><tr><td>foo</td>{<td><span style=\"font-style:italic\">bar</span></td>}<td>baz</td></tr></tbody></table>",
    116    [true,true],
    117    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,false,"",false,true,""]}],
    118 ["<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>",
    119    [["stylewithcss","false"],["italic",""]],
    120    "<table><tbody><tr><td>foo</td>{<td><i>bar</i></td>}<td>baz</td></tr></tbody></table>",
    121    [true,true],
    122    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,false,"",false,true,""]}],
    123 ["<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>",
    124    [["stylewithcss","true"],["italic",""]],
    125    "<table><tbody><tr>{<td><span style=\"font-style:italic\">foo</span></td><td><span style=\"font-style:italic\">bar</span></td>}<td>baz</td></tr></tbody></table>",
    126    [true,true],
    127    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,false,"",false,true,""]}],
    128 ["<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>",
    129    [["stylewithcss","false"],["italic",""]],
    130    "<table><tbody><tr>{<td><i>foo</i></td><td><i>bar</i></td>}<td>baz</td></tr></tbody></table>",
    131    [true,true],
    132    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,false,"",false,true,""]}],
    133 ["<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>",
    134    [["stylewithcss","true"],["italic",""]],
    135    "<table><tbody>{<tr><td><span style=\"font-style:italic\">foo</span></td><td><span style=\"font-style:italic\">bar</span></td><td><span style=\"font-style:italic\">baz</span></td></tr>}</tbody></table>",
    136    [true,true],
    137    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,false,"",false,true,""]}],
    138 ["<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>",
    139    [["stylewithcss","false"],["italic",""]],
    140    "<table><tbody>{<tr><td><i>foo</i></td><td><i>bar</i></td><td><i>baz</i></td></tr>}</tbody></table>",
    141    [true,true],
    142    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,false,"",false,true,""]}],
    143 ["<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>",
    144    [["stylewithcss","true"],["italic",""]],
    145    "<table>{<tbody><tr><td><span style=\"font-style:italic\">foo</span></td><td><span style=\"font-style:italic\">bar</span></td><td><span style=\"font-style:italic\">baz</span></td></tr></tbody>}</table>",
    146    [true,true],
    147    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,false,"",false,true,""]}],
    148 ["<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>",
    149    [["stylewithcss","false"],["italic",""]],
    150    "<table>{<tbody><tr><td><i>foo</i></td><td><i>bar</i></td><td><i>baz</i></td></tr></tbody>}</table>",
    151    [true,true],
    152    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,false,"",false,true,""]}],
    153 ["{<table><tr><td>foo<td>bar<td>baz</table>}",
    154    [["stylewithcss","true"],["italic",""]],
    155    "{<table><tbody><tr><td><span style=\"font-style:italic\">foo</span></td><td><span style=\"font-style:italic\">bar</span></td><td><span style=\"font-style:italic\">baz</span></td></tr></tbody></table>}",
    156    [true,true],
    157    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,false,"",false,true,""]}],
    158 ["{<table><tr><td>foo<td>bar<td>baz</table>}",
    159    [["stylewithcss","false"],["italic",""]],
    160    "{<table><tbody><tr><td><i>foo</i></td><td><i>bar</i></td><td><i>baz</i></td></tr></tbody></table>}",
    161    [true,true],
    162    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,false,"",false,true,""]}],
    163 ["foo<address>[bar]</address>baz",
    164    [["stylewithcss","true"],["italic",""]],
    165    "foo<address><span style=\"font-style:normal\">[bar]</span></address>baz",
    166    [true,true],
    167    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    168 ["foo<address>[bar]</address>baz",
    169    [["stylewithcss","false"],["italic",""]],
    170    "foo<address><span style=\"font-style:normal\">[bar]</span></address>baz",
    171    [true,true],
    172    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    173 ["foo<cite>[bar]</cite>baz",
    174    [["stylewithcss","true"],["italic",""]],
    175    "foo<cite><span style=\"font-style:normal\">[bar]</span></cite>baz",
    176    [true,true],
    177    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    178 ["foo<cite>[bar]</cite>baz",
    179    [["stylewithcss","false"],["italic",""]],
    180    "foo<cite><span style=\"font-style:normal\">[bar]</span></cite>baz",
    181    [true,true],
    182    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    183 ["foo<dfn>[bar]</dfn>baz",
    184    [["stylewithcss","true"],["italic",""]],
    185    "foo<dfn><span style=\"font-style:normal\">[bar]</span></dfn>baz",
    186    [true,true],
    187    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    188 ["foo<dfn>[bar]</dfn>baz",
    189    [["stylewithcss","false"],["italic",""]],
    190    "foo<dfn><span style=\"font-style:normal\">[bar]</span></dfn>baz",
    191    [true,true],
    192    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    193 ["foo<em>[bar]</em>baz",
    194    [["italic",""]],
    195    "foo[bar]baz",
    196    [true],
    197    {"italic":[false,true,"",false,false,""]}],
    198 ["foo<var>[bar]</var>baz",
    199    [["stylewithcss","true"],["italic",""]],
    200    "foo<var><span style=\"font-style:normal\">[bar]</span></var>baz",
    201    [true,true],
    202    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    203 ["foo<var>[bar]</var>baz",
    204    [["stylewithcss","false"],["italic",""]],
    205    "foo<var><span style=\"font-style:normal\">[bar]</span></var>baz",
    206    [true,true],
    207    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    208 ["foo{<address>bar</address>}baz",
    209    [["stylewithcss","true"],["italic",""]],
    210    "foo{<address><span style=\"font-style:normal\">bar</span></address>}baz",
    211    [true,true],
    212    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    213 ["foo{<address>bar</address>}baz",
    214    [["stylewithcss","false"],["italic",""]],
    215    "foo{<address><span style=\"font-style:normal\">bar</span></address>}baz",
    216    [true,true],
    217    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    218 ["foo{<cite>bar</cite>}baz",
    219    [["stylewithcss","true"],["italic",""]],
    220    "foo{<cite><span style=\"font-style:normal\">bar</span></cite>}baz",
    221    [true,true],
    222    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    223 ["foo{<cite>bar</cite>}baz",
    224    [["stylewithcss","false"],["italic",""]],
    225    "foo{<cite><span style=\"font-style:normal\">bar</span></cite>}baz",
    226    [true,true],
    227    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    228 ["foo{<dfn>bar</dfn>}baz",
    229    [["stylewithcss","true"],["italic",""]],
    230    "foo{<dfn><span style=\"font-style:normal\">bar</span></dfn>}baz",
    231    [true,true],
    232    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    233 ["foo{<dfn>bar</dfn>}baz",
    234    [["stylewithcss","false"],["italic",""]],
    235    "foo{<dfn><span style=\"font-style:normal\">bar</span></dfn>}baz",
    236    [true,true],
    237    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    238 ["foo{<em>bar</em>}baz",
    239    [["italic",""]],
    240    "foo{bar}baz",
    241    [true],
    242    {"italic":[false,true,"",false,false,""]}],
    243 ["foo{<var>bar</var>}baz",
    244    [["stylewithcss","true"],["italic",""]],
    245    "foo{<var><span style=\"font-style:normal\">bar</span></var>}baz",
    246    [true,true],
    247    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    248 ["foo{<var>bar</var>}baz",
    249    [["stylewithcss","false"],["italic",""]],
    250    "foo{<var><span style=\"font-style:normal\">bar</span></var>}baz",
    251    [true,true],
    252    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    253 ["foo<address>b[a]r</address>baz",
    254    [["stylewithcss","true"],["italic",""]],
    255    "foo<address>b<span style=\"font-style:normal\">[a]</span>r</address>baz",
    256    [true,true],
    257    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    258 ["foo<address>b[a]r</address>baz",
    259    [["stylewithcss","false"],["italic",""]],
    260    "foo<address>b<span style=\"font-style:normal\">[a]</span>r</address>baz",
    261    [true,true],
    262    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    263 ["foo<cite>b[a]r</cite>baz",
    264    [["stylewithcss","true"],["italic",""]],
    265    "foo<cite>b<span style=\"font-style:normal\">[a]</span>r</cite>baz",
    266    [true,true],
    267    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    268 ["foo<cite>b[a]r</cite>baz",
    269    [["stylewithcss","false"],["italic",""]],
    270    "foo<cite>b<span style=\"font-style:normal\">[a]</span>r</cite>baz",
    271    [true,true],
    272    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    273 ["foo<dfn>b[a]r</dfn>baz",
    274    [["stylewithcss","true"],["italic",""]],
    275    "foo<dfn>b<span style=\"font-style:normal\">[a]</span>r</dfn>baz",
    276    [true,true],
    277    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    278 ["foo<dfn>b[a]r</dfn>baz",
    279    [["stylewithcss","false"],["italic",""]],
    280    "foo<dfn>b<span style=\"font-style:normal\">[a]</span>r</dfn>baz",
    281    [true,true],
    282    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    283 // Should not replace existing <em> when partially removing the italic style.
    284 ["foo<em>b[a]r</em>baz",
    285    [["stylewithcss","true"],["italic",""]],
    286    "foo<em>b</em>a<em>r</em>baz",
    287    [true,true],
    288    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    289 ["foo<em>b[a]r</em>baz",
    290    [["stylewithcss","false"],["italic",""]],
    291    "foo<em>b</em>a<em>r</em>baz",
    292    [true,true],
    293    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    294 ["foo<i>b[a]r</i>baz",
    295    [["stylewithcss","true"],["italic",""]],
    296    "foo<span style=\"font-style:italic\">b</span>[a]<span style=\"font-style:italic\">r</span>baz",
    297    [true,true],
    298    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    299 ["foo<i>b[a]r</i>baz",
    300    [["stylewithcss","false"],["italic",""]],
    301    "foo<i>b</i>[a]<i>r</i>baz",
    302    [true,true],
    303    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    304 ["foo<var>b[a]r</var>baz",
    305    [["stylewithcss","true"],["italic",""]],
    306    "foo<var>b<span style=\"font-style:normal\">[a]</span>r</var>baz",
    307    [true,true],
    308    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    309 ["foo<var>b[a]r</var>baz",
    310    [["stylewithcss","false"],["italic",""]],
    311    "foo<var>b<span style=\"font-style:normal\">[a]</span>r</var>baz",
    312    [true,true],
    313    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    314 ["fo[o<address>bar</address>b]az",
    315    [["stylewithcss","true"],["italic",""]],
    316    "fo<span style=\"font-style:italic\">[o</span><address>bar</address><span style=\"font-style:italic\">b]</span>az",
    317    [true,true],
    318    {"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
    319 ["fo[o<address>bar</address>b]az",
    320    [["stylewithcss","false"],["italic",""]],
    321    "fo<i>[o</i><address>bar</address><i>b]</i>az",
    322    [true,true],
    323    {"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
    324 ["fo[o<cite>bar</cite>b]az",
    325    [["stylewithcss","true"],["italic",""]],
    326    "fo<span style=\"font-style:italic\">[o<cite>bar</cite>b]</span>az",
    327    [true,true],
    328    {"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
    329 ["fo[o<cite>bar</cite>b]az",
    330    [["stylewithcss","false"],["italic",""]],
    331    "fo<i>[o<cite>bar</cite>b]</i>az",
    332    [true,true],
    333    {"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
    334 ["fo[o<dfn>bar</dfn>b]az",
    335    [["stylewithcss","true"],["italic",""]],
    336    "fo<span style=\"font-style:italic\">[o<dfn>bar</dfn>b]</span>az",
    337    [true,true],
    338    {"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
    339 ["fo[o<dfn>bar</dfn>b]az",
    340    [["stylewithcss","false"],["italic",""]],
    341    "fo<i>[o<dfn>bar</dfn>b]</i>az",
    342    [true,true],
    343    {"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
    344 // Replace <em> with <i> or <span> when whole of it is wrapped in a new element.
    345 ["fo[o<em>bar</em>b]az",
    346    [["stylewithcss","true"],["italic",""]],
    347    "fo<span style=\"font-style:italic\">[obarb]</span>az",
    348    [true,true],
    349    {"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
    350 ["fo[o<em>bar</em>b]az",
    351    [["stylewithcss","false"],["italic",""]],
    352    "fo<i>[obarb]</i>az",
    353    [true,true],
    354    {"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
    355 ["fo[o<var>bar</var>b]az",
    356    [["stylewithcss","true"],["italic",""]],
    357    "fo<span style=\"font-style:italic\">[o<var>bar</var>b]</span>az",
    358    [true,true],
    359    {"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
    360 ["fo[o<var>bar</var>b]az",
    361    [["stylewithcss","false"],["italic",""]],
    362    "fo<i>[o<var>bar</var>b]</i>az",
    363    [true,true],
    364    {"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
    365 ["foo[<address>bar</address>baz]",
    366    [["stylewithcss","true"],["italic",""]],
    367    "foo[<address>bar</address><span style=\"font-style:italic\">baz]</span>",
    368    [true,true],
    369    {"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
    370 ["foo[<address>bar</address>baz]",
    371    [["stylewithcss","false"],["italic",""]],
    372    "foo[<address>bar</address><i>baz]</i>",
    373    [true,true],
    374    {"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
    375 ["foo[<cite>bar</cite>baz]",
    376    [["stylewithcss","true"],["italic",""]],
    377    "foo[<cite>bar</cite><span style=\"font-style:italic\">baz]</span>",
    378    [true,true],
    379    {"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
    380 ["foo[<cite>bar</cite>baz]",
    381    [["stylewithcss","false"],["italic",""]],
    382    "foo[<cite>bar</cite><i>baz]</i>",
    383    [true,true],
    384    {"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
    385 ["foo[<dfn>bar</dfn>baz]",
    386    [["stylewithcss","true"],["italic",""]],
    387    "foo[<dfn>bar</dfn><span style=\"font-style:italic\">baz]</span>",
    388    [true,true],
    389    {"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
    390 ["foo[<dfn>bar</dfn>baz]",
    391    [["stylewithcss","false"],["italic",""]],
    392    "foo[<dfn>bar</dfn><i>baz]</i>",
    393    [true,true],
    394    {"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
    395 ["foo[<em>bar</em>baz]",
    396    [["stylewithcss","true"],["italic",""]],
    397    "foo[<span style=\"font-style:italic\">barbaz]</span>",
    398    [true,true],
    399    {"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
    400 ["foo[<em>bar</em>baz]",
    401    [["stylewithcss","false"],["italic",""]],
    402    "foo[<i>barbaz]</i>",
    403    [true,true],
    404    {"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
    405 ["foo[<i>bar</i>baz]",
    406    [["stylewithcss","true"],["italic",""]],
    407    "foo[<span style=\"font-style:italic\">barbaz]</span>",
    408    [true,true],
    409    {"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
    410 ["foo[<i>bar</i>baz]",
    411    [["stylewithcss","false"],["italic",""]],
    412    "foo[<i>barbaz]</i>",
    413    [true,true],
    414    {"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
    415 ["foo[<var>bar</var>baz]",
    416    [["stylewithcss","true"],["italic",""]],
    417    "foo[<var>bar</var><span style=\"font-style:italic\">baz]</span>",
    418    [true,true],
    419    {"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
    420 ["foo[<var>bar</var>baz]",
    421    [["stylewithcss","false"],["italic",""]],
    422    "foo[<var>bar</var><i>baz]</i>",
    423    [true,true],
    424    {"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
    425 ["[foo<address>bar</address>]baz",
    426    [["stylewithcss","true"],["italic",""]],
    427    "<span style=\"font-style:italic\">[foo</span><address>bar</address>]baz",
    428    [true,true],
    429    {"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
    430 ["[foo<address>bar</address>]baz",
    431    [["stylewithcss","false"],["italic",""]],
    432    "<i>[foo</i><address>bar</address>]baz",
    433    [true,true],
    434    {"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
    435 ["[foo<cite>bar</cite>]baz",
    436    [["stylewithcss","true"],["italic",""]],
    437    "<span style=\"font-style:italic\">[foo<cite>bar</cite></span>]baz",
    438    [true,true],
    439    {"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
    440 ["[foo<cite>bar</cite>]baz",
    441    [["stylewithcss","false"],["italic",""]],
    442    "<i>[foo<cite>bar</cite></i>]baz",
    443    [true,true],
    444    {"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
    445 ["[foo<dfn>bar</dfn>]baz",
    446    [["stylewithcss","true"],["italic",""]],
    447    "<span style=\"font-style:italic\">[foo<dfn>bar</dfn></span>]baz",
    448    [true,true],
    449    {"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
    450 ["[foo<dfn>bar</dfn>]baz",
    451    [["stylewithcss","false"],["italic",""]],
    452    "<i>[foo<dfn>bar</dfn></i>]baz",
    453    [true,true],
    454    {"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
    455 ["[foo<em>bar</em>]baz",
    456    [["stylewithcss","true"],["italic",""]],
    457    "<span style=\"font-style:italic\">[foobar</span>]baz",
    458    [true,true],
    459    {"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
    460 ["[foo<em>bar</em>]baz",
    461    [["stylewithcss","false"],["italic",""]],
    462    "<i>[foobar</i>]baz",
    463    [true,true],
    464    {"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
    465 ["[foo<i>bar</i>]baz",
    466    [["stylewithcss","true"],["italic",""]],
    467    "<span style=\"font-style:italic\">[foobar</span>]baz",
    468    [true,true],
    469    {"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
    470 ["[foo<i>bar</i>]baz",
    471    [["stylewithcss","false"],["italic",""]],
    472    "<i>[foobar</i>]baz",
    473    [true,true],
    474    {"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
    475 ["[foo<var>bar</var>]baz",
    476    [["stylewithcss","true"],["italic",""]],
    477    "<span style=\"font-style:italic\">[foo<var>bar</var></span>]baz",
    478    [true,true],
    479    {"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
    480 ["[foo<var>bar</var>]baz",
    481    [["stylewithcss","false"],["italic",""]],
    482    "<i>[foo<var>bar</var></i>]baz",
    483    [true,true],
    484    {"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
    485 ["foo<span style=\"font-style: italic\">[bar]</span>baz",
    486    [["stylewithcss","true"],["italic",""]],
    487    "foo[bar]baz",
    488    [true,true],
    489    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    490 ["foo<span style=\"font-style: italic\">[bar]</span>baz",
    491    [["stylewithcss","false"],["italic",""]],
    492    "foo[bar]baz",
    493    [true,true],
    494    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    495 ["foo<span style=\"font-style: oblique\">[bar]</span>baz",
    496    [["stylewithcss","true"],["italic",""]],
    497    "foo[bar]baz",
    498    [true,true],
    499    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    500 ["foo<span style=\"font-style: oblique\">[bar]</span>baz",
    501    [["stylewithcss","false"],["italic",""]],
    502    "foo[bar]baz",
    503    [true,true],
    504    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    505 ["foo<span style=\"font-style: oblique\">b[a]r</span>baz",
    506    [["stylewithcss","true"],["italic",""]],
    507    "foo<span style=\"font-style:oblique\">b</span>[a]<span style=\"font-style:oblique\">r</span>baz",
    508    [true,true],
    509    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    510 ["foo<span style=\"font-style: oblique\">b[a]r</span>baz",
    511    [["stylewithcss","false"],["italic",""]],
    512    "foo<span style=\"font-style:oblique\">b</span>[a]<span style=\"font-style:oblique\">r</span>baz",
    513    [true,true],
    514    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    515 ["<i>{<p>foo</p><p>bar</p>}<p>baz</p></i>",
    516    [["stylewithcss","true"],["italic",""]],
    517    "{<p>foo</p><p>bar</p>}<p><span style=\"font-style:italic\">baz</span></p>",
    518    [true,true],
    519    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    520 ["<i>{<p>foo</p><p>bar</p>}<p>baz</p></i>",
    521    [["stylewithcss","false"],["italic",""]],
    522    "{<p>foo</p><p>bar</p>}<p><i>baz</i></p>",
    523    [true,true],
    524    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    525 ["<i><p>foo[<b>bar</b>}</p><p>baz</p></i>",
    526    [["stylewithcss","true"],["italic",""]],
    527    "<p><span style=\"font-style:italic\">foo[</span><b>bar</b>}</p><p><span style=\"font-style:italic\">baz</span></p>",
    528    [true,true],
    529    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    530 ["<i><p>foo[<b>bar</b>}</p><p>baz</p></i>",
    531    [["stylewithcss","false"],["italic",""]],
    532    "<p><i>foo[</i><b>bar</b>}</p><p><i>baz</i></p>",
    533    [true,true],
    534    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    535 ["foo [bar <b>baz] qoz</b> quz sic",
    536    [["stylewithcss","true"],["italic",""]],
    537    "foo <span style=\"font-style:italic\">[bar </span><b><span style=\"font-style:italic\">baz]</span> qoz</b> quz sic",
    538    [true,true],
    539    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,false,"",false,true,""]}],
    540 ["foo [bar <b>baz] qoz</b> quz sic",
    541    [["stylewithcss","false"],["italic",""]],
    542    "foo <i>[bar </i><b><i>baz]</i> qoz</b> quz sic",
    543    [true,true],
    544    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,false,"",false,true,""]}],
    545 ["foo bar <b>baz [qoz</b> quz] sic",
    546    [["stylewithcss","true"],["italic",""]],
    547    "foo bar <b>baz <span style=\"font-style:italic\">[qoz</span></b><span style=\"font-style:italic\"> quz]</span> sic",
    548    [true,true],
    549    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,false,"",false,true,""]}],
    550 ["foo bar <b>baz [qoz</b> quz] sic",
    551    [["stylewithcss","false"],["italic",""]],
    552    "foo bar <b>baz <i>[qoz</i></b><i> quz]</i> sic",
    553    [true,true],
    554    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,false,"",false,true,""]}],
    555 ["foo [bar <i>baz] qoz</i> quz sic",
    556    [["italic",""]],
    557    "foo <i>[bar baz] qoz</i> quz sic",
    558    [true],
    559    {"italic":[true,false,"",false,true,""]}],
    560 ["foo bar <i>baz [qoz</i> quz] sic",
    561    [["italic",""]],
    562    "foo bar <i>baz [qoz quz]</i> sic",
    563    [true],
    564    {"italic":[true,false,"",false,true,""]}],
    565 ["fo[o<i>b]ar</i>baz",
    566    [["italic",""]],
    567    "fo<i>[ob]ar</i>baz",
    568    [true],
    569    {"italic":[true,false,"",false,true,""]}],
    570 ["foo<i>ba[r</i>b]az",
    571    [["italic",""]],
    572    "foo<i>ba[rb]</i>az",
    573    [true],
    574    {"italic":[true,false,"",false,true,""]}],
    575 ["fo[o<i>bar</i>b]az",
    576    [["stylewithcss","true"],["italic",""]],
    577    "fo<span style=\"font-style:italic\">[obarb]</span>az",
    578    [true,true],
    579    {"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
    580 ["fo[o<i>bar</i>b]az",
    581    [["stylewithcss","false"],["italic",""]],
    582    "fo<i>[obarb]</i>az",
    583    [true,true],
    584    {"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
    585 ["foo[<i>b]ar</i>baz",
    586    [["stylewithcss","true"],["italic",""]],
    587    "foo[b]<span style=\"font-style:italic\">ar</span>baz",
    588    [true,true],
    589    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    590 ["foo[<i>b]ar</i>baz",
    591    [["stylewithcss","false"],["italic",""]],
    592    "foo[b]<i>ar</i>baz",
    593    [true,true],
    594    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    595 ["foo<i>ba[r</i>]baz",
    596    [["stylewithcss","true"],["italic",""]],
    597    "foo<span style=\"font-style:italic\">ba</span>[r]baz",
    598    [true,true],
    599    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    600 ["foo<i>ba[r</i>]baz",
    601    [["stylewithcss","false"],["italic",""]],
    602    "foo<i>ba</i>[r]baz",
    603    [true,true],
    604    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    605 ["foo[<i>bar</i>]baz",
    606    [["stylewithcss","true"],["italic",""]],
    607    "foo[bar]baz",
    608    [true,true],
    609    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    610 ["foo[<i>bar</i>]baz",
    611    [["stylewithcss","false"],["italic",""]],
    612    "foo[bar]baz",
    613    [true,true],
    614    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    615 ["foo<i>[bar]</i>baz",
    616    [["stylewithcss","true"],["italic",""]],
    617    "foo[bar]baz",
    618    [true,true],
    619    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    620 ["foo<i>[bar]</i>baz",
    621    [["stylewithcss","false"],["italic",""]],
    622    "foo[bar]baz",
    623    [true,true],
    624    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    625 ["foo{<i>bar</i>}baz",
    626    [["stylewithcss","true"],["italic",""]],
    627    "foo{bar}baz",
    628    [true,true],
    629    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    630 ["foo{<i>bar</i>}baz",
    631    [["stylewithcss","false"],["italic",""]],
    632    "foo{bar}baz",
    633    [true,true],
    634    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    635 ["fo[o<span style=font-style:italic>b]ar</span>baz",
    636    [["italic",""]],
    637    "fo<span style=\"font-style:italic\">[ob]ar</span>baz",
    638    [true],
    639    {"italic":[true,false,"",false,true,""]}],
    640 ["fo[o<span style=font-style:oblique>b]ar</span>baz",
    641    [["stylewithcss","true"],["italic",""]],
    642    "fo<span style=\"font-style:italic\">[o</span><span style=\"font-style:oblique\"><span style=\"font-style:italic\">b]</span>ar</span>baz",
    643    [true,true],
    644    {"stylewithcss":[false,false,"",false,true,""],"italic":[true,false,"",false,true,""]}],
    645 ["fo[o<span style=font-style:oblique>b]ar</span>baz",
    646    [["stylewithcss","false"],["italic",""]],
    647    "fo<i>[o</i><span style=\"font-style:oblique\"><i>b]</i>ar</span>baz",
    648    [true,true],
    649    {"stylewithcss":[false,true,"",false,false,""],"italic":[true,false,"",false,true,""]}],
    650 ["<span style=font-style:italic>fo[o</span><span style=font-style:oblique>b]ar</span>",
    651    [["stylewithcss","true"],["italic",""]],
    652    "<span style=\"font-style:italic\">fo</span>[ob]<span style=\"font-style:oblique\">ar</span>",
    653    [true,true],
    654    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    655 ["<span style=font-style:italic>fo[o</span><span style=font-style:oblique>b]ar</span>",
    656    [["stylewithcss","false"],["italic",""]],
    657    "<i>fo</i>[ob]<span style=\"font-style:oblique\">ar</span>",
    658    [true,true],
    659    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    660 ["<span style=font-style:oblique>fo[o</span><span style=font-style:italic>b]ar</span>",
    661    [["stylewithcss","true"],["italic",""]],
    662    "<span style=\"font-style:oblique\">fo</span>[ob]<span style=\"font-style:italic\">ar</span>",
    663    [true,true],
    664    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    665 ["<span style=font-style:oblique>fo[o</span><span style=font-style:italic>b]ar</span>",
    666    [["stylewithcss","false"],["italic",""]],
    667    "<span style=\"font-style:oblique\">fo</span>[ob]<i>ar</i>",
    668    [true,true],
    669    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    670 ["<i>fo[o</i><address>b]ar</address>",
    671    [["stylewithcss","true"],["italic",""]],
    672    "<span style=\"font-style:italic\">fo</span>[o<address><span style=\"font-style:normal\">b]</span>ar</address>",
    673    [true,true],
    674    {"stylewithcss":[false,false,"",false,true,""],"italic":[false,true,"",false,false,""]}],
    675 ["<i>fo[o</i><address>b]ar</address>",
    676    [["stylewithcss","false"],["italic",""]],
    677    "<i>fo</i>[o<address><span style=\"font-style:normal\">b]</span>ar</address>",
    678    [true,true],
    679    {"stylewithcss":[false,true,"",false,false,""],"italic":[false,true,"",false,false,""]}],
    680 
    681 // Should not change the style of the non-editable nodes so that only the
    682 // visible and editable nodes are wrapped into the <i> elements.
    683 ['{ <span contenteditable="false">A</span> ; <span contenteditable="false">B</span> ; <span contenteditable="false">C</span> }',
    684    [["stylewithcss","false"],["italic",""]],
    685    ' <span contenteditable="false">A</span><i> ; </i><span contenteditable="false">B</span><i> ; </i><span contenteditable="false">C</span> ',
    686    [true,true],
    687    {}],
    688 ]