diff --git a/event-algo.bs b/event-algo.bs index 4e24dcd..3f22980 100644 --- a/event-algo.bs +++ b/event-algo.bs @@ -876,7 +876,7 @@ Issue: TODO 1. If suppress key input events flag is set, then 1. Exit (since the keydown was canceled) - Issue: Handle historical keypress event here + Issue: Handle historical keypress event here. Return if cancelled. 1. Let |inputType| = null 1. Let |data| = null @@ -888,6 +888,9 @@ Issue: TODO 1. If |key| is "Delete", then |inputType| = "deleteContentForward" 1. Otherwise, 1. |inputType| = "insertText" + + Issue: |inputType| should be "insertParagraph" or "insertLineBreak" when pressing Enter. + 1. |data| = |key| 1. If |inputType| is not null, then @@ -896,12 +899,25 @@ Issue: TODO Can be enabled by changing the "dom.input_events.beforeinput_enabled" pref in "about:config" 1. Let |result| = fire an InputEvent with "beforeinput", |inputType| and |data| - 1. If |result| is true + 1. If |result| is false, then return. + 1. Let |textInputData| be |data|. + 1. Let |shouldFireTextInput| to true. + 1. If |inputType| is either "insertParagraph" or "insertLineBreak", then: + 1. Set |textInputData| to "\n". + 1. If |target| is an {{HTMLInputElement}}, then set |shouldFireTextInput| to false. + 1. If |inputType| is not one of "insertText", "insertParagraph" or "insertLineBreak", then set |shouldFireTextInput| to false. + 1. If |shouldFireTextInput| is true, then: + + 1. Set |result| = fire a TextEvent with "textInput", and |textInputData| + + Note: The "textInput" event is obsolete. + + 1. If |result| is false, then return. - Note: Perform DOM update here. Insert key into |target| element + Note: Perform DOM update here. Insert key into |target| element - Note: Compat: - For insertFromPaste, Chrome has data = null, Firefox has data = same as beforeinput. + Note: Compat: + For insertFromPaste, Chrome has data = null, Firefox has data = same as beforeinput. 1. Fire an InputEvent with "input", |inputType| and |data| @@ -935,6 +951,100 @@ Issue: TODO + + +
+

Text Event

+ +Note: {{TextEvent}} is obsolete. + +

TextEvent Interface

+ +

See IDL definition in UI Events.

+ +The data attribute must return the value it was initialized to. + +
+

The +initTextEvent(type, bubbles, cancelable, view, data) +method steps are: + +

    +
  1. If this's dispatch flag is set, then return. + +

  2. Initialize a UIEvent with this, |type| and |eventTarget| + +

  3. Set this.{{bubbles}} = |bubbles| + +

  4. Set this.{{cancelable}} = |cancelable| + +

  5. +

    Set this.{{view}} = |view| + +

    The bubbles/cancelable/view should be parameters to "Initialize a UIEvent" instead of being set twice. + +

  6. Set this.{{TextEvent/data}} = |data| +

+
+ +
+

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 UIEvent with |e|, |eventType| and |eventTarget| + + 1. Initialize the following public attributes + + 1. Set event.data = "" + +
+ +
+

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, or null + + : 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. If |data| is null, set |data| to the empty string. + 1. Set |event|.{{TextEvent/data}} = |data| + 1. Return the result of dispatch |event| at |target| + +
+ +
+ diff --git a/event-algo.html b/event-algo.html index 44bb7d3..b5a951d 100644 --- a/event-algo.html +++ b/event-algo.html @@ -1238,14 +1238,15 @@ grid-column: 2; width: auto; margin-right: 1rem; + border-bottom: 3px solid transparent; + margin-bottom: -3px; } #toc .content:hover, #toc .content:focus { background: rgba(75%, 75%, 75%, .25); background: var(--a-hover-bg); - border-bottom: 3px solid #054572; - border-bottom: 3px solid var(--toclink-underline); - margin-bottom: -3px; + border-bottom-color: #054572; + border-bottom-color: var(--toclink-underline); } #toc li li li .content { margin-left: 1rem; @@ -1269,7 +1270,7 @@ ul.index ul, ul.index dl { font-size: smaller; } @media not print { - ul.index li span:not(.dfn-paneled) { + ul.index li a + span { white-space: nowrap; color: transparent; } ul.index li a:hover + span, @@ -1487,10 +1488,9 @@ } } - - - - + - - - - - - + + + + + +} + +.ref-hint { + display: inline-block; + position: absolute; + z-index: 35; + width: 20em; + width: 300px; + height: auto; + max-height: 500px; + overflow: auto; + padding: 0.5em 0.5em; + font: small Helvetica Neue, sans-serif, Droid Sans Fallback; + background: var(--ref-hint-bg); + color: var(--ref-hint-text); + border: outset 0.2em; + white-space: normal; /* in case it's moved into a pre */ +} + +.ref-hint * { margin: 0; padding: 0; text-indent: 0; } + +.ref-hint ul { padding: 0 0 0 1em; list-style: none; } + + +

UI Events Algorithms

-

A Collection of Interesting Ideas,

+

A Collection of Interesting Ideas,

Issue Tracking: @@ -1947,7 +2083,7 @@

@@ -1956,12 +2092,11 @@

Abstract

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.

+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.