Skip to content

Commit d1cd8ad

Browse files
author
Orta Therox
authored
Merge pull request microsoft#913 from saschanaz/charcode
Add deprecated KeyboardEventInit.charCode
2 parents 271893c + 394e7fc commit d1cd8ad

File tree

4 files changed

+27
-11
lines changed

4 files changed

+27
-11
lines changed

baselines/dom.generated.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,8 @@ interface KeyAlgorithm {
642642
}
643643

644644
interface KeyboardEventInit extends EventModifierInit {
645+
/** @deprecated */
646+
charCode?: number;
645647
code?: string;
646648
isComposing?: boolean;
647649
key?: string;

inputfiles/addedTypes.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2297,10 +2297,11 @@
22972297
"KeyboardEventInit": {
22982298
"members": {
22992299
"member": {
2300+
"charCode": {
2301+
"deprecated": 1
2302+
},
23002303
"keyCode": {
2301-
"name": "keyCode",
2302-
"deprecated": 1,
2303-
"type": "unsigned long"
2304+
"deprecated": 1
23042305
}
23052306
}
23062307
}

inputfiles/idl/UI Events.widl

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
[Constructor(DOMString type, optional UIEventInit eventInitDict), Exposed=Window]
1+
[Exposed=Window]
22
interface UIEvent : Event {
3+
constructor(DOMString type, optional UIEventInit eventInitDict);
34
readonly attribute Window? view;
45
readonly attribute long detail;
56
};
@@ -9,17 +10,19 @@ dictionary UIEventInit : EventInit {
910
long detail = 0;
1011
};
1112

12-
[Constructor(DOMString type, optional FocusEventInit eventInitDict), Exposed=Window]
13+
[Exposed=Window]
1314
interface FocusEvent : UIEvent {
15+
constructor(DOMString type, optional FocusEventInit eventInitDict);
1416
readonly attribute EventTarget? relatedTarget;
1517
};
1618

1719
dictionary FocusEventInit : UIEventInit {
1820
EventTarget? relatedTarget = null;
1921
};
2022

21-
[Constructor(DOMString type, optional MouseEventInit eventInitDict), Exposed=Window]
23+
[Exposed=Window]
2224
interface MouseEvent : UIEvent {
25+
constructor(DOMString type, optional MouseEventInit eventInitDict);
2326
readonly attribute long screenX;
2427
readonly attribute long screenY;
2528
readonly attribute long clientX;
@@ -67,8 +70,9 @@ dictionary EventModifierInit : UIEventInit {
6770
boolean modifierSymbolLock = false;
6871
};
6972

70-
[Constructor(DOMString type, optional WheelEventInit eventInitDict), Exposed=Window]
73+
[Exposed=Window]
7174
interface WheelEvent : MouseEvent {
75+
constructor(DOMString type, optional WheelEventInit eventInitDict);
7276
// DeltaModeCode
7377
const unsigned long DOM_DELTA_PIXEL = 0x00;
7478
const unsigned long DOM_DELTA_LINE = 0x01;
@@ -87,8 +91,9 @@ dictionary WheelEventInit : MouseEventInit {
8791
unsigned long deltaMode = 0;
8892
};
8993

90-
[Constructor(DOMString type, optional InputEventInit eventInitDict), Exposed=Window]
94+
[Exposed=Window]
9195
interface InputEvent : UIEvent {
96+
constructor(DOMString type, optional InputEventInit eventInitDict);
9297
readonly attribute DOMString? data;
9398
readonly attribute boolean isComposing;
9499
readonly attribute DOMString inputType;
@@ -100,8 +105,9 @@ dictionary InputEventInit : UIEventInit {
100105
DOMString inputType = "";
101106
};
102107

103-
[Constructor(DOMString type, optional KeyboardEventInit eventInitDict), Exposed=Window]
108+
[Exposed=Window]
104109
interface KeyboardEvent : UIEvent {
110+
constructor(DOMString type, optional KeyboardEventInit eventInitDict);
105111
// KeyLocationCode
106112
const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00;
107113
const unsigned long DOM_KEY_LOCATION_LEFT = 0x01;
@@ -131,8 +137,9 @@ dictionary KeyboardEventInit : EventModifierInit {
131137
boolean isComposing = false;
132138
};
133139

134-
[Constructor(DOMString type, optional CompositionEventInit eventInitDict), Exposed=Window]
140+
[Exposed=Window]
135141
interface CompositionEvent : UIEvent {
142+
constructor(DOMString type, optional CompositionEventInit eventInitDict);
136143
readonly attribute DOMString data;
137144
};
138145

@@ -150,3 +157,9 @@ partial interface KeyboardEvent {
150157
readonly attribute unsigned long charCode;
151158
readonly attribute unsigned long keyCode;
152159
};
160+
161+
partial dictionary KeyboardEventInit {
162+
// The following support legacy user agents
163+
unsigned long charCode = 0;
164+
unsigned long keyCode = 0;
165+
};

inputfiles/idlSources.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@
495495
"title": "Touch Events"
496496
},
497497
{
498-
"url": "https://www.w3.org/TR/uievents/",
498+
"url": "https://w3c.github.io/uievents/",
499499
"title": "UI Events"
500500
},
501501
{

0 commit comments

Comments
 (0)