“Close” button in tabs not responding with the keyboard

Bug #779581 reported by Adolfo Jayme Barrientos
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Fix Released
Low
firefox (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: firefox

If you focus the “X” button in each tab and you “click” it with the spacebar, the button does not close the tab. Firefox 4.0.1.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: firefox 4.0.1+build1+nobinonly-0ubuntu0.11.04.1
ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
Uname: Linux 2.6.38-8-generic i686
NonfreeKernelModules: wl
Architecture: i386
Date: Sun May 8 13:12:49 2011
FirefoxPackages:
 firefox 4.0.1+build1+nobinonly-0ubuntu0.11.04.1
 flashplugin-installer N/A
 adobe-flashplugin 10.2.159.1-0natty1
 icedtea-plugin 1.1~20110420-0ubuntu1
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Beta i386 (20110330)
ProcEnviron:
 LANGUAGE=es_MX:es:en
 LANG=es_MX.UTF-8
 SHELL=/bin/bash
SourcePackage: firefox
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Adolfo Jayme Barrientos (fitojb) wrote :
description: updated
description: updated
description: updated
Revision history for this message
Chris Kellawan (ckellawan) wrote :

Another issue with the "X" button(s) is that they are not accessible via the [TAB] key.

Robert Roth (evfool)
Changed in firefox (Ubuntu):
status: New → Confirmed
hero1900 (hero1900)
Changed in firefox (Ubuntu):
assignee: nobody → hero1900 (hero1900)
Revision history for this message
Daniel Brownridge (freshnewpage) wrote :

Jumping in here...
 How do we know that using the spacebar to activate the tab close control (the 'X') is intended behavior? The reason for asking is if somebody has seen this behavior in a previous version of Firefox it would be useful to be able to have that as a reference.

Revision history for this message
Daniel Brownridge (freshnewpage) wrote :

Also we're now on Firefox 5.0. It doesn't appear that you can use the spacebar to close a tab with the X focused in this version either.

Revision history for this message
eviljoel (eviljoel-t) wrote :

Attempted in Firefox 3.6.18 (Mozilla Firefox for Ubuntu). It doesn't close the tab there either. However, a clicking animation does appear when the space bar is pressed. I believe this should still be considered a bug regardless of if closing the tab is the correct behavior. In my opinion, either the clicking animation should be removed or the tab should close. Having a response to the keyboard that does not result in a useful action is not appropriate. (Of course, this situation is so hard to find that it may not be worth fixing.)

I later tried reproducing this issue in an Official Windows build of Firefox (5.0.1). In Windows, you cannot focus on the close button, hence pressing spacebar does not cause the clicking animation. Given that Windows Firefox does not close the tab (and you cannot even focus on the close button), this suggests that focusing on the close button is the actual error.

Later still, I installed 11.04 in a VM and uninstalled the default Firefox. I then downloaded a Firefox build (5.0.1) from the Mozilla website and tested this issue from their build. This issue also occured in the Mozilla build of Firefox. I searched upstream for a similar bug but did not find one. Shouldn't we open a bug upstream?

Revision history for this message
Adolfo Jayme Barrientos (fitojb) wrote :

In Windows, you can click (without releasing the mouse button) to the X to bring focus to it, and then press spacebar to try to close the tab. The X button has the clicking animation, but does not close the tab.

Yes, we should open an upstream bug, as this issue also occurs in Windows (and maybe Mac OS X).

Revision history for this message
In , eviljoel (eviljoel-t) wrote :

This bug originated in Ubuntu's tracker as Bug #779581 (https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/779581). The original issue was that if the close button on a tab is in focus and the spacebar is pressed, the tab does not close. One might believe that the tab is suppose to close because the close button responds as though it is being pressed. However, upon further investigation, it is apparent that the erronous behavior is that either the close button becomes in focus or that once the button is in focus it responds to the spacebar. This behavior was tested in Mozilla Firefox for Ubuntu 3.6.18, Mozilla Firefox for Ubuntu 4.0.1, official Mozilla build of Firefox 5.0.1 for Linux and with some success on an official Mozilla build of Firefox 5.0.1 for Windows.

In Windows the behavior is a little different. Here you can get similar results by clicking and holding the close button (to bring focus to it), and then pressing spacebar (without releasing the mouse button). Like the Ubuntu versions, the close button has the clicking animation but does not close the tab (until the mouse button is released).

Thus far, no one has tested this issue in Mac OSX.

I dug into the code in the http://hg.mozilla.org/releases/mozilla-2.0/ (63475:5216dd412535) repository to try to find the problem. On line 20 of browser/base/content/tabbrowser.css there is an interesting comment:

.tab-close-button[selected="true"] {
  /* Make this button focusable so clicking on it will not focus the tab while
     it's getting closed */
  -moz-user-focus: normal;
}

Changing this value to 'none' or 'ignore' results in the tab getting focus when the close button is pressed. It might be better to just let the tab have focus but this is a less than an optimal solution.

One might also want to look at line 3507 of browser/base/content/tabbrowser.xml:

          <xul:toolbarbutton anonid="close-button"
                             xbl:inherits="fadein,pinned,selected"
                             tabindex="-1"
                             clickthrough="never"
                             class="tab-close-button"/>

My knowledge of this codebase is not so great, so any futher guildance in resolving this issue will be appreciated.

In my opinion, having a response to the keyboard that does not result in a useful action is not appropriate. (Of course, this situation is so hard to find that it may not be worth fixing.)

Please let me know if you need more information. Thanks.

Changed in firefox:
importance: Unknown → Low
status: Unknown → New
Revision history for this message
In , Xtc4uall (xtc4uall) wrote :

Confirmed against Mozilla/5.0 (Windows NT 5.1; rv:8.0a1) Gecko/20110816 Firefox/8.0a1 ID:20110816100414

Changed in firefox:
status: New → Confirmed
Revision history for this message
In , Dao (dao) wrote :

Created attachment 553868
stop making the close button focusable

Revision history for this message
eviljoel (eviljoel-t) wrote :

Someone submitted a patch upstream. The patch has not been committed to trunk.

Changed in firefox (Ubuntu):
status: Confirmed → In Progress
Changed in firefox:
status: Confirmed → In Progress
Revision history for this message
In , Enn (enndeakin) wrote :

Comment on attachment 553868
stop making the close button focusable

Is this reverting back 462289 or is that fixed in some other way?

What effect does removing stopPropagation have here?

Revision history for this message
In , Dao (dao) wrote :

(In reply to Neil Deakin from comment #3)
> Comment on attachment 553868
> stop making the close button focusable
>
> Is this reverting back 462289 or is that fixed in some other way?

It's still there, I'm only folding the three handlers with button="0"/"1"/"2" into one.

> What effect does removing stopPropagation have here?

It was needed to prevent the tab getting focused when clicking the close button, pre-bug 462289. Maintaining that branch now would regress bug 462289, since we wouldn't set MozUserFocus = 'ignore' in that case.

Revision history for this message
In , Enn (enndeakin) wrote :

Where does the close button get -moz-user-focus set to normal, that we need to set it to 'ignore'?

Can we remove the rule for '.tab-close-button:focus' from windows browser.css?

Revision history for this message
In , Dao (dao) wrote :

(In reply to Neil Deakin from comment #5)
> Where does the close button get -moz-user-focus set to normal, that we need
> to set it to 'ignore'?

We don't set it to 'ignore' for the close button but for the tab.

> Can we remove the rule for '.tab-close-button:focus' from windows
> browser.css?

Oh, yes.

Revision history for this message
In , Dao (dao) wrote :

Created attachment 556483
stop making the close button focusable, v2

Revision history for this message
In , Mak77 (mak77) wrote :
Changed in firefox:
status: In Progress → Fix Released
Revision history for this message
eviljoel (eviljoel-t) wrote :

Fix is now in Firefox's trunk. I'm sure this will get pulled into Debian eventually.

Changed in firefox (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Adolfo Jayme Barrientos (fitojb) wrote :

Thank you all!

Revision history for this message
Micah Gersten (micahg) wrote :

This was fixed upstream in Firefox 9. That will hit precise later this month.

Changed in firefox (Ubuntu):
assignee: hero1900 (hero1900) → nobody
importance: Undecided → Low
status: Fix Committed → Triaged
Timothy Kross (timkross)
Changed in firefox (Ubuntu):
status: Triaged → Fix Released
Micah Gersten (micahg)
Changed in firefox:
milestone: none → 9.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.