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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/selection/selection_remove_children.html

Issue 2680943004: Make FrameSelection to hold non-canonicalized positions (Closed)
Patch Set: 2014-02-14T23:34:22 Update TestExpectation to include extend-{0,2,4}0.html and selectAllChildren.html 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
1 <!doctype html> 1 <!doctype html>
2 <script src="../../resources/testharness.js"></script> 2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script> 3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="../assert_selection.js"></script> 4 <script src="../assert_selection.js"></script>
5 <script> 5 <script>
6 // Selection should be updated after set innerHTML 6 // Selection should be updated after set innerHTML
7 test(() => assert_selection( 7 test(() => assert_selection(
8 '<div id="sample"><span contenteditable>^foobar|</span></div>', 8 '<div id="sample"><span contenteditable>^foobar|</span></div>',
9 selection => { 9 selection => {
10 const sample = selection.document.getElementById('sample'); 10 const sample = selection.document.getElementById('sample');
11 selection.document.addEventListener('blur', function () { 11 selection.document.addEventListener('blur', function () {
12 selection.selectAllChildren(sample.firstChild); 12 selection.selectAllChildren(sample.firstChild);
13 }, true); 13 }, true);
14 sample.firstChild.focus(); 14 sample.firstChild.focus();
15 sample.innerHTML = ''; 15 sample.innerHTML = '';
16 }, 16 },
17 '<div id="sample">|</div>'), 17 '|<div id="sample"></div>'),
18 'Select by blur'); 18 'Select by blur');
19 19
20 test(() => assert_selection( 20 test(() => assert_selection(
21 '<div id="sample">^foobar|</div>', 21 '<div id="sample">^foobar|</div>',
22 selection => { 22 selection => {
23 const sample = selection.document.getElementById('sample'); 23 const sample = selection.document.getElementById('sample');
24 selection.document.addEventListener('DOMNodeRemovedFromDocument', 24 selection.document.addEventListener('DOMNodeRemovedFromDocument',
25 () => selection.selectAllChildren(sample), true); 25 () => selection.selectAllChildren(sample), true);
26 sample.innerHTML = ''; 26 sample.innerHTML = '';
27 }, 27 },
28 '<div id="sample">|</div>'), 28 '|<div id="sample"></div>'),
29 'Select by mutation event'); 29 'Select by mutation event');
30 </script> 30 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698