Bug 206341 - [GTK] Missing onbeforeinput or extra oninput in certain case
Summary: [GTK] Missing onbeforeinput or extra oninput in certain case
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-16 01:43 PST by Milan Crha
Modified: 2020-01-16 01:43 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milan Crha 2020-01-16 01:43:17 PST
As far as I know, every oninput event should be preceded by onbeforeinput, or at least things like entering text and deleting it should do that. I found out a case, where it is not done, the onbeforeinput is missing or the oninput is invoked in error.

Steps:
a) open MiniBrowser in editor mode:

   $ MiniBrowser --editor-mode

b) open the Web Inspector and execute in the JavaScript console these two commands:

   document.body.onbeforeinput = function(event) { console.log("before input:" + event.inputType); };
   document.body.oninput = function(event) { console.log("input:" + event.inputType); };

c) click with the mouse to the window body
d) press these keys: <Enter><Backspace>

   The console should show:

      before input:insertParagraph
      input:insertParagraph
      before input:deleteContentBackward
      input:deleteContentBackward

   So far so good.

d) press this key once: <Backspace>

   While there should be added to the console:

      before input:deleteContentBackward
      input:deleteContentBackward

   there's only added:

      input:deleteContentBackward

   thus the onbeforeinput invocation is missing.

Pressing <Backspace> again doesn't invoke onbeforeinput, neither oninput, as expected.