code: function getEditingHostOf(node) {
  	if (isEditingHost(node)) {
  		return node;
  	} else if (isEditable(node)) {
  		var ancestor = node.parentNode;
  		while (!isEditingHost(ancestor)) {
  			ancestor = ancestor.parentNode;
  		}
  		return ancestor;
  	} else {
  		return null;
  	}
  }
docs: "The editing host of node is null if node is neither editable nor an editing host; node itself, if node is an editing host; or the nearest ancestor of node that is an editing host, if node is editable."