Merge fx-team to m-c

This commit is contained in:
Wes Kocher 2014-01-06 17:20:37 -08:00
commit 8baa746395
8 changed files with 136 additions and 79 deletions

View File

@ -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

View File

@ -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]

View File

@ -118,39 +118,39 @@
<menuseparator/>
<menuitem id="se-dbg-cMenu-findFile"
label="&debuggerUI.searchFile;"
accesskey="&debuggerUI.searchFile.key;"
accesskey="&debuggerUI.searchFile.accesskey;"
key="fileSearchKey"
command="fileSearchCommand"/>
<menuitem id="se-dbg-cMenu-findGlobal"
label="&debuggerUI.searchGlobal;"
accesskey="&debuggerUI.searchGlobal.key;"
accesskey="&debuggerUI.searchGlobal.accesskey;"
key="globalSearchKey"
command="globalSearchCommand"/>
<menuitem id="se-dbg-cMenu-findFunction"
label="&debuggerUI.searchFunction;"
accesskey="&debuggerUI.searchFunction.key;"
accesskey="&debuggerUI.searchFunction.accesskey;"
key="functionSearchKey"
command="functionSearchCommand"/>
<menuseparator/>
<menuitem id="se-dbg-cMenu-findToken"
label="&debuggerUI.searchToken;"
accesskey="&debuggerUI.searchToken.key;"
accesskey="&debuggerUI.searchToken.accesskey;"
key="tokenSearchKey"
command="tokenSearchCommand"/>
<menuitem id="se-dbg-cMenu-findLine"
label="&debuggerUI.searchGoToLine;"
accesskey="&debuggerUI.searchGoToLine.key;"
accesskey="&debuggerUI.searchGoToLine.accesskey;"
key="lineSearchKey"
command="lineSearchCommand"/>
<menuseparator/>
<menuitem id="se-dbg-cMenu-findVariable"
label="&debuggerUI.searchVariable;"
accesskey="&debuggerUI.searchVariable.key;"
accesskey="&debuggerUI.searchVariable.accesskey;"
key="variableSearchKey"
command="variableSearchCommand"/>
<menuitem id="se-dbg-cMenu-focusVariables"
label="&debuggerUI.focusVariables;"
accesskey="&debuggerUI.focusVariables.key;"
accesskey="&debuggerUI.focusVariables.accesskey;"
key="variablesFocusKey"
command="variablesFocusCommand"/>
<menuitem id="se-dbg-cMenu-prettyPrint"
@ -160,12 +160,12 @@
<menupopup id="debuggerWatchExpressionsContextMenu">
<menuitem id="add-watch-expression"
label="&debuggerUI.addWatch;"
accesskey="&debuggerUI.addWatch.key;"
accesskey="&debuggerUI.addWatch.accesskey;"
key="addWatchExpressionKey"
command="addWatchExpressionCommand"/>
<menuitem id="removeAll-watch-expression"
label="&debuggerUI.removeAllWatch;"
accesskey="&debuggerUI.removeAllWatch.key;"
accesskey="&debuggerUI.removeAllWatch.accesskey;"
key="removeAllWatchExpressionsKey"
command="removeAllWatchExpressionsCommand"/>
</menupopup>
@ -182,32 +182,32 @@
<menuitem id="pause-on-exceptions"
type="checkbox"
label="&debuggerUI.pauseExceptions;"
accesskey="&debuggerUI.pauseExceptions.key;"
accesskey="&debuggerUI.pauseExceptions.accesskey;"
command="togglePauseOnExceptions"/>
<menuitem id="ignore-caught-exceptions"
type="checkbox"
label="&debuggerUI.ignoreCaughtExceptions;"
accesskey="&debuggerUI.ignoreCaughtExceptions.key;"
accesskey="&debuggerUI.ignoreCaughtExceptions.accesskey;"
command="toggleIgnoreCaughtExceptions"/>
<menuitem id="show-panes-on-startup"
type="checkbox"
label="&debuggerUI.showPanesOnInit;"
accesskey="&debuggerUI.showPanesOnInit.key;"
accesskey="&debuggerUI.showPanesOnInit.accesskey;"
command="toggleShowPanesOnStartup"/>
<menuitem id="show-vars-only-enum"
type="checkbox"
label="&debuggerUI.showOnlyEnum;"
accesskey="&debuggerUI.showOnlyEnum.key;"
accesskey="&debuggerUI.showOnlyEnum.accesskey;"
command="toggleShowOnlyEnum"/>
<menuitem id="show-vars-filter-box"
type="checkbox"
label="&debuggerUI.showVarsFilter;"
accesskey="&debuggerUI.showVarsFilter.key;"
accesskey="&debuggerUI.showVarsFilter.accesskey;"
command="toggleShowVariablesFilterBox"/>
<menuitem id="show-original-source"
type="checkbox"
label="&debuggerUI.showOriginalSource;"
accesskey="&debuggerUI.showOriginalSource.key;"
accesskey="&debuggerUI.showOriginalSource.accesskey;"
command="toggleShowOriginalSource"/>
</menupopup>
</popupset>

