remove erroneous reference to Window.focus() method

RESOLVED FIXED

Status

RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: myk, Assigned: irakli)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
The Windows API documentation suggests that one can activate a window by calling its focus() method, but Window objects don't actually have a focus() method (one activates them by setting the activeWindow property).  The docs should be updated to remove this erroneous reference.
Actually Window's do have focus method and activeWindow setter just calls it. There are also technical reasons to keep focus method. Access to the wrapped window is encapsulated in the `BrowserWindow` instances so that no one else can have access the window object itself and there for focus it. That being said of course it's not impossible but will end up in more complex code without much of an advantage.

As an alternative I can suggest converting `activeWindow` property to a read only and keep focus method. 
This is also less verbose:

browserWindows[3].focus();

then 

borwserWindows.activeWindow = browserWindows[3];
 

I guess web devs also might find themself more familiar cause dom API's do usually have focus() methods.
Depends on: 612758
Assignee: nobody → rFobic
This has been discussed on mailing list: http://groups.google.com/group/mozilla-labs-jetpack/browse_thread/thread/108df8db72e9a7da#

Outcome is that we have to make activeWindow read-only and rename focus to activate. 

All of this is done in 612758. Once it's inn this bug can be closed.
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.