You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Specify the textInput event
Fixes#353
* void -> undefined in IDL
* Move textInput spec into event-algo.bs
* Try to fix build errors
* Second attempt with build errors
* Third attempt with build errors, remove slashes
* Fourth attempt, slash more slashes
* Don't fire textInput for delete. Fire it on paste.
* Fire textInput before compositionend
* Set .data for insertParagraph/insertLineBreak
* Don't set data to null
Also fix a typo (and infinite recursion) in initialize a TextEvent.
* Move IDL back to the main spec so that wpt will pick it up
* Don't fire textInput when pressing Enter in <input>
<h3 id="fire-a-textevent"><dfn>fire a TextEvent</dfn></h3>
1029
+
1030
+
: Input
1031
+
:: |eventType|, a DOMString containing the event type
1032
+
:: |data|, a DOMString containing event data, or null
1033
+
1034
+
: Output
1035
+
:: None
1036
+
1037
+
1. Let target =
1038
+
<a href="https://html.spec.whatwg.org/#currently-focused-area-of-a-top-level-browsing-context">currently focused area of a top-level browsing context</a>
1039
+
1. Let |event| = result of <a>create a TextEvent</a> with |eventType|, |target|
1040
+
1. If |data| is null, set |data| to the empty string.
1041
+
1. Set |event|.{{TextEvent/data}} = |data|
1042
+
1. Return the result of <a>dispatch</a> |event| at |target|
1043
+
1044
+
</div><!-- algorithm -->
1045
+
1046
+
</section>
1047
+
938
1048
<!--
939
1049
K K EEEEE Y Y BBBB OOO AAA RRRR DDDD EEEEE V V EEEEE N N TTTTT
940
1050
K K E Y Y B B O O A A R R D D E V V E NN N T
@@ -1549,9 +1659,17 @@ And the following internal state:
1549
1659
1550
1660
1. If <a>in composition flag</a> is not set, then exit
1551
1661
1552
-
Issue: Compat: Chrome sends out beforeinput/compositionupdate/input sequence before
1662
+
Issue: Compat: Chrome sends out beforeinput/compositionupdate/textInput/input sequence before
1553
1663
compositionend (tested on macOS). Compare with Firefox.
1554
1664
1665
+
1. Set |result| = <a>fire a TextEvent</a> with "textInput", and |data|
1666
+
1667
+
Note: The "textInput" event is obsolete.
1668
+
1669
+
1. If |result| is false, then return.
1670
+
1671
+
1. Issue: fire an input event here.
1672
+
1555
1673
1. Let |data| = the current composition candidate string
1556
1674
1. <a>fire a CompositionEvent</a> with "compositionend" and |data|
1557
1675
@@ -2073,10 +2191,16 @@ Issue: Should these be moved into the Clipboard spec?
2073
2191
1. Let |data| = the text on the clipboard being pasted
2074
2192
1. Let |result| = <a>fire an InputEvent</a> with "beforeinput", "insertFromPaste" and |data|
2075
2193
2076
-
1. If |result| is true, then
2194
+
1. If |result| is false, then return.
2195
+
2196
+
1. Set |result| = <a>fire a TextEvent</a> with "textInput", and |data|
2197
+
2198
+
Note: The "textInput" event is obsolete.
2199
+
2200
+
1. If |result| is false, then return.
2077
2201
2078
-
1. Paste clipboard contents into DOM target element
2079
-
1. <a>Fire an InputEvent</a> with "input", "insertFromPaste" and |data|
2202
+
1. Paste clipboard contents into DOM target element
2203
+
1. <a>Fire an InputEvent</a> with "input", "insertFromPaste" and |data|
0 commit comments