Poll selection to see whether it's changed.

@param {object} nativeEvent
@return {?SyntheticEvent}
768307
function constructSelectEvent(nativeEvent, nativeEventTarget) {
  // Ensure we have the right element, and that the user is not dragging a
  // selection (this matches native `select` event behavior). In HTML5, select
  // fires only on input and textarea thus if there's no focused element we
  // won't dispatch.
  if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {
    return null;
  }

  // Only fire when selection has actually changed.
  var currentSelection = getSelection(activeElement);
  if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
    lastSelection = currentSelection;

    var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementInst, nativeEvent, nativeEventTarget);

    syntheticEvent.type = 'select';
    syntheticEvent.target = activeElement;

    EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);

    return syntheticEvent;
  }

  return null;
}
853178
function onPointerEvent(e) {
       var ret = true; // normalize eventTypes

       normalizeEvent(e); // remember/use the first "primary" normalized event for pointer.bind

       var button = normalizedEvents[0].button; // dispatch event to registered objects

       if (dispatchEvent(normalizedEvents) || api.preventDefault) {
         // prevent default action
         ret = api._preventDefaultFn(e);
       }

       var keycode = api.pointer.bind[button]; // check if mapped to a key

       if (keycode) {
         if (POINTER_DOWN.includes(e.type)) {
           return api._keydown(e, keycode, button + 1);
         } else {
           // 'mouseup' or 'touchend'
           return api._keyup(e, keycode, button + 1);
         }
       }

       return ret;
     }
347512
void addSelectionBinding(ReadOnlyObjectProperty<Change> currentChange) {
    currentChange.addListener(
        (observable, oldValue, newValue) -> getSelectionModel().select(newValue)
    );
  }
1138185
function nativeCallback(msg) {
  // parse call arguments
  var resultObj = processMessageFromNative(msg);
  if (resultObj.action == null) {
    console.log('Action is not provided, skipping');
    return;
  }

  broadcastEventFromNative(resultObj);
}
1374405
function( event ) {
			// SAP MODIFICATION: if jQuery event is created programatically there's no originalEvent property. Therefore the existence of event.originalEvent needs to be checked.
			var data = event.originalEvent && event.originalEvent.touches ?
					event.originalEvent.touches[ 0 ] : event;
			return {
						time: ( new Date() ).getTime(),
						coords: [ data.pageX, data.pageY ],
						origin: $( event.target )
					};
		}
616000
function CancelableEvent (type, eventInit) {
        if ( eventInit === void 0 ) eventInit = {};

        Object.assign(this, CancelableEvent.defaults(), eventInit, { type: type });

        Object.defineProperties(this, {
            type: _makeCancelableEventProps(),
            cancelable: _makeCancelableEventProps(),
            nativeEvent: _makeCancelableEventProps(),
            target: _makeCancelableEventProps(),
            relatedTarget: _makeCancelableEventProps(),
            vueTarget: _makeCancelableEventProps()
        });

        var defaultPrevented = false;

        this.preventDefault = function preventDefault() {
            if (this.cancelable) {
                defaultPrevented = true;
            }
        };

        Object.defineProperty(this, 'defaultPrevented', {
            enumerable: true,
            get: function get() {
                return defaultPrevented
            }
        });
    }
1290927
function fixInitialSelection( root, nativeSel, doFocus ) {
		// It may happen that setting proper selection will
		// cause focus to be fired (even without actually focusing root).
		// Cancel it because focus shouldn't be fired when retriving selection. (#10115)
		var listener = root.on( 'focus', function( evt ) {
			evt.cancel();
		}, null, null, -100 );

		// FF && Webkit.
		if ( !CKEDITOR.env.ie ) {
			var range = new CKEDITOR.dom.range( root );
			range.moveToElementEditStart( root );

			var nativeRange = root.getDocument().$.createRange();
			nativeRange.setStart( range.startContainer.$, range.startOffset );
			nativeRange.collapse( 1 );

			nativeSel.removeAllRanges();
			nativeSel.addRange( nativeRange );
		}
		else {
			// IE in specific case may also fire selectionchange.
			// We cannot block bubbling selectionchange, so at least we
			// can prevent from falling into inf recursion caused by fix for #9699
			// (see wysiwygarea plugin).
			// http://dev.ckeditor.com/ticket/10438#comment:13
			var listener2 = root.getDocument().on( 'selectionchange', function( evt ) {
				evt.cancel();
			}, null, null, -100 );
		}

		doFocus && root.focus();

		listener.removeListener();
		listener2 && listener2.removeListener();
	}
15756
function processAfterStateChange(el) {
    const optionValue = el.dataset.optionValue;
    const optionIndex = Array.prototype.slice.call(el.parentNode.children).indexOf(el);
    this.setSelectedOption(optionValue);
    elementScroll.scroll(el);
    emitAndFire(this, 'listbox-change', {
        index: optionIndex,
        selected: [optionValue],
        el
    });
}
57740
function() {
		var e = this.originalEvent;
		this.defaultPrevented = true;
    this.isDefaultPrevented = returnTrue;
		if ( e && e.preventDefault ){ e.preventDefault(); }
	}
36896
function(event) {
        var changed = false;
        if(this.features) {
            if(this.num === null) {
                this.num = -1;
            }
            var start = (this.num + 1) * this.length;
            changed = this.page(start, event);
        }
        return changed;
    }
866681
function _onKeyEvent(instance, event) {
            self.trigger("keyEvent", self, event);  // deprecated
            self.trigger(event.type, self, event);
            return event.defaultPrevented;   // false tells CodeMirror we didn't eat the event
        }
