Assuming you have this markup:
<div contenteditable="true">Hello world</div>
Now select the whole "Hello world" by triple clicking or pressing CTRL+A.
Now watch the onbeforeinput handler, when typing a character or hitting backspace.
function onbeforeinput(event) {
// I'd expect the two logs below to show the same element
// On Chrome/Safari they do, but not in Firefox
console.log(event.getTargetRanges()[0].startContainer); // returns the div
console.log(window.getSelection().anchorNode); // returns the "Hello world" text node
}
Repro: https://w3c.github.io/editing/repros/493.html