DOM
Source-
Let composedPath be an empty list.
-
If path is empty, then return composedPath.
-
Let currentTarget be this’s
currentTarget
attribute value. -
Append currentTarget to composedPath.
-
Let currentTargetIndex be 0.
-
Let currentTargetHiddenSubtreeLevel be 0.
-
Let index be path’s size − 1.
-
While index is greater than or equal to 0:
-
If path[index]'s root-of-closed-tree is true, then increase currentTargetHiddenSubtreeLevel by 1.
-
If path[index]'s invocation target is currentTarget, then set currentTargetIndex to index and break.
-
If path[index]'s slot-in-closed-tree is true, then decrease currentTargetHiddenSubtreeLevel by 1.
-
Decrease index by 1.
-
-
Let currentHiddenLevel and maxHiddenLevel be currentTargetHiddenSubtreeLevel.
-
Set index to currentTargetIndex − 1.
-
While index is greater than or equal to 0:
-
If path[index]'s root-of-closed-tree is true, then increase currentHiddenLevel by 1.
-
If currentHiddenLevel is less than or equal to maxHiddenLevel, then prepend path[index]'s invocation target to composedPath.
-
If path[index]'s slot-in-closed-tree is true, then:
-
Decrease currentHiddenLevel by 1.
-
If currentHiddenLevel is less than maxHiddenLevel, then set maxHiddenLevel to currentHiddenLevel.
-
-
Decrease index by 1.
-
-
Set currentHiddenLevel and maxHiddenLevel to currentTargetHiddenSubtreeLevel.
-
Set index to currentTargetIndex + 1.
-
While index is less than path’s size:
-
If path[index]'s slot-in-closed-tree is true, then increase currentHiddenLevel by 1.
-
If currentHiddenLevel is less than or equal to maxHiddenLevel, then append path[index]'s invocation target to composedPath.
-
If path[index]'s root-of-closed-tree is true, then:
-
Decrease currentHiddenLevel by 1.
-
If currentHiddenLevel is less than maxHiddenLevel, then set maxHiddenLevel to currentHiddenLevel.
-
-
Increase index by 1.
-
-
Return composedPath.
In all current engines.
FirefoxYesSafariYesChrome45+ Opera32+Edge79+ Edge (Legacy)12+IE9+ Firefox for AndroidYesiOS SafariYesChrome for Android45+Android WebView45+Samsung Internet5.0+Opera Mobile32+ Node.js14.5.0+
The eventPhase
attribute must return the value it was
initialized to, which must be one of the following:
NONE
(numeric value 0) Events not currently dispatched are in this phase. CAPTURING_PHASE
(numeric value 1) When an event is dispatched to an object that participates in a tree it will be in this phase before it reaches its target. AT_TARGET
(numeric value 2) When an event is dispatched it will be in this phase on its target. BUBBLING_PHASE
(numeric value 3) When an event is dispatched to an object that participates in a tree it will be in this phase after it reaches its target. Initially the attribute must be initialized to NONE
.
Each event has the following associated flags that are all initially unset:
- stop propagation flag
- stop immediate propagation flag
- canceled flag
- in passive listener flag
- composed flag
- initialized flag
- dispatch flag
In all current engines.
Firefox1+Safari1+Chrome1+ Opera7+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ Node.js14.5.0+
The stopPropagation()
method steps are to set this’s stop propagation flag.
Read Next page