Closed Bug 1555951 Opened 2 years ago Closed 2 years ago

Use AppConstants.platform instead of RegExp::test(navigator.platform) in custom element scripts

Categories

(Toolkit :: XUL Widgets, task, P3)

task
Points:
1

Tracking

()

RESOLVED FIXED
mozilla69
Iteration:
69.4 - Jun 24 - Jul 7
Tracking Status
firefox69 --- fixed

People

(Reporter: dao, Assigned: dao)

References

Details

Attachments

(1 file)

We couldn't easily import AppConstants.jsm into tabbox.xml, but in tabbox.js this is a no-brainer.

Definitely one of the benefits of moving into JS. We should be able to remove pretty much all of the non-XBL consumers of this regexp: https://searchfox.org/mozilla-central/search?q=%2FMac%2F.test&path=.

Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED
Summary: Use AppConstants.platform instead of /Mac/.test(navigator.platform) in tabbox.js → Use AppConstants.platform instead of RegExp::test(navigator.platform) in custom element scripts
Pushed by dgottwald@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7d0ccb92fae0
Use AppConstants.platform instead of RegExp::test(navigator.platform) in custom element scripts. r=bgrins
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
--- a/toolkit/content/widgets/tree.js
+++ b/toolkit/content/widgets/tree.js
@@ -551,17 +553,17 @@
       }
 
       this.setAttribute("hidevscroll", "true");
       this.setAttribute("hidehscroll", "true");
       this.setAttribute("clickthrough", "never");
 
       this.initializeAttributeInheritance();
 
-      this.pageUpOrDownMovesSelection = !/Mac/.test(navigator.platform);
+      this.pageUpOrDownMovesSelection = AppConstants.platform == "macosx";
 
       this._inputField = null;
 
       this._editingRow = -1;
 
       this._editingColumn = null;
 
       this._columnsDirty = true;

This should be AppConstants.platform != "macosx"; and has broken ctrl+click on <tree>. :-(

Regressions: 1558721
Iteration: --- → 69.4 - Jun 24 - Jul 7
Points: --- → 1
You need to log in before you can comment on or make changes to this bug.