| <sky> |
| <import src="../resources/chai.sky" /> |
| <import src="../resources/mocha.sky" /> |
| This test verifies that the height of an editable block remains the same after adding block elements and removing them. |
| <div contenteditable="true" style="border: solid blue" id="test"></div> |
| <script> |
| describe("height of an editable block", function() { |
| it("remains the same after adding block elements and removing them", function(done) { |
| var elem = document.getElementById("test"); |
| var originalHeight = elem.offsetHeight; |
| var d = elem.appendChild(document.createElement('div')); |
| d.appendChild(new Text('aaa')); |
| d = elem.appendChild(document.createElement('div')); |
| d.appendChild(new Text('bbb')); |
| var newHeight = elem.offsetHeight; |
| |
| while (elem.firstChild) { |
| elem.removeChild(elem.firstChild); |
| } |
| |
| setTimeout(function() { |
| assert.equal(elem.offsetHeight, originalHeight); |
| done(); |
| }); |
| }); |
| }) |
| </script> |
| </sky> |