RFR: 8278759 : PointerEvent: buttons property set to 0 when mouse down [v2]

Kevin Rushforth kcr at openjdk.java.net
Fri Feb 25 13:31:59 UTC 2022


On Fri, 25 Feb 2022 11:15:23 GMT, Hima Bindu Meda <duke at openjdk.java.net> wrote:

>> Basically, buttons property is a mask which represents the button/buttons clicked on the mouse.
>>     It is observed that event.buttons property is set to 0 when there is mouse press or drag event.This behaviour is observed only with javafx webView.Other browsers set the buttons property to 1, when there is mouse press or drag.
>>      The issue happens because the buttons property is not updated in the framework.
>>      Added implementation to update and propagate the buttons property from javafx platform to native webkit.Added a robot test case for the same.
>>    Performed sanity testing with the added implementation and the buttons property is compliant with the specification mentioned in https://w3c.github.io/pointerevents/#the-buttons-property.
>
> Hima Bindu Meda has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Refactor variable names and update the formatting

All changes look good. While doing final testing, I am seeing test failures on Windows caused by the popup not being dismissed. See below.

tests/system/src/test/java/test/robot/javafx/web/PointerEventTest.java line 212:

> 210:         Util.runAndWait(() -> {
> 211:             robot.mouseRelease(MouseButton.PRIMARY, MouseButton.MIDDLE, MouseButton.SECONDARY);
> 212:             robot.mouseClick(MouseButton.PRIMARY);

I presume clicking the left mouse button is done to dismiss the popup that will happens when dragging with the right mouse button? This doesn't work on Windows, so subsequent tests fail. If you change it to pressing the `ESC` key, then it should work:


    robot.keyType(KeyCode.ESCAPE);

-------------

PR: https://git.openjdk.java.net/jfx/pull/742


More information about the openjfx-dev mailing list