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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/selection/keep-selection-after-set-focus.html

Issue 2616623002: Do not send redundant selectionchange-events (decouple focus) (Closed)
Patch Set: Fix spatnav tests (clear selection when focus goes to non editable element). Remove now invalid kee… Created 3 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <div id="container">
4 <p contenteditable id="sample">01234567</p>
5 <button id="button">This is a button</button>
6 </div>
7 <script>
8 description('Selection should be kept after focus changed.');
9 var selection = getSelection();
10 var sample = document.getElementById('sample').firstChild;
11 selection.collapse(sample, 3);
12 selection.extend(sample, 6);
13 document.getElementById('button').focus();
14 shouldBe('selection.anchorNode', 'sample');
15 shouldBe('selection.anchorOffset', '3');
16 shouldBe('selection.focusNode', 'sample');
17 shouldBe('selection.focusOffset', '6');
18 document.getElementById('container').outerHTML = '';
19 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698