Closed
Bug 7818
Opened 26 years ago
Closed 26 years ago
[DOGFOOD/BLOCK] window.focus() doesn't work
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P3)
Tracking
()
VERIFIED
FIXED
M8
People
(Reporter: hyatt, Assigned: joki)
References
Details
window.focus() doesn't actually work. It calls mWebShell->SetFocus(), and this
doesn't work either. All this method does is set the focus to the mWindow
variable of the webshell. However, this isn't really giving focus to the
document inside the webshell (which is what you would expect). This is
presumably because of the extra windows that are being inserted by the
view system.
On Windows, the window hierarchy looks like this:
WebShell's mWindow
|____ Some other window
|______ scrollbar windows
|
|______ the actual window that SHOULD get the focus
|
|______ some mysterious 16x16 window whose origin is a mystery to me
When you set the focus only to the mWindow variable, the real window that should
get focused isn't getting it. Hence window.focus() isn't really working.
Updated•26 years ago
|
Severity: normal → critical
Comment 1•26 years ago
|
||
I boosted the severity and I'm very close to making this a "blocker".
This is really making life difficult for the editor. Please fix ASAP!
Comment 2•26 years ago
|
||
Hey TOM: This is important! Please fix ASAP! I'd like to see a target Milestone
at least.
Assignee | ||
Updated•26 years ago
|
Status: NEW → ASSIGNED
Target Milestone: M8
Assignee | ||
Comment 3•26 years ago
|
||
Well you can have your milestone for the moment. Hopefully, if the fixes to
get the content shell are in as hyatt says I can get this fix in rsn.
Reporter | ||
Comment 4•26 years ago
|
||
Yes. The code to add to make something the primary content window is
<iframe type="content-primary"...>
Then it will be considered the primary content shell. There is now a method
in nsWebShellWindow that lets you retrieve this. GetContentWebShell is its
name.
You can also refer to a window's primary content area through JS by saying
window.content... so you can now automatically reference your content area on
your own, e.g., you can return focus to the content area by saying
"window.content.focus()".
Furthermore, if you need to target the primary content area, you can use the
magic "_content" name in a link, for example... e.g., <a target="_content"
href="...">.
Assignee | ||
Updated•26 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 5•26 years ago
|
||
Okay, I've checked this in. Going to mark fixed but needs testing.
Comment 6•26 years ago
|
||
All the contentWindow.focus() calls in editor now work.
Updated•26 years ago
|
Status: RESOLVED → VERIFIED
Comment 7•26 years ago
|
||
Verifying fixed per cmanske's comments
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•