code: function isEditingHost(node) {
          return node &&
              ((node.nodeType == 9 && node.designMode == "on") ||
              (isEditableElement(node) && !isEditableElement(node.parentNode)));
      }
docs: "An editing host is a node that is either an Element whose isContentEditable property returns true but whose parent node is not an element or whose isContentEditable property returns false, or a Document whose designMode is enabled."