Closed
Bug 1425363
Opened 6 years ago
Closed 6 years ago
Switch mac window menu to JS instead of RDF
Categories
(Toolkit :: General, enhancement)
Toolkit
General
Tracking
()
RESOLVED
FIXED
mozilla59
Tracking | Status | |
---|---|---|
firefox59 | --- | fixed |
People
(Reporter: Gijs, Assigned: Gijs)
References
Details
Attachments
(3 files)
As far as we can tell, we have an RDF data source for the single purpose of doing this menu only on mac. Instead we could just implement it with some simple JS.
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 4•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=5b68c3d47de6
Assignee | ||
Comment 5•6 years ago
|
||
(In reply to :Gijs from comment #4) > https://treeherder.mozilla.org/#/jobs?repo=try&revision=5b68c3d47de6 Hrmpf, things built alright locally so I forgot about packaging, and missed removing the .xpt file from the installer. In other news, looks like we build and ship this stuff on android!? Wat.
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 8•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=0f6f39caec89
Comment 9•6 years ago
|
||
mozreview-review |
Comment on attachment 8936982 [details] Bug 1425363 - use JS instead of the windowds data source for the mac window menu, https://reviewboard.mozilla.org/r/207724/#review213654 browser/extensions/pdfjs/test/browser_pdfjs_savedialog.js seems to be failing on try. Could you verify that this isn't related to the changes here? Two minor nits below. ::: toolkit/content/macWindowMenu.js:8 (Diff revision 1) > function macWindowMenuDidShow() { > - var windowManagerDS = > - Components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"] > - .getService(Components.interfaces.nsIWindowDataSource); > - var sep = document.getElementById("sep-window-list"); > // Using double parens to avoid warning nit: remove comment ::: toolkit/content/macWindowMenu.js:23 (Diff revision 1) > + if (win == window) { > + item.setAttribute("checked", "true"); > -} > + } > - > -function toOpenWindow( aWindow ) { > - // deminiaturize the window, if it's in the Dock > + item.addEventListener("command", () => { > + if (win.windowState == window.STATE_MINIMIZED) > + win.restore(); nit: wrap in braces
Attachment #8936982 -
Flags: review?(spohl.mozilla.bugs)
Comment 10•6 years ago
|
||
mozreview-review |
Comment on attachment 8936983 [details] Bug 1425363 - remove the windowds XPCOM component, https://reviewboard.mozilla.org/r/207726/#review213668
Attachment #8936983 -
Flags: review?(spohl.mozilla.bugs) → review+
Assignee | ||
Comment 11•6 years ago
|
||
mozreview-review |
Comment on attachment 8936982 [details] Bug 1425363 - use JS instead of the windowds data source for the mac window menu, https://reviewboard.mozilla.org/r/207724/#review213676 ::: toolkit/content/macWindowMenu.js:9 (Diff revision 1) > - var windowManagerDS = > - Components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"] > - .getService(Components.interfaces.nsIWindowDataSource); > - var sep = document.getElementById("sep-window-list"); > // Using double parens to avoid warning > - while ((sep = sep.nextSibling)) { > + let windows = Services.wm.getEnumerator(""); Self-nit: need to check that we actually have `Services` everywhere we run this, and import it when we don't.
Assignee | ||
Comment 12•6 years ago
|
||
(In reply to Stephen A Pohl [:spohl] from comment #9) > browser/extensions/pdfjs/test/browser_pdfjs_savedialog.js seems to be > failing on try. Could you verify that this isn't related to the changes > here? Two minor nits below. Good catch! I'm pretty sure this is because of the third cset which touches the test (removes the empty onWindowTitleChanged handler), which triggers TV (test verification) on it, but I bet that TV fails for this test generally because the test is slightly bogus. I'll push a dummy cset with a whitespace change to the test to try to verify. (This type of thing is part of why that test is still tier-2) https://treeherder.mozilla.org/#/jobs?repo=try&revision=1ff985a37a5399320502af37160c11adb3808dc8
Assignee | ||
Comment 13•6 years ago
|
||
(In reply to :Gijs from comment #12) > (In reply to Stephen A Pohl [:spohl] from comment #9) > > browser/extensions/pdfjs/test/browser_pdfjs_savedialog.js seems to be > > failing on try. Could you verify that this isn't related to the changes > > here? Two minor nits below. > > Good catch! I'm pretty sure this is because of the third cset which touches > the test (removes the empty onWindowTitleChanged handler), which triggers TV > (test verification) on it, but I bet that TV fails for this test generally > because the test is slightly bogus. I'll push a dummy cset with a whitespace > change to the test to try to verify. > > (This type of thing is part of why that test is still tier-2) > > https://treeherder.mozilla.org/#/ > jobs?repo=try&revision=1ff985a37a5399320502af37160c11adb3808dc8 Yep, this is also all orange.
Comment 14•6 years ago
|
||
mozreview-review |
Comment on attachment 8936982 [details] Bug 1425363 - use JS instead of the windowds data source for the mac window menu, https://reviewboard.mozilla.org/r/207724/#review213694 Thanks for verifying.
Attachment #8936982 -
Flags: review+
Comment 15•6 years ago
|
||
mozreview-review |
Comment on attachment 8936982 [details] Bug 1425363 - use JS instead of the windowds data source for the mac window menu, https://reviewboard.mozilla.org/r/207724/#review213940 I love the fact that it takes less (and more straightforward) code to implement this feature in vanilla JS
Attachment #8936982 -
Flags: review?(bgrinstead) → review+
Comment 16•6 years ago
|
||
mozreview-review |
Comment on attachment 8936984 [details] Bug 1425363 - remove onWindowTitleChanged given that nobody uses it, https://reviewboard.mozilla.org/r/207728/#review213942 r+!
Attachment #8936984 -
Flags: review?(bgrinstead) → review+
Assignee | ||
Comment 17•6 years ago
|
||
mozreview-review |
Comment on attachment 8936982 [details] Bug 1425363 - use JS instead of the windowds data source for the mac window menu, https://reviewboard.mozilla.org/r/207724/#review214000 ::: toolkit/content/macWindowMenu.js:9 (Diff revision 1) > - var windowManagerDS = > - Components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"] > - .getService(Components.interfaces.nsIWindowDataSource); > - var sep = document.getElementById("sep-window-list"); > // Using double parens to avoid warning > - while ((sep = sep.nextSibling)) { > + let windows = Services.wm.getEnumerator(""); This is fine because this stuff is included in baseMenuOverlay.xul which loads utilityOverlay.js which imports Services.jsm.
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 21•6 years ago
|
||
Pushed by gijskruitbosch@gmail.com: https://hg.mozilla.org/integration/autoland/rev/8cc8bd064aa8 use JS instead of the windowds data source for the mac window menu, r=bgrins,spohl https://hg.mozilla.org/integration/autoland/rev/f8a8b592c702 remove the windowds XPCOM component, r=spohl https://hg.mozilla.org/integration/autoland/rev/59321d42d617 remove onWindowTitleChanged given that nobody uses it, r=bgrins
Comment 22•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8cc8bd064aa8 https://hg.mozilla.org/mozilla-central/rev/f8a8b592c702 https://hg.mozilla.org/mozilla-central/rev/59321d42d617
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Comment 23•6 years ago
|
||
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/e2167dafd13a Port bug 1425363 to TB/IB/SM: remove windowds.xpt from package manifests. rs=bustage-fix
Blocks: SM-killrdf
No longer blocks: SM-killrdf
You need to log in
before you can comment on or make changes to this bug.
Description
•