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

Unified Diff: LayoutTests/editing/selection/selection-change-in-blur-event-by-remove-children.html

Issue 25389004: Notify nodes removal to Range/Selection after dispatching blur and mutation event (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2013-10-07T14:24:36 Created 7 years, 2 months 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
« no previous file with comments | « no previous file | LayoutTests/editing/selection/selection-change-in-blur-event-by-remove-children-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/editing/selection/selection-change-in-blur-event-by-remove-children.html
diff --git a/LayoutTests/editing/selection/selection-change-in-blur-event-by-remove-children.html b/LayoutTests/editing/selection/selection-change-in-blur-event-by-remove-children.html
new file mode 100644
index 0000000000000000000000000000000000000000..88b7005422572f64e866d897686b5b1519626845
--- /dev/null
+++ b/LayoutTests/editing/selection/selection-change-in-blur-event-by-remove-children.html
@@ -0,0 +1,27 @@
+<div id="container">
+<p id="description"></p>
+<div id="sample"><span contenteditable="true">foobar</span></div>
+</div>
+<div id="console"></div>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script>
+description('Selection should be updated after set innerHTML.');
+
+function $(id) { return document.getElementById(id); }
+
+var selection = window.getSelection();
+document.addEventListener('blur', function () {
+ selection.selectAllChildren($('sample').firstChild);
+}, true);
+
+selection.selectAllChildren($('sample').firstChild);
+$('sample').firstChild.focus();
+$('sample').innerHTML = '';
+
+shouldBe('selection.anchorOffset', '0');
+shouldBe('selection.focusOffset', '0');
+
+if (window.testRunner)
+ $('container').outerHTML = '';
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
« no previous file with comments | « no previous file | LayoutTests/editing/selection/selection-change-in-blur-event-by-remove-children-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698