diff --git a/browser/components/customizableui/src/CustomizableUI.jsm b/browser/components/customizableui/src/CustomizableUI.jsm index 8c6f26b0c11a..f622b3a563be 100644 --- a/browser/components/customizableui/src/CustomizableUI.jsm +++ b/browser/components/customizableui/src/CustomizableUI.jsm @@ -2089,25 +2089,71 @@ let CustomizableUIInternal = { Object.freeze(CustomizableUIInternal); this.CustomizableUI = { + /** + * Constant reference to the ID of the menu panel. + */ get AREA_PANEL() "PanelUI-contents", + /** + * Constant reference to the ID of the navigation toolbar. + */ get AREA_NAVBAR() "nav-bar", + /** + * Constant reference to the ID of the menubar's toolbar. + */ get AREA_MENUBAR() "toolbar-menubar", + /** + * Constant reference to the ID of the tabstrip toolbar. + */ get AREA_TABSTRIP() "TabsToolbar", + /** + * Constant reference to the ID of the bookmarks toolbar. + */ get AREA_BOOKMARKS() "PersonalToolbar", + /** + * Constant reference to the ID of the addon-bar toolbar shim. + * Do not use, this will be removed as soon as reasonably possible. + * @deprecated + */ get AREA_ADDONBAR() "addon-bar", - - get PROVIDER_XUL() "xul", - get PROVIDER_API() "api", - get PROVIDER_SPECIAL() "special", - - get SOURCE_BUILTIN() "builtin", - get SOURCE_EXTERNAL() "external", - - get TYPE_BUTTON() "button", + /** + * Constant indicating the area is a menu panel. + */ get TYPE_MENU_PANEL() "menu-panel", + /** + * Constant indicating the area is a toolbar. + */ get TYPE_TOOLBAR() "toolbar", + /** + * Constant indicating a XUL-type provider. + */ + get PROVIDER_XUL() "xul", + /** + * Constant indicating an API-type provider. + */ + get PROVIDER_API() "api", + /** + * Constant indicating dynamic (special) widgets: spring, spacer, and separator. + */ + get PROVIDER_SPECIAL() "special", + + /** + * Constant indicating the widget is built-in + */ + get SOURCE_BUILTIN() "builtin", + /** + * Constant indicating the widget is externally provided + * (e.g. by add-ons or other items not part of the builtin widget set). + */ + get SOURCE_EXTERNAL() "external", + + /** + * The class used to distinguish items that span the entire menu panel. + */ get WIDE_PANEL_CLASS() "panel-wide-item", + /** + * The (constant) number of columns in the menu panel. + */ get PANEL_COLUMN_COUNT() 3, /** @@ -2681,7 +2727,9 @@ this.CustomizableUI = { return CustomizableUIInternal.canWidgetMoveToArea(aWidgetId, aArea); }, /** - * Whether we're in a default state. + * Whether we're in a default state. Note that non-removable non-default + * widgets and non-existing widgets are not taken into account in determining + * whether we're in the default state. * * NB: this is a property with a getter. The getter is NOT cheap, because * it does smart things with non-removable non-default items, non-existent diff --git a/browser/components/customizableui/test/browser.ini b/browser/components/customizableui/test/browser.ini index 278a16187870..52cc3408c718 100644 --- a/browser/components/customizableui/test/browser.ini +++ b/browser/components/customizableui/test/browser.ini @@ -38,6 +38,10 @@ skip-if = true # Because this test is about the menubar, it can't be run on mac skip-if = os == "mac" +[browser_946320_tabs_from_other_computers.js] +# Because the test frequently intermittently fails on Linux for some reason +skip-if = os == "linux" + [browser_934951_zoom_in_toolbar.js] [browser_938980_navbar_collapsed.js] [browser_938995_indefaultstate_nonremovable.js] @@ -49,7 +53,6 @@ skip-if = os == "mac" [browser_943683_migration_test.js] [browser_944887_destroyWidget_should_destroy_in_palette.js] [browser_945739_showInPrivateBrowsing_customize_mode.js] -[browser_946320_tabs_from_other_computers.js] [browser_947987_removable_default.js] [browser_948985_non_removable_defaultArea.js] [browser_952963_areaType_getter_no_area.js] diff --git a/browser/devtools/debugger/debugger.xul b/browser/devtools/debugger/debugger.xul index f6fec1854fc5..5c87349b1080 100644 --- a/browser/devtools/debugger/debugger.xul +++ b/browser/devtools/debugger/debugger.xul @@ -118,39 +118,39 @@ @@ -182,32 +182,32 @@ diff --git a/browser/devtools/styleeditor/StyleEditorUtil.jsm b/browser/devtools/styleeditor/StyleEditorUtil.jsm index f6df3953a20e..069244847e28 100644 --- a/browser/devtools/styleeditor/StyleEditorUtil.jsm +++ b/browser/devtools/styleeditor/StyleEditorUtil.jsm @@ -172,8 +172,11 @@ this.wire = function wire(aRoot, aSelectorOrElement, aDescriptor) * @param callback * The callback method, which will be called passing in the selected * file or null if the user did not pick one. + * @param AString suggestedFilename + * The suggested filename when toSave is true. */ -this.showFilePicker = function showFilePicker(path, toSave, parentWindow, callback) +this.showFilePicker = function showFilePicker(path, toSave, parentWindow, + callback, suggestedFilename) { if (typeof(path) == "string") { try { @@ -213,6 +216,10 @@ this.showFilePicker = function showFilePicker(path, toSave, parentWindow, callba } }; + if (toSave && suggestedFilename) { + fp.defaultString = suggestedFilename; + } + fp.init(parentWindow, _(key + ".title"), mode); fp.appendFilters(_(key + ".filter"), "*.css"); fp.appendFilters(fp.filterAll); diff --git a/browser/devtools/styleeditor/StyleSheetEditor.jsm b/browser/devtools/styleeditor/StyleSheetEditor.jsm index bc307b1afea2..d9c39bfb1aed 100644 --- a/browser/devtools/styleeditor/StyleSheetEditor.jsm +++ b/browser/devtools/styleeditor/StyleSheetEditor.jsm @@ -19,6 +19,7 @@ const {CssLogic} = require("devtools/styleinspector/css-logic"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/FileUtils.jsm"); Cu.import("resource://gre/modules/NetUtil.jsm"); +Cu.import("resource://gre/modules/osfile.jsm"); Cu.import("resource:///modules/devtools/shared/event-emitter.js"); Cu.import("resource:///modules/devtools/StyleEditorUtil.jsm"); @@ -359,8 +360,13 @@ StyleSheetEditor.prototype = { }.bind(this)); }; - showFilePicker(file || this._styleSheetFilePath, true, this._window, onFile); - }, + let defaultName; + if (this._friendlyName) { + defaultName = OS.Path.basename(this._friendlyName); + } + showFilePicker(file || this._styleSheetFilePath, true, this._window, + onFile, defaultName); + }, /** * Retrieve custom key bindings objects as expected by Editor. @@ -394,8 +400,8 @@ StyleSheetEditor.prototype = { const TAB_CHARS = "\t"; -const OS = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).OS; -const LINE_SEPARATOR = OS === "WINNT" ? "\r\n" : "\n"; +const CURRENT_OS = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).OS; +const LINE_SEPARATOR = CURRENT_OS === "WINNT" ? "\r\n" : "\n"; /** * Prettify minified CSS text. diff --git a/browser/locales/en-US/chrome/browser/devtools/debugger.dtd b/browser/locales/en-US/chrome/browser/devtools/debugger.dtd index 8068ccc46826..7f2e7aba8c36 100644 --- a/browser/locales/en-US/chrome/browser/devtools/debugger.dtd +++ b/browser/locales/en-US/chrome/browser/devtools/debugger.dtd @@ -68,36 +68,36 @@ - - + + - - + + - - + + - - + + - - + + - - + + @@ -105,39 +105,46 @@ - - - + + + + - - + + + - - + + + - - + + + - - + + + - - + + + - - + + + @@ -145,8 +152,8 @@ - - + + - + - - + + +