src/Event/EventTarget.php
/**
     * Prepares to execute callbacks for the specified event and object.
     *
     * @internal
     *
     * @see https://dom.spec.whatwg.org/#concept-event-listener-invoke
     */
Prepares to execute callbacks for the specified event and object.
@internal


Prepares to execute callbacks for the specified event and object . @internal
private function invokeEventListener(EventTarget $object, Event $event): void
    {
        if ($event->getFlags() & EventFlags::STOP_PROPAGATION) {
            return;
        }
        $listeners = $object->listeners;
        $event->setCurrentTarget($object);
        $found = $this->innerInvokeEventListener($object, $event, $listeners);
        if (!$found && $event->isTrusted) {
            $originalEventType = $event->type;
            switch ($originalEventType) {
                case 'animationend':
                    $event->setType('webkitAnimationEnd');
                    break;
                case 'animationiteration':
                    $event->setType('webkitAnimationIteration');
                    break;
                case 'animationstart':
                    $event->setType('webkitAnimationStart');
                    break;
                case 'transitionend':
                    $event->setType('webkitTransitionEnd');
                    break;
                default:
                    return;
            }
            $this->innerInvokeEventListener($object, $event, $listeners);
            $event->setType($originalEventType);
        }
    }
private function invokeEventListener ( EventTarget $ object , Event $ event ) : void { if ( $ event -> getFlags ( ) & EventFlags :: STOP_PROPAGATION ) { return ; } $ listeners = $ object -> listeners ; $ event -> setCurrentTarget ( $ object ) ; $ found = $ this -> innerInvokeEventListener ( $ object , $ event , $ listeners ) ; if ( ! $ found && $ event -> isTrusted ) { $ originalEventType = $ event -> type ; switch ( $ originalEventType ) { case 'animationend' : $ event -> setType ( 'webkitAnimationEnd' ) ; break ; case 'animationiteration' : $ event -> setType ( 'webkitAnimationIteration' ) ; break ; case 'animationstart' : $ event -> setType ( 'webkitAnimationStart' ) ; break ; case 'transitionend' : $ event -> setType ( 'webkitTransitionEnd' ) ; break ; default : return ; } $ this -> innerInvokeEventListener ( $ object , $ event , $ listeners ) ; $ event -> setType ( $ originalEventType ) ; } }
Prepares to execute callbacks for the specified event and object.
Prepares to execute callbacks for the specified event and object .
// This avoids event listeners added after this point from being run. // Note that removal still has an effect due to the removed field. // If event’s type attribute value is a match for any of the strings // in the first column in the following table, set event’s type // attribute value to the string in the second column on the same // row as the matching string, and terminate these substeps // otherwise.