Closed Bug 713713 Opened 14 years ago Closed 2 years ago

Clean up OpenBrowserWindow

Categories

(Firefox :: General, task, P2)

task

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox117 --- fixed
firefox118 --- fixed
firefox119 --- fixed

People

(Reporter: zpao, Assigned: dao)

References

Details

(Whiteboard: [sng])

Attachments

(2 files, 1 obsolete file)

I was poking at this elsewhere and it's all repeaty so I cleaned it up.
Attached patch Patch v0.1 (obsolete) — Splinter Review
I'm not actually sure this is right (will the empty string be handled the same as no argument?). If not, I guess I could just not instantiate charsetArg so it will be undefined and that should be exactly the same as not passing anything.
Assignee: nobody → paul
Attachment #584466 - Flags: review?(gavin.sharp)
Comment on attachment 584466 [details] [diff] [review] Patch v0.1 >diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js > function OpenBrowserWindow() > { >- var charsetArg = new String(); >+ var charsetArg = ""; might as well also move this next to its first use >+ return window.openDialog("chrome://browser/content/", "_blank", >+ "chrome,all,dialog=no", defaultArgs, charsetArg); This will change window.arguments.length, but the existing checks for this (which are ancient and kind of ugly) should handle this OK, since they null check arguments[1], and nothing else cares about window.arguments.length == 1 vs. 2. http://hg.mozilla.org/mozilla-central/annotate/d85920b5691b/browser/base/content/browser.js#l1453 You could write a test to ensure this, though!
Attachment #584466 - Flags: review?(gavin.sharp) → review+
Attached patch Patch v0.2Splinter Review
Now with a test, at least I think it's testing what it's supposed to...
Attachment #584466 - Attachment is obsolete: true
Attachment #595445 - Flags: review?(gavin.sharp)
Comment on attachment 595445 [details] [diff] [review] Patch v0.2 BrowserSetForcedCharacterSet causes a page reload, so it's probably best to have this test open a new tab first and close it when it's done, rather than operating on the current tab. It might be useful to also test that OpenBrowserWindow still works when invoked from a non-browser window.
Attachment #595445 - Flags: review?(gavin.sharp) → review+
Assignee: paul → nobody
Severity: trivial → S4
Blocks: 1840880

Resurrecting this bug as OpenBrowserWindow looks like it still could use some cleanup, and we also have too many similar functions with slightly different behavior.

Assignee: nobody → dao+bmo
Severity: S4 → N/A
Status: NEW → ASSIGNED
Type: defect → task
Depends on: 1837392, 1792466
Priority: -- → P2
Version: 11 Branch → Trunk
Attachment #9341900 - Attachment description: WIP: Bug 713713 - Expand BrowserWindowTracker.openWindow to cover the use cases of OpenBrowserWindow, and remove BrowserUIUtils.openNewBrowserWindow. → Bug 713713 - Expand BrowserWindowTracker.openWindow to cover the use cases of OpenBrowserWindow, and remove BrowserUIUtils.openNewBrowserWindow. r=mossop
Whiteboard: [sng]
Pushed by dgottwald@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e9251e249c27 Expand BrowserWindowTracker.openWindow to cover the use cases of OpenBrowserWindow, and remove BrowserUIUtils.openNewBrowserWindow. r=mossop
Flags: needinfo?(dao+bmo)
Pushed by dgottwald@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a09e586f7b7f Expand BrowserWindowTracker.openWindow to cover the use cases of OpenBrowserWindow, and remove BrowserUIUtils.openNewBrowserWindow. r=mossop
Flags: needinfo?(dao+bmo)
Pushed by dgottwald@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e72d614ce773 Expand BrowserWindowTracker.openWindow to cover the use cases of OpenBrowserWindow, and remove BrowserUIUtils.openNewBrowserWindow. r=mossop
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch
Regressions: 1850828

(In reply to Ryan VanderMeulen [:RyanVM] from comment #13)

This was backed out for 117.0.1 due to bug 1850828. It remains in effect for 118+.
https://hg.mozilla.org/releases/mozilla-release/rev/1095e192521fc2ae558176d1881a6eee935ccc41

This is hitting test failures in browser_search_history.js. I'm going to re-land this and uplift the patch from bug 1850828 instead.

See Also: → 1863392
Regressions: 1880452
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: