Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: sky/tests/editing/delete_block_contents.sky

Issue 748943002: remove childrenInline & setChildrenInline (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: moar Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sky/tests/editing/delete_block_contents.sky
diff --git a/sky/tests/editing/delete_block_contents.sky b/sky/tests/editing/delete_block_contents.sky
new file mode 100644
index 0000000000000000000000000000000000000000..1c88b89bef54e95673b60fe1b9cc97765679fcba
--- /dev/null
+++ b/sky/tests/editing/delete_block_contents.sky
@@ -0,0 +1,24 @@
+<html>
+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>
+window.addEventListener('load', function() {
+
+ var elem = document.getElementById("test");
+ var originalHeight = elem.offsetHeight;
+ var d = elem.appendChild(document.createElement('div'));
+ d.appendChild(document.createTextNode('aaa'));
+ d = elem.appendChild(document.createElement('div'));
+ d.appendChild(document.createTextNode('bbb'));
+ var newHeight = elem.offsetHeight;
+
+ while (elem.firstChild) {
+ elem.removeChild(elem.firstChild);
+ }
+
+ setTimeout(function() {
+ internals.notifyTestComplete(elem.offsetHeight == originalHeight ? 'PASS' : 'FAIL: expected=' + originalHeight + ', actual=' + elen.offsetHeight);
ojan 2014/11/21 22:55:10 This is fine. It'd be better if you used a mocha+c
+ });
+});
+</script>
+</html>

Powered by Google App Engine
This is Rietveld 408576698