| <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> |
| import "../resources/third_party/unittest/unittest.dart"; |
| import "../resources/unit.dart"; |
| |
| import "dart:async"; |
| import "dart:sky"; |
| |
| void main() { |
| initUnit(); |
| |
| test("remains the same after adding block elements and removing them", () { |
| 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; |
| |
| elem.removeChildren(); |
| |
| new Timer(Duration.ZERO, expectAsync(() { |
| expect(elem.offsetHeight, equals(originalHeight)); |
| })); |
| }); |
| } |
| </script> |
| </sky> |