Closed Bug 343642 Opened 18 years ago Closed 15 years ago

document.activeElement wrongly gives BODY in background tabs

Categories

(Core :: DOM: Core & HTML, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: pkasting, Unassigned)

References

Details

This is follow-on to bug 337631 comment 8 and bug 337631 comment 14.

Due to the focus architecture in Gecko, background tabs don't really have an "active element".  This information actually gets saved inside browser.xml, which the Gecko core code shouldn't be depending on.  Therefore document.activeElement wrongly returns the BODY in background tabs.

To fix this, we need to rework focus entirely, so this isn't going to happen any time soon.  I didn't find a bug about that already (though I know it's been discussed previously).  If there is one, this should depend on that.

See also bug 307933.
Neil, was this issue incorporated into your focus handling re-work?
(In reply to comment #1)
> Neil, was this issue incorporated into your focus handling re-work?

activeElement returns what is currently focused if the tab is active or what would be focused (in other words what was last focused) if the tab is not active.

So in that sense this bug was fixed. It's not clear from the comment above though that the result for background tabs is expected to be 'what would be focused' or 'null'. I think what is currently implemented is more useful.
Means we can close this bug?
The desired behavior is for background tabs to be treated identically to foreground tabs.  Therefore, the current behavior (as described in comment 2) is correct and this bug is Fixed.

BTW, thanks Neil for the reworking of focus handling.  What a nightmare.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
So I think fixed by bug 178324? Marking so.
Assignee: general → nobody
Depends on: 178324
QA Contact: ian → general
Target Milestone: --- → mozilla1.9.2a1
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.