| 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 if (window.internals) | 3 if (window.internals) |
| 4 internals.settings.setEditingBehavior('win'); | 4 internals.settings.setEditingBehavior('win'); |
| 5 var testContainer = document.createElement("div"); | 5 var testContainer = document.createElement("div"); |
| 6 testContainer.contentEditable = true; | 6 testContainer.contentEditable = true; |
| 7 document.body.appendChild(testContainer); | 7 document.body.appendChild(testContainer); |
| 8 | 8 |
| 9 var styleWithCSS = false; | 9 var styleWithCSS = false; |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 return 'last two words'; | 51 return 'last two words'; |
| 52 } | 52 } |
| 53 | 53 |
| 54 | 54 |
| 55 debug("Font size"); | 55 debug("Font size"); |
| 56 styleWithCSS = false; | 56 styleWithCSS = false; |
| 57 testSingleToggle("fontsize", 2, selectAll, 'hello world', '<font size="2">hello
world</font>'); | 57 testSingleToggle("fontsize", 2, selectAll, 'hello world', '<font size="2">hello
world</font>'); |
| 58 testSingleToggle("fontsize", 4, selectAll, 'hello world', '<font size="4">hello
world</font>'); | 58 testSingleToggle("fontsize", 4, selectAll, 'hello world', '<font size="4">hello
world</font>'); |
| 59 testSingleToggle("fontsize", 5, selectFirstWord, 'hello world', '<font size="5">
hello </font>world'); | 59 testSingleToggle("fontsize", 5, selectFirstWord, 'hello world', '<font size="5">
hello </font>world'); |
| 60 testSingleToggle("fontsize", 3, selectFirstWord, '<font size="7">hello <div>worl
d</div></font>', 'hello <div style="font-size: -webkit-xxx-large;">world</div>')
; | 60 testSingleToggle("fontsize", 3, selectFirstWord, '<font size="7">hello <div>worl
d</div></font>', 'hello <div style="font-size: -webkit-xxx-large;">world</div>')
; |
| 61 testSingleToggle("fontsize", 3, selectFirstWord, '<font size="7"><div>hello</div
><div>world</div></font>', '<div>hello</div><div style="font-size: -webkit-xxx-l
arge;">world</div>'); | 61 testSingleToggle("fontsize", 3, selectFirstWord, '<font size="7"><div>hello</div
><div>world</div></font>', '<div style="">hello</div><div style="font-size: -web
kit-xxx-large;">world</div>'); |
| 62 testSingleToggle("fontsize", 3, selectSecondWord, '<font size="7"><div>hello</di
v>world</font>', '<div style="font-size: -webkit-xxx-large;">hello</div>world'); | 62 testSingleToggle("fontsize", 3, selectSecondWord, '<font size="7"><div>hello</di
v>world</font>', '<div style="font-size: -webkit-xxx-large;">hello</div>world'); |
| 63 | 63 |
| 64 testSingleToggle("fontsize", 7, selectAll, '<font size="7"><div>hello</div>world
</font>', '<font size="7"><div>hello</div>world</font>'); | 64 testSingleToggle("fontsize", 7, selectAll, '<font size="7"><div>hello</div>world
</font>', '<font size="7"><div>hello</div>world</font>'); |
| 65 testSingleToggle("fontsize", 7, selectAll, '<font size="3"><div>hello</div>world
</font>', '<div><font size="7">hello</font></div><font size="7">world</font>'); | 65 testSingleToggle("fontsize", 7, selectAll, '<font size="3"><div>hello</div>world
</font>', '<div style=""><font size="7">hello</font></div><font size="7">world</
font>'); |
| 66 testSingleToggle("fontsize", 6, selectAll, '<font size="7"><div>hello</div>world
</font>', '<div><font size="6">hello</font></div><font size="6">world</font>'); | 66 testSingleToggle("fontsize", 6, selectAll, '<font size="7"><div>hello</div>world
</font>', '<div style=""><font size="6">hello</font></div><font size="6">world</
font>'); |
| 67 testSingleToggle("fontsize", 5, selectAll, '<font size="7"><div>hello</div>world
</font>', '<div><font size="5">hello</font></div><font size="5">world</font>'); | 67 testSingleToggle("fontsize", 5, selectAll, '<font size="7"><div>hello</div>world
</font>', '<div style=""><font size="5">hello</font></div><font size="5">world</
font>'); |
| 68 testSingleToggle("fontsize", 3, selectAll, '<font size="7"><div>hello</div>world
</font>', '<div>hello</div>world'); | 68 testSingleToggle("fontsize", 3, selectAll, '<font size="7"><div>hello</div>world
</font>', '<div style="">hello</div>world'); |
| 69 testSingleToggle("fontsize", 3, selectAll, '<font size="3"><div>hello</div>world
</font>', '<font size="3"><div>hello</div>world</font>'); | 69 testSingleToggle("fontsize", 3, selectAll, '<font size="3"><div>hello</div>world
</font>', '<font size="3"><div>hello</div>world</font>'); |
| 70 testSingleToggle("fontsize", 1, selectAll, '<font size="3"><div>hello</div>world
</font>', '<div><font size="1">hello</font></div><font size="1">world</font>'); | 70 testSingleToggle("fontsize", 1, selectAll, '<font size="3"><div>hello</div>world
</font>', '<div style=""><font size="1">hello</font></div><font size="1">world</
font>'); |
| 71 | 71 |
| 72 debug(""); | 72 debug(""); |
| 73 debug("Font size (with CSS)"); | 73 debug("Font size (with CSS)"); |
| 74 styleWithCSS = true; | 74 styleWithCSS = true; |
| 75 testSingleToggle("fontsize", 7, selectAll, '<font size="7"><div>hello</div>world
</font>', '<font size="7"><div>hello</div>world</font>'); | 75 testSingleToggle("fontsize", 7, selectAll, '<font size="7"><div>hello</div>world
</font>', '<font size="7"><div>hello</div>world</font>'); |
| 76 testSingleToggle("fontsize", 7, selectAll, '<font size="3"><div>hello</div>world
</font>', '<div><span style="font-size: -webkit-xxx-large;">hello</span></div><s
pan style="font-size: -webkit-xxx-large;">world</span>'); | 76 testSingleToggle("fontsize", 7, selectAll, '<font size="3"><div>hello</div>world
</font>', '<div style=""><span style="font-size: -webkit-xxx-large;">hello</span
></div><span style="font-size: -webkit-xxx-large;">world</span>'); |
| 77 testSingleToggle("fontsize", 6, selectAll, '<font size="7"><div>hello</div>world
</font>', '<div><span style="font-size: xx-large;">hello</span></div><span style
="font-size: xx-large;">world</span>'); | 77 testSingleToggle("fontsize", 6, selectAll, '<font size="7"><div>hello</div>world
</font>', '<div style=""><span style="font-size: xx-large;">hello</span></div><s
pan style="font-size: xx-large;">world</span>'); |
| 78 testSingleToggle("fontsize", 5, selectAll, '<font size="7"><div>hello</div>world
</font>', '<div><span style="font-size: x-large;">hello</span></div><span style=
"font-size: x-large;">world</span>'); | 78 testSingleToggle("fontsize", 5, selectAll, '<font size="7"><div>hello</div>world
</font>', '<div style=""><span style="font-size: x-large;">hello</span></div><sp
an style="font-size: x-large;">world</span>'); |
| 79 testSingleToggle("fontsize", 3, selectAll, '<font size="7"><div>hello</div>world
</font>', '<div>hello</div>world'); | 79 testSingleToggle("fontsize", 3, selectAll, '<font size="7"><div>hello</div>world
</font>', '<div style="">hello</div>world'); |
| 80 testSingleToggle("fontsize", 3, selectAll, '<font size="3"><div>hello</div>world
</font>', '<font size="3"><div>hello</div>world</font>'); | 80 testSingleToggle("fontsize", 3, selectAll, '<font size="3"><div>hello</div>world
</font>', '<font size="3"><div>hello</div>world</font>'); |
| 81 testSingleToggle("fontsize", 1, selectAll, '<font size="3"><div>hello</div>world
</font>', '<div><span style="font-size: x-small;">hello</span></div><span style=
"font-size: x-small;">world</span>'); | 81 testSingleToggle("fontsize", 1, selectAll, '<font size="3"><div>hello</div>world
</font>', '<div style=""><span style="font-size: x-small;">hello</span></div><sp
an style="font-size: x-small;">world</span>'); |
| 82 | 82 |
| 83 debug(""); | 83 debug(""); |
| 84 debug("Font family"); | 84 debug("Font family"); |
| 85 styleWithCSS = false; | 85 styleWithCSS = false; |
| 86 testSingleToggle("fontname", "Arial", selectAll, 'hello world', '<font face="Ari
al">hello world</font>'); | 86 testSingleToggle("fontname", "Arial", selectAll, 'hello world', '<font face="Ari
al">hello world</font>'); |
| 87 testSingleToggle("fontname", "Arial", selectFirstWord, '<font face="sans-serif">
hello world</font>', '<font face="Arial">hello </font><font face="sans-serif">wo
rld</font>'); | 87 testSingleToggle("fontname", "Arial", selectFirstWord, '<font face="sans-serif">
hello world</font>', '<font face="Arial">hello </font><font face="sans-serif">wo
rld</font>'); |
| 88 testSingleToggle("fontname", "Arial", selectFirstWord, '<font face="sans-serif">
hello<div>world</div></font>', '<font face="Arial">hello</font><div style="font-
family: sans-serif;">world</div>'); | 88 testSingleToggle("fontname", "Arial", selectFirstWord, '<font face="sans-serif">
hello<div>world</div></font>', '<font face="Arial">hello</font><div style="font-
family: sans-serif;">world</div>'); |
| 89 testSingleToggle("fontname", "Arial", selectSecondWord, '<font face="sans-serif"
>hello<div>world</div></font>', '<font face="sans-serif">hello</font><div><font
face="Arial">world</font></div>'); | 89 testSingleToggle("fontname", "Arial", selectSecondWord, '<font face="sans-serif"
>hello<div>world</div></font>', '<font face="sans-serif">hello</font><div style=
""><font face="Arial">world</font></div>'); |
| 90 testSingleToggle("fontname", "Sans-Serif", selectAll, '<font face="sans-serif"><
div>hello</div><div>world</div></font>', '<font face="sans-serif"><div>hello</di
v><div>world</div></font>'); | 90 testSingleToggle("fontname", "Sans-Serif", selectAll, '<font face="sans-serif"><
div>hello</div><div>world</div></font>', '<font face="sans-serif"><div>hello</di
v><div>world</div></font>'); |
| 91 testSingleToggle("fontname", "Arial", selectAll, '<font face="sans-serif"><div>h
ello</div><div>world</div></font>', '<div><font face="Arial">hello</font></div><
div><font face="Arial">world</font></div>'); | 91 testSingleToggle("fontname", "Arial", selectAll, '<font face="sans-serif"><div>h
ello</div><div>world</div></font>', '<div><font face="Arial">hello</font></div><
div><font face="Arial">world</font></div>'); |
| 92 | 92 |
| 93 debug(""); | 93 debug(""); |
| 94 debug("Font family (with CSS)"); | 94 debug("Font family (with CSS)"); |
| 95 styleWithCSS = true; | 95 styleWithCSS = true; |
| 96 testSingleToggle("fontname", "Arial", selectAll, 'hello world', '<span style="fo
nt-family: Arial;">hello world</span>'); | 96 testSingleToggle("fontname", "Arial", selectAll, 'hello world', '<span style="fo
nt-family: Arial;">hello world</span>'); |
| 97 testSingleToggle("fontname", "Arial", selectFirstWord, '<font face="sans-serif">
hello world</font>', '<span style="font-family: Arial;">hello </span><font face=
"sans-serif">world</font>'); | 97 testSingleToggle("fontname", "Arial", selectFirstWord, '<font face="sans-serif">
hello world</font>', '<span style="font-family: Arial;">hello </span><font face=
"sans-serif">world</font>'); |
| 98 testSingleToggle("fontname", "Arial", selectFirstWord, '<font face="sans-serif">
hello<div>world</div></font>', '<span style="font-family: Arial;">hello</span><d
iv style="font-family: sans-serif;">world</div>'); | 98 testSingleToggle("fontname", "Arial", selectFirstWord, '<font face="sans-serif">
hello<div>world</div></font>', '<span style="font-family: Arial;">hello</span><d
iv style="font-family: sans-serif;">world</div>'); |
| 99 testSingleToggle("fontname", "Arial", selectSecondWord, '<font face="sans-serif"
>hello<div>world</div></font>', '<span style="font-family: sans-serif;">hello</s
pan><div><span style="font-family: Arial;">world</span></div>'); | 99 testSingleToggle("fontname", "Arial", selectSecondWord, '<font face="sans-serif"
>hello<div>world</div></font>', '<span style="font-family: sans-serif;">hello</s
pan><div style=""><span style="font-family: Arial;">world</span></div>'); |
| 100 testSingleToggle("fontname", "Sans-Serif", selectAll, '<font face="sans-serif"><
div>hello</div><div>world</div></font>', '<font face="sans-serif"><div>hello</di
v><div>world</div></font>'); | 100 testSingleToggle("fontname", "Sans-Serif", selectAll, '<font face="sans-serif"><
div>hello</div><div>world</div></font>', '<font face="sans-serif"><div>hello</di
v><div>world</div></font>'); |
| 101 testSingleToggle("fontname", "Arial", selectAll, '<font face="sans-serif"><div>h
ello</div><div>world</div></font>', '<div><span style="font-family: Arial;">hell
o</span></div><div><span style="font-family: Arial;">world</span></div>'); | 101 testSingleToggle("fontname", "Arial", selectAll, '<font face="sans-serif"><div>h
ello</div><div>world</div></font>', '<div><span style="font-family: Arial;">hell
o</span></div><div style=""><span style="font-family: Arial;">world</span></div>
'); |
| 102 | 102 |
| 103 document.body.removeChild(testContainer); | 103 document.body.removeChild(testContainer); |
| 104 | 104 |
| 105 var successfullyParsed = true; | 105 var successfullyParsed = true; |
| OLD | NEW |