Closed Bug 496309 Opened 15 years ago Closed 15 years ago

focusElement and getBrowserFromContentWindow in utilityOverlay.js should be removed

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 3.7a1

People

(Reporter: enndeakin, Assigned: dao)

References

Details

Attachments

(1 file)

After bug 178324, the focusElement function in utilityOverlay.js isn't useful. I left it for compatibility for now. There are only three callers, one which could just call gURLBar.focus() directly. The other two just need to focus a window which they could do with:

var browser = getBrowserFromContentWindow(content);
if (browser)
  browser.focus();
Depends on: 502239
Attached patch patchSplinter Review
Assignee: nobody → dao
Attachment #393681 - Flags: superreview?
Attachment #393681 - Flags: review?(enndeakin)
Attachment #393681 - Flags: superreview? → superreview?(mconnor)
OS: Mac OS X → All
Hardware: x86 → All
Target Milestone: --- → Firefox 3.7
Version: unspecified → Trunk
Attachment #393681 - Flags: review?(enndeakin) → review+
So... we're removing getBrowserFromContentWindow() which you cite in comment 0 as a way for consumers to not use focusElement()... can you explain why we're removing that method too?
getBrowserFromContentWindow(content) is gBrowser.selectedBrowser.
Comment on attachment 393681 [details] [diff] [review]
patch

Yes, this is quite true, I didn't look into it at all.  Let's do this, though I would like to see if we can get a search on the AMO codebase DB to see if anyone's relying on either of these before we land it.
Attachment #393681 - Flags: superreview?(mconnor) → superreview+
I'm actually pretty sure focusElement is used in the wild, as we used it in a few prominent places in browser.js and people tend to copy that. But in 3.6 it produces a warning suggesting what should be used instead, so I think removing it in 3.7 should be ok.
getBrowserFromContentWindow is used by Annoyance Remover, focusElement is used by Tab Mix Plus and RubNub for YubNub.
Once Annoyance Remover is updated to work with 3.5, it should use aBrowser instead of getBrowserFromContentWindow(aWebProgress.top).
http://hg.mozilla.org/mozilla-central/rev/38008241849d
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Summary: focusElement in utilityOverlay.js should be removed → focusElement and getBrowserFromContentWindow in utilityOverlay.js should be removed
Target Milestone: Firefox 3.7 → Firefox 3.7a1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: