Closed Bug 1475550 Opened 7 years ago Closed 4 years ago

On GNU+Linux switching tabs with alt+1 etc passes the hit of 1 to the page

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P2)

62 Branch
defect

Tracking

()

RESOLVED DUPLICATE of bug 1427984

People

(Reporter: alexander.kern, Unassigned)

References

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0 Build ID: 20180709172241 Steps to reproduce: Browse a website that uses "1" as input and switch tabs with tab with alt+1. Actual results: Go back to the previous tab and you'll see that it behaves as if you'd pressed 1 although you pressed alt+1. Expected results: Page should be agnostic of user pressing alt+1 because it's a hotkey to switch tabs.
See Also: → 1475551
Hi Alexander, What website(s) did you use to try this? I used a few websites with submission forms and couldn't reproduce the issue. Cannot reproduce this issue with the following specs: Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0 Build ID: 20180713213322
Component: Untriaged → Event Handling
Flags: needinfo?(alexander.kern)
Product: Firefox → Core
Hi Grover, it doesn't seem to happen for forms, but it does happen if Javascript listens for the key press event. Should be reproducible on this site: http://jsfiddle.net/82mwje0t/4/ Sorry, I could have been clearer on "website that uses 1 as input."
Flags: needinfo?(alexander.kern)
Looks like we're not correctly gobbling up this event before it hits the page. bz, I don't suppose you know where we should be preventing this event? My quick searching didn't turn anything up.
Flags: needinfo?(bzbarsky)
Priority: -- → P2
masayuki might recall.
https://searchfox.org/mozilla-central/rev/e52cd92858800a69b74cb97d26d9bdb960d611ca/browser/base/content/browser-sets.inc#353-367 Perhaps, there should be: #expand <key id="keyup_selectTab1" oncommand="event.stopImmediatePropagation();" key="1" modifiers="__NUM_SELECT_TAB_MODIFIER__" event="keyup"/> #expand <key id="keyup_selectTab2" oncommand="event.stopImmediatePropagation();" key="2" modifiers="__NUM_SELECT_TAB_MODIFIER__" event="keyup"/> #expand <key id="keyup_selectTab3" oncommand="event.stopImmediatePropagation();" key="3" modifiers="__NUM_SELECT_TAB_MODIFIER__" event="keyup"/> #expand <key id="keyup_selectTab4" oncommand="event.stopImmediatePropagation();" key="4" modifiers="__NUM_SELECT_TAB_MODIFIER__" event="keyup"/> #expand <key id="keyup_selectTab5" oncommand="event.stopImmediatePropagation();" key="5" modifiers="__NUM_SELECT_TAB_MODIFIER__" event="keyup"/> #expand <key id="keyup_selectTab6" oncommand="event.stopImmediatePropagation();" key="6" modifiers="__NUM_SELECT_TAB_MODIFIER__" event="keyup"/> #expand <key id="keyup_selectTab7" oncommand="event.stopImmediatePropagation();" key="7" modifiers="__NUM_SELECT_TAB_MODIFIER__" event="keyup"/> #expand <key id="keyup_selectTab8" oncommand="event.stopImmediatePropagation();" key="8" modifiers="__NUM_SELECT_TAB_MODIFIER__" event="keyup"/> #expand <key id="keyup_selectLastTab" oncommand="event.stopImmediatePropagation();" key="9" modifiers="__NUM_SELECT_TAB_MODIFIER__" event="keyup"/> to consume keyup event.
Hmm, but anyway, the modifier keyup event may be fired in the tab. This is race between keyup events and reply event of keypress event.
Flags: needinfo?(bzbarsky)
Component: Event Handling → User events and focus handling

I am experiencing this on Manjaro Linux using 70.0.1.

Mozilla/5.0 (X11; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0

Most annoyingly the issue appears on Youtube where changing tabs with alt-number skips the video like when you only press a number.

Looks like a duplicate of bug 1427984. Though masayuki looked at both so maybe not?

Flags: needinfo?(masayuki)

(In reply to Kevin Brosnan [:kbrosnan] from comment #8)

Looks like a duplicate of bug 1427984. Though masayuki looked at both so maybe not?

If I had known about bug 1427984 I wouldn't have opened/reported this bug.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
Flags: needinfo?(masayuki)
You need to log in before you can comment on or make changes to this bug.