1 description('Test to make sure WebKit does not remove content when unbolding nested b\'s. See <a href="https://bugs.webkit.org/show_bug.cgi?id=30083">Bug 30083</a> for detail.');
3 var testContainer = document.createElement("div");
4 testContainer.contentEditable = true;
5 document.body.appendChild(testContainer);
7 function removeStyleAndExpect(command, content, expected)
9 testContainer.innerHTML = content;
10 var e = document.getElementById('e');
11 var s = window.getSelection();
12 var r = document.createRange();
19 document.execCommand(command, false, null);
21 return shouldBe("'"+testContainer.innerHTML+"'","'"+expected+"'");
24 removeStyleAndExpect('bold', '<span id="e"><b>1<b>2</b></b></span>', '<span id="e">12</span>');
25 removeStyleAndExpect('bold', '<span id="e"><b id="foo">1<b>2</b></b></span>', '<span id="e"><span id="foo">12</span></span>');
26 removeStyleAndExpect('bold', '<span id="e"><b id="foo"><b>1</b>2</b></span>', '<span id="e"><span id="foo">12</span></span>');
27 removeStyleAndExpect('bold', '<span id="e"><b><b><b>12</b></b></b></span>', '<span id="e">12</span>');
28 removeStyleAndExpect('bold', '<span id="e"><b><b><b>1</b></b>2</b></span>', '<span id="e">12</span>');
29 removeStyleAndExpect('italic', '<span id="e"><i>1<i>2</i></i></span>', '<span id="e">12</span>');
30 removeStyleAndExpect('strikeThrough', '<span id="e"><s>1<s>2</s></s></span>', '<span id="e">12</span>');
32 document.body.removeChild(testContainer);
34 var successfullyParsed = true;