function mouseEnterLeave(element, enter, leave) {
    var over, out;
    if ('onmouseenter' in element && 'onmouseleave' in element) { // Supported
      element.addEventListener('mouseenter', enter, false);
      element.addEventListener('mouseleave', leave, false);
      return function() {
        element.removeEventListener('mouseenter', enter, false);
        element.removeEventListener('mouseleave', leave, false);
      };

    } else { // Unsupported
      console.warn('mouseenter and mouseleave events polyfill is enabled.');
      over = function(event) {
        /* eslint-disable no-invalid-this */
        if (!event.relatedTarget ||
            event.relatedTarget !== this &&
            !(this.compareDocumentPosition(event.relatedTarget) & Node.DOCUMENT_POSITION_CONTAINED_BY)) {
          enter.apply(this, arguments);
        }
        /* eslint-enable no-invalid-this */
      };
      element.addEventListener('mouseover', over);
      out = function(event) {
        /* eslint-disable no-invalid-this */
        if (!event.relatedTarget ||
            event.relatedTarget !== this &&
            !(this.compareDocumentPosition(event.relatedTarget) & Node.DOCUMENT_POSITION_CONTAINED_BY)) {
          leave.apply(this, arguments);
        }
        /* eslint-enable no-invalid-this */
      };
      element.addEventListener('mouseout', out);
      return function() {
        element.removeEventListener('mouseover', over, false);
        element.removeEventListener('mouseout', out, false);
      };
    }
  }
Add `mouseenter` and `mouseleave` event listeners to the element.
@param {Element} element - Target element.
@param {Function} enter - Event listener.
@param {Function} leave - Event listener.
@returns {Function} Function that removes the added listeners.