blob: e56c12cb2bae325b86e0fa97c558a20b403da3a5 [file] [log] [blame]
<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
test(() => {
assert_own_property(window, 'testRunner', 'This test requires testRunner');
assert_selection(
[
'<div contenteditable><a href="http://www.example.com/">^text|</a></div>',
'<a href="http://www.example2.com/" id="other">link</a>'
].join(''),
selection => {
const other = selection.document.getElementById('other');
other.focus();
testRunner.execCommand('unlink');
assert_equals(selection.document.activeElement, other);
},
[
'<div contenteditable><a href="http://www.example.com/">^text|</a></div>',
'<a href="http://www.example2.com/" id="other">link</a>'
].join(''));
}, 'Unlink with unfocused selection in contenteditable div');
</script>