738314
function createNativeEvent(type, debug) {
        var event = new Event(type);
        event.debug = debug;

        // Make the "target" writable
        Object.defineProperty(event, 'target', {
            writable: true
        });

        return event;
    }
709602
function changeDelegatedHandler(eventOptions = {}) {
    const { key } = eventOptions;
    const def = defs.get(this);

    if (key && key in def.keys) {
        triggerOne(this, '_asterisk:set', eventOptions);
    }
}
193150
function NativeEngine() {
// public
    // Override
    this.isAvailable = function() {
        if (browserVersion && browserVersion.isIE) {
            // javascript-xpath can fake out the check otherwise
            return false;
        }

        return this.doc && this.doc.evaluate;
    };

    // Override
    this.selectNodes = function(xpath, contextNode, namespaceResolver) {
        if (contextNode != this.doc) {
            xpath = '.' + xpath;
        }

        var nodes = [];

        try {
            var xpathResult = this.doc.evaluate(xpath, contextNode,
                namespaceResolver, 0, null);
        }
        catch (e) {
            var msg = extractExceptionMessage(e);
            throw new SeleniumError("Invalid xpath [1]: " + msg);
        }
        finally {
            if (xpathResult == null) {
                // If the result is null, we should still throw an Error.
                throw new SeleniumError("Invalid xpath [2]: " + xpath);
            }
        }

        var node = xpathResult.iterateNext();

        while (node) {
            nodes.push(node);
            node = xpathResult.iterateNext();
        }

        return nodes;
    };
}
421315
function cancelEvent(ev: ?SyntheticEvent<*>) {
  if (!ev) return;
  ev.preventDefault && ev.preventDefault();
  ev.stopPropagation && ev.stopPropagation();
}
1229905
function checkSelectionChange() {
		// A possibly available fake-selection.
		var sel = this._.fakeSelection,
			realSel;

		if ( sel ) {
			realSel = this.getSelection( 1 );

			// If real (not locked/stored) selection was moved from hidden container,
			// then the fake-selection must be invalidated.
			if ( !realSel || !realSel.isHidden() ) {
				// Remove the cache from fake-selection references in use elsewhere.
				sel.reset();

				// Have the code using the native selection.
				sel = 0;
			}
		}

		// If not fake-selection is available then get the native selection.
		if ( !sel ) {
			sel = realSel || this.getSelection( 1 );

			// Editor may have no selection at all.
			if ( !sel || sel.getType() == CKEDITOR.SELECTION_NONE )
				return;
		}

		this.fire( 'selectionCheck', sel );

		var currentPath = this.elementPath();
		if ( !currentPath.compare( this._.selectionPreviousPath ) ) {
			// Cache the active element, which we'll eventually lose on Webkit.
			if ( CKEDITOR.env.webkit )
				this._.previousActive = this.document.getActive();

			this._.selectionPreviousPath = currentPath;
			this.fire( 'selectionChange', { selection: sel, path: currentPath } );
		}
	}
56982
function(nativeEvent, typeOverride) {
  var evt = eventWrapper(nativeEvent);
  if (typeOverride !== undefined) {
    evt.type = typeOverride;
  }
  var activePath = [];
  var elem = evt.target;
  var events;

  /**
   * Handle calling bound functions with the proper targets set
   * @TODO move this outside eventHandler
   * @param  {Element}         elem      DOM element to trigger events on
   * @param  {Array<Function>} funcArr   Array of bound functions to trigger
   * @param  {String}          selector  Selector string that the event was bound to
   * @param  {Element}         delegate  DOM element this event was bound to for delegation
   */
  var triggerEventFunctions = function(elem, funcArr, selector, delegate) {
    var result;
    evt.currentTarget = elem;
    evt.delegateTarget = delegate;
    for (var i = 0; i < funcArr.length; i++) {
      if (!evt.isImmediatePropagationStopped()) {
        evt.vEvent = {
          handler: funcArr[i].method,
          selector: selector
        };

        result = funcArr[i].method(evt);
        if (result === false) {
          falseHandler(evt);
        }
      }
    }
  };

  /**
   * Checks if bound events should fire
   * @param  {Object}    typeEvents        Event object of events to check if should fire
   */
  var checkEvents = function(typeEvents) {
    var elemClasses, elemClass;

    // Iterate over previously passed elements to check for any delegated events
    var activePathLength = activePath.length;
    for (var i = 0; i < activePathLength; i++) {
      elemClasses = activePath[i].classes;
      // Once stopPropagation is called stop
      if (!evt.isPropagationStopped()) {
        var elemClassesLength = elemClasses.length;
        for (var j = 0; j < elemClassesLength; j++) {
          elemClass = elemClasses[j];
          if (typeEvents[elemClass]) {
            triggerEventFunctions(activePath[i].element, typeEvents[elemClass], elemClass, elem);
          }
        }
      }
    }

    // Check for any non-delegated events
    if (!evt.isPropagationStopped() && typeEvents.self) {
      triggerEventFunctions(elem, typeEvents.self);
    }
  };

  while (elem && !evt.isPropagationStopped()) {
    events = module.exports.getEvents(elem);
    if (events) {
      // Generic events
      if (events[evt.type]) {
        checkEvents(events[evt.type]);
      }
    }
    // Create array of class names that match our pattern to check for delegation later
    var elemActiveClasses = module.exports.getActiveClasses(elem);
    if (elemActiveClasses.length) {
      activePath.push({
        element: elem,
        classes: elemActiveClasses
      });
    }
    elem = elem.parentNode;
  }
}