Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / editing / pasteboard / page-zoom.html
1 <body>
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>
5 <br /><br />
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>
9 <br /><br />
10 <div id="results">FAIL (this test requires DRT)<div>
11 </body>
12 <script src="../editing.js"></script>
13 <script>
14 function editingTest()
15 {
16     for (var i = 0; i < 4; ++i)
17         execExtendSelectionForwardByWordCommand();
18     execCopyCommand();
19
20     var elem = document.getElementById("target");
21     var selection = window.getSelection();
22     selection.collapse(elem, 0);
23     execMoveSelectionForwardByWordCommand();
24     execPasteCommand();
25
26     if (document.getElementById("target").innerHTML.toString().indexOf("font-size: 16px") == -1)
27         throw "absolute font size is wrong";
28
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();
35     execCopyCommand();
36
37     var elem = document.getElementById("target2");
38     var selection = window.getSelection();
39     selection.collapse(elem, 0);
40     execMoveSelectionForwardByWordCommand();
41     execPasteCommand();
42
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";
46 }
47
48 runDumpAsTextEditingTest(false);
49 </script>