blob: c193d12b5ce06c7a318c4678b0723b664dacaf61 [file] [log] [blame]
<!DOCTYPE html>
<p>This tests modifying a text node with selection but without a focus.
WebKit used to automatically set the focus to the root editable element of this node but it should not.
You should see 'PASS' below:</p>
<div id="target" onfocus="target.innerText='FAIL'" contenteditable>hello</div>
<div id="focused" contenteditable>world</div>
var target = document.getElementById('target');
var focused = document.getElementById('focused');
getSelection().setBaseAndExtent(target.firstChild, 1, target.firstChild, 3);
// The bug doesn't reproduce if this function was ran here or inside load event handler
setTimeout(function() { = 'PASS';
alert('activeElement:' +; // necessary to reproduce the bug
}, 50);