Checking node.contentEditable has drawbacks:
- it doesn't account for inheritance, if contentEditable="inherit" is being used
- it's a string value, which people sometimes forget (see: T114545)
- it requires something like $focusNode.closest( '[contenteditable]' ) anywhere it's checked,
Apparently in the past isContentEditable had problems, but @Krinkle tested it out in T114545 and didn't find any of them remaining in our currently supported browsers.
So, switch everywhere using the currently closest-contenteditable check to use isContentEditable instead. It needs to account for text nodes not having this property, so some helper function might make sense...
function isContentEditable( node ) { return ( node.nodeType === Node.TEXT_NODE ? node.parentNode : node ).isContentEditable; }