View File

@ -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);

View File

@ -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,7 +360,12 @@ 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);
},
/**
@ -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.

View File

@ -69,35 +69,35 @@
<!-- LOCALIZATION NOTE (debuggerUI.pauseExceptions): This is the label for the
- checkbox that toggles pausing on exceptions. -->
<!ENTITY debuggerUI.pauseExceptions "Pause on exceptions">
<!ENTITY debuggerUI.pauseExceptions.key "E">
<!ENTITY debuggerUI.pauseExceptions.accesskey "E">
<!-- LOCALIZATION NOTE (debuggerUI.ignoreCaughtExceptions): This is the label for the
- checkbox that toggles ignoring caught exceptions. -->
<!ENTITY debuggerUI.ignoreCaughtExceptions "Ignore caught exceptions">
<!ENTITY debuggerUI.ignoreCaughtExceptions.key "C">
<!ENTITY debuggerUI.ignoreCaughtExceptions.accesskey "C">
<!-- LOCALIZATION NOTE (debuggerUI.showPanesOnInit): This is the label for the
- checkbox that toggles visibility of panes when opening the debugger. -->
<!ENTITY debuggerUI.showPanesOnInit "Show panes on startup">
<!ENTITY debuggerUI.showPanesOnInit.key "S">
<!ENTITY debuggerUI.showPanesOnInit.accesskey "S">
<!-- LOCALIZATION NOTE (debuggerUI.showVarsFilter): This is the label for the
- checkbox that toggles visibility of a designated variables filter box. -->
<!ENTITY debuggerUI.showVarsFilter "Show variables filter box">
<!ENTITY debuggerUI.showVarsFilter.key "V">
<!ENTITY debuggerUI.showVarsFilter.accesskey "V">
<!-- LOCALIZATION NOTE (debuggerUI.showOnlyEnum): This is the label for the
- checkbox that toggles visibility of hidden (non-enumerable) variables and
- properties in stack views. The "enumerable" flag is a state of a property
- defined in JavaScript. When in doubt, leave untranslated. -->
<!ENTITY debuggerUI.showOnlyEnum "Show only enumerable properties">
<!ENTITY debuggerUI.showOnlyEnum.key "P">
<!ENTITY debuggerUI.showOnlyEnum.accesskey "P">
<!-- LOCALIZATION NOTE (debuggerUI.showOriginalSource): This is the label for
- the checkbox that toggles the display of original or sourcemap-derived
- sources. -->
<!ENTITY debuggerUI.showOriginalSource "Show original sources">
<!ENTITY debuggerUI.showOriginalSource.key "O">
<!ENTITY debuggerUI.showOriginalSource.accesskey "O">
<!-- LOCALIZATION NOTE (debuggerUI.searchPanelOperators): This is the text that
- appears in the filter panel popup as a header for the operators part. -->
@ -108,36 +108,43 @@
<!ENTITY debuggerUI.searchFile "Filter scripts">
<!ENTITY debuggerUI.searchFile.key "P">
<!ENTITY debuggerUI.searchFile.altkey "O">
<!ENTITY debuggerUI.searchFile.accesskey "P">
<!-- LOCALIZATION NOTE (debuggerUI.searchGlobal): This is the text that appears
- in the source editor's context menu for the global search operation. -->
<!ENTITY debuggerUI.searchGlobal "Search in all files">
<!ENTITY debuggerUI.searchGlobal.key "F">
<!ENTITY debuggerUI.searchGlobal.accesskey "F">
<!-- LOCALIZATION NOTE (debuggerUI.searchFunction): This is the text that appears
- in the source editor's context menu for the function search operation. -->
<!ENTITY debuggerUI.searchFunction "Search for function definition">
<!ENTITY debuggerUI.searchFunction.key "D">
<!ENTITY debuggerUI.searchFunction.accesskey "D">
<!-- LOCALIZATION NOTE (debuggerUI.searchToken): This is the text that appears
- in the source editor's context menu for the token search operation. -->
<!ENTITY debuggerUI.searchToken "Find">
<!ENTITY debuggerUI.searchToken.key "F">
<!ENTITY debuggerUI.searchToken.accesskey "F">
<!-- LOCALIZATION NOTE (debuggerUI.searchLine): This is the text that appears
- in the source editor's context menu for the line search operation. -->
<!ENTITY debuggerUI.searchGoToLine "Go to line…">
<!ENTITY debuggerUI.searchGoToLine.key "L">
<!ENTITY debuggerUI.searchGoToLine.accesskey "L">
<!-- LOCALIZATION NOTE (debuggerUI.searchVariable): This is the text that appears
- in the source editor's context menu for the variables search operation. -->
<!ENTITY debuggerUI.searchVariable "Filter variables">
<!ENTITY debuggerUI.searchVariable.key "V">
<!ENTITY debuggerUI.searchVariable.accesskey "V">
<!-- LOCALIZATION NOTE (debuggerUI.focusVariables): This is the text that appears
- in the source editor's context menu for the variables focus operation. -->
<!ENTITY debuggerUI.focusVariables "Focus variables tree">
<!ENTITY debuggerUI.focusVariables.key "V">
<!ENTITY debuggerUI.focusVariables.accesskey "V">
<!-- LOCALIZATION NOTE (debuggerUI.condBreakPanelTitle): This is the text that
- appears in the conditional breakpoint panel popup as a description. -->
@ -170,12 +177,13 @@
<!-- LOCALIZATION NOTE (debuggerUI.addWatch): This is the text that
- appears in the watch expressions context menu for adding an expression. -->
<!ENTITY debuggerUI.addWatch "Add watch expression">
<!ENTITY debuggerUI.addWatch.key "E">
<!ENTITY debuggerUI.addWatch.accesskey "E">
<!-- LOCALIZATION NOTE (debuggerUI.removeWatch): This is the text that
- appears in the watch expressions context menu for removing all expressions. -->
<!ENTITY debuggerUI.removeAllWatch "Remove all watch expressions">
<!ENTITY debuggerUI.removeAllWatch.key "E">
<!ENTITY debuggerUI.removeAllWatch.accesskey "E">
<!-- LOCALIZATION NOTE (debuggerUI.stepping): These are the keycodes that
- control the stepping commands in the debugger (continue, step over,

View File

@ -448,7 +448,6 @@
border: 0px solid #000;
border-bottom-width: 1px;
box-shadow: 0 -2px 0 rgba(0,0,0,.1) inset;
min-height: 32px;
padding: 0;
}
@ -464,7 +463,7 @@
.devtools-tab {
-moz-appearance: none;
min-width: 32px;
min-height: 32px;
min-height: 26px;
max-width: 127px;
color: #b6babf;
margin: 0;

View File

@ -3217,20 +3217,6 @@ Tab.prototype = {
// Adjust the max line box width to be no more than the viewport width, but
// only if the reflow-on-zoom preference is enabled.
let isZooming = !fuzzyEquals(aViewport.zoom, this._zoom);
if (BrowserApp.selectedTab.reflozPinchSeen &&
isZooming && aViewport.zoom < 1.0) {
// In this case, we want to restore the max line box width,
// because we are pinch-zooming to zoom out.
BrowserEventHandler.resetMaxLineBoxWidth();
BrowserApp.selectedTab.reflozPinchSeen = false;
} else if (BrowserApp.selectedTab.reflozPinchSeen &&
isZooming) {
// In this case, the user pinch-zoomed in, so we don't want to
// preserve position as we would with reflow-on-zoom.
BrowserApp.selectedTab.probablyNeedRefloz = false;
BrowserApp.selectedTab.clearReflowOnZoomPendingActions();
BrowserApp.selectedTab._mReflozPoint = null;
}
let docViewer = null;