blob: d7c041a68d151ddf5d2942af1a0800c37ce20bc8 [file] [log] [blame]
<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>