     node isnt @element and @nodeIsEditable(node)
 
   nodeIsEditable: (node) ->
-    node?.nodeType is Node.ELEMENT_NODE and node.isContentEditable
+    DOM.closestElementNode(node)?.isContentEditable
 
   nodesModifiedByMutation: (mutation) ->
     nodes = []

      when "characterData"
        # Changes to text nodes should consider the parent element
        nodes.push(mutation.target.parentNode)
      when "childList"
        # Consider each added or removed node
        nodes.push(mutation.addedNodes...)

#= require trix/utilities/helpers
#= require trix/utilities/dom

{defer} = Trix.Helpers
{DOM} = Trix

class Trix.MutationObserver
  options =
