From f25e304cbd0afe85cf2073a03d09e1f80a0cb691 Mon Sep 17 00:00:00 2001
From: Simon Pieters The
+ If this's dispatch flag is set, then return.
+
+ Initialize a UIEvent with this, |type| and |eventTarget|
+
+ Set this.{{bubbles}} = |bubbles|
+
+ Set this.{{cancelable}} = |cancelable|
+
+ Set this.{{view}} = |view|
+
+ The bubbles/cancelable/view should be parameters to "Initialize a UIEvent" instead of being set twice.
+
+ Set this.{{TextEvent/data}} = |data|
+ To the extent possible under law, the editors have waived all copyright
and related or neighboring rights to this work.
-In addition, as of 11 January 2024,
+In addition, as of 15 January 2024,
the editors have made this specification available under the Open Web Foundation Agreement Version 1.0,
which is available at http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
Parts of this work may be from another specification document. If so, those parts are instead covered by the license of that specification document. This document attempts to describe, in an algorithmic manner, how UIEvents
-
- should be handled by User Agents. Because this functionality has been shipping
- in UAs for many years, the primary goal is to document the existing behaviors
- and identify areas where implementations disagree. The intent is to fold this
- information into the main UIEvents spec (and other specs) once there is
- consensus that this process described here is adequate.Element
| KeyboardEvent | Yes | Yes | Varies: launch text composition system; |
| | | | | | | | EVENT{blur} and EVENT{focus} events; |
| | | | | | | | EVENT{DOMActivate} event; other event |
++| textInput | Sync | Yes | Element
| TextEvent | Yes | Yes | EVENT{input} event |
++-----------------------------+--------+----------+------------------------------------------+------------------+------------+------------+------------------------------------------------+
@@ -517,6 +518,118 @@ completeness.
++---+-------------+------------------------+---------------------+--------------------------------+
+Legacy {{TextEvent}} events
+
+Interface TextEvent
+
+
+
+ [Exposed=Window]
+ interface TextEvent : Event {
+ readonly attribute DOMString data;
+ void initTextEvent(DOMString type,
+ optional boolean bubbles = false,
+ optional boolean cancelable = false,
+ optional Window? view = null,
+ optional DOMString data = "undefined");
+ };
+
+
+
+
+
+data
holds the value of the characters generated by
+ an input method. This MAY be a single Unicode character or a
+ non-empty sequence of Unicode characters [[Unicode]]. Characters
+ SHOULD be normalized as defined by the Unicode normalization
+ form NFC, defined in [[UAX15]]. This
+ attribute MAY be the empty string.
+
+ The un-initialized value of this attribute MUST be
+ ""
(the empty string).
+ TextEvent
object.
+ This method has the same behavior as {{Event/initEvent()}}.
+
+
+
+ null
.
+ Legacy {{TextEvent}} event types
+
+ textInput
+
+
+
+
+ If supported by a user agent, this event MUST be dispatched
+ as the default action of a EVENT{beforeinput} event.
+
+
+
+ Type
+
+ textInput
+
+ Interface
+ {{TextEvent}}
+
+
+ Sync / Async
+ Sync
+
+
+ Bubbles
+ Yes
+
+
+ Trusted Targets
+
+ Element
+
+ Cancelable
+ Yes
+
+
+ Composed
+ Yes
+
+
+ Default action
+
+ EVENT{input} event
+
+
+ Context
+
(trusted events)
+
+
+
+ Legacy {{MutationEvent}} events
The mutation and mutation name event modules are designed to allow
From c8951aa2bc80f8121b3ec6bfe153a130431c0193 Mon Sep 17 00:00:00 2001
From: Simon Pieters Text Event
+
+Note: {{TextEvent}} is obsolete.
+
+TextEvent Interface
+
+
+[Exposed=Window]
+interface TextEvent : UIEvent {
+ readonly attribute DOMString data;
+ undefined initTextEvent(DOMString type,
+ optional boolean bubbles = false,
+ optional boolean cancelable = false,
+ optional Window? view = null,
+ optional DOMString data = "undefined");
+};
+
+
+The data
attribute must return the value it was initialized to.
+
+initTextEvent(type, bubbles, cancelable, view, data)
+method steps are:
+
+
+
+initialize a TextEvent
+
+ : Input
+ :: |e|, the {{Event}} to initialize
+ :: |eventType|, a DOMString containing the event type
+ :: |eventTarget|, the {{EventTarget}} of the event
+
+ : Output
+ :: None
+
+ 1. Initialize a TextEvent with |e|, |eventType| and |eventTarget|
+
+ 1. Initialize the following public attributes
+
+ 1. Set event.data = null
+
+create a TextEvent
+
+ : Input
+ :: |eventType|, a DOMString containing the event type
+ :: |eventTarget|, the {{EventTarget}} of the event
+
+ : Output
+ :: None
+
+ 1. Let |e| = the result of
+ creating a new event using {{TextEvent}}
+ 1. Initialize a TextEvent with |e|, |eventType| and |eventTarget|
+
+ 1. Return |e|
+
+fire a TextEvent
+
+ : Input
+ :: |eventType|, a DOMString containing the event type
+ :: |data|, a DOMString containing event data
+
+ : Output
+ :: None
+
+ 1. Let target =
+ currently focused area of a top-level browsing context
+ 1. Let |event| = result of create a TextEvent with |eventType|, |target|
+ 1. Set |event|.{{TextEvent/data}} = |data|
+ 1. Return the result of dispatch |event| at |target|
+
+UI Events Algorithms
- A Collection of Interesting Ideas,
+ A Collection of Interesting Ideas,
Abstract
This is a proposal. See uievents/270
@@ -2610,7 +2656,7 @@A UIEvent
has the following:
view
+ view
detail
Along with the following historical attribute:
@@ -2639,7 +2685,7 @@Set event.view
= the eventTarget’s node document’s Window
object
Set event.view
= the eventTarget’s node document’s Window
object
Set event.detail
= 0
screenY
clientX
clientY
- ctrlKey
- shiftKey
- altKey
- metaKey
+ ctrlKey
+ shiftKey
+ altKey
+ metaKey
button
buttons
- relatedTarget
+ relatedTarget
If result is false, then return.
Set result = fire a TextEvent with "textInput", and data
- -Note: The "textInput" event is obsolete.
-If result is false, then return.
+If inputType is "insertText", then
+Set result = fire a TextEvent with "textInput", and data
+Note: The "textInput" event is obsolete.
+If result is false, then return.
+Note: Perform DOM update here. Insert key into target element
Note: Compat: @@ -3328,7 +3378,7 @@
bubbles
= cancelable
= view
= data
= "undefined");
+ data
= "undefined");
};
The data
attribute must return the value it was initialized to.
Set this.cancelable
= cancelable
The bubbles/cancelable/view should be parameters to "Initialize a UIEvent" instead of being set twice.
keyCode
- keyChar
+ keyChar
And the following internal state:
Let result = fire an InputEvent with "beforeinput", "insertFromPaste" and data
If result is true, then
+If result is false, then return.
+Set result = fire a TextEvent with "textInput", and data
+Note: The "textInput" event is obsolete.
+If result is false, then return.
Paste clipboard contents into DOM target element