OLD | NEW |
1 description('Test to make sure we push down inline styles properly.'); | 1 description('Test to make sure we push down inline styles properly.'); |
2 | 2 |
3 var testContainer = document.createElement("div"); | 3 var testContainer = document.createElement("div"); |
4 testContainer.contentEditable = true; | 4 testContainer.contentEditable = true; |
5 document.body.appendChild(testContainer); | 5 document.body.appendChild(testContainer); |
6 | 6 |
7 function testSingleToggle(toggleCommand, initialContents, expectedContents) | 7 function testSingleToggle(toggleCommand, initialContents, expectedContents) |
8 { | 8 { |
9 testContainer.innerHTML = initialContents; | 9 testContainer.innerHTML = initialContents; |
10 if (document.getElementById('test')) | 10 if (document.getElementById('test')) |
(...skipping 22 matching lines...) Expand all Loading... |
33 testSingleToggle("italic", '<span style="font-style: italic; font-weight: bold;"
><div>hello</div></span>', '<span style="font-weight: bold;"><div>hello</div></s
pan>'); | 33 testSingleToggle("italic", '<span style="font-style: italic; font-weight: bold;"
><div>hello</div></span>', '<span style="font-weight: bold;"><div>hello</div></s
pan>'); |
34 testSingleToggle("italic", '<span style="font-style: italic; text-decoration: li
ne-through;"><div>hello</div></span>', '<span style="text-decoration-line: line-
through;"><div>hello</div></span>'); | 34 testSingleToggle("italic", '<span style="font-style: italic; text-decoration: li
ne-through;"><div>hello</div></span>', '<span style="text-decoration-line: line-
through;"><div>hello</div></span>'); |
35 testSingleToggle("italic", '<span style="font-style: italic;">hello<div id="test
">world</div><blockquote>webkit</blockquote></span>', '<i>hello</i><div id="test
">world</div><blockquote style="font-style: italic;">webkit</blockquote>'); | 35 testSingleToggle("italic", '<span style="font-style: italic;">hello<div id="test
">world</div><blockquote>webkit</blockquote></span>', '<i>hello</i><div id="test
">world</div><blockquote style="font-style: italic;">webkit</blockquote>'); |
36 testSingleToggle("italic", '<span style="font-style: italic;">hello <span id="te
st">world</span> webkit</span>', '<i>hello </i><span id="test">world</span><i> w
ebkit</i>'); | 36 testSingleToggle("italic", '<span style="font-style: italic;">hello <span id="te
st">world</span> webkit</span>', '<i>hello </i><span id="test">world</span><i> w
ebkit</i>'); |
37 testSingleToggle("underline", '<span style="text-decoration: underline;"><div id
="test">hello</div>world</span>', '<div id="test">hello</div><u>world</u>'); | 37 testSingleToggle("underline", '<span style="text-decoration: underline;"><div id
="test">hello</div>world</span>', '<div id="test">hello</div><u>world</u>'); |
38 testSingleToggle("underline", '<span style="text-decoration: underline;"><div id
="test">hello</div><blockquote>world<br>webkit</blockquote></span>', '<div id="t
est">hello</div><blockquote style="text-decoration-line: underline;">world<br>we
bkit</blockquote>'); | 38 testSingleToggle("underline", '<span style="text-decoration: underline;"><div id
="test">hello</div><blockquote>world<br>webkit</blockquote></span>', '<div id="t
est">hello</div><blockquote style="text-decoration-line: underline;">world<br>we
bkit</blockquote>'); |
39 testSingleToggle("underline", '<span style="text-decoration: underline;">hello<d
iv id="test">world</div>webkit</u>', '<u>hello</u><div id="test">world</div><u>w
ebkit</u>'); | 39 testSingleToggle("underline", '<span style="text-decoration: underline;">hello<d
iv id="test">world</div>webkit</u>', '<u>hello</u><div id="test">world</div><u>w
ebkit</u>'); |
40 testSingleToggle("underline", | 40 testSingleToggle("underline", |
41 '<div style="text-decoration: underline;"><div>hello</span></div><div id="te
st">webkit</div><span style="font-style: italic;">rocks</span>', | 41 '<div style="text-decoration: underline;"><div>hello</span></div><div id="te
st">webkit</div><span style="font-style: italic;">rocks</span>', |
42 '<div><div style="text-decoration-line: underline;">hello</span></div><div i
d="test">webkit</div><u><span style="font-style: italic;">rocks</span></u></div>
'); | 42 '<div><div style="text-decoration-line: underline;">hello</span></div><div i
d="test">webkit</div><u><span style="font-style: italic;">rocks</span></u></div>
'); |
43 testSingleToggle("underline", '<span style="text-decoration: underline;"><div st
yle="text-decoration: line-through;">hello</div><div id="test">world</div></span
>', '<div style="text-decoration-line: underline line-through;">hello</div><div
id="test">world</div>'); | 43 testSingleToggle("underline", '<span style="text-decoration-line: underline;"><d
iv style="text-decoration-line: line-through;">hello</div><div id="test">world</
div></span>', '<div style="text-decoration-line: underline line-through;">hello<
/div><div id="test">world</div>'); |
44 testSingleToggle("strikeThrough", '<span style="text-decoration: line-through;">
<div id="test">hello</div><div style="text-decoration: underline;">world</div></
span>', '<div id="test">hello</div><div style="text-decoration-line: line-throug
h underline;">world</div>'); | 44 testSingleToggle("strikeThrough", '<span style="text-decoration-line: line-throu
gh;"><div id="test">hello</div><div style="text-decoration-line: underline;">wor
ld</div></span>', '<div id="test">hello</div><div style="text-decoration-line: l
ine-through underline;">world</div>'); |
45 | 45 |
46 document.body.removeChild(testContainer); | 46 document.body.removeChild(testContainer); |
47 | 47 |
48 var successfullyParsed = true; | 48 var successfullyParsed = true; |
OLD | NEW |