Merge m-c to b2ginbound, a=merge

This commit is contained in:
Wes Kocher 2015-10-15 11:37:20 -07:00
commit f2a6f6f373
169 changed files with 1832 additions and 1154 deletions

12
.gitignore vendored
View File

@ -74,3 +74,15 @@ mobile/android/gradle/.gradle
# Ignore node_modules from eslint-plugin-mozilla
testing/eslint-plugin-mozilla/node_modules/
# Ignore talos virtualenv and tp5n files.
# The tp5n set is supposed to be decompressed at
# testing/talos/talos/page_load_test/tp5n in order to run tests like tps
# locally. Similarly, running talos requires a Python package virtual
# environment. Both the virtual environment and tp5n files end up littering
# the status command, so we ignore them.
testing/talos/.Python
testing/talos/bin/
testing/talos/include/
testing/talos/lib/
testing/talos/talos/page_load_test/tp5n/

View File

@ -96,3 +96,15 @@ GPATH
# Ignore node_modules from eslint-plugin-mozilla
^testing/eslint-plugin-mozilla/node_modules/
# Ignore talos virtualenv and tp5n files.
# The tp5n set is supposed to be decompressed at
# testing/talos/talos/page_load_test/tp5n in order to run tests like tps
# locally. Similarly, running talos requires a Python package virtual
# environment. Both the virtual environment and tp5n files end up littering
# the status command, so we ignore them.
^testing/talos/.Python
^testing/talos/bin/
^testing/talos/include/
^testing/talos/lib/
^testing/talos/talos/page_load_test/tp5n/

View File

@ -10,6 +10,7 @@
border-radius: 2px;
box-shadow: 1px 1px 1px #444;
display: none;
z-index: 10;
}
#virtual-cursor-box.show {

View File

