3 <script src=../../editing/editing.js
language=
"JavaScript" type=
"text/JavaScript" ></script>
4 <script src=
"../../resources/js-test.js"></script>
7 <p id=
"description"></p>
8 <div id=
"console"></div>
11 <div contenteditable
id=
"source">Text to copy-paste-undo.
</div>
12 <input type=
"text" id=
"destination"></input>
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
;
25 document
.getElementById('destination').focus();
26 shouldBeEqualToString('document.getElementById("destination").value', '');
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');
34 shouldBeEqualToString('document.getElementById("destination").value', '');
35 shouldBeTrue('document.getElementById("source").clientHeight == initialClientHeight');
36 shouldBeTrue('window.getComputedStyle(document.getElementById("source")).height == initialClientComputedHeight');