Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / input-paste-undo.html
blobdb17b03c0f87523ce5fe3cbe6f2105da64e24672
1 <html>
2 <head>
3 <script src=../../editing/editing.js language="JavaScript" type="text/JavaScript" ></script>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id="console"></div>
10 <br></br>
11 <div contenteditable id="source">Text to copy-paste-undo.</div>
12 <input type="text" id="destination"></input>
14 <script>
15 description("This test checks that undoing a paste into an empty text field doesn't cause it to collapse vertically.");
17 var selection = window.getSelection();
18 var source = document.getElementById('source');
19 selection.selectAllChildren(source);
21 var initialClientHeight = source.clientHeight;
22 var initialClientComputedHeight = window.getComputedStyle(source).height;
24 copyCommand();
25 document.getElementById('destination').focus();
26 shouldBeEqualToString('document.getElementById("destination").value', '');
28 pasteCommand();
29 shouldBeEqualToString('document.getElementById("destination").value', 'Text to copy-paste-undo.');
30 shouldBeTrue('document.getElementById("source").clientHeight == initialClientHeight');
31 shouldBeTrue('window.getComputedStyle(document.getElementById("source")).height == initialClientComputedHeight');
33 undoCommand();
34 shouldBeEqualToString('document.getElementById("destination").value', '');
35 shouldBeTrue('document.getElementById("source").clientHeight == initialClientHeight');
36 shouldBeTrue('window.getComputedStyle(document.getElementById("source")).height == initialClientComputedHeight');
39 </script>
40 </body>
41 </html>