Skip to content

Commit 09a2031

Browse files
committed
Split event types source file by event type
This splits the event-types.txt file into smaller files (by event type) so that they are easier to manage. This should help reduce conflicts while converting the event types to an algorithmic description. The generated spec should be identical after this cl.
1 parent 579c178 commit 09a2031

10 files changed

+3444
-3416
lines changed

build.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,13 @@ def process_main_spec():
258258
'architecture',
259259
'event-interfaces',
260260
'event-types',
261+
'event-types-uievent',
262+
'event-types-focusevent',
263+
'event-types-mouseevent',
264+
'event-types-wheelevent',
265+
'event-types-inputevent',
266+
'event-types-keyboardevent',
267+
'event-types-compositionevent',
261268
'keyboard',
262269
'legacy-event-initializers',
263270
'legacy-key-attributes',

index.bs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,32 @@ path: sections/event-interfaces.include
9595
</pre>
9696

9797
<!-- Section 5: The Events ================================================= -->
98+
<section>
9899
<pre class="include">
99100
path: sections/event-types.include
100101
</pre>
102+
<pre class="include">
103+
path: sections/event-types-uievent.include
104+
</pre>
105+
<pre class="include">
106+
path: sections/event-types-focusevent.include
107+
</pre>
108+
<pre class="include">
109+
path: sections/event-types-mouseevent.include
110+
</pre>
111+
<pre class="include">
112+
path: sections/event-types-wheelevent.include
113+
</pre>
114+
<pre class="include">
115+
path: sections/event-types-inputevent.include
116+
</pre>
117+
<pre class="include">
118+
path: sections/event-types-keyboardevent.include
119+
</pre>
120+
<pre class="include">
121+
path: sections/event-types-compositionevent.include
122+
</pre>
123+
</section>
101124

102125
<!-- Section 6: Keyboard and key values ==================================== -->
103126
<pre class="include">

sections/event-types-compositionevent.txt

Lines changed: 345 additions & 0 deletions
Large diffs are not rendered by default.

sections/event-types-focusevent.txt

Lines changed: 253 additions & 0 deletions
Large diffs are not rendered by default.

