2 <div id=
"test" style=
"font-size:16px;zoom:200%;">Copy this
16px text.
</div>
3 <div id=
"target" contentEditable
style=
"zoom:200%; border:1px solid">Paste it here.
</div>
4 <div>The pasted text should have a font size of
16px.
</div>
6 <div id=
"test2" style=
"font-size:x-small;zoom:200%;">Copy this x-small text.
</div>
7 <div id=
"target2" contentEditable
style=
"zoom:150%; border:1px solid">Paste it here.
</div>
8 <div>The pasted text should have a font size of x-small.
</div>
10 <div id=
"results">FAIL (this test requires DRT)
<div>
12 <script src=
"../editing.js"></script>
14 function editingTest()
16 for (var i
= 0; i
< 4; ++i
)
17 execExtendSelectionForwardByWordCommand();
20 var elem
= document
.getElementById("target");
21 var selection
= window
.getSelection();
22 selection
.collapse(elem
, 0);
23 execMoveSelectionForwardByWordCommand();
26 if (document
.getElementById("target").innerHTML
.toString().indexOf("font-size: 16px") == -1)
27 throw "absolute font size is wrong";
29 // Make sure relative font sizes are not adjusted.
30 var elem
= document
.getElementById("test2");
31 var selection
= window
.getSelection();
32 selection
.collapse(elem
, 0);
33 for (var i
= 0; i
< 4; ++i
)
34 execExtendSelectionForwardByWordCommand();
37 var elem
= document
.getElementById("target2");
38 var selection
= window
.getSelection();
39 selection
.collapse(elem
, 0);
40 execMoveSelectionForwardByWordCommand();
43 if (document
.getElementById("target2").innerHTML
.toString().indexOf("font-size: x-small") == -1)
44 throw "relative font size not preserved";
45 document
.getElementById("results").innerText
= "PASS";
48 runDumpAsTextEditingTest(false);