3 ms·
Yes, contentEditable is the poster child for why it's a bad idea to base a widely used feature on reverse engineering an implementation, rather than on a standa
by jgraham 5y ago
Yes, contentEditable is the poster child for why it's a bad idea to base a widely used feature on reverse engineering an implementation, rather than on a standard that had meaningful cross-vendor input from the start. Not only are all the implementations different, the behaviour itself often seems to be "whatever happened to be easy to implement in trident (i.e. IE) at the time". What's worse is that it's become so widely used despite the differences that editing libraries typically have browser-specific codepaths, which can make it hard to align behaviour without breaking things. The spec, such as it is, was written post-hoc and doesn't reflect the behaviours that sites expect today.
As you can see, the whole area is a bit of a mess, and so some substantial work will be needed to clean things up. But that's the point of this kind of effort!
Also, assuming you filed the linked bug, thanks for the detailed report with testcases! It's appreciated.
- jitl 5y agoOh yeah, tell me about it. I spent 6 months adding text selection across blocks to the Notion editor. At least MutationObserver exists today! And beforeInput is something. It’s not enough, because of IMEs and Android, but it’s something.