@ -522,7 +522,9 @@ var Output = {
stop: function stop() {
if (this.highlightBox) {
Utils.win.document.documentElement.removeChild(this.highlightBox.get());
let doc = Utils.win.document;
(doc.body || doc.documentElement).documentElement.removeChild(
this.highlightBox.get());
delete this.highlightBox;
}
},
@ -538,16 +540,17 @@ var Output = {
{
let highlightBox = null;
if (!this.highlightBox) {
let doc = Utils.win.document;
// Add highlight box
highlightBox = Utils.win.document.
createElementNS('http://www.w3.org/1999/xhtml', 'div');
Utils.win.document.documentElement.appendChild(highlightBox);
let parent = doc.body || doc.documentElement;
parent.appendChild(highlightBox);
highlightBox.id = 'virtual-cursor-box';
// Add highlight inset for inner shadow
highlightBox.appendChild(
Utils.win.document.createElementNS(
'http://www.w3.org/1999/xhtml', 'div'));
doc.createElementNS('http://www.w3.org/1999/xhtml', 'div'));
this.highlightBox = Cu.getWeakReference(highlightBox);
} else {

View File

@ -12,7 +12,7 @@ const { Cc, Ci, Cu, Cr } = require("chrome");
const self = require("../self");
const prefs = require("../preferences/service");
const { merge } = require("../util/object");
const { ConsoleAPI } = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
const { ConsoleAPI } = Cu.import("resource://gre/modules/Console.jsm", {});
const DEFAULT_LOG_LEVEL = "error";
const ADDON_LOG_LEVEL_PREF = "extensions." + self.id + ".sdk.console.logLevel";

View File

@ -798,7 +798,7 @@ function Loader(options) {
globals: {
get console() {
// Import Console.jsm from here to prevent loading it until someone uses it
let { ConsoleAPI } = Cu.import("resource://gre/modules/devtools/shared/Console.jsm");
let { ConsoleAPI } = Cu.import("resource://gre/modules/Console.jsm");
let console = new ConsoleAPI({
consoleID: options.id ? "addon/" + options.id : ""
});

View File

@ -5,7 +5,7 @@
const { utils: Cu } = Components;
const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
const LoaderModule = Cu.import("resource://gre/modules/commonjs/toolkit/loader.js", {}).Loader;
const { console } = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
const { console } = Cu.import("resource://gre/modules/Console.jsm", {});
var {
Loader, main, Module, Require, unload
} = LoaderModule;

View File

@ -1310,327 +1310,6 @@ sticky_pref("lightweightThemes.selectedThemeID", "firefox-devedition@mozilla.org
sticky_pref("lightweightThemes.selectedThemeID", "");
#endif
// Developer edition promo preferences
pref("devtools.devedition.promo.shown", false);
pref("devtools.devedition.promo.url", "https://www.mozilla.org/firefox/developer/?utm_source=firefox-dev-tools&utm_medium=firefox-browser&utm_content=betadoorhanger");
// Only potentially show in beta release
#if MOZ_UPDATE_CHANNEL == beta
pref("devtools.devedition.promo.enabled", true);
#else
pref("devtools.devedition.promo.enabled", false);
#endif
// Disable the error console
pref("devtools.errorconsole.enabled", false);
// Developer toolbar preferences
pref("devtools.toolbar.enabled", true);
pref("devtools.toolbar.visible", false);
// Enable the app manager
pref("devtools.appmanager.enabled", true);
pref("devtools.appmanager.lastTab", "help");
pref("devtools.appmanager.manifestEditor.enabled", true);
// Enable DevTools WebIDE by default
pref("devtools.webide.enabled", true);
// Toolbox preferences
pref("devtools.toolbox.footer.height", 250);
pref("devtools.toolbox.sidebar.width", 500);
pref("devtools.toolbox.host", "bottom");
pref("devtools.toolbox.previousHost", "side");
pref("devtools.toolbox.selectedTool", "webconsole");
pref("devtools.toolbox.toolbarSpec", '["splitconsole", "paintflashing toggle","tilt toggle","scratchpad","resize toggle","eyedropper","screenshot --fullpage", "rulers", "measure"]');
pref("devtools.toolbox.sideEnabled", true);
pref("devtools.toolbox.zoomValue", "1");
pref("devtools.toolbox.splitconsoleEnabled", false);
pref("devtools.toolbox.splitconsoleHeight", 100);
// Toolbox Button preferences
pref("devtools.command-button-pick.enabled", true);
pref("devtools.command-button-frames.enabled", true);
pref("devtools.command-button-splitconsole.enabled", true);
pref("devtools.command-button-paintflashing.enabled", false);
pref("devtools.command-button-tilt.enabled", false);
pref("devtools.command-button-scratchpad.enabled", false);
pref("devtools.command-button-responsive.enabled", true);
pref("devtools.command-button-eyedropper.enabled", false);
pref("devtools.command-button-screenshot.enabled", false);
pref("devtools.command-button-rulers.enabled", false);
pref("devtools.command-button-measure.enabled", false);
// Inspector preferences
// Enable the Inspector
pref("devtools.inspector.enabled", true);
// What was the last active sidebar in the inspector
pref("devtools.inspector.activeSidebar", "ruleview");
pref("devtools.inspector.remote", false);
// Collapse pseudo-elements by default in the rule-view
pref("devtools.inspector.show_pseudo_elements", false);
// The default size for image preview tooltips in the rule-view/computed-view/markup-view
pref("devtools.inspector.imagePreviewTooltipSize", 300);
// Enable user agent style inspection in rule-view
pref("devtools.inspector.showUserAgentStyles", false);
// Show all native anonymous content (like controls in <video> tags)
pref("devtools.inspector.showAllAnonymousContent", false);
// Enable the MDN docs tooltip
pref("devtools.inspector.mdnDocsTooltip.enabled", true);
// DevTools default color unit
pref("devtools.defaultColorUnit", "authored");
// Enable the Responsive UI tool
pref("devtools.responsiveUI.no-reload-notification", false);
// Enable the Debugger
pref("devtools.debugger.enabled", true);
pref("devtools.debugger.chrome-debugging-host", "localhost");
pref("devtools.debugger.chrome-debugging-port", 6080);
pref("devtools.debugger.remote-host", "localhost");
pref("devtools.debugger.remote-timeout", 20000);
pref("devtools.debugger.pause-on-exceptions", false);
pref("devtools.debugger.ignore-caught-exceptions", true);
pref("devtools.debugger.source-maps-enabled", true);
pref("devtools.debugger.pretty-print-enabled", true);
pref("devtools.debugger.auto-pretty-print", false);
pref("devtools.debugger.auto-black-box", true);
pref("devtools.debugger.workers", false);
pref("devtools.debugger.promise", false);
// The default Debugger UI settings
pref("devtools.debugger.ui.panes-workers-and-sources-width", 200);
pref("devtools.debugger.ui.panes-instruments-width", 300);
pref("devtools.debugger.ui.panes-visible-on-startup", false);
pref("devtools.debugger.ui.variables-sorting-enabled", true);
pref("devtools.debugger.ui.variables-only-enum-visible", false);
pref("devtools.debugger.ui.variables-searchbox-visible", false);
// Enable the Memory tools
pref("devtools.memory.enabled", false);
// Enable the Performance tools
pref("devtools.performance.enabled", true);
// The default Performance UI settings
pref("devtools.performance.memory.sample-probability", "0.05");
// Can't go higher than this without causing internal allocation overflows while
// serializing the allocations data over the RDP.
pref("devtools.performance.memory.max-log-length", 125000);
pref("devtools.performance.timeline.hidden-markers",
"[\"Composite\",\"CompositeForwardTransaction\"]");
pref("devtools.performance.profiler.buffer-size", 10000000);
pref("devtools.performance.profiler.sample-frequency-khz", 1);
pref("devtools.performance.ui.invert-call-tree", true);
pref("devtools.performance.ui.invert-flame-graph", false);
pref("devtools.performance.ui.flatten-tree-recursion", true);
pref("devtools.performance.ui.show-platform-data", false);
pref("devtools.performance.ui.show-idle-blocks", true);
pref("devtools.performance.ui.enable-memory", false);
pref("devtools.performance.ui.enable-allocations", false);
pref("devtools.performance.ui.enable-framerate", true);
pref("devtools.performance.ui.enable-jit-optimizations", false);
pref("devtools.performance.ui.show-triggers-for-gc-types",
"TOO_MUCH_MALLOC ALLOC_TRIGGER LAST_DITCH EAGER_ALLOC_TRIGGER");
// Temporary pref disabling memory flame views
// TODO remove once we have flame charts via bug 1148663
pref("devtools.performance.ui.enable-memory-flame", false);
// Enable experimental options in the UI only in Nightly
#if defined(NIGHTLY_BUILD)
pref("devtools.performance.ui.experimental", true);
#else
pref("devtools.performance.ui.experimental", false);
#endif
// The default cache UI setting
pref("devtools.cache.disabled", false);
// The default service workers UI setting
pref("devtools.serviceWorkers.testing.enabled", false);
// Enable the Network Monitor
pref("devtools.netmonitor.enabled", true);
// The default Network Monitor UI settings
pref("devtools.netmonitor.panes-network-details-width", 550);
pref("devtools.netmonitor.panes-network-details-height", 450);
pref("devtools.netmonitor.statistics", true);
pref("devtools.netmonitor.filters", "[\"all\"]");
// The default Network monitor HAR export setting
pref("devtools.netmonitor.har.defaultLogDir", "");
pref("devtools.netmonitor.har.defaultFileName", "Archive %y-%m-%d %H-%M-%S");
pref("devtools.netmonitor.har.jsonp", false);
pref("devtools.netmonitor.har.jsonpCallback", "");
pref("devtools.netmonitor.har.includeResponseBodies", true);
pref("devtools.netmonitor.har.compress", false);
pref("devtools.netmonitor.har.forceExport", false);
pref("devtools.netmonitor.har.pageLoadedTimeout", 1500);
pref("devtools.netmonitor.har.enableAutoExportToFile", false);
// Enable the Tilt inspector
pref("devtools.tilt.enabled", true);
pref("devtools.tilt.intro_transition", true);
pref("devtools.tilt.outro_transition", true);
// Scratchpad settings
// - recentFileMax: The maximum number of recently-opened files
// stored. Setting this preference to 0 will not
// clear any recent files, but rather hide the
// 'Open Recent'-menu.
// - lineNumbers: Whether to show line numbers or not.
// - wrapText: Whether to wrap text or not.
// - showTrailingSpace: Whether to highlight trailing space or not.
// - editorFontSize: Editor font size configuration.
// - enableAutocompletion: Whether to enable JavaScript autocompletion.
pref("devtools.scratchpad.recentFilesMax", 10);
pref("devtools.scratchpad.lineNumbers", true);
pref("devtools.scratchpad.wrapText", false);
pref("devtools.scratchpad.showTrailingSpace", false);
pref("devtools.scratchpad.editorFontSize", 12);
pref("devtools.scratchpad.enableAutocompletion", true);
// Enable the Storage Inspector
pref("devtools.storage.enabled", false);
// Enable the Style Editor.
pref("devtools.styleeditor.enabled", true);
pref("devtools.styleeditor.source-maps-enabled", true);
pref("devtools.styleeditor.autocompletion-enabled", true);
pref("devtools.styleeditor.showMediaSidebar", true);
pref("devtools.styleeditor.mediaSidebarWidth", 238);
pref("devtools.styleeditor.navSidebarWidth", 245);
pref("devtools.styleeditor.transitions", true);
// Enable the Shader Editor.
pref("devtools.shadereditor.enabled", false);
// Enable the Canvas Debugger.
pref("devtools.canvasdebugger.enabled", false);
// Enable the Web Audio Editor
pref("devtools.webaudioeditor.enabled", false);
// Web Audio Editor Inspector Width should be a preference
pref("devtools.webaudioeditor.inspectorWidth", 300);
// Default theme ("dark" or "light")
#ifdef MOZ_DEV_EDITION
sticky_pref("devtools.theme", "dark");
#else
sticky_pref("devtools.theme", "light");
#endif
// Remember the Web Console filters
pref("devtools.webconsole.filter.network", true);
pref("devtools.webconsole.filter.networkinfo", false);
pref("devtools.webconsole.filter.netwarn", true);
pref("devtools.webconsole.filter.netxhr", false);
pref("devtools.webconsole.filter.csserror", true);
pref("devtools.webconsole.filter.cssparser", false);
pref("devtools.webconsole.filter.csslog", false);
pref("devtools.webconsole.filter.exception", true);
pref("devtools.webconsole.filter.jswarn", true);
pref("devtools.webconsole.filter.jslog", false);
pref("devtools.webconsole.filter.error", true);
pref("devtools.webconsole.filter.warn", true);
pref("devtools.webconsole.filter.info", true);
pref("devtools.webconsole.filter.log", true);
pref("devtools.webconsole.filter.secerror", true);
pref("devtools.webconsole.filter.secwarn", true);
pref("devtools.webconsole.filter.serviceworkers", false);
pref("devtools.webconsole.filter.sharedworkers", false);
pref("devtools.webconsole.filter.windowlessworkers", false);
pref("devtools.webconsole.filter.servererror", false);
pref("devtools.webconsole.filter.serverwarn", false);
pref("devtools.webconsole.filter.serverinfo", false);
pref("devtools.webconsole.filter.serverlog", false);
// Remember the Browser Console filters
pref("devtools.browserconsole.filter.network", true);
pref("devtools.browserconsole.filter.networkinfo", false);
pref("devtools.browserconsole.filter.netwarn", true);
pref("devtools.browserconsole.filter.netxhr", false);
pref("devtools.browserconsole.filter.csserror", true);
pref("devtools.browserconsole.filter.cssparser", false);
pref("devtools.browserconsole.filter.csslog", false);
pref("devtools.browserconsole.filter.exception", true);
pref("devtools.browserconsole.filter.jswarn", true);
pref("devtools.browserconsole.filter.jslog", true);
pref("devtools.browserconsole.filter.error", true);
pref("devtools.browserconsole.filter.warn", true);
pref("devtools.browserconsole.filter.info", true);
pref("devtools.browserconsole.filter.log", true);
pref("devtools.browserconsole.filter.secerror", true);
pref("devtools.browserconsole.filter.secwarn", true);
pref("devtools.browserconsole.filter.serviceworkers", true);
pref("devtools.browserconsole.filter.sharedworkers", true);
pref("devtools.browserconsole.filter.windowlessworkers", true);
pref("devtools.browserconsole.filter.servererror", false);
pref("devtools.browserconsole.filter.serverwarn", false);
pref("devtools.browserconsole.filter.serverinfo", false);
pref("devtools.browserconsole.filter.serverlog", false);
// Text size in the Web Console. Use 0 for the system default size.
pref("devtools.webconsole.fontSize", 0);
// Max number of inputs to store in web console history.
pref("devtools.webconsole.inputHistoryCount", 50);
// Persistent logging: |true| if you want the Web Console to keep all of the
// logged messages after reloading the page, |false| if you want the output to
// be cleared each time page navigation happens.
pref("devtools.webconsole.persistlog", false);
// Web Console timestamp: |true| if you want the logs and instructions
// in the Web Console to display a timestamp, or |false| to not display
// any timestamps.
pref("devtools.webconsole.timestampMessages", false);
// The number of lines that are displayed in the web console for the Net,
// CSS, JS and Web Developer categories. These defaults should be kept in sync
// with DEFAULT_LOG_LIMIT in the webconsole frontend.
pref("devtools.hud.loglimit.network", 1000);
pref("devtools.hud.loglimit.cssparser", 1000);
pref("devtools.hud.loglimit.exception", 1000);
pref("devtools.hud.loglimit.console", 1000);
// By how many times eyedropper will magnify pixels
pref("devtools.eyedropper.zoom", 6);
// The developer tools editor configuration:
// - tabsize: how many spaces to use when a Tab character is displayed.
// - expandtab: expand Tab characters to spaces.
// - keymap: which keymap to use (can be 'default', 'emacs' or 'vim')
// - autoclosebrackets: whether to permit automatic bracket/quote closing.
// - detectindentation: whether to detect the indentation from the file
// - enableCodeFolding: Whether to enable code folding or not.
pref("devtools.editor.tabsize", 2);
pref("devtools.editor.expandtab", true);
pref("devtools.editor.keymap", "default");
pref("devtools.editor.autoclosebrackets", true);
pref("devtools.editor.detectindentation", true);
pref("devtools.editor.enableCodeFolding", true);
pref("devtools.editor.autocomplete", true);
// Enable the Font Inspector
pref("devtools.fontinspector.enabled", true);
// Pref to store the browser version at the time of a telemetry ping for an
// opened developer tool. This allows us to ping telemetry just once per browser
// version for each user.
pref("devtools.telemetry.tools.opened.version", "{}");
// Enable the JSON View tool (an inspector for application/json documents)
#ifdef MOZ_DEV_EDITION
pref("devtools.jsonview.enabled", true);
#else
pref("devtools.jsonview.enabled", false);
#endif
// Whether the character encoding menu is under the main Firefox button. This
// preference is a string so that localizers can alter it.
pref("browser.menu.showCharacterEncoding", "chrome://browser/locale/browser.properties");

View File

@ -5,7 +5,7 @@
#endif
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/devtools/shared/Console.jsm");
"resource://gre/modules/Console.jsm");
var gDebug = false;
try {

View File

@ -64,7 +64,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "Task",
"resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyGetter(this, "DownloadsLogger", () => {
let { ConsoleAPI } = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
let { ConsoleAPI } = Cu.import("resource://gre/modules/Console.jsm", {});
let consoleOptions = {
maxLogLevelPref: "browser.download.loglevel",
prefix: "Downloads"

View File

@ -203,25 +203,17 @@ body {
}
.new-room-view {
border-bottom: 1px solid #d8d8d8;
display: flex;
flex-direction: column;
border-top: 1px solid #d8d8d8;
}
.new-room-view > .btn {
flex: 1;
height: 3rem;
display: block;
border-radius: 5px;
font-size: 1.2rem;
margin: 7px 15px 0 15px;
padding: .5rem 1rem;
border-radius: 4px;
}
/* Remove when bug 1142671 is backed out. */
.new-room-view > .context.hide + .new-room-button {
border-radius: 3px;
margin-top: 0.5rem;
font-weight: bold;
margin: 1rem;
padding: 1rem;
}
.room-list {

View File

@ -225,6 +225,16 @@ loop.panel = (function(_, mozL10n) {
this.hideDropdownMenu();
},
/**
* Load on the browser the feedback url from prefs
*/
handleSubmitFeedback: function(event) {
event.preventDefault();
var helloFeedbackUrl = this.props.mozLoop.getLoopPref("feedback.formURL");
this.props.mozLoop.openURL(helloFeedbackUrl);
this.closeWindow();
},
_isSignedIn: function() {
return !!this.props.mozLoop.userProfile;
},
@ -262,6 +272,9 @@ loop.panel = (function(_, mozL10n) {
onClick: this.handleClickSettingsEntry}),
React.createElement(SettingsDropdownEntry, {label: mozL10n.get("tour_label"),
onClick: this.openGettingStartedTour}),
React.createElement(SettingsDropdownEntry, {extraCSSClass: "entry-settings-feedback",
label: mozL10n.get("settings_menu_item_feedback"),
onClick: this.handleSubmitFeedback}),
React.createElement(SettingsDropdownEntry, {displayed: this.props.mozLoop.fxAEnabled,
extraCSSClass: accountEntryCSSClass,
label: this._isSignedIn() ?
@ -649,10 +662,10 @@ loop.panel = (function(_, mozL10n) {
_renderLoadingRoomsView: function() {
return (
React.createElement("div", {className: "room-list"},
this._renderNewRoomButton(),
React.createElement("div", {className: "room-list-loading"},
React.createElement("img", {src: "loop/shared/img/animated-spinner.svg"})
),
this._renderNewRoomButton()
)
)
);
},
@ -660,6 +673,7 @@ loop.panel = (function(_, mozL10n) {
_renderNoRoomsView: function() {
return (
React.createElement("div", {className: "rooms"},
this._renderNewRoomButton(),
React.createElement("div", {className: "room-list-empty"},
React.createElement("div", {className: "no-conversations-message"},
React.createElement("p", {className: "panel-text-medium"},
@ -669,8 +683,7 @@ loop.panel = (function(_, mozL10n) {
mozL10n.get("no_conversations_start_message2")
)
)
),
this._renderNewRoomButton()
)
)
);
},
@ -700,6 +713,7 @@ loop.panel = (function(_, mozL10n) {
return (
React.createElement("div", {className: "rooms"},
this._renderNewRoomButton(),
React.createElement("h1", null, mozL10n.get("rooms_list_recent_conversations")),
React.createElement("div", {className: "room-list"},
this.state.rooms.map(function(room, i) {
@ -711,8 +725,7 @@ loop.panel = (function(_, mozL10n) {
room: room})
);
}, this)
),
this._renderNewRoomButton()
)
)
);
}

View File

@ -225,6 +225,16 @@ loop.panel = (function(_, mozL10n) {
this.hideDropdownMenu();
},
/**
* Load on the browser the feedback url from prefs
*/
handleSubmitFeedback: function(event) {
event.preventDefault();
var helloFeedbackUrl = this.props.mozLoop.getLoopPref("feedback.formURL");
this.props.mozLoop.openURL(helloFeedbackUrl);
this.closeWindow();
},
_isSignedIn: function() {
return !!this.props.mozLoop.userProfile;
},
@ -262,6 +272,9 @@ loop.panel = (function(_, mozL10n) {
onClick={this.handleClickSettingsEntry} />
<SettingsDropdownEntry label={mozL10n.get("tour_label")}
onClick={this.openGettingStartedTour} />
<SettingsDropdownEntry extraCSSClass="entry-settings-feedback"
label={mozL10n.get("settings_menu_item_feedback")}
onClick={this.handleSubmitFeedback} />
<SettingsDropdownEntry displayed={this.props.mozLoop.fxAEnabled}
extraCSSClass={accountEntryCSSClass}
label={this._isSignedIn() ?
@ -649,10 +662,10 @@ loop.panel = (function(_, mozL10n) {
_renderLoadingRoomsView: function() {
return (
<div className="room-list">
{this._renderNewRoomButton()}
<div className="room-list-loading">
<img src="loop/shared/img/animated-spinner.svg" />
</div>
{this._renderNewRoomButton()}
</div>
);
},
@ -660,6 +673,7 @@ loop.panel = (function(_, mozL10n) {
_renderNoRoomsView: function() {
return (
<div className="rooms">
{this._renderNewRoomButton()}
<div className="room-list-empty">
<div className="no-conversations-message">
<p className="panel-text-medium">
@ -670,7 +684,6 @@ loop.panel = (function(_, mozL10n) {
</p>
</div>
</div>
{this._renderNewRoomButton()}
</div>
);
},
@ -700,6 +713,7 @@ loop.panel = (function(_, mozL10n) {
return (
<div className="rooms">
{this._renderNewRoomButton()}
<h1>{mozL10n.get("rooms_list_recent_conversations")}</h1>
<div className="room-list">{
this.state.rooms.map(function(room, i) {
@ -712,7 +726,6 @@ loop.panel = (function(_, mozL10n) {
);
}, this)
}</div>
{this._renderNewRoomButton()}
</div>
);
}

View File

@ -135,7 +135,6 @@ loop.roomViews = (function(mozL10n) {
render: function() {
var settingsMenuItems = [
{ id: "feedback" },
{ id: "help" }
];
@ -794,7 +793,6 @@ loop.roomViews = (function(mozL10n) {
visible: true,
onClick: this.handleEditContextClick
},
{ id: "feedback" },
{ id: "help" }
];
return (

View File

@ -135,7 +135,6 @@ loop.roomViews = (function(mozL10n) {
render: function() {
var settingsMenuItems = [
{ id: "feedback" },
{ id: "help" }
];
@ -794,7 +793,6 @@ loop.roomViews = (function(mozL10n) {
visible: true,
onClick: this.handleEditContextClick
},
{ id: "feedback" },
{ id: "help" }
];
return (

View File

@ -300,27 +300,12 @@ loop.shared.views = (function(_, mozL10n) {
this.props.mozLoop.openURL(helloSupportUrl);
},
/**
* Load on the browser the feedback url from prefs
*/
handleSubmitFeedback: function(event) {
event.preventDefault();
var helloFeedbackUrl = this.props.mozLoop.getLoopPref("feedback.formURL");
this.props.mozLoop.openURL(helloFeedbackUrl);
},
/**
* Recover the needed info for generating an specific menu Item
*/
getItemInfo: function(menuItem) {
var cx = React.addons.classSet;
switch (menuItem.id) {
case "feedback":
return {
cssClasses: "dropdown-menu-item",
handler: this.handleSubmitFeedback,
label: mozL10n.get("feedback_request_button")
};
case "help":
return {
cssClasses: "dropdown-menu-item",

View File

@ -300,27 +300,12 @@ loop.shared.views = (function(_, mozL10n) {
this.props.mozLoop.openURL(helloSupportUrl);
},
/**
* Load on the browser the feedback url from prefs
*/
handleSubmitFeedback: function(event) {
event.preventDefault();
var helloFeedbackUrl = this.props.mozLoop.getLoopPref("feedback.formURL");
this.props.mozLoop.openURL(helloFeedbackUrl);
},
/**
* Recover the needed info for generating an specific menu Item
*/
getItemInfo: function(menuItem) {
var cx = React.addons.classSet;
switch (menuItem.id) {
case "feedback":
return {
cssClasses: "dropdown-menu-item",
handler: this.handleSubmitFeedback,
label: mozL10n.get("feedback_request_button")
};
case "help":
return {
cssClasses: "dropdown-menu-item",

View File

@ -7,7 +7,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/devtools/shared/Console.jsm");
"resource://gre/modules/Console.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "LoopStorage",
"resource:///modules/loop/LoopStorage.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Promise",

View File

@ -182,7 +182,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "gWM",
// Create a new instance of the ConsoleAPI so we can control the maxLogLevel with a pref.
XPCOMUtils.defineLazyGetter(this, "log", () => {
let ConsoleAPI = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {}).ConsoleAPI;
let ConsoleAPI = Cu.import("resource://gre/modules/Console.jsm", {}).ConsoleAPI;
let consoleOptions = {
maxLogLevelPref: PREF_LOG_LEVEL,
prefix: "Loop"

View File

@ -48,20 +48,16 @@
insertScript(devTimeUrl, true);
}
// Various browsers use different mechanisms to indicate whether
// the user has opted-in to the "Do Not Track" mechanism. We check for
// each of them and disable the use of Google Analytics if any are
// present. Note that Internet Explorer versions 10 and 11 did not
// have an opt-in "Do not Track" mechanism, so we specifically
// ignore their indications.
(function() {
// window.navigator.doNotTrack "yes" is for old versions of FF
// window.navigator.doNotTrack "1" is for current versions of FF + Chrome + Opera
// window.doNotTrack is Safari + IE11
// window.navigator.msDoNotTrack for IE9 and IE10
// See also
// https://developer.mozilla.org/en-US/docs/Web/API/Navigator/doNotTrack#Browser_compatibility
if (window.navigator.doNotTrack !== "yes" &&
window.navigator.doNotTrack !== "1" &&
window.doNotTrack !== "1" &&
window.navigator.msDoNotTrack !== "1") {
insertScript("//cdn.optimizely.com/js/2768540301.js");
function enableTracking() {
// This is an unfolded, readable version of the official GA inclusion
// script.
window.GoogleAnalyticsObject = "ga";
@ -81,6 +77,42 @@
});
window.ga("send", "pageview");
}
insertScript("//cdn.optimizely.com/js/2768540301.js");
// See also
// https://developer.mozilla.org/en-US/docs/Web/API/Navigator/doNotTrack#Browser_compatibility
var trackEnable = true;
// window.navigator.doNotTrack "yes" is for old versions of FF
// window.navigator.doNotTrack "1" is for current versions of FF + Chrome + Opera
if (window.navigator.doNotTrack === "yes" || String(window.navigator.doNotTrack) === "1") {
trackEnable = false;
}
// window.doNotTrack is "1" for Safari, IE11, and IE12
// Ignore IE11 DNT setting
if (String(window.doNotTrack) === "1") {
// Honour if Safari or IE12
if (navigator.userAgent.indexOf("Safari") !== -1) {
trackEnable = false;
} else {
// Is MS IE11 or IE12
// Disable tracking for IE12 only
if (!/rv[ :]11/g.test(window.navigator.userAgent)) {
trackEnable = false;
}
}
}
// window.navigator.msDoNotTrack is "1" for IE9 and IE10
// Honor MS-specific "Do Not Track" for IE 9 only
if (String(window.navigator.msDoNotTrack) === "1" &&
window.navigator.userAgent.search("IE 9") !== -1) {
trackEnable = false;
}
if (trackEnable) {
enableTracking();
}
})();
</script>

View File

@ -434,6 +434,47 @@ describe("loop.panel", function() {
});
});
describe("Submit feedback", function() {
var view, feedbackUrl;
function mountTestComponent() {
return TestUtils.renderIntoDocument(
React.createElement(loop.panel.SettingsDropdown, {
mozLoop: fakeMozLoop
}));
}
beforeEach(function() {
feedbackUrl = "https://example.com";
fakeMozLoop.getLoopPref = function(pref) {
if (pref === "feedback.formURL") {
return feedbackUrl;
}
return "unseen";
};
});
it("should open a tab to the feedback page", function() {
view = mountTestComponent();
TestUtils.Simulate
.click(view.getDOMNode().querySelector(".entry-settings-feedback"));
sinon.assert.calledOnce(fakeMozLoop.openURL);
sinon.assert.calledWithExactly(fakeMozLoop.openURL, feedbackUrl);
});
it("should close the panel", function() {
view = mountTestComponent();
TestUtils.Simulate
.click(view.getDOMNode().querySelector(".entry-settings-feedback"));
sinon.assert.calledOnce(fakeWindow.close);
});
});
describe("#render", function() {
it("should not render a ToSView when gettingStarted.seen is true", function() {
navigator.mozLoop.getLoopPref = function() {

View File

@ -287,7 +287,6 @@ describe("loop.shared.views", function() {
describe("SettingsControlButton", function() {
var fakeMozLoop;
var support_url = "https://support.com";
var feedback_url = "https://feedback.com";
beforeEach(function() {
fakeMozLoop = {
@ -297,8 +296,6 @@ describe("loop.shared.views", function() {
switch (prefName) {
case "support_url":
return support_url;
case "feedback.formURL":
return feedback_url;
default:
return prefName;
}
@ -316,7 +313,7 @@ describe("loop.shared.views", function() {
}
it("should render a visible button", function() {
var settingsMenuItems = [{ id: "feedback" }];
var settingsMenuItems = [{ id: "help" }];
var comp = mountTestComponent({ menuItems: settingsMenuItems} );
var node = comp.getDOMNode().querySelector(".btn-settings");
@ -348,7 +345,7 @@ describe("loop.shared.views", function() {
});
it("should show the settings dropdown on click", function() {
var settingsMenuItems = [{ id: "feedback" }];
var settingsMenuItems = [{ id: "help" }];
var comp = mountTestComponent({ menuItems: settingsMenuItems} );
expect(comp.state.showMenu).eql(false);
@ -428,22 +425,8 @@ describe("loop.shared.views", function() {
sinon.assert.calledOnce(settingsMenuItems[0].onClick);
});
it("should open a tab to the feedback url when the feedback menu item is clicked", function() {
var settingsMenuItems = [
{ id: "feedback" },
{ id: "help" }
];
var comp = mountTestComponent({ menuItems: settingsMenuItems} );
TestUtils.Simulate.click(comp.getDOMNode().querySelector(".settings-menu > li:first-child"));
sinon.assert.calledOnce(fakeMozLoop.openURL);
sinon.assert.calledWithExactly(fakeMozLoop.openURL, feedback_url);
});
it("should open a tab to the support url when the support menu item is clicked", function() {
var settingsMenuItems = [
{ id: "feedback" },
{ id: "help" }
];
var comp = mountTestComponent({ menuItems: settingsMenuItems} );

View File

@ -38,7 +38,7 @@ Cu.import("resource://gre/modules/AsyncShutdown.jsm");
Cu.import("resource://gre/modules/Preferences.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/devtools/shared/Console.jsm");
"resource://gre/modules/Console.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "RunState",
"resource:///modules/sessionstore/RunState.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch",

View File

@ -18,7 +18,7 @@ Cu.import("resource://gre/modules/TelemetryStopwatch.jsm", this);
XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
"resource://gre/modules/AppConstants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/devtools/shared/Console.jsm");
"resource://gre/modules/Console.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrivacyFilter",
"resource:///modules/sessionstore/PrivacyFilter.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "SessionStore",

View File

@ -13,7 +13,7 @@ Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/devtools/shared/Console.jsm");
"resource://gre/modules/Console.jsm");
// Returns the principal for a given |frame| contained in a given |docShell|.
function getPrincipalForFrame(docShell, frame) {

View File

@ -131,7 +131,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "gScreenManager",
XPCOMUtils.defineLazyServiceGetter(this, "Telemetry",
"@mozilla.org/base/telemetry;1", "nsITelemetry");
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/devtools/shared/Console.jsm");
"resource://gre/modules/Console.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow",
"resource:///modules/RecentWindow.jsm");

View File

@ -13,7 +13,7 @@ Cu.import("resource://gre/modules/Promise.jsm", this);
Cu.import("resource://gre/modules/Task.jsm", this);
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/devtools/shared/Console.jsm");
"resource://gre/modules/Console.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrivacyFilter",
"resource:///modules/sessionstore/PrivacyFilter.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TabStateCache",

View File

@ -42,7 +42,7 @@ Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
Cu.import("resource://gre/modules/Promise.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/devtools/shared/Console.jsm");
"resource://gre/modules/Console.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "SessionFile",
"resource:///modules/sessionstore/SessionFile.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "CrashMonitor",

View File

@ -73,7 +73,7 @@ const TARGET_SEARCHENGINE_PREFIX = "searchEngine-";
// Create a new instance of the ConsoleAPI so we can control the maxLogLevel with a pref.
XPCOMUtils.defineLazyGetter(this, "log", () => {
let ConsoleAPI = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {}).ConsoleAPI;
let ConsoleAPI = Cu.import("resource://gre/modules/Console.jsm", {}).ConsoleAPI;
let consoleOptions = {
maxLogLevelPref: PREF_LOG_LEVEL,
prefix: "UITour",

View File

@ -688,6 +688,7 @@
; DevTools
@RESPATH@/browser/chrome/devtools@JAREXT@
@RESPATH@/browser/chrome/devtools.manifest
@RESPATH@/browser/@PREF_DIR@/devtools.js
; shell icons
#ifdef XP_UNIX

View File

@ -86,6 +86,7 @@ settings_menu_item_signout=Sign Out
settings_menu_item_signin=Sign In
settings_menu_item_turnnotificationson=Turn Notifications On
settings_menu_item_turnnotificationsoff=Turn Notifications Off
settings_menu_item_feedback=Submit Feedback
settings_menu_button_tooltip=Settings
# Contact Strings (Panel)

View File

@ -20,11 +20,11 @@ MOZ_ARG_WITH_STRING(android-gnu-compiler-version,
gnu compiler version to use],
android_gnu_compiler_version=$withval)
MOZ_ARG_ENABLE_BOOL(android-libstdcxx,
[ --enable-android-libstdcxx
use GNU libstdc++ instead of STLPort],
MOZ_ANDROID_LIBSTDCXX=1,
MOZ_ANDROID_LIBSTDCXX= )
MOZ_ARG_WITH_STRING(android-cxx-stl,
[ --with-android-cxx-stl=VALUE
use the specified C++ STL (stlport, libstdc++, libc++)],
android_cxx_stl=$withval,
android_cxx_stl=mozstlport)
define([MIN_ANDROID_VERSION], [9])
android_version=MIN_ANDROID_VERSION
@ -210,26 +210,60 @@ if test "$OS_TARGET" = "Android" -a -z "$gonkdir"; then
AC_SUBST(ANDROID_CPU_ARCH)
cpu_arch_dir="$ANDROID_CPU_ARCH"
if test "$MOZ_THUMB2" = 1; then
cpu_arch_dir="$cpu_arch_dir/thumb"
fi
if test -z "$STLPORT_CPPFLAGS$STLPORT_LIBS"; then
if test -n "$MOZ_ANDROID_LIBSTDCXX" ; then
case "$android_cxx_stl" in
libstdc++)
# android-ndk-r8b and later
ndk_base="$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version"
ndk_libs="$ndk_base/libs/$ANDROID_CPU_ARCH"
ndk_libs_include="$ndk_base/libs/$ANDROID_CPU_ARCH"
ndk_libs="$ndk_base/libs/$cpu_arch_dir"
ndk_include="$ndk_base/include"
if test -e "$ndk_libs/libgnustl_static.a"; then
STLPORT_LIBS="-L$ndk_libs -lgnustl_static"
STLPORT_CPPFLAGS="-I$ndk_include -I$ndk_include/backward -I$ndk_libs/include"
else
if ! test -e "$ndk_libs/libgnustl_static.a"; then
AC_MSG_ERROR([Couldn't find path to gnu-libstdc++ in the android ndk])
fi
else
STLPORT_LIBS="-L$ndk_libs -lgnustl_static"
STLPORT_CPPFLAGS="-I$ndk_include -I$ndk_include/backward -I$ndk_libs_include/include"
;;
libc++)
# android-ndk-r8b and later
ndk_base="$android_ndk/sources/cxx-stl"
cxx_base="$ndk_base/llvm-libc++"
cxx_libs="$cxx_base/libs/$cpu_arch_dir"
cxx_include="$cxx_base/libcxx/include"
cxxabi_base="$ndk_base/llvm-libc++abi"
cxxabi_include="$cxxabi_base/libcxxabi/include"
if ! test -e "$cxx_libs/libc++_static.a"; then
AC_MSG_ERROR([Couldn't find path to llvm-libc++ in the android ndk])
fi
STLPORT_LIBS="-L$cxx_libs -lc++_static"
# Add android/support/include/ for prototyping long double math
# functions, locale-specific C library functions, multibyte support,
# etc.
STLPORT_CPPFLAGS="-I$android_ndk/sources/android/support/include -I$cxx_include -I$cxxabi_include"
;;
mozstlport)
# We don't need to set STLPORT_LIBS, because the build system will
# take care of linking in our home-built stlport where it is needed.
STLPORT_CPPFLAGS="-isystem $_topsrcdir/build/stlport/stlport -isystem $_topsrcdir/build/stlport/overrides -isystem $android_ndk/sources/cxx-stl/system/include"
fi
;;
*)
AC_MSG_ERROR([Bad value for --enable-android-cxx-stl])
;;
esac
fi
CXXFLAGS="$CXXFLAGS $STLPORT_CPPFLAGS"
fi
AC_SUBST([MOZ_ANDROID_LIBSTDCXX])
MOZ_ANDROID_CXX_STL=$android_cxx_stl
AC_SUBST([MOZ_ANDROID_CXX_STL])
AC_SUBST([STLPORT_LIBS])
])

View File

@ -279,6 +279,8 @@ public:
CustomTypeAnnotation(const char *Spelling, const char *Pretty)
: Spelling(Spelling), Pretty(Pretty){};
virtual ~CustomTypeAnnotation() {}
// Checks if this custom annotation "effectively affects" the given type.
bool hasEffectiveAnnotation(QualType T) {
return directAnnotationReason(T).valid();
@ -299,6 +301,10 @@ public:
private:
bool hasLiteralAnnotation(QualType T) const;
AnnotationReason directAnnotationReason(QualType T);
protected:
// Allow subclasses to apply annotations to external code:
virtual bool hasFakeAnnotation(const TagDecl *D) const { return false; }
};
static CustomTypeAnnotation StackClass =
@ -313,8 +319,32 @@ static CustomTypeAnnotation NonTemporaryClass =
CustomTypeAnnotation("moz_non_temporary_class", "non-temporary");
static CustomTypeAnnotation MustUse =
CustomTypeAnnotation("moz_must_use", "must-use");
static CustomTypeAnnotation NonMemMovable =
CustomTypeAnnotation("moz_non_memmovable", "non-memmove()able");
class MemMoveAnnotation final : public CustomTypeAnnotation {
public:
MemMoveAnnotation()
: CustomTypeAnnotation("moz_non_memmovable", "non-memmove()able") {}
virtual ~MemMoveAnnotation() {}
protected:
bool hasFakeAnnotation(const TagDecl *D) const override {
// Annotate everything in ::std, with a few exceptions; see bug
// 1201314 for discussion.
if (getDeclarationNamespace(D) == "std") {
// This doesn't check that it's really ::std::pair and not
// ::std::something_else::pair, but should be good enough.
StringRef Name = D->getName();
if (Name == "pair" || Name == "atomic" || Name == "__atomic_base") {
return false;
}
return true;
}
return false;
}
};
static MemMoveAnnotation NonMemMovable = MemMoveAnnotation();
class MozChecker : public ASTConsumer, public RecursiveASTVisitor<MozChecker> {
DiagnosticsEngine &Diag;
@ -768,7 +798,7 @@ bool CustomTypeAnnotation::hasLiteralAnnotation(QualType T) const {
#else
if (const CXXRecordDecl *D = T->getAsCXXRecordDecl()) {
#endif
return MozChecker::hasCustomAnnotation(D, Spelling);
return hasFakeAnnotation(D) || MozChecker::hasCustomAnnotation(D, Spelling);
}
return false;
}

View File

@ -0,0 +1,21 @@
#define MOZ_NEEDS_MEMMOVABLE_TYPE __attribute__((annotate("moz_needs_memmovable_type")))
template<class T>
class MOZ_NEEDS_MEMMOVABLE_TYPE Mover { T mForceInst; }; // expected-error-re 4 {{Cannot instantiate 'Mover<{{.*}}>' with non-memmovable template argument '{{.*}}'}}
namespace std {
// In theory defining things in std:: like this invokes undefined
// behavior, but in practice it's good enough for this test case.
template<class C> class basic_string { };
typedef basic_string<char> string;
template<class T, class U> class pair { T mT; U mU; }; // expected-note {{std::pair<bool, std::basic_string<char> >' is a non-memmove()able type because member 'mU' is a non-memmove()able type 'std::basic_string<char>'}}
class arbitrary_name { };
}
class HasString { std::string m; }; // expected-note {{'HasString' is a non-memmove()able type because member 'm' is a non-memmove()able type 'std::string' (aka 'basic_string<char>')}}
static Mover<std::string> bad; // expected-note {{instantiation of 'Mover<std::basic_string<char> >' requested here}}
static Mover<HasString> bad_mem; // expected-note {{instantiation of 'Mover<HasString>' requested here}}
static Mover<std::arbitrary_name> assumed_bad; // expected-note {{instantiation of 'Mover<std::arbitrary_name>' requested here}}
static Mover<std::pair<bool, int>> good;
static Mover<std::pair<bool, std::string>> not_good; // expected-note {{instantiation of 'Mover<std::pair<bool, std::basic_string<char> > >' requested here}}

View File

@ -24,6 +24,7 @@ SOURCES += [
'TestNoExplicitMoveConstructor.cpp',
'TestNonHeapClass.cpp',
'TestNonMemMovable.cpp',
'TestNonMemMovableStd.cpp',
'TestNonTemporaryClass.cpp',
'TestNoRefcountedInsideLambdas.cpp',
'TestRefCountedCopyConstructor.cpp',

View File

@ -15,7 +15,7 @@ if CONFIG['OS_ARCH'] == 'WINNT':
else:
DIRS += ['unix']
if CONFIG['OS_TARGET'] == 'Android' and not CONFIG['MOZ_ANDROID_LIBSTDCXX']:
if CONFIG['OS_TARGET'] == 'Android' and CONFIG['MOZ_ANDROID_CXX_STL'] == 'mozstlport':
DIRS += ['stlport']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':

View File

@ -21,7 +21,8 @@ def Binary():
if CONFIG['STLPORT_LIBS']:
OS_LIBS += [CONFIG['STLPORT_LIBS']]
elif CONFIG['OS_TARGET'] == 'Android':
USE_LIBS += ['stlport']
if CONFIG['MOZ_ANDROID_CXX_STL'] == 'mozstlport':
USE_LIBS += ['stlport']
@template

View File

@ -318,6 +318,7 @@ if test -n "$gonkdir" ; then
AC_DEFINE(HAVE_PTHREADS)
MOZ_CHROME_FILE_FORMAT=omni
direct_nspr_config=1
android_cxx_stl=mozstlport
else
MOZ_ANDROID_NDK

View File

@ -11,7 +11,7 @@ var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
Cu.import("resource://gre/modules/Task.jsm");
var { loader, require } = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm");
Cu.import("resource://gre/modules/devtools/shared/Console.jsm");
Cu.import("resource://gre/modules/Console.jsm");
Cu.import("resource:///modules/devtools/client/shared/widgets/ViewHelpers.jsm");
loader.lazyRequireGetter(this, "promise");

View File

@ -459,10 +459,10 @@ function AnimationsTimeline(inspector) {
this.inspector = inspector;
this.onAnimationStateChanged = this.onAnimationStateChanged.bind(this);
this.onTimeHeaderMouseDown = this.onTimeHeaderMouseDown.bind(this);
this.onTimeHeaderMouseUp = this.onTimeHeaderMouseUp.bind(this);
this.onTimeHeaderMouseOut = this.onTimeHeaderMouseOut.bind(this);
this.onTimeHeaderMouseMove = this.onTimeHeaderMouseMove.bind(this);
this.onScrubberMouseDown = this.onScrubberMouseDown.bind(this);
this.onScrubberMouseUp = this.onScrubberMouseUp.bind(this);
this.onScrubberMouseOut = this.onScrubberMouseOut.bind(this);
this.onScrubberMouseMove = this.onScrubberMouseMove.bind(this);
EventEmitter.decorate(this);
}
@ -487,13 +487,21 @@ AnimationsTimeline.prototype = {
}
});
this.scrubberHandleEl = createNode({
parent: this.scrubberEl,
attributes: {
"class": "scrubber-handle"
}
});
this.scrubberHandleEl.addEventListener("mousedown", this.onScrubberMouseDown);
this.timeHeaderEl = createNode({
parent: this.rootWrapperEl,
attributes: {
"class": "time-header"
}
});
this.timeHeaderEl.addEventListener("mousedown", this.onTimeHeaderMouseDown);
this.timeHeaderEl.addEventListener("mousedown", this.onScrubberMouseDown);
this.animationsEl = createNode({
parent: this.rootWrapperEl,
@ -509,7 +517,9 @@ AnimationsTimeline.prototype = {
this.unrender();
this.timeHeaderEl.removeEventListener("mousedown",
this.onTimeHeaderMouseDown);
this.onScrubberMouseDown);
this.scrubberHandleEl.removeEventListener("mousedown",
this.onScrubberMouseDown);
this.rootWrapperEl.remove();
this.animations = [];
@ -518,6 +528,7 @@ AnimationsTimeline.prototype = {
this.timeHeaderEl = null;
this.animationsEl = null;
this.scrubberEl = null;
this.scrubberHandleEl = null;
this.win = null;
this.inspector = null;
},
@ -539,18 +550,21 @@ AnimationsTimeline.prototype = {
this.animationsEl.innerHTML = "";
},
onTimeHeaderMouseDown: function(e) {
onScrubberMouseDown: function(e) {
this.moveScrubberTo(e.pageX);
this.win.addEventListener("mouseup", this.onTimeHeaderMouseUp);
this.win.addEventListener("mouseout", this.onTimeHeaderMouseOut);
this.win.addEventListener("mousemove", this.onTimeHeaderMouseMove);
this.win.addEventListener("mouseup", this.onScrubberMouseUp);
this.win.addEventListener("mouseout", this.onScrubberMouseOut);
this.win.addEventListener("mousemove", this.onScrubberMouseMove);
// Prevent text selection while dragging.
e.preventDefault();
},
onTimeHeaderMouseUp: function() {
onScrubberMouseUp: function() {
this.cancelTimeHeaderDragging();
},
onTimeHeaderMouseOut: function(e) {
onScrubberMouseOut: function(e) {
// Check that mouseout happened on the window itself, and if yes, cancel
// the dragging.
if (!this.win.document.contains(e.relatedTarget)) {
@ -559,12 +573,12 @@ AnimationsTimeline.prototype = {
},
cancelTimeHeaderDragging: function() {
this.win.removeEventListener("mouseup", this.onTimeHeaderMouseUp);
this.win.removeEventListener("mouseout", this.onTimeHeaderMouseOut);
this.win.removeEventListener("mousemove", this.onTimeHeaderMouseMove);
this.win.removeEventListener("mouseup", this.onScrubberMouseUp);
this.win.removeEventListener("mouseout", this.onScrubberMouseOut);
this.win.removeEventListener("mousemove", this.onScrubberMouseMove);
},
onTimeHeaderMouseMove: function(e) {
onScrubberMouseMove: function(e) {
this.moveScrubberTo(e.pageX);
},

View File

@ -8,23 +8,21 @@
// in the header area.
// Also check that doing so changes the timeline's play/pause button to paused
// state.
// Finally, also check that the scrubber can be moved using the scrubber handle.
add_task(function*() {
yield addTab(TEST_URL_ROOT + "doc_simple_animation.html");
let {panel} = yield openAnimationInspector();
let timeline = panel.animationsTimelineComponent;
let win = timeline.win;
let timeHeaderEl = timeline.timeHeaderEl;
let scrubberEl = timeline.scrubberEl;
let {win, timeHeaderEl, scrubberEl, scrubberHandleEl} = timeline;
let playTimelineButtonEl = panel.playTimelineButtonEl;
ok(!playTimelineButtonEl.classList.contains("paused"),
"The timeline play button is in its playing state by default");
info("Mousedown in the header to move the scrubber");
yield synthesizeMouseAndWaitForTimelineChange(timeline, 50, 1, "mousedown");
yield synthesizeInHeaderAndWaitForChange(timeline, 50, 1, "mousedown");
let newPos = parseInt(scrubberEl.style.left, 10);
is(newPos, 50, "The scrubber moved on mousedown");
@ -32,7 +30,7 @@ add_task(function*() {
"The timeline play button is in its paused state after mousedown");
info("Continue moving the mouse and verify that the scrubber tracks it");
yield synthesizeMouseAndWaitForTimelineChange(timeline, 100, 1, "mousemove");
yield synthesizeInHeaderAndWaitForChange(timeline, 100, 1, "mousemove");
newPos = parseInt(scrubberEl.style.left, 10);
is(newPos, 100, "The scrubber followed the mouse");
@ -44,9 +42,19 @@ add_task(function*() {
EventUtils.synthesizeMouse(timeHeaderEl, 200, 1, {type: "mousemove"}, win);
newPos = parseInt(scrubberEl.style.left, 10);
is(newPos, 100, "The scrubber stopped following the mouse");
info("Try to drag the scrubber handle and check that the scrubber moves");
let onDataChanged = timeline.once("timeline-data-changed");
EventUtils.synthesizeMouse(scrubberHandleEl, 1, 20, {type: "mousedown"}, win);
EventUtils.synthesizeMouse(timeHeaderEl, 0, 0, {type: "mousemove"}, win);
EventUtils.synthesizeMouse(timeHeaderEl, 0, 0, {type: "mouseup"}, win);
yield onDataChanged;
newPos = parseInt(scrubberEl.style.left, 10);
is(newPos, 0, "The scrubber stopped following the mouse");
});
function* synthesizeMouseAndWaitForTimelineChange(timeline, x, y, type) {
function* synthesizeInHeaderAndWaitForChange(timeline, x, y, type) {
let onDataChanged = timeline.once("timeline-data-changed");
EventUtils.synthesizeMouse(timeline.timeHeaderEl, x, y, {type}, timeline.win);
yield onDataChanged;

View File

@ -9,7 +9,7 @@ const {gDevTools} = Cu.import("resource:///modules/devtools/client/framework/gDe
const {require} = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
const promise = require("promise");
const {TargetFactory} = require("devtools/client/framework/target");
const {console} = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
const {console} = Cu.import("resource://gre/modules/Console.jsm", {});
const {ViewHelpers} = Cu.import("resource:///modules/devtools/client/shared/widgets/ViewHelpers.jsm", {});
const DevToolsUtils = require("devtools/shared/DevToolsUtils");

View File

@ -9,7 +9,7 @@ Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource:///modules/devtools/client/shared/widgets/SideMenuWidget.jsm");
Cu.import("resource:///modules/devtools/client/shared/widgets/ViewHelpers.jsm");
Cu.import("resource://gre/modules/devtools/shared/Console.jsm");
Cu.import("resource://gre/modules/Console.jsm");
const { require } = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
const promise = require("promise");

View File

@ -6,7 +6,7 @@ const TEST_BASE_HTTP = "http://example.com/browser/devtools/client/commandline/t
const TEST_BASE_HTTPS = "https://example.com/browser/devtools/client/commandline/test/";
var { require } = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
var { console } = require("resource://gre/modules/devtools/shared/Console.jsm");
var { console } = require("resource://gre/modules/Console.jsm");
var DevToolsUtils = require("devtools/shared/DevToolsUtils");
// Import the GCLI test helper

View File

@ -43,7 +43,7 @@ devtoolsCommandlineHandler.prototype = {
// Load the browser devtools main module as the loader's main module.
Cu.import("resource:///modules/devtools/client/framework/gDevTools.jsm");
let hudservice = require("devtools/client/webconsole/hudservice");
let { console } = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
let { console } = Cu.import("resource://gre/modules/Console.jsm", {});
hudservice.toggleBrowserConsole().then(null, console.error);
} else {
window.focus(); // the Browser Console was already open

View File

@ -14,7 +14,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Task",
"resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/devtools/shared/Console.jsm");
"resource://gre/modules/Console.jsm");
function FontInspector(inspector, window)
{

View File

@ -17,7 +17,7 @@ loader.lazyRequireGetter(this, "TargetFactory", "devtools/client/framework/targe
loader.lazyRequireGetter(this, "Toolbox", "devtools/client/framework/toolbox", true);
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/devtools/shared/Console.jsm");
"resource://gre/modules/Console.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
"resource:///modules/CustomizableUI.jsm");
loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true);

View File

@ -14,7 +14,7 @@ function scopedCuImport(path) {
const {Services} = scopedCuImport("resource://gre/modules/Services.jsm");
const {gDevTools} = scopedCuImport("resource:///modules/devtools/client/framework/gDevTools.jsm");
const {console} = scopedCuImport("resource://gre/modules/devtools/shared/Console.jsm");
const {console} = scopedCuImport("resource://gre/modules/Console.jsm");
const {ScratchpadManager} = scopedCuImport("resource:///modules/devtools/client/scratchpad/scratchpad-manager.jsm");
const {require} = scopedCuImport("resource://gre/modules/devtools/shared/Loader.jsm");

View File

@ -25,7 +25,7 @@ waitForExplicitFinish();
var {require} = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
var {TargetFactory} = require("devtools/client/framework/target");
var {console} = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
var {console} = Cu.import("resource://gre/modules/Console.jsm", {});
var DevToolsUtils = require("devtools/shared/DevToolsUtils");
var promise = require("promise");

View File

@ -12,7 +12,12 @@ const Ci = Components.interfaces;
const {XPCOMUtils} = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
const {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
const {devtools} = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
// Load devtools module lazily.
XPCOMUtils.defineLazyGetter(this, "devtools", function() {
const {devtools} = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
return devtools;
});
// Load JsonView services lazily.
XPCOMUtils.defineLazyGetter(this, "JsonViewService", function() {

View File

@ -7,11 +7,13 @@
"use strict";
const {Cu, Ci, Cc} = require("chrome");
const JsonViewUtils = require("devtools/client/jsonview/utils");
// Constants
const {XPCOMUtils} = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
const {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
const {makeInfallible} = require("devtools/shared/DevToolsUtils");
XPCOMUtils.defineLazyGetter(this, "JsonViewService", function() {
return require("devtools/client/jsonview/utils");
});
/**
* Singleton object that represents the JSON View in-content tool.
@ -19,7 +21,7 @@ const {makeInfallible} = require("devtools/shared/DevToolsUtils");
* DevTools() object from gDevTools.jsm
*/
var JsonView = {
initialize: makeInfallible(function() {
initialize: function() {
// Load JSON converter module. This converter is responsible
// for handling 'application/json' documents and converting
// them into a simple web-app that allows easy inspection
@ -33,12 +35,12 @@ var JsonView = {
// Register for messages coming from the child process.
Services.ppmm.addMessageListener(
"devtools:jsonview:save", this.onSaveListener);
}),
},
destroy: makeInfallible(function() {
destroy: function() {
Services.ppmm.removeMessageListener(
"devtools:jsonview:save", this.onSaveListener);
}),
},
// Message handlers for events from child processes

View File

@ -7,7 +7,7 @@
var Cu = Components.utils;
var {gDevTools} = Cu.import("resource:///modules/devtools/client/framework/gDevTools.jsm", {});
var {require} = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
var {console} = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
var {console} = Cu.import("resource://gre/modules/Console.jsm", {});
var {TargetFactory} = require("devtools/client/framework/target");
var promise = require("promise");
var DevToolsUtils = require("devtools/shared/DevToolsUtils");

View File

@ -10,7 +10,7 @@ var {utils: Cu, interfaces: Ci, classes: Cc} = Components;
Cu.import("resource://gre/modules/Task.jsm");
const {require} = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
Cu.import("resource://gre/modules/devtools/shared/Console.jsm");
Cu.import("resource://gre/modules/Console.jsm");
Cu.import("resource:///modules/devtools/client/shared/widgets/ViewHelpers.jsm");
const {InplaceEditor, editableItem} = require("devtools/client/shared/inplace-editor");

View File

@ -5,7 +5,7 @@
var Cu = Components.utils;
var {require} = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
var {TargetFactory} = require("devtools/client/framework/target");
var {console} = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
var {console} = Cu.import("resource://gre/modules/Console.jsm", {});
var promise = require("promise");
var {getInplaceEditorForSpan: inplaceEditor} = require("devtools/client/shared/inplace-editor");
var clipboard = require("sdk/clipboard");

View File

@ -6,7 +6,7 @@
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
var { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
var { gDevTools } = Cu.import("resource:///modules/devtools/client/framework/gDevTools.jsm", {});
var { console } = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
var { console } = Cu.import("resource://gre/modules/Console.jsm", {});
var { require } = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
var { TargetFactory } = require("devtools/client/framework/target");
var DevToolsUtils = require("devtools/shared/DevToolsUtils");

View File

@ -23,6 +23,7 @@ DIRS += [
'memory',
'netmonitor',
'performance',
'preferences',
'projecteditor',
'promisedebugger',
'responsivedesign',

View File

@ -9,7 +9,7 @@ var { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
var { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
var { require } = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
var { gDevTools } = Cu.import("resource:///modules/devtools/client/framework/gDevTools.jsm", {});
var { console } = require("resource://gre/modules/devtools/shared/Console.jsm");
var { console } = require("resource://gre/modules/Console.jsm");
var { TargetFactory } = require("devtools/client/framework/target");
var Promise = require("promise");
var DevToolsUtils = require("devtools/shared/DevToolsUtils");
@ -291,7 +291,7 @@ function consoleExecute (console, method, val) {
ui.on("new-messages", handler);
jsterm.execute(message);
let { console: c } = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
let { console: c } = Cu.import("resource://gre/modules/Console.jsm", {});
function handler (event, messages) {
for (let msg of messages) {
if (msg.response._message === message) {

View File

@ -6,9 +6,8 @@ var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
var { require } = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
var { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
var { console } = require("resource://gre/modules/devtools/shared/Console.jsm");
var { console } = require("resource://gre/modules/Console.jsm");
const RecordingUtils = require("devtools/shared/performance/recording-utils");
const PLATFORM_DATA_PREF = "devtools.performance.ui.show-platform-data";
/**

View File

@ -0,0 +1,325 @@
# -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
// Developer edition promo preferences
pref("devtools.devedition.promo.shown", false);
pref("devtools.devedition.promo.url", "https://www.mozilla.org/firefox/developer/?utm_source=firefox-dev-tools&utm_medium=firefox-browser&utm_content=betadoorhanger");
// Only potentially show in beta release
#if MOZ_UPDATE_CHANNEL == beta
pref("devtools.devedition.promo.enabled", true);
#else
pref("devtools.devedition.promo.enabled", false);
#endif
// Disable the error console
pref("devtools.errorconsole.enabled", false);
// Developer toolbar preferences
pref("devtools.toolbar.enabled", true);
pref("devtools.toolbar.visible", false);
// Enable the app manager
pref("devtools.appmanager.enabled", true);
pref("devtools.appmanager.lastTab", "help");
pref("devtools.appmanager.manifestEditor.enabled", true);
// Enable DevTools WebIDE by default
pref("devtools.webide.enabled", true);
// Toolbox preferences
pref("devtools.toolbox.footer.height", 250);
pref("devtools.toolbox.sidebar.width", 500);
pref("devtools.toolbox.host", "bottom");
pref("devtools.toolbox.previousHost", "side");
pref("devtools.toolbox.selectedTool", "webconsole");
pref("devtools.toolbox.toolbarSpec", '["splitconsole", "paintflashing toggle","tilt toggle","scratchpad","resize toggle","eyedropper","screenshot --fullpage", "rulers", "measure"]');
pref("devtools.toolbox.sideEnabled", true);
pref("devtools.toolbox.zoomValue", "1");
pref("devtools.toolbox.splitconsoleEnabled", false);
pref("devtools.toolbox.splitconsoleHeight", 100);
// Toolbox Button preferences
pref("devtools.command-button-pick.enabled", true);
pref("devtools.command-button-frames.enabled", true);
pref("devtools.command-button-splitconsole.enabled", true);
pref("devtools.command-button-paintflashing.enabled", false);
pref("devtools.command-button-tilt.enabled", false);
pref("devtools.command-button-scratchpad.enabled", false);
pref("devtools.command-button-responsive.enabled", true);
pref("devtools.command-button-eyedropper.enabled", false);
pref("devtools.command-button-screenshot.enabled", false);
pref("devtools.command-button-rulers.enabled", false);
pref("devtools.command-button-measure.enabled", false);
// Inspector preferences
// Enable the Inspector
pref("devtools.inspector.enabled", true);
// What was the last active sidebar in the inspector
pref("devtools.inspector.activeSidebar", "ruleview");
pref("devtools.inspector.remote", false);
// Collapse pseudo-elements by default in the rule-view
pref("devtools.inspector.show_pseudo_elements", false);
// The default size for image preview tooltips in the rule-view/computed-view/markup-view
pref("devtools.inspector.imagePreviewTooltipSize", 300);
// Enable user agent style inspection in rule-view
pref("devtools.inspector.showUserAgentStyles", false);
// Show all native anonymous content (like controls in <video> tags)
pref("devtools.inspector.showAllAnonymousContent", false);
// Enable the MDN docs tooltip
pref("devtools.inspector.mdnDocsTooltip.enabled", true);
// DevTools default color unit
pref("devtools.defaultColorUnit", "authored");
// Enable the Responsive UI tool
pref("devtools.responsiveUI.no-reload-notification", false);
// Enable the Debugger
pref("devtools.debugger.enabled", true);
pref("devtools.debugger.chrome-debugging-host", "localhost");
pref("devtools.debugger.chrome-debugging-port", 6080);
pref("devtools.debugger.remote-host", "localhost");
pref("devtools.debugger.remote-timeout", 20000);
pref("devtools.debugger.pause-on-exceptions", false);
pref("devtools.debugger.ignore-caught-exceptions", true);
pref("devtools.debugger.source-maps-enabled", true);
pref("devtools.debugger.pretty-print-enabled", true);
pref("devtools.debugger.auto-pretty-print", false);
pref("devtools.debugger.auto-black-box", true);
pref("devtools.debugger.workers", false);
pref("devtools.debugger.promise", false);
// The default Debugger UI settings
pref("devtools.debugger.ui.panes-workers-and-sources-width", 200);
pref("devtools.debugger.ui.panes-instruments-width", 300);
pref("devtools.debugger.ui.panes-visible-on-startup", false);
pref("devtools.debugger.ui.variables-sorting-enabled", true);
pref("devtools.debugger.ui.variables-only-enum-visible", false);
pref("devtools.debugger.ui.variables-searchbox-visible", false);
// Enable the Memory tools
pref("devtools.memory.enabled", false);
// Enable the Performance tools
pref("devtools.performance.enabled", true);
// The default Performance UI settings
pref("devtools.performance.memory.sample-probability", "0.05");
// Can't go higher than this without causing internal allocation overflows while
// serializing the allocations data over the RDP.
pref("devtools.performance.memory.max-log-length", 125000);
pref("devtools.performance.timeline.hidden-markers",
"[\"Composite\",\"CompositeForwardTransaction\"]");
pref("devtools.performance.profiler.buffer-size", 10000000);
pref("devtools.performance.profiler.sample-frequency-khz", 1);
pref("devtools.performance.ui.invert-call-tree", true);
pref("devtools.performance.ui.invert-flame-graph", false);
pref("devtools.performance.ui.flatten-tree-recursion", true);
pref("devtools.performance.ui.show-platform-data", false);
pref("devtools.performance.ui.show-idle-blocks", true);
pref("devtools.performance.ui.enable-memory", false);
pref("devtools.performance.ui.enable-allocations", false);
pref("devtools.performance.ui.enable-framerate", true);
pref("devtools.performance.ui.enable-jit-optimizations", false);
pref("devtools.performance.ui.show-triggers-for-gc-types",
"TOO_MUCH_MALLOC ALLOC_TRIGGER LAST_DITCH EAGER_ALLOC_TRIGGER");
// Temporary pref disabling memory flame views
// TODO remove once we have flame charts via bug 1148663
pref("devtools.performance.ui.enable-memory-flame", false);
// Enable experimental options in the UI only in Nightly
#if defined(NIGHTLY_BUILD)
pref("devtools.performance.ui.experimental", true);
#else
pref("devtools.performance.ui.experimental", false);
#endif
// The default cache UI setting
pref("devtools.cache.disabled", false);
// The default service workers UI setting
pref("devtools.serviceWorkers.testing.enabled", false);
// Enable the Network Monitor
pref("devtools.netmonitor.enabled", true);
// The default Network Monitor UI settings
pref("devtools.netmonitor.panes-network-details-width", 550);
pref("devtools.netmonitor.panes-network-details-height", 450);
pref("devtools.netmonitor.statistics", true);
pref("devtools.netmonitor.filters", "[\"all\"]");
// The default Network monitor HAR export setting
pref("devtools.netmonitor.har.defaultLogDir", "");
pref("devtools.netmonitor.har.defaultFileName", "Archive %y-%m-%d %H-%M-%S");
pref("devtools.netmonitor.har.jsonp", false);
pref("devtools.netmonitor.har.jsonpCallback", "");
pref("devtools.netmonitor.har.includeResponseBodies", true);
pref("devtools.netmonitor.har.compress", false);
pref("devtools.netmonitor.har.forceExport", false);
pref("devtools.netmonitor.har.pageLoadedTimeout", 1500);
pref("devtools.netmonitor.har.enableAutoExportToFile", false);
// Enable the Tilt inspector
pref("devtools.tilt.enabled", true);
pref("devtools.tilt.intro_transition", true);
pref("devtools.tilt.outro_transition", true);
// Scratchpad settings
// - recentFileMax: The maximum number of recently-opened files
// stored. Setting this preference to 0 will not
// clear any recent files, but rather hide the
// 'Open Recent'-menu.
// - lineNumbers: Whether to show line numbers or not.
// - wrapText: Whether to wrap text or not.
// - showTrailingSpace: Whether to highlight trailing space or not.
// - editorFontSize: Editor font size configuration.
// - enableAutocompletion: Whether to enable JavaScript autocompletion.
pref("devtools.scratchpad.recentFilesMax", 10);
pref("devtools.scratchpad.lineNumbers", true);
pref("devtools.scratchpad.wrapText", false);
pref("devtools.scratchpad.showTrailingSpace", false);
pref("devtools.scratchpad.editorFontSize", 12);
pref("devtools.scratchpad.enableAutocompletion", true);
// Enable the Storage Inspector
pref("devtools.storage.enabled", false);
// Enable the Style Editor.
pref("devtools.styleeditor.enabled", true);
pref("devtools.styleeditor.source-maps-enabled", true);
pref("devtools.styleeditor.autocompletion-enabled", true);
pref("devtools.styleeditor.showMediaSidebar", true);
pref("devtools.styleeditor.mediaSidebarWidth", 238);
pref("devtools.styleeditor.navSidebarWidth", 245);
pref("devtools.styleeditor.transitions", true);
// Enable the Shader Editor.
pref("devtools.shadereditor.enabled", false);
// Enable the Canvas Debugger.
pref("devtools.canvasdebugger.enabled", false);
// Enable the Web Audio Editor
pref("devtools.webaudioeditor.enabled", false);
// Web Audio Editor Inspector Width should be a preference
pref("devtools.webaudioeditor.inspectorWidth", 300);
// Default theme ("dark" or "light")
#ifdef MOZ_DEV_EDITION
sticky_pref("devtools.theme", "dark");
#else
sticky_pref("devtools.theme", "light");
#endif
// Remember the Web Console filters
pref("devtools.webconsole.filter.network", true);
pref("devtools.webconsole.filter.networkinfo", false);
pref("devtools.webconsole.filter.netwarn", true);
pref("devtools.webconsole.filter.netxhr", false);
pref("devtools.webconsole.filter.csserror", true);
pref("devtools.webconsole.filter.cssparser", false);
pref("devtools.webconsole.filter.csslog", false);
pref("devtools.webconsole.filter.exception", true);
pref("devtools.webconsole.filter.jswarn", true);
pref("devtools.webconsole.filter.jslog", false);
pref("devtools.webconsole.filter.error", true);
pref("devtools.webconsole.filter.warn", true);
pref("devtools.webconsole.filter.info", true);
pref("devtools.webconsole.filter.log", true);
pref("devtools.webconsole.filter.secerror", true);
pref("devtools.webconsole.filter.secwarn", true);
pref("devtools.webconsole.filter.serviceworkers", false);
pref("devtools.webconsole.filter.sharedworkers", false);
pref("devtools.webconsole.filter.windowlessworkers", false);
pref("devtools.webconsole.filter.servererror", false);
pref("devtools.webconsole.filter.serverwarn", false);
pref("devtools.webconsole.filter.serverinfo", false);
pref("devtools.webconsole.filter.serverlog", false);
// Remember the Browser Console filters
pref("devtools.browserconsole.filter.network", true);
pref("devtools.browserconsole.filter.networkinfo", false);
pref("devtools.browserconsole.filter.netwarn", true);
pref("devtools.browserconsole.filter.netxhr", false);
pref("devtools.browserconsole.filter.csserror", true);
pref("devtools.browserconsole.filter.cssparser", false);
pref("devtools.browserconsole.filter.csslog", false);
pref("devtools.browserconsole.filter.exception", true);
pref("devtools.browserconsole.filter.jswarn", true);
pref("devtools.browserconsole.filter.jslog", true);
pref("devtools.browserconsole.filter.error", true);
pref("devtools.browserconsole.filter.warn", true);
pref("devtools.browserconsole.filter.info", true);
pref("devtools.browserconsole.filter.log", true);
pref("devtools.browserconsole.filter.secerror", true);
pref("devtools.browserconsole.filter.secwarn", true);
pref("devtools.browserconsole.filter.serviceworkers", true);
pref("devtools.browserconsole.filter.sharedworkers", true);
pref("devtools.browserconsole.filter.windowlessworkers", true);
pref("devtools.browserconsole.filter.servererror", false);
pref("devtools.browserconsole.filter.serverwarn", false);
pref("devtools.browserconsole.filter.serverinfo", false);
pref("devtools.browserconsole.filter.serverlog", false);
// Text size in the Web Console. Use 0 for the system default size.
pref("devtools.webconsole.fontSize", 0);
// Max number of inputs to store in web console history.
pref("devtools.webconsole.inputHistoryCount", 50);
// Persistent logging: |true| if you want the Web Console to keep all of the
// logged messages after reloading the page, |false| if you want the output to
// be cleared each time page navigation happens.
pref("devtools.webconsole.persistlog", false);
// Web Console timestamp: |true| if you want the logs and instructions
// in the Web Console to display a timestamp, or |false| to not display
// any timestamps.
pref("devtools.webconsole.timestampMessages", false);
// The number of lines that are displayed in the web console for the Net,
// CSS, JS and Web Developer categories. These defaults should be kept in sync
// with DEFAULT_LOG_LIMIT in the webconsole frontend.
pref("devtools.hud.loglimit.network", 1000);
pref("devtools.hud.loglimit.cssparser", 1000);
pref("devtools.hud.loglimit.exception", 1000);
pref("devtools.hud.loglimit.console", 1000);
// By how many times eyedropper will magnify pixels
pref("devtools.eyedropper.zoom", 6);
// The developer tools editor configuration:
// - tabsize: how many spaces to use when a Tab character is displayed.
// - expandtab: expand Tab characters to spaces.
// - keymap: which keymap to use (can be 'default', 'emacs' or 'vim')
// - autoclosebrackets: whether to permit automatic bracket/quote closing.
// - detectindentation: whether to detect the indentation from the file
// - enableCodeFolding: Whether to enable code folding or not.
pref("devtools.editor.tabsize", 2);
pref("devtools.editor.expandtab", true);
pref("devtools.editor.keymap", "default");
pref("devtools.editor.autoclosebrackets", true);
pref("devtools.editor.detectindentation", true);
pref("devtools.editor.enableCodeFolding", true);
pref("devtools.editor.autocomplete", true);
// Enable the Font Inspector
pref("devtools.fontinspector.enabled", true);
// Pref to store the browser version at the time of a telemetry ping for an
// opened developer tool. This allows us to ping telemetry just once per browser
// version for each user.
pref("devtools.telemetry.tools.opened.version", "{}");
// Enable the JSON View tool (an inspector for application/json documents)
#ifdef MOZ_DEV_EDITION
pref("devtools.jsonview.enabled", true);
#else
pref("devtools.jsonview.enabled", false);
#endif

View File

@ -0,0 +1,9 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
JS_PREFERENCE_FILES += [
'devtools.js',
]

View File

@ -5,7 +5,7 @@
var Cu = Components.utils;
const {require} = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
const {TargetFactory} = require("devtools/client/framework/target");
const {console} = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
const {console} = Cu.import("resource://gre/modules/Console.jsm", {});
const promise = require("promise");
const {FileUtils} = Cu.import("resource://gre/modules/FileUtils.jsm", {});
const {NetUtil} = Cu.import("resource://gre/modules/NetUtil.jsm", {});

View File

@ -6,7 +6,7 @@
const {NetUtil} = Cu.import("resource://gre/modules/NetUtil.jsm", {});
const {FileUtils} = Cu.import("resource://gre/modules/FileUtils.jsm", {});
const {console} = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
const {console} = Cu.import("resource://gre/modules/Console.jsm", {});
const {require} = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
const {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
const DevToolsUtils = require("devtools/shared/DevToolsUtils");

View File

@ -10,7 +10,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource:///modules/devtools/client/shared/widgets/SideMenuWidget.jsm");
Cu.import("resource:///modules/devtools/client/shared/widgets/ViewHelpers.jsm");
Cu.import("resource://gre/modules/devtools/shared/Console.jsm");
Cu.import("resource://gre/modules/Console.jsm");
const {require} = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
const promise = require("promise");

View File

@ -20,7 +20,7 @@ const promise = require("promise");
const Node = Ci.nsIDOMNode;
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/devtools/shared/Console.jsm");
"resource://gre/modules/Console.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
"resource://gre/modules/PluralForm.jsm");

View File

@ -4,7 +4,7 @@
var {require} = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
var {TargetFactory} = require("devtools/client/framework/target");
var {console} = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
var {console} = Cu.import("resource://gre/modules/Console.jsm", {});
var {gDevTools} = Cu.import("resource:///modules/devtools/client/framework/gDevTools.jsm", {});
const {DOMHelpers} = Cu.import("resource:///modules/devtools/client/shared/DOMHelpers.jsm", {});
const {Hosts} = require("devtools/client/framework/toolbox-hosts");

View File

@ -14,7 +14,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "EventEmitter",
"resource://gre/modules/devtools/shared/event-emitter.js");
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/devtools/shared/Console.jsm");
"resource://gre/modules/Console.jsm");
this.EXPORTED_SYMBOLS = ["AbstractTreeItem"];

View File

@ -27,7 +27,7 @@ XPCOMUtils.defineLazyGetter(this, "VARIABLES_SORTING_ENABLED", () =>
);
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/devtools/shared/Console.jsm");
"resource://gre/modules/Console.jsm");
const MAX_LONG_STRING_LENGTH = 200000;
const MAX_PROPERTY_ITEMS = 2000;

View File

@ -4,7 +4,7 @@
"use strict";
var { console } = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
var { console } = Cu.import("resource://gre/modules/Console.jsm", {});
var { require } = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
var { TargetFactory } = require("devtools/client/framework/target");
var promise = require("promise");

View File

@ -28,7 +28,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
const { require } = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
const { PrefObserver, PREF_ORIG_SOURCES } = require("devtools/client/styleeditor/utils");
const csscoverage = require("devtools/server/actors/csscoverage");
const console = require("resource://gre/modules/devtools/shared/Console.jsm").console;
const console = require("resource://gre/modules/Console.jsm").console;
const promise = require("promise");
const LOAD_ERROR = "error-load";

View File

@ -23,7 +23,7 @@ Cu.import("resource://gre/modules/Services.jsm");
const PROPERTIES_URL = "chrome://browser/locale/devtools/styleeditor.properties";
const {require} = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
const console = require("resource://gre/modules/devtools/shared/Console.jsm").console;
const console = require("resource://gre/modules/Console.jsm").console;
const gStringBundle = Services.strings.createBundle(PROPERTIES_URL);

View File

@ -15,7 +15,7 @@ const {require} = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm",
const Editor = require("devtools/client/sourceeditor/editor");
const promise = require("promise");
const {CssLogic} = require("devtools/shared/styleinspector/css-logic");
const {console} = require("resource://gre/modules/devtools/shared/Console.jsm");
const {console} = require("resource://gre/modules/Console.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/FileUtils.jsm");

View File

@ -9,7 +9,7 @@ const TEST_HOST = 'mochi.test:8888';
var {require} = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
var {TargetFactory} = require("devtools/client/framework/target");
var {console} = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
var {console} = Cu.import("resource://gre/modules/Console.jsm", {});
var promise = require("promise");
var DevToolsUtils = require("devtools/shared/DevToolsUtils");

View File

@ -16,7 +16,7 @@ var promise = require("promise");
var {editableField, getInplaceEditorForSpan: inplaceEditor} =
require("devtools/client/shared/inplace-editor");
var {console} =
Components.utils.import("resource://gre/modules/devtools/shared/Console.jsm", {});
Components.utils.import("resource://gre/modules/Console.jsm", {});
// All tests are asynchronous
waitForExplicitFinish();

View File

@ -201,6 +201,19 @@ body {
border-right: 5px solid transparent;
}
/* The scrubber handle is a transparent element displayed on top of the scrubber
line that allows users to drag it */
.animation-timeline .scrubber .scrubber-handle {
position: absolute;
height: 100%;
top: 0;
/* Make it thick enough for easy dragging */
width: 6px;
right: -3px;
cursor: col-resize;
pointer-events: all;
}
.animation-timeline .time-header {
margin-left: var(--timeline-sidebar-width);
min-height: var(--toolbar-height);

View File

@ -12,7 +12,7 @@ Cu.import("resource:///modules/devtools/client/framework/gDevTools.jsm");
const { loader, require } = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
var { console } = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
var { console } = Cu.import("resource://gre/modules/Console.jsm", {});
var { EventTarget } = require("sdk/event/target");
const { Task } = Cu.import("resource://gre/modules/Task.jsm", {});

View File

@ -21,7 +21,7 @@ add_task(function*() {
let storage = consoleStorage.getService(Ci.nsIConsoleAPIStorage);
storage.clearEvents();
let {console} = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
let {console} = Cu.import("resource://gre/modules/Console.jsm", {});
console.log("bug861338-log-cached");
let hud = yield HUDService.toggleBrowserConsole();
@ -153,7 +153,7 @@ add_task(function* testPrefix() {
let storage = consoleStorage.getService(Ci.nsIConsoleAPIStorage);
storage.clearEvents();
let {ConsoleAPI} = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
let {ConsoleAPI} = Cu.import("resource://gre/modules/Console.jsm", {});
let consoleOptions = {
maxLogLevel: "error",
prefix: "Log Prefix",
@ -184,7 +184,7 @@ add_task(function* testMaxLogLevelPrefMissing() {
let storage = consoleStorage.getService(Ci.nsIConsoleAPIStorage);
storage.clearEvents();
let {ConsoleAPI} = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
let {ConsoleAPI} = Cu.import("resource://gre/modules/Console.jsm", {});
let consoleOptions = {
maxLogLevel: "error",
maxLogLevelPref: "testing.maxLogLevel",
@ -223,7 +223,7 @@ add_task(function* testMaxLogLevelPref() {
let storage = consoleStorage.getService(Ci.nsIConsoleAPIStorage);
storage.clearEvents();
let {ConsoleAPI} = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
let {ConsoleAPI} = Cu.import("resource://gre/modules/Console.jsm", {});
let consoleOptions = {
maxLogLevel: "error",
maxLogLevelPref: "testing.maxLogLevel",

View File

@ -6,7 +6,7 @@
"use strict";
var {gDevTools} = Cu.import("resource:///modules/devtools/client/framework/gDevTools.jsm", {});
var {console} = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
var {console} = Cu.import("resource://gre/modules/Console.jsm", {});
var {Task} = Cu.import("resource://gre/modules/Task.jsm", {});
var {require} = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
var promise = require("promise");

View File

@ -7,7 +7,7 @@ var Ci = Components.interfaces;
var Cu = Components.utils;
Cu.import("resource://gre/modules/Services.jsm");
const {console} = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
const {console} = Cu.import("resource://gre/modules/Console.jsm", {});
const {require} = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
const {DebuggerClient} = require("devtools/shared/client/main");
const {DebuggerServer} = require("devtools/server/main");

View File

@ -185,7 +185,7 @@ function tryImport(url) {
}
tryImport("resource://gre/modules/devtools/shared/Loader.jsm");
tryImport("resource://gre/modules/devtools/shared/Console.jsm");
tryImport("resource://gre/modules/Console.jsm");
function testExceptionHook(ex) {
try {

View File

@ -393,7 +393,7 @@ DevToolsLoader.prototype = {
};
// Lazy define console in order to load Console.jsm only when it is used
XPCOMUtils.defineLazyGetter(this._provider.globals, "console", () => {
return Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {}).console;
return Cu.import("resource://gre/modules/Console.jsm", {}).console;
});
this._provider.load();

View File

@ -17,7 +17,7 @@
this.EXPORTED_SYMBOLS = [ "template" ];
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/devtools/shared/Console.jsm");
"resource://gre/modules/Console.jsm");
'use strict';

View File

@ -35,7 +35,6 @@ XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
DevToolsModules(
'async-storage.js',
'async-utils.js',
'Console.jsm',
'content-observer.js',
'css-color.js',
'deprecated-sync-thenables.js',

View File

@ -9,7 +9,7 @@ const { require } = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm
this.sourceMap = require("source-map");
this.acorn = require("acorn/acorn");
this.prettyFast = require("devtools/shared/pretty-fast/pretty-fast");
const { console } = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
const { console } = Cu.import("resource://gre/modules/Console.jsm", {});
// Register a console listener, so console messages don't just disappear
// into the ether.

View File

@ -17,8 +17,8 @@ const WARNING_PREF = "devtools.migration.warnings";
if (Services.prefs.getBoolPref(WARNING_PREF)) {
const { Deprecated } = Cu.import("resource://gre/modules/Deprecated.jsm", {});
Deprecated.warning("This path to Console.jsm is deprecated. Please use " +
"Cu.import(\"resource://gre/modules/devtools/shared/" +
"Console.jsm\") to load this module.",
"Cu.import(\"resource://gre/modules/Console.jsm\") " +
"to load this module.",
"https://bugzil.la/912121");
}
@ -28,7 +28,7 @@ this.EXPORTED_SYMBOLS = [
];
const module =
Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
Cu.import("resource://gre/modules/Console.jsm", {});
for (let symbol of this.EXPORTED_SYMBOLS) {
this[symbol] = module[symbol];

View File

@ -15,3 +15,8 @@ EXTRA_JS_MODULES.devtools += [
'Loader.jsm',
'Simulator.jsm',
]
# Extra compatibility layer for transitional URL used in middle of fx44 cycle
EXTRA_JS_MODULES.devtools.shared += [
'Console.jsm',
]

View File

@ -1,7 +1,7 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const { console, ConsoleAPI } = Cu.import("resource://gre/modules/devtools/shared/Console.jsm");
const { console, ConsoleAPI } = Cu.import("resource://gre/modules/Console.jsm");
const { ConsoleAPIListener } = require("devtools/shared/webconsole/utils");

View File

@ -11,7 +11,7 @@ Cu.import("resource://gre/modules/Services.jsm");
const {Task} = Cu.import("resource://gre/modules/Task.jsm", {});
// This gives logging to stdout for tests
var {console} = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
var {console} = Cu.import("resource://gre/modules/Console.jsm", {});
var {require} = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
var WebConsoleUtils = require("devtools/shared/webconsole/utils").Utils;

View File

@ -18,7 +18,7 @@ let expectedConsoleCalls = [];
function doConsoleCalls(aState)
{
let { ConsoleAPI } = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {});
let { ConsoleAPI } = Cu.import("resource://gre/modules/Console.jsm", {});
let console = new ConsoleAPI({
innerID: window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils)

View File

@ -13,7 +13,7 @@
const { require } = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
this.isWorker = false;
this.Promise = Cu.import("resource://gre/modules/Promise.jsm", {}).Promise;
this.console = Cu.import("resource://gre/modules/devtools/shared/Console.jsm", {}).console;
this.console = Cu.import("resource://gre/modules/Console.jsm", {}).console;
factory.call(
this, require, this, { exports: this },
{ Cc, Ci, Cu }, ChromeWorker, null

View File

@ -419,16 +419,26 @@ GetDataInfo(const nsACString& aUri)
}
DataInfo* res;
nsCString uriIgnoringRef;
int32_t hashPos = aUri.FindChar('#');
if (hashPos < 0) {
uriIgnoringRef = aUri;
// Let's remove any fragment and query from this URI.
int32_t hasFragmentPos = aUri.FindChar('#');
int32_t hasQueryPos = aUri.FindChar('?');
int32_t pos = -1;
if (hasFragmentPos >= 0 && hasQueryPos >= 0) {
pos = std::min(hasFragmentPos, hasQueryPos);
} else if (hasFragmentPos >= 0) {
pos = hasFragmentPos;
} else {
pos = hasQueryPos;
}
else {
uriIgnoringRef = StringHead(aUri, hashPos);
if (pos < 0) {
gDataTable->Get(aUri, &res);
} else {
gDataTable->Get(StringHead(aUri, pos), &res);
}
gDataTable->Get(uriIgnoringRef, &res);
return res;
}

View File

@ -383,6 +383,7 @@ skip-if = buildapp == 'b2g' || (android_version == '18' && debug) # b2g(flaky on
support-files = test_XHR_timeout.js
[test_base.xhtml]
[test_blobconstructor.html]
[test_blob_fragment_and_query.html]
[test_bug166235.html]
skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # b2g(clipboard undefined) b2g-debug(clipboard undefined) b2g-desktop(clipboard undefined)
[test_bug199959.html]

View File

@ -0,0 +1,48 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Test for Blob URI with fragments</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<script>
var blob = new Blob(['hello world']);
ok(blob, "We have a blob.");
var url = URL.createObjectURL(blob);
ok(url, "We have a URI");
var tests = [
url,
url + "?aa",
url + "#bb",
url + "?cc#dd",
url + "#ee?ff",
];
function runTest() {
if (!tests.length) {
SimpleTest.finish();
return;
}
var test = tests.shift();
var xhr = new XMLHttpRequest();
xhr.open('GET', test);
xhr.onload = function() {
is(xhr.responseText, 'hello world', 'URL: ' + test);
runTest();
}
xhr.send();
}
SimpleTest.waitForExplicitFinish();
runTest();
</script>
</body>
</html>

View File

@ -2758,17 +2758,12 @@ nsresult HTMLMediaElement::InitializeDecoderAsClone(MediaDecoder* aOriginal)
MediaResource* originalResource = aOriginal->GetResource();
if (!originalResource)
return NS_ERROR_FAILURE;
nsRefPtr<MediaDecoder> decoder = aOriginal->Clone();
nsRefPtr<MediaDecoder> decoder = aOriginal->Clone(this);
if (!decoder)
return NS_ERROR_FAILURE;
LOG(LogLevel::Debug, ("%p Cloned decoder %p from %p", this, decoder.get(), aOriginal));
if (!decoder->Init(this)) {
LOG(LogLevel::Debug, ("%p Failed to init cloned decoder %p", this, decoder.get()));
return NS_ERROR_FAILURE;
}
decoder->SetMediaSeekable(aOriginal->IsMediaSeekable());
nsRefPtr<MediaResource> resource = originalResource->CloneData(decoder);

View File

@ -32,7 +32,7 @@ const orientationTypes = new Set(['any', 'natural', 'landscape', 'portrait',
'portrait-primary', 'portrait-secondary', 'landscape-primary',
'landscape-secondary'
]);
Cu.import('resource://gre/modules/devtools/shared/Console.jsm');
Cu.import('resource://gre/modules/Console.jsm');
// ValueExtractor is used by the various processors to get values
// from the manifest and to report errors.
Cu.import('resource://gre/modules/ValueExtractor.jsm');

View File

@ -586,33 +586,33 @@ InstantiateDecoder(const nsACString& aType, MediaDecoderOwner* aOwner)
#ifdef MOZ_FMP4
if (IsMP4SupportedType(aType)) {
decoder = new MP4Decoder();
decoder = new MP4Decoder(aOwner);
return decoder.forget();
}
#endif
if (IsMP3SupportedType(aType)) {
decoder = new MP3Decoder();
decoder = new MP3Decoder(aOwner);
return decoder.forget();
}
#ifdef MOZ_GSTREAMER
if (IsGStreamerSupportedType(aType)) {
decoder = new GStreamerDecoder();
decoder = new GStreamerDecoder(aOwner);
return decoder.forget();
}
#endif
#ifdef MOZ_RAW
if (IsRawType(aType)) {
decoder = new RawDecoder();
decoder = new RawDecoder(aOwner);
return decoder.forget();
}
#endif
if (IsOggType(aType)) {
decoder = new OggDecoder();
decoder = new OggDecoder(aOwner);
return decoder.forget();
}
#ifdef MOZ_WAVE
if (IsWaveType(aType)) {
decoder = new WaveDecoder();
decoder = new WaveDecoder(aOwner);
return decoder.forget();
}
#endif
@ -635,10 +635,10 @@ InstantiateDecoder(const nsACString& aType, MediaDecoderOwner* aOwner)
}
#if ANDROID_VERSION >= 18
decoder = MediaDecoder::IsOmxAsyncEnabled()
? static_cast<MediaDecoder*>(new MediaCodecDecoder())
: static_cast<MediaDecoder*>(new MediaOmxDecoder());
? static_cast<MediaDecoder*>(new MediaCodecDecoder(aOwner))
: static_cast<MediaDecoder*>(new MediaOmxDecoder(aOwner));
#else
decoder = new MediaOmxDecoder();
decoder = new MediaOmxDecoder(aOwner);
#endif
return decoder.forget();
}
@ -647,10 +647,10 @@ InstantiateDecoder(const nsACString& aType, MediaDecoderOwner* aOwner)
if (IsRtspSupportedType(aType)) {
#if ANDROID_VERSION >= 18
decoder = MediaDecoder::IsOmxAsyncEnabled()
? static_cast<MediaDecoder*>(new RtspMediaCodecDecoder())
: static_cast<MediaDecoder*>(new RtspOmxDecoder());
? static_cast<MediaDecoder*>(new RtspMediaCodecDecoder(aOwner))
: static_cast<MediaDecoder*>(new RtspOmxDecoder(aOwner));
#else
decoder = new RtspOmxDecoder();
decoder = new RtspOmxDecoder(aOwner);
#endif
return decoder.forget();
}
@ -658,25 +658,25 @@ InstantiateDecoder(const nsACString& aType, MediaDecoderOwner* aOwner)
#ifdef MOZ_ANDROID_OMX
if (MediaDecoder::IsAndroidMediaEnabled() &&
EnsureAndroidMediaPluginHost()->FindDecoder(aType, nullptr)) {
decoder = new AndroidMediaDecoder(aType);
decoder = new AndroidMediaDecoder(aOwner, aType);
return decoder.forget();
}
#endif
if (DecoderTraits::IsWebMType(aType)) {
decoder = new WebMDecoder();
decoder = new WebMDecoder(aOwner);
return decoder.forget();
}
#ifdef MOZ_DIRECTSHOW
// Note: DirectShow should come before WMF, so that we prefer DirectShow's
// MP3 support over WMF's.
if (IsDirectShowSupportedType(aType)) {
decoder = new DirectShowDecoder();
decoder = new DirectShowDecoder(aOwner);
return decoder.forget();
}
#endif
#ifdef MOZ_APPLEMEDIA
if (IsAppleMediaSupportedType(aType)) {
decoder = new AppleDecoder();
decoder = new AppleDecoder(aOwner);
return decoder.forget();
}
#endif
@ -689,11 +689,7 @@ already_AddRefed<MediaDecoder>
DecoderTraits::CreateDecoder(const nsACString& aType, MediaDecoderOwner* aOwner)
{
MOZ_ASSERT(NS_IsMainThread());
nsRefPtr<MediaDecoder> decoder(InstantiateDecoder(aType, aOwner));
NS_ENSURE_TRUE(decoder != nullptr, nullptr);
NS_ENSURE_TRUE(decoder->Init(aOwner), nullptr);
return decoder.forget();
return InstantiateDecoder(aType, aOwner);
}
/* static */

View File

@ -15,11 +15,11 @@
namespace mozilla {
MediaDecoder*
MP3Decoder::Clone() {
MP3Decoder::Clone(MediaDecoderOwner* aOwner) {
if (!IsEnabled()) {
return nullptr;
}
return new MP3Decoder();
return new MP3Decoder(aOwner);
}
MediaDecoderStateMachine*

View File

@ -13,7 +13,8 @@ namespace mozilla {
class MP3Decoder : public MediaDecoder {
public:
// MediaDecoder interface.
MediaDecoder* Clone() override;
explicit MP3Decoder(MediaDecoderOwner* aOwner) : MediaDecoder(aOwner) {}
MediaDecoder* Clone(MediaDecoderOwner* aOwner) override;
MediaDecoderStateMachine* CreateStateMachine() override;
// Returns true if the MP3 backend is preffed on, and we're running on a

View File

@ -348,7 +348,7 @@ MediaDecoder::IsInfinite()
return mInfiniteStream;
}
MediaDecoder::MediaDecoder()
MediaDecoder::MediaDecoder(MediaDecoderOwner* aOwner)
: mWatchManager(this, AbstractThread::MainThread())
, mDormantSupported(false)
, mLogicalPosition(0.0)
@ -358,7 +358,8 @@ MediaDecoder::MediaDecoder()
#endif
, mIgnoreProgressData(false)
, mInfiniteStream(false)
, mOwner(nullptr)
, mOwner(aOwner)
, mVideoFrameContainer(aOwner->GetVideoFrameContainer())
, mPlaybackStatistics(new MediaChannelStatistics())
, mPinnedForSeek(false)
, mShuttingDown(false)
@ -441,16 +442,8 @@ MediaDecoder::MediaDecoder()
// mIgnoreProgressData
mWatchManager.Watch(mLogicallySeeking, &MediaDecoder::SeekingChanged);
}
bool
MediaDecoder::Init(MediaDecoderOwner* aOwner)
{
MOZ_ASSERT(NS_IsMainThread());
mOwner = aOwner;
mVideoFrameContainer = aOwner->GetVideoFrameContainer();
MediaShutdownManager::Instance().Register(this);
return true;
}
void

View File

@ -299,24 +299,18 @@ public:
// Must be called exactly once, on the main thread, during startup.
static void InitStatics();
MediaDecoder();
explicit MediaDecoder(MediaDecoderOwner* aOwner);
// Reset the decoder and notify the media element that
// server connection is closed.
virtual void ResetConnectionState();
// Create a new decoder of the same type as this one.
// Subclasses must implement this.
virtual MediaDecoder* Clone() = 0;
virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) = 0;
// Create a new state machine to run this decoder.
// Subclasses must implement this.
virtual MediaDecoderStateMachine* CreateStateMachine() = 0;
// Call on the main thread only.
// Perform any initialization required for the decoder.
// Return true on successful initialisation, false
// on failure.
virtual bool Init(MediaDecoderOwner* aOwner);
// Cleanup internal data structures. Must be called on the main
// thread by the owning object before that object disposes of this object.
virtual void Shutdown();

View File

@ -10,7 +10,9 @@
namespace mozilla {
AndroidMediaDecoder::AndroidMediaDecoder(const nsACString& aType) : mType(aType)
AndroidMediaDecoder::AndroidMediaDecoder(MediaDecoderOwner* aOwner,
const nsACString& aType)
: MediaDecoder(aOwner), mType(aType)
{
}

Some files were not shown because too many files have changed in this diff Show More