mozilla / geckodriver

WebDriver for Firefox
https://firefox-source-docs.mozilla.org/testing/geckodriver/
Mozilla Public License 2.0
7.03k stars 1.51k forks source link

Repeating the modifier key does not release it anymore #2043

Closed phoenix384 closed 1 year ago

phoenix384 commented 1 year ago

System

See #1386 and #1502. Up to Firefox 98 it was possible to press a modifier and release it by simply repeating it since modifier keys ought to be stateful. Since Firefox 99 this also doesn't work anymore. input.sendKeys(Keys.CONTROL, "a", Keys.CONTROL, "bc"); should select everything inside the input field and overwrite it with "bc", but it doesn't do anything. This code works in Firefox 98 and Chrome.

jgraham commented 1 year ago

Hmm, afaict the spec doesn't require that sending the modifier key multiple times releases the modifier. However it does seem like we'd dispatch the ctrl-modified "a" when the second Keys.CONTROL is reached and then at the end dispatch ctrl-modified "bc", which would indeed do nothing. I think the theoretical way to release the modifier would be to send Keys.NULL, although that may not work in Firefox currently. Alternatively a workaround would be to write input.sendKeys(Keys.CONTROL, "a"); input.sendKeys("bc")

whimboo commented 1 year ago

Note that the change for Firefox 90 which caused this change in behavior is https://bugzilla.mozilla.org/show_bug.cgi?id=1686666.

Yes, in Firefox we currently do not support the NULL value. There is https://bugzilla.mozilla.org/show_bug.cgi?id=1494661 to get this implemented.

phoenix384 commented 1 year ago

Yes, maybe the holy spec does not require that sending the modifier key multiple times releases the modifier - I don't know. At least it was a working workaround. And yes, there is https://bugzilla.mozilla.org/show_bug.cgi?id=1494661 but it is 4 years old and the last comment is "We know, but we don't care", although the spec says that this has to work.

whimboo commented 1 year ago

My last comment didn't say we don't care at all but we are a very small team and this issue didn't come up all the last months/years. As such it never got re-evaluated. We will discuss a possible prioritization in our next triage meeting.

I would close this issue as dupe of #1502.