| Test to make sure we can toggle underline and strike through separately. |
| |
| On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| |
| |
| document.execCommand("styleWithCSS", false, false); |
| |
| Toggling strikeThrough |
| PASS content("<s><u>a</u>b</s>"); select(0, 2); toggle("strikeThrough") is "<u>a</u>b" |
| PASS content("<s><u>a</u>b<u>c</u></s>"); select(0, 3); toggle("strikeThrough") is "<u>a</u>b<u>c</u>" |
| PASS content("<s>a<u>b</u>c</s>"); select(0, 3); toggle("strikeThrough") is "a<u>b</u>c" |
| PASS content("<s>a<u>b</u>c</s>"); select(1, 3); toggle("strikeThrough") is "<strike>a</strike><u>b</u>c" |
| PASS content("<s>a<u>b</u>c</s>"); select(0, 2); toggle("strikeThrough") is "a<u>b</u><strike>c</strike>" |
| PASS content("<s><u>ab</u></s>c"); select(1, 3); toggle("strikeThrough") is "<u><strike>a</strike>b</u>c" |
| PASS content("<s>a<u>b</u></s>c"); select(1, 3); toggle("strikeThrough") is "<strike>a</strike><u>b</u>c" |
| PASS content("a<s><u>b</u>c</s>"); select(0, 2); toggle("strikeThrough") is "<strike>a</strike><s><u>b</u>c</s>" |
| PASS content("a<strike><u>b</u>c</strike>"); select(0, 2); toggle("strikeThrough") is "<strike>a<u>b</u>c</strike>" |
| PASS content("a<u><s>bc</s></u>"); select(0, 2); toggle("strikeThrough") is "<strike>a</strike><u><s>bc</s></u>" |
| PASS content("a<s><b><u>bc</u></b></s>"); select(0, 2); toggle("strikeThrough") is "<strike>a</strike><s><b><u>bc</u></b></s>" |
| PASS content("a<strike><b><u>bc</u></b></strike>"); select(0, 2); toggle("strikeThrough") is "<strike>a<b><u>bc</u></b></strike>" |
| |
| Toggling underline |
| PASS content("<u><s>a</s>b</u>"); select(0, 2); toggle("underline") is "<s>a</s>b" |
| PASS content("<u><s>a</s>b<s>c</s></u>"); select(0, 3); toggle("underline") is "<s>a</s>b<s>c</s>" |
| PASS content("<u>a<s>b</s>c</u>"); select(0, 3); toggle("underline") is "a<s>b</s>c" |
| PASS content("<u>a<s>b</s>c</u>"); select(1, 3); toggle("underline") is "<u>a</u><s>b</s>c" |
| PASS content("<u>a<s>b</s>c</u>"); select(0, 2); toggle("underline") is "a<s>b</s><u>c</u>" |
| PASS content("<u><s>ab</s></u>c"); select(1, 3); toggle("underline") is "<s><u>a</u>b</s>c" |
| PASS content("<u>a<s>b</s></u>c"); select(1, 3); toggle("underline") is "<u>a</u><s>b</s>c" |
| PASS content("a<u><s>b</s>c</u>"); select(0, 2); toggle("underline") is "<u>a<s>b</s>c</u>" |
| PASS content("a<s><u>bc</u></s>"); select(0, 2); toggle("underline") is "<u>a</u><s><u>bc</u></s>" |
| PASS content("a<u><b><s>bc</s></b></u>"); select(0, 2); toggle("underline") is "<u>a<b><s>bc</s></b></u>" |
| document.execCommand("styleWithCSS", false, true); |
| |
| Toggling strikeThrough |
| PASS content('<span style="text-decoration: line-through;"><span style="text-decoration: underline">a</span>b</span>'); |
| select(0, 2); toggle("strikeThrough") is '<span style="text-decoration: underline;">a</span>b' |
| PASS content('<span style="text-decoration: line-through;"><span style="text-decoration: underline;">a</span>b<span style="text-decoration: underline">c</span></span>'); |
| select(0, 3); toggle("strikeThrough") is '<span style="text-decoration: underline;">a</span>b<span style="text-decoration: underline;">c</span>' |
| PASS content('<span style="text-decoration: line-through;">a<span style="text-decoration: underline;">b</span>c</span>'); |
| select(0, 3); toggle("strikeThrough") is 'a<span style="text-decoration: underline;">b</span>c' |
| PASS content('<span style="text-decoration: line-through;">a<span style="text-decoration: underline;">b</span>c</span>'); |
| select(1, 3); toggle("strikeThrough") is '<span style="text-decoration: line-through;">a</span><span style="text-decoration: underline;">b</span>c' |
| PASS content('<span style="text-decoration: line-through;">a<span style="text-decoration: underline;">b</span>c</span>'); |
| select(0, 2); toggle("strikeThrough") is 'a<span style="text-decoration: underline;">b</span><span style="text-decoration: line-through;">c</span>' |
| PASS content('<span style="text-decoration: line-through;"><span style="text-decoration: underline;">ab</span></span>c'); |
| select(1, 3); toggle("strikeThrough") is '<span style="text-decoration: underline;"><span style="text-decoration: line-through;">a</span>b</span>c' |
| PASS content('a<span style="text-decoration: line-through;"><span style="text-decoration: underline;">b</span>c</span>'); |
| select(0, 2); toggle("strikeThrough") is '<span style="text-decoration: line-through;">a<span style="text-decoration: underline line-through;">b</span>c</span>' |
| PASS content('a<span style="text-decoration: underline;"><span style="text-decoration: line-through;">bc</span></span>'); |
| select(0, 2); toggle("strikeThrough") is '<span style="text-decoration: line-through;">a</span><span style="text-decoration: underline;"><span style="text-decoration: line-through;">bc</span></span>' |
| PASS content('a<span style="text-decoration: line-through;"><b><span style="text-decoration: underline;">bc</span></b></span>'); |
| select(0, 2); toggle("strikeThrough") is '<span style="text-decoration: line-through;">a<b><span style="text-decoration: underline;"><span style="text-decoration: underline line-through;">b</span>c</span></b></span>' |
| |
| Toggling underline |
| PASS content('<span style="text-decoration: underline;"><span style="text-decoration: line-through;">a</span>b</span>'); |
| select(0, 2); toggle("underline") is '<span style="text-decoration: line-through;">a</span>b' |
| PASS content('<span style="text-decoration: underline;"><span style="text-decoration: line-through;">a</span>b<span style="text-decoration: line-through;">c</span></span>'); |
| select(0, 3); toggle("underline") is '<span style="text-decoration: line-through;">a</span>b<span style="text-decoration: line-through;">c</span>' |
| PASS content('<span style="text-decoration: underline;">a<span style="text-decoration: line-through;">b</span>c</span>'); |
| select(0, 3); toggle("underline") is 'a<span style="text-decoration: line-through;">b</span>c' |
| PASS content('<span style="text-decoration: underline;">a<span style="text-decoration: line-through;">b</span>c</span>'); |
| select(1, 3); toggle("underline") is '<span style="text-decoration: underline;">a</span><span style="text-decoration: line-through;">b</span>c' |
| PASS content('<span style="text-decoration: underline;">a<span style="text-decoration: line-through;">b</span>c</span>'); |
| select(0, 2); toggle("underline") is 'a<span style="text-decoration: line-through;">b</span><span style="text-decoration: underline;">c</span>' |
| PASS content('<span style="text-decoration: underline;"><span style="text-decoration: line-through;">ab</span></span>c'); |
| select(1, 3); toggle("underline") is '<span style="text-decoration: line-through;"><span style="text-decoration: underline;">a</span>b</span>c' |
| PASS content('<span style="text-decoration: underline;">a<span style="text-decoration: line-through;">b</span></span>c'); |
| select(1, 3); toggle("underline") is '<span style="text-decoration: underline;">a</span><span style="text-decoration: line-through;">b</span>c' |
| PASS content('a<span style="text-decoration: underline;"><span style="text-decoration: line-through;">b</span>c</span>'); |
| select(0, 2); toggle("underline") is '<span style="text-decoration: underline;">a<span style="text-decoration: line-through underline;">b</span>c</span>' |
| PASS content('a<span style="text-decoration: line-through;"><span style="text-decoration: underline;">bc</span></span>'); |
| select(0, 2); toggle("underline") is '<span style="text-decoration: underline;">a</span><span style="text-decoration: line-through;"><span style="text-decoration: underline;">bc</span></span>' |
| PASS content('a<span style="text-decoration: underline;"><b><span style="text-decoration: line-through;">bc</span></b></span>'); |
| select(0, 2); toggle("underline") is '<span style="text-decoration: underline;">a<b><span style="text-decoration: line-through;"><span style="text-decoration: underline line-through;">b</span>c</span></b></span>' |
| PASS successfullyParsed is true |
| |
| TEST COMPLETE |
| |