Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 366266

Summary: [Browser] Spacebar keypress action on webpage object is ignored
Product: [Eclipse Project] Platform Reporter: Missing name Mising name <armoret77>
Component: SWTAssignee: Paul Pazderski <paul-eclipse>
Status: VERIFIED FIXED QA Contact: Niraj Modi <niraj.modi>
Severity: normal    
Priority: P3 CC: carolynmacleod4, karsten.thoms, mawe75, niraj.modi, paul-eclipse, peter.billstrom, speedyjack, xavier_robert
Version: 3.7.1Keywords: triaged
Target Milestone: 4.14 M3   
Hardware: PC   
OS: Windows All   
See Also: https://git.eclipse.org/r/150623
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=d17f2303152f85b1cc84f9ca5d702a6e16705fdb
Whiteboard:

Description Missing name Mising name CLA 2011-12-09 16:24:39 EST
Using the SWT Browser configured to embed Internet Explorer, the spacebar action should activate a focused html object as if it was clicked. For example, it should check or uncheck a check box object, or activate a link, etc. But the key action seems to be ignored.

This can be simply tested by opening a web page within eclipse, navigating to any object using one of the traversal keys (tab for instance) and then pressing space bar on the focused object.

This behavior occurs with SWT 3.7.1 and previous versions, on XP and Windows 7 with IE6 and IE9 (no all versions tested).

The only way I found to fix that is calling a javascript action when the spacebar is pressed (inside a key listener for instance) and then call "document.activeElement.click();". But this is only a work around, this fix may give side effects depending on the page.

Any other cleaner solution will be greatly appreciated!
Comment 1 Grant Gayed CLA 2011-12-13 11:07:51 EST
I see this with checkboxes, stand-alone IE toggles the checkbox when Space is pressed but embedded IE does not.

Note that pressing space when a link has focus is not expected to activate it, see stand-alone IE and Firefox.
Comment 2 Grant Gayed CLA 2011-12-16 09:48:13 EST
*** Bug 338190 has been marked as a duplicate of this bug. ***
Comment 3 Carolyn MacLeod CLA 2011-12-16 10:15:54 EST
> Note that pressing space when a link has focus is not expected to activate it,
> see stand-alone IE and Firefox.

Interesting. Pressing space is supposed to work on a focused link, according to this doc:
http://www.w3.org/TR/wai-aria-practices/#link
But I agree with you that it doesn't. (It has a strange "scroll down" behavior that I don't understand). I will check with Rich.

Note that typing Enter on a link that has focus does work in standalone IE and Firefox, and in the SWT Browser.
Comment 4 Missing name Mising name CLA 2011-12-24 10:59:25 EST
Hi to all, just a precision: 
my work around has a main drawback, it causes a JVM crashes on some pages. I could see it while typing in an entry field which had already some javascript actions on mouse click (for instance, the default text is used as a label and is erased when the user it typing data).
I tried to add more tests in the javascript function that is called when spacebar is pressed (for checking the html object type, checking null objects, etc) but that did not change anything. Simulating a click action on an entry field that already processes click/focus actions may create some kind of recursive effect and that may be the reason of the crash ? I don't really know because the JVM crash report is not really useful.
I can hardly debug this because this is related to JNI and W32 and that's not my specialty, otherwise I would have participated to help.

I use the SWT browser embedded in an application and fixing this behavior will be kindly appreciated because my application's users need to use this browser without mouse...
Thx
Comment 5 Eclipse Genie CLA 2019-10-03 12:30:22 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 6 Karsten Thoms CLA 2019-10-04 14:03:02 EDT
Could anyone on Windows check if this still has relevance? If not or when no one tries to reproduce this then the issue should be closed.
Comment 7 Paul Pazderski CLA 2019-10-04 14:12:04 EDT
Still the same on Windows 10, IE 11 and SWT 3.112.100.v20191002-1801.
Comment 8 Paul Pazderski CLA 2019-10-04 17:00:41 EDT
Sometimes I'm good at guessing. While testing I noticed that when pressing space in standalone IE the check box get black and when releasing it is checked. In SWT embedded IE it also get black when pressing space but is not checked when releasing.

I'm sure space is working but interpreted twice, checking the box and immediately unchecking it again.
Comment 9 Eclipse Genie CLA 2019-10-04 17:01:32 EDT
New Gerrit change created: https://git.eclipse.org/r/150623
Comment 11 Niraj Modi CLA 2019-10-25 08:28:32 EDT
(In reply to Eclipse Genie from comment #10)
> Gerrit change https://git.eclipse.org/r/150623 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=d17f2303152f85b1cc84f9ca5d702a6e16705fdb

Thanks Paul for the fix, resolving now.
Comment 12 Niraj Modi CLA 2019-11-21 00:58:45 EST
Verified "Internal Browser" tested https://validator.w3.org/#validate_by_uri+with_options using Build id: I20191119-2200 on Win7.