Safari Developer Library

Developer

SafariEvent Class Reference

Options
Deployment Target:

On This Page

SafariEvent

The SafariEvent class is a base class used to encapsulate events. Developers who are familiar with DOM events will notice many similarities in design and behavior. More...

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Not Applicable Not Applicable

Availability


Available in Safari 5.0 and later.
  • type Property

    The type of the event.

    Declaration

    JavaScript

    readonly attribute DOMString type

    Discussion

    The string used to identify a particular type of event is documented in the reference for that class.

    Availability

    Available in Safari 5.0 and later.

  • target Property

    The target of the event.

    Declaration

    JavaScript

    readonly attribute SafariEventTarget target

    Discussion

    This attribute stays the same as the event moves through the event-dispatch hierarchy. Its value is the same as the object that the event is sent to during the targeting phase.

    Availability

    Available in Safari 5.0 and later.

  • currentTarget Property

    The object that the event is currently being sent to.

    Declaration

    JavaScript

    readonly attribute SafariEventTarget currentTarget

    Discussion

    This attribute varies as the event progresses through the phases, changing as the event moves through the event-dispatch hierarchy.

    Availability

    Available in Safari 5.0 and later.

  • timeStamp Property

    The time and date that the event was created.

    Declaration

    JavaScript

    readonly attribute DOMTimeStamp timeStamp

    Availability

    Available in Safari 5.0 and later.

  • eventPhase Property

    The event-handling phase that the event is in.

    Declaration

    JavaScript

    readonly attribute unsigned short eventPhase

    Discussion

    The values for this property are the same as the values used by Webkit to identify the event-handling phases. See Event Handling Phases.

    Availability

    Available in Safari 5.0 and later.

  • bubbles Property

    A Boolean value that indicates whether the event goes through the bubbling phase.

    Declaration

    JavaScript

    readonly attribute boolean bubbles

    Availability

    Available in Safari 5.0 and later.

  • cancelable Property

    A Boolean value that indicates whether the event can be canceled.

    Declaration

    JavaScript

    readonly attribute boolean cancelable

    Availability

    Available in Safari 5.0 and later.

    See Also

    stopPropagation

  • Prevents the event from any further propagation.

    Declaration

    JavaScript

    void stopPropagation ();

    Discussion

    Propagation can be stopped only fon cancelable events. After propagation is stopped, the event is not sent to any other targets.

    Availability

    Available in Safari 5.0 and later.

    See Also

    cancelable

  • Prevents the browser from performing the default action for an event.

    Declaration

    JavaScript

    void preventDefault ();

    Discussion

    Use this method to indicate that your extension has already fully handled the event; you don’t want the browser to do anything. Note that preventing the default action does not stop an event from propagating.

    Availability

    Available in Safari 5.0 and later.

  • defaultPrevented Property

    A Boolean value that indicates whether the event’s default action has been prevented.

    Declaration

    JavaScript

    readonly attribute boolean defaultPrevented

    Availability

    Available in Safari 5.0 and later.

Constants

  • Phases of the event-handling process.

    Declaration

    Constants

    • BUBBLING_PHASE

      BUBBLING_PHASE

      The bubbling phase.

      Available in Safari 5.1 and later.

    • CAPTURING_PHASE

      CAPTURING_PHASE

      The capturing phase.

      Available in Safari 5.1 and later.

    • TARGETING_PHASE

      TARGETING_PHASE

      The targeting phase.

      Available in Safari 5.1 and later.

    Import Statement