Closed Bug 596759 Opened 9 years ago Closed 9 years ago

Selecting a tab should focus its content


(Toolkit :: XUL Widgets, defect)

Not set





(Reporter: Mic, Assigned: florian)




(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv: Gecko/20100824 Firefox/3.6.9
Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.0b7pre) Gecko/20100914 Firefox/4.0b7pre

commandDispatcher.advanceFocusIntoSubtree() seems to be malfunctioning in some cases. 

(See STR before going on here ->)

Going through the code brought me to

Checking the focused element before and after the call of advanceFocusIntoSubtree revealed that by following the STR the focused element is unchanged, while it normally updates.

I first noticed this bug on Instantbird, but was able to reproduce it on Firefox 3.6.9, a recent Minefile build and Thunderbird 3.1.3.

Reproducible: Always

Steps to Reproduce:
  1. Go to Firefox Options->Advanced
  2. Select Encryption tab
  3. Cycle backwards through the tabs, either by mouse or keyboard
  4. Notice: how there is no focused UI element in the now selected tab.

  Using SPACE will toggle checkboxes or press buttons on a background tab in such a case.

  1. Go to Firefox Options->Advanced
  2. Notice: that no UI element is focused
Actual Results:  
See STR:Notice

Expected Results:  
Opening a tab should focus properly.
Going backwards through the tabs should also focused the right element (ie the one that would be focused if we went the other direction)

Happens atleast on Windows XP and Windows 7. Can't check on Linux/Mac OS X right now.
I can reproduce on Mac too. I believe this is a problem in the tabbox binding (thus changing the component).
Component: Event Handling → XUL Widgets
Ever confirmed: true
OS: Windows XP → All
Product: Core → Toolkit
QA Contact: events → xul.widgets
Hardware: x86 → All
Version: unspecified → Trunk
Attached patch PatchSplinter Review
I haven't found any documentation for the advanceFocusIntoSubtree, but the "IntoSubtree" part of its name makes me believe it attempts to focus something in the subtree of the given DOM element. If this assumption is right, it should take the tabpanel as parameter and not the tab. The attached patch does that and gets the expect result.
Assignee: nobody → florian
Attachment #475787 - Flags: review?(enndeakin)
Summary: commandDispatcher.advanceFocusIntoSubtree strangeness → Selecting a tab should focus its content
I should have checked the DOM tree first before jumping to conclusions. I'm sorry for the confusion and it's nice to see that Florian seems to have fixed this problem so quickly.

Thanks a lot.
Comment on attachment 475787 [details] [diff] [review]

Seems ok.
Attachment #475787 - Flags: review?(enndeakin) → review+
Keywords: checkin-needed
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: fixed-in-cedar
Target Milestone: --- → mozilla2.2
I'm trying to verify this as part of Aurora Testday (although I might be a little late). When I follow part A of the STR, I notice that there IS a focused element on the current tab, which would seem to imply this is verified. But when I follow part B, there is still no UI element focused. So I'm not sure.

Mozilla/5.0 (Windows NT 6.1; rv:5.0a2) Gecko/20110506 Firefox/5.0a2
See Also: → 953943
You need to log in before you can comment on or make changes to this bug.