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

Side by Side Diff: Source/WebCore/manual-tests/mutate-unfocused-text-with-selection.html

Issue 8133029: Merge 96628 - REGRESSION(r94274): setting input.value erroneously triggers focus event (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 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 unified diff | Download patch
« no previous file with comments | « Source/WebCore/editing/FrameSelection.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <p>This tests modifying a text node with selection but without a focus. 4 <p>This tests modifying a text node with selection but without a focus.
5 WebKit used to automatically set the focus to the root editable element of this node but it should not. 5 WebKit used to automatically set the focus to the root editable element of this node but it should not.
6 You should see 'PASS' below:</p> 6 You should see 'PASS' below:</p>
7 <div id="target" onfocus="target.innerText='FAIL'" contenteditable>hello</div> 7 <div id="target" onfocus="target.innerText='FAIL'" contenteditable>hello</div>
8 <div id="focused" contenteditable>world</div> 8 <div id="focused" contenteditable>world</div>
9 <script> 9 <script>
10 10
11 var target = document.getElementById('target'); 11 var target = document.getElementById('target');
12 var focused = document.getElementById('focused'); 12 var focused = document.getElementById('focused');
13 focused.focus(); 13 focused.focus();
14 getSelection().setBaseAndExtent(target.firstChild, 1, target.firstChild, 3); 14 getSelection().setBaseAndExtent(target.firstChild, 1, target.firstChild, 3);
15 15
16 // The bug doesn't reproduce if this function was ran here or inside load event handler 16 // The bug doesn't reproduce if this function was ran here or inside load event handler
17 setTimeout(function() { 17 setTimeout(function() {
18 target.firstChild.data = 'PASS'; 18 target.firstChild.data = 'PASS';
19 alert('activeElement:' + document.activeElement.id); // necessary to reprodu ce the bug 19 alert('activeElement:' + document.activeElement.id); // necessary to reprodu ce the bug
20 }, 50); 20 }, 50);
21 21
22 </script> 22 </script>
23 </body> 23 </body>
24 </html> 24 </html>
OLDNEW
« no previous file with comments | « Source/WebCore/editing/FrameSelection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698