Safari class is a base class used to encapsulate events. Developers who are familiar with DOM events will notice many similarities in design and behavior.
- Safari Desktop 5.0+
- Safari Extensions JS
Events are sent to their target and its ancestors in three phases. In order, they are as follows:
Capturing. The event is sent to every ancestor of its target, starting with the most distant ancestor, and ending with the parent of the event’s target.
Targeting. The event is sent to its target.
Bubbling. The event is sent to every ancestor of its target, starting with the parent of the event’s target, and ending with its most distant ancestor.
You can tell which phase an event is in from the value of its
event property. When you register for an event notification, you specify whether or not you want to be notified during the capturing phase. (You may not always need to check what phase the event is in.) The string used to identify a particular type of event is documented in the reference for that class. See Table 1 for some common event types.
Safari event class