JDK-8127642 : fast/events/keydown-keypress-preventDefault.html test fails in WebView
  • Type: Bug
  • Component: javafx
  • Sub-Component: web
  • Affected Version: fx2.1
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2012-01-18
  • Updated: 2015-06-17
  • Resolved: 2012-04-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7u6Fixed
Related Reports
Relates :  
Description
Open the fast/events/keydown-keypress-preventDefault.html test in WebView and type some character (e.g. 'a') in the text box that appears. The expected behavior is the test should log a message 'key down' below the text box and the text box should remain empty. In WebView, however, two message are logged, 'key down' and 'key press', and the text box displays the typed character.

The problem is, if a custom 'key down' event handler requests the caller to stop default event processing (by returning false), WebView does not properly suppress the subsequent 'key press' event.

It is unclear at the moment if there is an easy way to fix this problem. To implement the desired behavior, the Windows port, for example, has to jump through hoops and forcefully delete WM_CHAR messages from the Windows message queue whenever the key down event handler requests so.
Comments
Fixed as part of RT-20828
13-04-2012