sections/event-types-inputevent.txt

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
<h3 id="events-inputevents">Input Events</h3>
2+
3+
Input events are sent as notifications whenever the DOM is being updated (or about
4+
to be updated) as a direct result of a user action (e.g., keyboard input in an editable
5+
region, deleting or formatting text, ...).
6+
7+
<h4 id="interface-inputevent">Interface InputEvent</h4>
8+
9+
<h5 id="idl-inputevent">InputEvent</h5>
10+
11+
<p class="intro-dom">Introduced in DOM Level 3</p>
12+
13+
<pre class="idl">
14+
[Exposed=Window]
15+
interface InputEvent : UIEvent {
16+
constructor(DOMString type, optional InputEventInit eventInitDict = {});
17+
readonly attribute USVString? data;
18+
readonly attribute boolean isComposing;
19+
readonly attribute DOMString inputType;
20+
};
21+
</pre>
22+
23+
<dl dfn-for="InputEvent">
24+
<dt><dfn attribute>data</dfn></dt>
25+
<dd>
26+
<code>data</code> holds the value of the characters generated by
27+
an input method. This MAY be a single Unicode character or a
28+
non-empty sequence of Unicode characters [[Unicode]]. Characters
29+
SHOULD be normalized as defined by the Unicode normalization
30+
form <em>NFC</em>, defined in [[UAX15]].
31+
This attribute MAY contain the <a>empty string</a>.
32+
33+
The <a>un-initialized value</a> of this attribute MUST be
34+
<code>null</code>.
35+
</dd>
36+
37+
<dt><dfn attribute>isComposing</dfn></dt>
38+
<dd>
39+
<code>true</code> if the input event occurs as part of a
40+
composition session, i.e., after a EVENT{compositionstart} event
41+
and before the corresponding EVENT{compositionend} event.
42+
43+
The <a>un-initialized value</a> of this attribute MUST be
44+
<code>false</code>.
45+
</dd>
46+
47+
<dt><dfn attribute>inputType</dfn></dt>
48+
<dd>
49+
<code>inputType</code> contains a string that identifies the type
50+
of input associated with the event.
51+
52+
For a list of valid values for this attribute, refer to the
53+
[[Input-Events]] specification.
54+
55+
The <a>un-initialized value</a> of this attribute MUST be
56+
the empty string <code>""</code>.
57+
</dd>
58+
</dl>
59+
60+
<h5 id="idl-inputeventinit">InputEventInit</h5>
61+
62+
<pre class="idl">
63+
dictionary InputEventInit : UIEventInit {
64+
DOMString? data = null;
65+
boolean isComposing = false;
66+
DOMString inputType = "";
67+
};
68+
</pre>
69+
70+
<dl dfn-for="InputEventInit">
71+
<dt><dfn dict-member>data</dfn></dt>
72+
<dd>
73+
Initializes the <code>data</code> attribute of the InputEvent object.
74+
</dd>
75+
76+
<dt><dfn dict-member>isComposing</dfn></dt>
77+
<dd>
78+
Initializes the <code>isComposing</code> attribute of the InputEvent object.
79+
</dd>
80+
81+
<dt><dfn dict-member>inputType</dfn></dt>
82+
<dd>
83+
Initializes the <code>inputType</code> attribute of the InputEvent object.
84+
</dd>
85+
</dl>
86+
87+
<h4 id="events-inputevent-event-order">Input Event Order</h4>
88+
89+
The input events defined in this specification MUST occur in a set order
90+
relative to one another.
91+
92+
++---+-------------+---------------------------------------------------+
93+
=| # | Event Type | Notes |
94+
+---+-------------+---------------------------------------------------+
95+
+| 1 | beforeinput | |
96+
+| | | <em>DOM element is updated</em> |
97+
+| 2 | input | |
98+
++---+-------------+---------------------------------------------------+
99+
100+
<h4 id="events-input-types">Input Event Types</h4>
101+
102+
<h5 id="event-type-beforeinput"><dfn>beforeinput</dfn></h5>
103+
104+
++------------------+--------------------------------------------------------------------------------------+ event-definition
105+
=| % | |
106+
+------------------+--------------------------------------------------------------------------------------+
107+
+| Type | <strong><code>beforeinput</code></strong> |
108+
+| Interface | {{InputEvent}} |
109+
+| Sync / Async | Sync |
110+
+| Bubbles | Yes |
111+
+| Trusted Targets | <code>Element</code> (specifically: control types such as |
112+
| | <code>HTMLInputElement</code>, etc.) or any <code>Element</code> with |
113+
| | <code>contenteditable</code> attribute enabled |
114+
+| Cancelable | Yes |
115+
+| Composed | Yes |
116+
+| Default action | Update the DOM element |
117+
+| Context<br> | <ul> |
118+
| (trusted events) | <li>{{Event}}.{{Event/target}} : <a>event target</a> that is about to be updated</li>|
119+
| | <li>{{UIEvent}}.{{UIEvent/view}} : <a><code>Window</code></a></li> |
120+
| | <li>{{UIEvent}}.{{UIEvent/detail}} : <code>0</code></li> |
121+
| | <li>{{InputEvent}}.{{InputEvent/data}} : the string containing the data that will |
122+
| | be added to the element, which MAY be <code>null</code> if the content will |
123+
| | be deleted</li> |
124+
| | <li>{{InputEvent}}.{{InputEvent/isComposing}} : <code>true</code> if this event is |
125+
| | dispatched during a <a href="#keys-dead">dead key</a> sequence or while an |
126+
| | <a>input method editor</a> is active (such that |
127+
| | <a href="#events-compositionevents">composition events</a> are being dispatched);|
128+
| | <code>false</code> otherwise.</li> |
129+
| | </ul> |
130+
++------------------+--------------------------------------------------------------------------------------+
131+
132+
A <a>user agent</a> MUST dispatch this event when the DOM is about
133+
to be updated.
134+
135+
<h5 id="event-type-input"><dfn>input</dfn></h5>
136+
137+
++------------------+--------------------------------------------------------------------------------------+ event-definition
138+
=| % | |
139+
+------------------+--------------------------------------------------------------------------------------+
140+
+| Type | <strong><code>input</code></strong> |
141+
+| Interface | {{InputEvent}} |
142+
+| Sync / Async | Sync |
143+
+| Bubbles | Yes |
144+
+| Trusted Targets | <code>Element</code> (specifically: control types such as |
145+
| | <code>HTMLInputElement</code>, etc.) or any <code>Element</code> with |
146+
| | <code>contenteditable</code> attribute enabled |
147+
+| Cancelable | No |
148+
+| Composed | Yes |
149+
+| Default action | None |
150+
+| Context<br> | <ul> |
151+
| (trusted events) | <li>{{Event}}.{{Event/target}} : <a>event target</a> that was just updated</li> |
152+
| | <li>{{UIEvent}}.{{UIEvent/view}} : <a><code>Window</code></a></li> |
153+
| | <li>{{UIEvent}}.{{UIEvent/detail}} : <code>0</code></li> |
154+
| | <li>{{InputEvent}}.{{InputEvent/data}} : the string containing the data that has |
155+
| | been added to the element, which MAY be the <a>empty string</a> if the content |
156+
| | has been deleted</li> |
157+
| | <li>{{InputEvent}}.{{InputEvent/isComposing}} : <code>true</code> if this event is |
158+
| | dispatched during a <a href="#keys-dead">dead key</a> sequence or while an |
159+
| | <a>input method editor</a> is active (such that |
160+
| | <a href="#events-compositionevents">composition events</a> are being dispatched);|
161+
| | <code>false</code> otherwise.</li> |
162+
| | </ul> |
163+
++------------------+--------------------------------------------------------------------------------------+
164+
165+
A <a>user agent</a> MUST dispatch this event immediately after the
166+
DOM has been updated.
167+
168+

0 commit comments

Comments
 (0)