Skip to content

Commit c6c22ef

Browse files
committed
feat(xhr): add all properties of Event class
1 parent 30f17f7 commit c6c22ef

File tree

1 file changed

+57
-3
lines changed

1 file changed

+57
-3
lines changed

python/pythonmonkey/builtin_modules/event-target.js

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,68 @@
1313
class Event
1414
{
1515
/**
16-
* The name identifying the type of the event.
16+
* Indicates whether the event bubbles up through the DOM tree or not.
17+
* @type {Boolean}
1718
*/
18-
type = '';
19+
bubbles = false;
20+
21+
/**
22+
* Indicates whether the event is cancelable.
23+
* @type {Boolean}
24+
*/
25+
cancelable = true;
1926

2027
/**
28+
* Indicates whether the event can bubble across the boundary between the shadow DOM and the regular DOM.
29+
* @type {Boolean}
30+
*/
31+
composed = false;
32+
33+
/**
34+
* The element to which the event handler has been attached.
2135
* @type {EventTarget}
2236
*/
23-
target = null;
37+
currentTarget = null;
38+
39+
/**
40+
* Indicates whether the call to event.preventDefault() canceled the event.
41+
* @type {Boolean}
42+
*/
43+
devaultPrevented = false;
44+
45+
/**
46+
* Indicates which phase of the event flow is currently being evaluated.
47+
* @type {Number}
48+
*/
49+
eventPhase = Event.NONE;
50+
static NONE = 0; // The event is not being processed
51+
static CAPTURING_PHASE = 1; // The event is being propagated through the target's ancestor objects
52+
static AT_TARGET = 2; // The event has arrived at the event's target
53+
static BUBBLING_PHASE = 3; // The event is propagating back up through the target's ancestors in reverse order, starting with the parent
54+
55+
/**
56+
* Indicates whether the event was initiated by the browser or by a script.
57+
* @type {Boolean}
58+
*/
59+
isTrusted = false;
60+
61+
/**
62+
* A reference to the object to which the event was originally dispatched.
63+
* @type {EventTarget}
64+
*/
65+
target = null;
66+
67+
/**
68+
* The time at which the event was created (in milliseconds). By specification, this value is time since epoch.
69+
* @type {Number}
70+
*/
71+
timeStamp = null;
72+
73+
/**
74+
* The name identifying the type of the event.
75+
* @type {String}
76+
*/
77+
type = '';
2478

2579
/**
2680
* @param {string} type A string with the name of the event.

0 commit comments

Comments
 (0)