mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-22 16:09:23 +00:00
Unspecced but common behavior in the major browsers: if the selection moves to an editing host, the editing host itself should become focused.
15 lines
534 B
HTML
15 lines
534 B
HTML
<!DOCTYPE html>
|
|
<div contenteditable>foo</div>
|
|
<script src="include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
const divElm = document.querySelector('div[contenteditable]');
|
|
const range = document.createRange();
|
|
range.setStart(divElm.childNodes[0], 1);
|
|
range.setEnd(divElm.childNodes[0], 2);
|
|
window.getSelection().addRange(range);
|
|
|
|
println(`Range: ${range.startContainer} ${range.startOffset} ${range.endContainer} ${range.endOffset}`);
|
|
println(`document.activeElement: ${document.activeElement}`);
|
|
});
|
|
</script>
|