Closed Bug 273092 Opened 20 years ago Closed 20 years ago

tab captures focus when tab unselect

Categories

(Core :: XUL, defect)

x86
All
defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: surkov, Assigned: MatsPalmgren_bugz)

References

Details

(Keywords: testcase)

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a5) Gecko/20041122
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a5) Gecko/20041122

When I select tab then previous selected tab captures the focus.

Reproducible: Always
Steps to Reproduce:
1. create tabbox with two tabs
2. select second tab
3. select first tab

Actual Results:  
second tab captures the focus

Expected Results:  
element of first tabpanel should have focus
Attached file testcase
Blocks: 140346
The tabs binding changes the selected index but advanceFocusIntoSubtree thinks
that the second tab is still focusable although the tab[selected="true"] {
-moz-user-focus: normal; } rule should only apply to the first tab.

If this is difficult to fix in layout it would probably be straightfoward to
advance the focus from the tabpanels instead.
So is this an issue with style changes not being applied "soon enough"?  Or
something else?  Should the focus-advancing code flush out style changes?
Attached patch Patch rev .1Splinter Review
Boris, you were right - this fixes it.
Mats, where's MoveFocus called from?  Could there be times when it's called from
layout (frame) code?
Boris, the callers of nsFocusController::MoveFocus are:

nsXULCommandDispatcher::AdvanceFocus()
nsXULCommandDispatcher::RewindFocus()
nsXULCommandDispatcher::AdvanceFocusIntoSubtree(nsIDOMElement* aElt)
nsXFormsSwitchElement::SetFocus(nsIDOMElement* aDeselected,
                               nsIDOMElement* aSelected)

which I believe means "no" to your 2nd question.
Severity: normal → minor
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase
OS: Windows 2000 → All
Comment on attachment 171081 [details] [diff] [review]
Patch rev .1

Ok. r+sr=bzbarsky, but make that Flush_Frames, please?	The effect will be the
same, but it'll be clearer why we're doing it (and maybe add a comment about
ensuring all frames have been constructed or something)?
Comment on attachment 171081 [details] [diff] [review]
Patch rev .1

And make it Flush_Style if we're actually going for style being up-to-date
instead of frames being up-to-date.
Attachment #171081 - Flags: superreview+
Attachment #171081 - Flags: review+
Assignee: jag → mats.palmgren
I made it Flush_Frames and added a comment. Checked in 2005-01-22 13:55 PDT.

-> FIXED
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: