Merge autoland to mozilla-central. a=merge on a CLOSED TREE

--HG--
extra : amend_source : def86b2bde0dafee971b53da39ff666d664eb953
This commit is contained in:
Daniel Varga 2019-08-04 01:09:52 +03:00
Родитель 0d37af9437 6515ac7225
Коммит 515c95b17d
184 изменённых файлов: 704 добавлений и 432 удалений

Просмотреть файл

@ -72,13 +72,13 @@ const HTML_VOID_ELEMENTS = [
// Contains only valid computed display property types of the node to display in the
// element markup and their respective title tooltip text.
const DISPLAY_TYPES = {
flex: INSPECTOR_L10N.getStr("markupView.display.flex.tooltiptext"),
flex: INSPECTOR_L10N.getStr("markupView.display.flex.tooltiptext2"),
"inline-flex": INSPECTOR_L10N.getStr(
"markupView.display.inlineFlex.tooltiptext"
"markupView.display.inlineFlex.tooltiptext2"
),
grid: INSPECTOR_L10N.getStr("markupView.display.grid.tooltiptext"),
grid: INSPECTOR_L10N.getStr("markupView.display.grid.tooltiptext2"),
"inline-grid": INSPECTOR_L10N.getStr(
"markupView.display.inlineGrid.tooltiptext"
"markupView.display.inlineGrid.tooltiptext2"
),
subgrid: INSPECTOR_L10N.getStr("markupView.display.subgrid.tooltiptiptext"),
"flow-root": INSPECTOR_L10N.getStr("markupView.display.flowRoot.tooltiptext"),

Просмотреть файл

@ -34,25 +34,25 @@ markupView.more.showAll2=Show one more node;Show all #1 nodes
# the inspector.
markupView.whitespaceOnly=Whitespace-only text node: %S
# LOCALIZATION NOTE (markupView.display.flex.tooltiptext)
# LOCALIZATION NOTE (markupView.display.flex.tooltiptext2)
# Used in a tooltip that appears when the user hovers over the display type button in
# the markup view.
markupView.display.flex.tooltiptext=This element behaves like a block element and lays out its content according to the flexbox model.
markupView.display.flex.tooltiptext2=This element behaves like a block element and lays out its content according to the flexbox model. Click to toggle the flexbox overlay for this element.
# LOCALIZATION NOTE (markupView.display.inlineFlex.tooltiptext)
# LOCALIZATION NOTE (markupView.display.inlineFlex.tooltiptext2)
# Used in a tooltip that appears when the user hovers over the display type button in
# the markup view.
markupView.display.inlineFlex.tooltiptext=This element behaves like an inline element and lays out its content according to the flexbox model.
markupView.display.inlineFlex.tooltiptext2=This element behaves like an inline element and lays out its content according to the flexbox model. Click to toggle the flexbox overlay for this element.
# LOCALIZATION NOTE (markupView.display.grid.tooltiptext)
# LOCALIZATION NOTE (markupView.display.grid.tooltiptext2)
# Used in a tooltip that appears when the user hovers over the display type button in
# the markup view.
markupView.display.grid.tooltiptext=This element behaves like a block element and lays out its content according to the grid model.
markupView.display.grid.tooltiptext2=This element behaves like a block element and lays out its content according to the grid model. Click to toggle the grid overlay for this element.
# LOCALIZATION NOTE (markupView.display.inlineGrid.tooltiptext)
# LOCALIZATION NOTE (markupView.display.inlineGrid.tooltiptext2)
# Used in a tooltip that appears when the user hovers over the display type button in
# the markup view.
markupView.display.inlineGrid.tooltiptext=This element behaves like an inline element and lays out its content according to the grid model.
markupView.display.inlineGrid.tooltiptext2=This element behaves like an inline element and lays out its content according to the grid model. Click to toggle the grid overlay for this element.
# LOCALIZATION NOTE (markupView.display.subgrid.tooltiptext)
# Used in a tooltip that appears when the user hovers over the display type button in

Просмотреть файл

@ -433,3 +433,9 @@ webconsole.editor.toolbar.history.nextExpressionButton.tooltip=Next Expression
# displayed when the editor mode is enabled (devtools.webconsole.input.editor=true).
# Parameters: %S is the keyboard shortcut.
webconsole.editor.toolbar.closeButton.tooltip=Close Editor (%S)
# LOCALIZATION NOTE (webconsole.input.openEditorButton.tooltip)
# Label used for the tooltip on the open editor button, in console input, which is
# displayed when the console is in regular mode.
# Parameters: %S is the keyboard shortcut.
webconsole.input.openEditorButton.tooltip=Open Editor (%S)

Просмотреть файл

@ -106,12 +106,27 @@ body {
overflow-y: auto;
overflow-x: hidden;
flex-grow: 1;
/* We display the open editor button at the end of the input */
display: grid;
grid-template-columns: 1fr auto;
/* This allows us to not define a column for the CodeMirror container */
grid-auto-flow: column;
}
.jsterm-cm .jsterm-input-container {
padding-block-start: 2px;
}
.webconsole-input-openEditorButton {
grid-column: -1 / -2;
height: 24px;
margin: 0;
}
.webconsole-input-openEditorButton::before {
background-image: url("chrome://devtools/skin/images/webconsole/editor.svg");
}
.webconsole-app .webconsole-output:empty ~ .jsterm-input-container {
border-top: none;
}
@ -249,7 +264,11 @@ body {
}
.jsterm-editor .webconsole-editor-toolbar .webconsole-editor-toolbar-closeButton::before {
background-image: url(chrome://devtools/skin/images/webconsole/editor.svg);
background-image: url("chrome://devtools/skin/images/close.svg");
}
.jsterm-editor .webconsole-input-openEditorButton {
display: none;
}
.jsterm-editor .webconsole-output {
@ -263,6 +282,7 @@ body {
width: 30vw;
min-width: 150px;
border-top: none;
display: block;
}
.jsterm-editor #webconsole-notificationbox {

Просмотреть файл

@ -279,6 +279,7 @@ class App extends Component {
autocomplete,
editorMode,
editorWidth,
editorFeatureEnabled,
} = this.props;
return JSTerm({
@ -288,8 +289,9 @@ class App extends Component {
onPaste: this.onPaste,
codeMirrorEnabled: jstermCodeMirror,
autocomplete,
editorMode,
editorMode: editorMode && editorFeatureEnabled,
editorWidth,
editorFeatureEnabled,
});
}
@ -314,13 +316,13 @@ class App extends Component {
}
renderNotificationBox() {
const { notifications, editorMode } = this.props;
const { notifications, editorMode, editorFeatureEnabled } = this.props;
return NotificationBox({
id: "webconsole-notificationbox",
key: "notification-box",
displayBorderTop: !editorMode,
displayBorderBottom: editorMode,
displayBorderTop: !(editorMode && editorFeatureEnabled),
displayBorderBottom: editorMode && editorFeatureEnabled,
wrapping: true,
notifications,
});
@ -338,10 +340,10 @@ class App extends Component {
}
renderRootElement(children) {
const { jstermCodeMirror, editorMode } = this.props;
const { jstermCodeMirror, editorMode, editorFeatureEnabled } = this.props;
const classNames = ["webconsole-app"];
if (editorMode) {
if (editorMode && editorFeatureEnabled) {
classNames.push("jsterm-editor");
}
if (jstermCodeMirror) {
@ -362,7 +364,12 @@ class App extends Component {
}
render() {
const { webConsoleUI, editorMode, dispatch } = this.props;
const {
webConsoleUI,
editorMode,
editorFeatureEnabled,
dispatch,
} = this.props;
const filterBar = this.renderFilterBar();
const consoleOutput = this.renderConsoleOutput();
@ -374,7 +381,7 @@ class App extends Component {
return this.renderRootElement([
filterBar,
editorMode
editorFeatureEnabled && editorMode
? EditorToolbar({
dispatch,
editorMode,
@ -388,7 +395,7 @@ class App extends Component {
jsterm
),
GridElementWidthResizer({
enabled: editorMode,
enabled: editorFeatureEnabled && editorMode,
position: "end",
className: "editor-resizer",
getControlledElementNode: () => webConsoleUI.jsterm.node,

Просмотреть файл

@ -73,8 +73,7 @@ class EditorToolbar extends Component {
},
}),
dom.button({
className:
"devtools-button webconsole-editor-toolbar-closeButton checked",
className: "devtools-button webconsole-editor-toolbar-closeButton",
title: l10n.getFormatStr(
"webconsole.editor.toolbar.closeButton.tooltip",
[isMacOS ? "Cmd + B" : "Ctrl + B"]

Просмотреть файл

@ -7,6 +7,7 @@
const { Utils: WebConsoleUtils } = require("devtools/client/webconsole/utils");
const Services = require("Services");
const { debounce } = require("devtools/shared/debounce");
const isMacOS = Services.appinfo.OS === "Darwin";
loader.lazyRequireGetter(this, "Debugger", "Debugger");
loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter");
@ -37,6 +38,12 @@ loader.lazyRequireGetter(
"devtools/client/shared/focus",
true
);
loader.lazyRequireGetter(
this,
"l10n",
"devtools/client/webconsole/utils/messages",
true
);
// React & Redux
const { Component } = require("devtools/client/shared/vendor/react");
@ -92,6 +99,10 @@ class JSTerm extends Component {
autocompleteClear: PropTypes.func.isRequired,
// Data to be displayed in the autocomplete popup.
autocompleteData: PropTypes.object.isRequired,
// Toggle the editor mode.
editorToggle: PropTypes.func.isRequired,
// Is the editor feature enabled
editorFeatureEnabled: PropTypes.bool,
// Is the input in editor mode.
editorMode: PropTypes.bool,
editorWidth: PropTypes.number,
@ -144,8 +155,6 @@ class JSTerm extends Component {
autoSelect: true,
};
const isMacOS = Services.appinfo.OS === "Darwin";
const doc = this.webConsoleUI.document;
const toolbox = this.webConsoleUI.wrapper.toolbox;
const tooltipDoc = toolbox ? toolbox.doc : doc;
@ -1536,17 +1545,31 @@ class JSTerm extends Component {
return null;
}
const openEditorButton = this.props.editorFeatureEnabled
? dom.button({
className: "devtools-button webconsole-input-openEditorButton",
title: l10n.getFormatStr(
"webconsole.input.openEditorButton.tooltip",
[isMacOS ? "Cmd + B" : "Ctrl + B"]
),
onClick: this.props.editorToggle,
})
: undefined;
if (this.props.codeMirrorEnabled) {
return dom.div({
className: "jsterm-input-container devtools-input devtools-monospace",
key: "jsterm-container",
style: { direction: "ltr" },
"aria-live": "off",
onContextMenu: this.onContextMenu,
ref: node => {
this.node = node;
return dom.div(
{
className: "jsterm-input-container devtools-input devtools-monospace",
key: "jsterm-container",
style: { direction: "ltr" },
"aria-live": "off",
onContextMenu: this.onContextMenu,
ref: node => {
this.node = node;
},
},
});
openEditorButton
);
}
const { onPaste } = this.props;
@ -1581,7 +1604,8 @@ class JSTerm extends Component {
onPaste: onPaste,
onDrop: onPaste,
onContextMenu: this.onContextMenu,
})
}),
openEditorButton
);
}
}
@ -1607,6 +1631,7 @@ function mapDispatchToProps(dispatch) {
autocompleteClear: () => dispatch(actions.autocompleteClear()),
evaluateExpression: expression =>
dispatch(actions.evaluateExpression(expression)),
editorToggle: () => dispatch(actions.editorToggle()),
};
}

Просмотреть файл

@ -30,6 +30,10 @@ async function performTests() {
false,
"Editor is disabled when pref is set to false"
);
let openEditorButton = getInlineOpenEditorButton(hud);
ok(openEditorButton, "button is rendered in the inline input");
let rect = openEditorButton.getBoundingClientRect();
ok(rect.width > 0 && rect.height > 0, "Button is visible");
await closeConsole();
@ -43,4 +47,16 @@ async function performTests() {
true,
"Editor is enabled when pref is set to true"
);
openEditorButton = getInlineOpenEditorButton(hud);
rect = openEditorButton.getBoundingClientRect();
ok(rect.width === 0 && rect.height === 0, "Button is hidden in editor mode");
await toggleLayout(hud);
getInlineOpenEditorButton(hud).click();
await waitFor(() => isEditorModeEnabled(hud));
ok("Editor is open when clicking on the button");
}
function getInlineOpenEditorButton(hud) {
return hud.ui.outputNode.querySelector(".webconsole-input-openEditorButton");
}

Просмотреть файл

@ -11,6 +11,9 @@ const TEST_URI =
"data:text/html,<meta charset=utf8>Testing jsterm with no input";
add_task(async function() {
// For now, let's disable editor as we don't know what the final placement of the
// open editor button (which may impact this test).
await pushPref("devtools.webconsole.features.editor", false);
// Run test with legacy JsTerm
await pushPref("devtools.webconsole.jsterm.codeMirror", false);
await performTests();

Просмотреть файл

@ -4,7 +4,6 @@
"use strict";
const defer = require("devtools/shared/defer");
const Services = require("Services");
const l10n = require("devtools/client/webconsole/utils/l10n");
@ -15,91 +14,44 @@ const PREF_CONNECTION_TIMEOUT = "devtools.debugger.remote-timeout";
/**
* The WebConsoleConnectionProxy handles the connection between the Web Console
* and the application we connect to through the remote debug protocol.
*
* @constructor
* @param {WebConsoleUI} webConsoleUI
* A WebConsoleUI instance that owns this connection proxy.
* @param RemoteTarget target
* The target that the console will connect to.
* @param Boolean isBrowserConsole
* Indicates if we're setting up the connection for a browser console
* @param Boolean fissionSupport
* Indicates if the console should support a "Fission architecture".
*/
function WebConsoleConnectionProxy(
webConsoleUI,
target,
isBrowserConsole,
fissionSupport
) {
this.webConsoleUI = webConsoleUI;
this.target = target;
this.webConsoleClient = target.activeConsole;
this.isBrowserConsole = isBrowserConsole;
this.fissionSupport = fissionSupport;
this._onPageError = this._onPageError.bind(this);
this._onLogMessage = this._onLogMessage.bind(this);
this._onConsoleAPICall = this._onConsoleAPICall.bind(this);
this._onNetworkEvent = this._onNetworkEvent.bind(this);
this._onNetworkEventUpdate = this._onNetworkEventUpdate.bind(this);
this._onTabNavigated = this._onTabNavigated.bind(this);
this._onTabWillNavigate = this._onTabWillNavigate.bind(this);
this._onAttachConsole = this._onAttachConsole.bind(this);
this._onCachedMessages = this._onCachedMessages.bind(this);
this._connectionTimeout = this._connectionTimeout.bind(this);
this._onLastPrivateContextExited = this._onLastPrivateContextExited.bind(
this
);
this._clearLogpointMessages = this._clearLogpointMessages.bind(this);
}
WebConsoleConnectionProxy.prototype = {
class WebConsoleConnectionProxy {
/**
* The owning WebConsoleUI instance.
*
* @see WebConsoleUI
* @type object
* @constructor
* @param {WebConsoleUI} webConsoleUI
* A WebConsoleUI instance that owns this connection proxy.
* @param RemoteTarget target
* The target that the console will connect to.
*/
webConsoleUI: null,
constructor(webConsoleUI, target, isBrowserConsole, fissionSupport) {
this.webConsoleUI = webConsoleUI;
this.target = target;
this.webConsoleClient = target.activeConsole;
this.isBrowserConsole = isBrowserConsole;
this.fissionSupport = fissionSupport;
/**
* The target that the console connects to.
* @type RemoteTarget
*/
target: null,
/**
* The DebuggerClient object.
*
* @see DebuggerClient
* @type object
*/
this.client = target.client;
/**
* The DebuggerClient object.
*
* @see DebuggerClient
* @type object
*/
client: null,
this._connecter = null;
/**
* The WebConsoleClient object.
*
* @see WebConsoleClient
* @type object
*/
webConsoleClient: null,
/**
* Tells if the connection is established.
* @type boolean
*/
connected: false,
/**
* Timer used for the connection.
* @private
* @type object
*/
_connectTimer: null,
_connectDefer: null,
_disconnecter: null,
this._onPageError = this._onPageError.bind(this);
this._onLogMessage = this._onLogMessage.bind(this);
this._onConsoleAPICall = this._onConsoleAPICall.bind(this);
this._onNetworkEvent = this._onNetworkEvent.bind(this);
this._onNetworkEventUpdate = this._onNetworkEventUpdate.bind(this);
this._onTabNavigated = this._onTabNavigated.bind(this);
this._onTabWillNavigate = this._onTabWillNavigate.bind(this);
this._onLastPrivateContextExited = this._onLastPrivateContextExited.bind(
this
);
this._clearLogpointMessages = this._clearLogpointMessages.bind(this);
}
/**
* Initialize a debugger client and connect it to the debugger server.
@ -108,93 +60,80 @@ WebConsoleConnectionProxy.prototype = {
* A promise object that is resolved/rejected based on the success of
* the connection initialization.
*/
connect: function() {
if (this._connectDefer) {
return this._connectDefer.promise;
connect() {
if (this._connecter) {
return this._connecter;
}
this._connectDefer = defer();
const timeout = Services.prefs.getIntPref(PREF_CONNECTION_TIMEOUT);
this._connectTimer = setTimeout(this._connectionTimeout, timeout);
const connPromise = this._connectDefer.promise;
connPromise.then(
() => {
clearTimeout(this._connectTimer);
this._connectTimer = null;
},
() => {
clearTimeout(this._connectTimer);
this._connectTimer = null;
}
);
this.client = this.target.client;
this.target.on("will-navigate", this._onTabWillNavigate);
this.target.on("navigate", this._onTabNavigated);
this._attachConsole();
const connection = (async () => {
this._addWebConsoleClientEventListeners();
await this._attachConsole();
return connPromise;
},
// There is no way to view response bodies from the Browser Console, so do
// not waste the memory.
const saveBodies =
!this.webConsoleUI.isBrowserConsole &&
Services.prefs.getBoolPref(
"devtools.netmonitor.saveRequestAndResponseBodies"
);
await this.webConsoleUI.setSaveRequestAndResponseBodies(saveBodies);
/**
* Connection timeout handler.
* @private
*/
_connectionTimeout: function() {
const error = {
error: "timeout",
message: l10n.getStr("connectionTimeout"),
};
const cachedMessages = await this._getCachedMessages();
const networkMessages = this._getNetworkMessages();
const messages = cachedMessages.concat(networkMessages);
messages.sort((a, b) => a.timeStamp - b.timeStamp);
this.dispatchMessagesAdd(messages);
this._connectDefer.reject(error);
},
if (!this.webConsoleClient.hasNativeConsoleAPI) {
await this.webConsoleUI.logWarningAboutReplacedAPI();
}
})();
let timeoutId;
const connectionTimeout = new Promise((_, reject) => {
timeoutId = setTimeout(() => {
reject({
error: "timeout",
message: l10n.getStr("connectionTimeout"),
});
}, Services.prefs.getIntPref(PREF_CONNECTION_TIMEOUT));
});
// If the connectionTimeout rejects before the connection promise settles, then
// this._connecter will reject with the same arguments connectionTimeout was
// rejected with.
this._connecter = Promise.race([connection, connectionTimeout]);
// In case the connection was successful, cancel the setTimeout.
connection.then(() => clearTimeout(timeoutId));
return this._connecter;
}
/**
* Attach to the Web Console actor.
* @private
* @returns Promise
*/
_attachConsole: function() {
_attachConsole() {
const listeners = ["PageError", "ConsoleAPI", "NetworkActivity"];
// Enable the forwarding of console messages to the parent process
// when we open the Browser Console or Toolbox.
if (this.target.chrome && !this.target.isAddon) {
listeners.push("ContentProcessMessages");
}
return this.webConsoleClient
.startListeners(listeners)
.then(this._onAttachConsole, error => {
console.error("attachConsole failed: " + error);
this._connectDefer.reject(error);
});
},
return this.webConsoleClient.startListeners(listeners);
}
/**
* The "attachConsole" response handler.
* Sets all the relevant event listeners on the webconsole client.
*
* @private
* @param object response
* The JSON response object received from the server.
* @param object webConsoleClient
* The WebConsoleClient instance for the attached console, for the
* specific tab we work with.
*/
_onAttachConsole: async function(response) {
let saveBodies = Services.prefs.getBoolPref(
"devtools.netmonitor.saveRequestAndResponseBodies"
);
// There is no way to view response bodies from the Browser Console, so do
// not waste the memory.
if (this.webConsoleUI.isBrowserConsole) {
saveBodies = false;
}
this.webConsoleUI.setSaveRequestAndResponseBodies(saveBodies);
_addWebConsoleClientEventListeners() {
this.webConsoleClient.on("networkEvent", this._onNetworkEvent);
this.webConsoleClient.on("networkEventUpdate", this._onNetworkEventUpdate);
this.webConsoleClient.on("logMessage", this._onLogMessage);
@ -208,84 +147,62 @@ WebConsoleConnectionProxy.prototype = {
"clearLogpointMessages",
this._clearLogpointMessages
);
const msgs = ["PageError", "ConsoleAPI"];
const cachedMessages = await this.webConsoleClient.getCachedMessages(msgs);
this._onCachedMessages(cachedMessages);
},
}
/**
* Dispatch a message add on the new frontend and emit an event for tests.
*/
dispatchMessageAdd: function(packet) {
this.webConsoleUI.wrapper.dispatchMessageAdd(packet);
},
/**
* Batched dispatch of messages.
*/
dispatchMessagesAdd: function(packets) {
this.webConsoleUI.wrapper.dispatchMessagesAdd(packets);
},
/**
* Dispatch a message event on the new frontend and emit an event for tests.
*/
dispatchMessageUpdate: function(networkInfo, response) {
// Some message might try to update while we are closing the toolbox.
if (!this.webConsoleUI) {
return;
}
this.webConsoleUI.wrapper.dispatchMessageUpdate(networkInfo, response);
},
dispatchRequestUpdate: function(id, data) {
// Some request might try to update while we are closing the toolbox.
if (!this.webConsoleUI) {
return Promise.resolve();
}
return this.webConsoleUI.wrapper.dispatchRequestUpdate(id, data);
},
/**
* The "cachedMessages" response handler.
* Remove all set event listeners on the webconsole client.
*
* @private
* @param object response
* The JSON response object received from the server.
*/
_onCachedMessages: async function(response) {
if (response.error) {
console.error(
"Web Console getCachedMessages error: " +
response.error +
" " +
response.message
);
this._connectDefer.reject(response);
return;
}
if (!this._connectTimer) {
// This happens if the promise is rejected (eg. a timeout), but the
// connection attempt is successful, nonetheless.
console.error("Web Console getCachedMessages error: invalid state.");
}
const messages = response.messages.concat(
...this.webConsoleClient.getNetworkEvents()
_removeWebConsoleClientEventListeners() {
this.webConsoleClient.off("networkEvent", this._onNetworkEvent);
this.webConsoleClient.off("networkEventUpdate", this._onNetworkEventUpdate);
this.webConsoleClient.off("logMessage", this._onLogMessage);
this.webConsoleClient.off("pageError", this._onPageError);
this.webConsoleClient.off("consoleAPICall", this._onConsoleAPICall);
this.webConsoleClient.off(
"lastPrivateContextExited",
this._onLastPrivateContextExited
);
messages.sort((a, b) => a.timeStamp - b.timeStamp);
this.webConsoleClient.off(
"clearLogpointMessages",
this._clearLogpointMessages
);
}
this.dispatchMessagesAdd(messages);
if (!this.webConsoleClient.hasNativeConsoleAPI) {
await this.webConsoleUI.logWarningAboutReplacedAPI();
/**
* Get cached messages from the server.
*
* @private
* @returns A Promise that resolves with the cached messages, or reject if something
* went wront.
*/
async _getCachedMessages() {
const response = await this.webConsoleClient.getCachedMessages([
"PageError",
"ConsoleAPI",
]);
if (response.error) {
throw new Error(
`Web Console getCachedMessages error: ${response.error} ${
response.message
}`
);
}
this.connected = true;
this._connectDefer.resolve(this);
},
return response.messages;
}
/**
* Get network messages from the server.
*
* @private
* @returns An array of network messages.
*/
_getNetworkMessages() {
return Array.from(this.webConsoleClient.getNetworkEvents());
}
/**
* The "pageError" message type handler. We redirect any page errors to the UI
@ -295,13 +212,14 @@ WebConsoleConnectionProxy.prototype = {
* @param object packet
* The message received from the server.
*/
_onPageError: function(packet) {
_onPageError(packet) {
if (!this.webConsoleUI) {
return;
}
packet.type = "pageError";
this.dispatchMessageAdd(packet);
},
}
/**
* The "logMessage" message type handler. We redirect any message to the UI
* for displaying.
@ -310,13 +228,14 @@ WebConsoleConnectionProxy.prototype = {
* @param object packet
* The message received from the server.
*/
_onLogMessage: function(packet) {
_onLogMessage(packet) {
if (!this.webConsoleUI) {
return;
}
packet.type = "logMessage";
this.dispatchMessageAdd(packet);
},
}
/**
* The "consoleAPICall" message type handler. We redirect any message to
* the UI for displaying.
@ -327,19 +246,19 @@ WebConsoleConnectionProxy.prototype = {
* @param object packet
* The message received from the server.
*/
_onConsoleAPICall: function(packet) {
_onConsoleAPICall(packet) {
if (!this.webConsoleUI) {
return;
}
packet.type = "consoleAPICall";
this.dispatchMessageAdd(packet);
},
}
_clearLogpointMessages(logpointId) {
if (this.webConsoleUI) {
this.webConsoleUI.wrapper.dispatchClearLogpointMessages(logpointId);
}
},
}
/**
* The "networkEvent" message type handler. We redirect any message to
@ -349,12 +268,13 @@ WebConsoleConnectionProxy.prototype = {
* @param object networkInfo
* The network request information.
*/
_onNetworkEvent: function(networkInfo) {
_onNetworkEvent(networkInfo) {
if (!this.webConsoleUI) {
return;
}
this.dispatchMessageAdd(networkInfo);
},
}
/**
* The "networkEventUpdate" message type handler. We redirect any message to
* the UI for displaying.
@ -363,12 +283,13 @@ WebConsoleConnectionProxy.prototype = {
* @param object response
* The update response received from the server.
*/
_onNetworkEventUpdate: function(response) {
_onNetworkEventUpdate(response) {
if (!this.webConsoleUI) {
return;
}
this.dispatchMessageUpdate(response.networkInfo, response);
},
}
/**
* The "lastPrivateContextExited" message type handler. When this message is
* received the Web Console UI is cleared.
@ -379,11 +300,11 @@ WebConsoleConnectionProxy.prototype = {
* @param object packet
* The message received from the server.
*/
_onLastPrivateContextExited: function(packet) {
_onLastPrivateContextExited(packet) {
if (this.webConsoleUI) {
this.webConsoleUI.clearPrivateMessages();
}
},
}
/**
* The "navigate" event handlers. We redirect any message to the UI for displaying.
@ -392,9 +313,9 @@ WebConsoleConnectionProxy.prototype = {
* @param object packet
* The message received from the server.
*/
_onTabNavigated: function(packet) {
_onTabNavigated(packet) {
this.webConsoleUI.handleTabNavigated(packet);
},
}
/**
* The "will-navigate" event handlers. We redirect any message to the UI for displaying.
@ -403,9 +324,43 @@ WebConsoleConnectionProxy.prototype = {
* @param object packet
* The message received from the server.
*/
_onTabWillNavigate: function(packet) {
_onTabWillNavigate(packet) {
this.webConsoleUI.handleTabWillNavigate(packet);
},
}
/**
* Dispatch a message add on the new frontend and emit an event for tests.
*/
dispatchMessageAdd(packet) {
this.webConsoleUI.wrapper.dispatchMessageAdd(packet);
}
/**
* Batched dispatch of messages.
*/
dispatchMessagesAdd(packets) {
this.webConsoleUI.wrapper.dispatchMessagesAdd(packets);
}
/**
* Dispatch a message event on the new frontend and emit an event for tests.
*/
dispatchMessageUpdate(networkInfo, response) {
// Some message might try to update while we are closing the toolbox.
if (!this.webConsoleUI) {
return;
}
this.webConsoleUI.wrapper.dispatchMessageUpdate(networkInfo, response);
}
dispatchRequestUpdate(id, data) {
// Some request might try to update while we are closing the toolbox.
if (!this.webConsoleUI) {
return Promise.resolve();
}
return this.webConsoleUI.wrapper.dispatchRequestUpdate(id, data);
}
/**
* Release an object actor.
@ -413,11 +368,11 @@ WebConsoleConnectionProxy.prototype = {
* @param string actor
* The actor ID to send the request to.
*/
releaseActor: function(actor) {
releaseActor(actor) {
if (this.client) {
this.client.release(actor).catch(() => {});
}
},
}
/**
* Disconnect the Web Console from the remote server.
@ -425,33 +380,20 @@ WebConsoleConnectionProxy.prototype = {
* @return object
* A promise object that is resolved when disconnect completes.
*/
disconnect: function() {
disconnect() {
if (!this.client) {
return;
}
this.webConsoleClient.off("logMessage", this._onLogMessage);
this.webConsoleClient.off("pageError", this._onPageError);
this.webConsoleClient.off("consoleAPICall", this._onConsoleAPICall);
this.webConsoleClient.off(
"lastPrivateContextExited",
this._onLastPrivateContextExited
);
this.webConsoleClient.off("networkEvent", this._onNetworkEvent);
this.webConsoleClient.off("networkEventUpdate", this._onNetworkEventUpdate);
this.webConsoleClient.off(
"clearLogpointMessages",
this._clearLogpointMessages
);
this._removeWebConsoleClientEventListeners();
this.target.off("will-navigate", this._onTabWillNavigate);
this.target.off("navigate", this._onTabNavigated);
this.client = null;
this.webConsoleClient = null;
this.target = null;
this.connected = false;
this.webConsoleUI = null;
},
};
}
}
exports.WebConsoleConnectionProxy = WebConsoleConnectionProxy;

Просмотреть файл

@ -410,9 +410,7 @@ void ImageResource::NotifyDrawingObservers() {
return;
}
bool match = false;
if ((NS_FAILED(mURI->SchemeIs("resource", &match)) || !match) &&
(NS_FAILED(mURI->SchemeIs("chrome", &match)) || !match)) {
if (!mURI->SchemeIs("resource") && !mURI->SchemeIs("chrome")) {
return;
}

Просмотреть файл

@ -48,9 +48,9 @@ ImageCacheKey::ImageCacheKey(nsIURI* aURI, const OriginAttributes& aAttrs,
mControlledDocument(GetSpecialCaseDocumentToken(aDocument, aURI)),
mTopLevelBaseDomain(GetTopLevelBaseDomain(aDocument, aURI)),
mIsChrome(false) {
if (SchemeIs("blob")) {
if (mURI->SchemeIs("blob")) {
mBlobSerial = BlobSerial(mURI);
} else if (SchemeIs("chrome")) {
} else if (mURI->SchemeIs("chrome")) {
mIsChrome = true;
}
}
@ -144,11 +144,6 @@ void ImageCacheKey::EnsureHash() const {
mHash.emplace(hash);
}
bool ImageCacheKey::SchemeIs(const char* aScheme) {
bool matches = false;
return NS_SUCCEEDED(mURI->SchemeIs(aScheme, &matches)) && matches;
}
/* static */
void* ImageCacheKey::GetSpecialCaseDocumentToken(Document* aDocument,
nsIURI* aURI) {

Просмотреть файл

@ -59,8 +59,6 @@ class ImageCacheKey final {
void* ControlledDocument() const { return mControlledDocument; }
private:
bool SchemeIs(const char* aScheme);
// For ServiceWorker we need to use the document as
// token for the key. All those exceptions are handled by this method.
static void* GetSpecialCaseDocumentToken(dom::Document* aDocument,

Просмотреть файл

@ -34,24 +34,18 @@ void ImageFactory::Initialize() {}
static uint32_t ComputeImageFlags(nsIURI* uri, const nsCString& aMimeType,
bool isMultiPart) {
nsresult rv;
// We default to the static globals.
bool isDiscardable = StaticPrefs::image_mem_discardable();
bool doDecodeImmediately = StaticPrefs::image_decode_immediately_enabled();
// We want UI to be as snappy as possible and not to flicker. Disable
// discarding for chrome URLS.
bool isChrome = false;
rv = uri->SchemeIs("chrome", &isChrome);
if (NS_SUCCEEDED(rv) && isChrome) {
if (uri->SchemeIs("chrome")) {
isDiscardable = false;
}
// We don't want resources like the "loading" icon to be discardable either.
bool isResource = false;
rv = uri->SchemeIs("resource", &isResource);
if (NS_SUCCEEDED(rv) && isResource) {
if (uri->SchemeIs("resource")) {
isDiscardable = false;
}
@ -75,9 +69,7 @@ static uint32_t ComputeImageFlags(nsIURI* uri, const nsCString& aMimeType,
// Synchronously decode metadata (including size) if we have a data URI since
// the data is immediately available.
bool isDataURI = false;
rv = uri->SchemeIs("data", &isDataURI);
if (NS_SUCCEEDED(rv) && isDataURI) {
if (uri->SchemeIs("data")) {
imageFlags |= Image::INIT_FLAG_SYNC_LOAD;
}
@ -115,9 +107,7 @@ already_AddRefed<Image> ImageFactory::CreateImage(
#ifdef DEBUG
// Record the image load for startup performance testing.
bool match = false;
if ((NS_SUCCEEDED(aURI->SchemeIs("resource", &match)) && match) ||
(NS_SUCCEEDED(aURI->SchemeIs("chrome", &match)) && match)) {
if (aURI->SchemeIs("resource") || aURI->SchemeIs("chrome")) {
NotifyImageLoading(aURI);
}
#endif

Просмотреть файл

@ -198,10 +198,9 @@ nsresult nsIconChannel::InitWithGIO(nsIMozIconURI* aIconURI) {
// Get icon for file specified by URI
if (fileURI) {
bool isFile;
nsAutoCString spec;
fileURI->GetAsciiSpec(spec);
if (NS_SUCCEEDED(fileURI->SchemeIs("file", &isFile)) && isFile) {
if (fileURI->SchemeIs("file")) {
GFile* file = g_file_new_for_uri(spec.get());
GFileInfo* fileInfo =
g_file_query_info(file, G_FILE_ATTRIBUTE_STANDARD_ICON,

Просмотреть файл

@ -272,8 +272,7 @@ nsresult nsMozIconURI::SetSpecInternal(const nsACString& aSpec) {
mIconURL = do_QueryInterface(uri);
if (mIconURL) {
// The inner URI should be a 'file:' one. If not, bail.
bool isFile = false;
if (!NS_SUCCEEDED(mIconURL->SchemeIs("file", &isFile)) || !isFile) {
if (!mIconURL->SchemeIs("file")) {
return NS_ERROR_MALFORMED_URI;
}
mFileName.Truncate();

Просмотреть файл

@ -2029,9 +2029,7 @@ bool imgLoader::PreferLoadFromCache(nsIURI* aURI) const {
// the moz-extension:// protocol), load it directly from the cache to prevent
// re-decoding the image. See Bug 1373258.
// TODO: Bug 1406134
bool match = false;
return (NS_SUCCEEDED(aURI->SchemeIs("moz-page-thumb", &match)) && match) ||
(NS_SUCCEEDED(aURI->SchemeIs("moz-extension", &match)) && match);
return aURI->SchemeIs("moz-page-thumb") || aURI->SchemeIs("moz-extension");
}
#define LOAD_FLAGS_CACHE_MASK \
@ -3000,15 +2998,12 @@ imgCacheValidator::AsyncOnChannelRedirect(
// security code, which needs to know whether there is an insecure load at any
// point in the redirect chain.
nsCOMPtr<nsIURI> oldURI;
bool isHttps = false;
bool isChrome = false;
bool schemeLocal = false;
if (NS_FAILED(oldChannel->GetURI(getter_AddRefs(oldURI))) ||
NS_FAILED(oldURI->SchemeIs("https", &isHttps)) ||
NS_FAILED(oldURI->SchemeIs("chrome", &isChrome)) ||
NS_FAILED(NS_URIChainHasFlags(
oldURI, nsIProtocolHandler::URI_IS_LOCAL_RESOURCE, &schemeLocal)) ||
(!isHttps && !isChrome && !schemeLocal)) {
(!oldURI->SchemeIs("https") && !oldURI->SchemeIs("chrome") &&
!schemeLocal)) {
mHadInsecureRedirect = true;
}

Просмотреть файл

@ -111,14 +111,11 @@ nsresult imgRequest::Init(nsIURI* aURI, nsIURI* aFinalURI,
// account, as it needs to be handled using more complicated rules than
// earlier elements of the redirect chain.
if (aURI != aFinalURI) {
bool isHttps = false;
bool isChrome = false;
bool schemeLocal = false;
if (NS_FAILED(aURI->SchemeIs("https", &isHttps)) ||
NS_FAILED(aURI->SchemeIs("chrome", &isChrome)) ||
NS_FAILED(NS_URIChainHasFlags(
if (NS_FAILED(NS_URIChainHasFlags(
aURI, nsIProtocolHandler::URI_IS_LOCAL_RESOURCE, &schemeLocal)) ||
(!isHttps && !isChrome && !schemeLocal)) {
(!aURI->SchemeIs("https") && !aURI->SchemeIs("chrome") &&
!schemeLocal)) {
mHadInsecureRedirect = true;
}
}

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
use jsapi::root::*;
#[cfg(feature = "debugmozjs")]
use std::ptr;

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
use jsapi::root::*;
use heap::Heap;
use std::os::raw::c_void;

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
use glue;
use jsapi::root::*;
use rust::GCMethods;

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
#[cfg(feature = "debugmozjs")]
include!(concat!(env!("OUT_DIR"), "/jsapi_debug.rs"));

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
// Give a builtin constructor that we can use as the default. When we give
// it to our newly made class, we will be sure to set it up with the correct name
// and .prototype, so that everything works properly.

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
// Function template for the following functions:
// * RegExpGlobalReplaceOpt
// * RegExpGlobalReplaceOptFunc

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
// Function template for the following functions:
// * RegExpLocalReplaceOpt
// * RegExpLocalReplaceOptFunc

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
#include "TypedObjectConstants.h"
///////////////////////////////////////////////////////////////////////////

Просмотреть файл

@ -1,4 +1,8 @@
#!/usr/bin/env 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/.
import argparse
import json

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
window.tests.set('bigTextNodes', (function() {
var garbage = [];
var garbageIndex = 0;

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
window.tests.set('events', (function() {
var garbage = [];
var garbageIndex = 0;

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
window.tests.set('expandoEvents', (function() {
var garbage = [];
var garbageIndex = 0;

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
window.tests.set('globalArrayArrayLiteral', (function() {
var garbage = [];
var garbageIndex = 0;

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
window.tests.set('globalArrayBuffer', (function() {
var garbage = [];
var garbageIndex = 0;

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
window.tests.set('globalArrayFgFinalized', (function() {
var garbage = [];
var garbageIndex = 0;

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
window.tests.set('globalArrayLargeArray', (function() {
var garbage = [];
var garbageIndex = 0;

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
window.tests.set('globalArrayLargeObject', (function() {
var garbage = [];
var garbageIndex = 0;

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
window.tests.set('globalArrayNewObject', (function() {
var garbage = [];
var garbageIndex = 0;

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
window.tests.set('globalArrayObjectLiteral', (function() {
var garbage = [];
var garbageIndex = 0;

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
window.tests.set('globalArrayReallocArray', (function() {
var garbage = [];
var garbageIndex = 0;

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
window.tests.set('largeArrayPropertyAndElements', (function() {
var garbage;
var index;

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
window.tests.set('noAllocation', {
description: "Do not generate any garbage.",
load: (N) => {},

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
window.tests.set('pairCyclicWeakMap', (function() {
var garbage = [];
var garbageIndex = 0;

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
window.tests.set('propertyTreeSplitting', (function() {
var garbage = [];
var garbageIndex = 0;

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
window.tests.set('selfCyclicWeakMap', (function() {
var garbage = [];
var garbageIndex = 0;

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
window.tests.set('textNodes', (function() {
var garbage = [];
var garbageIndex = 0;

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
// Per-frame time sampling infra. Also GC'd: hopefully will not perturb things too badly.
var numSamples = 500;
var delays = new Array(numSamples);

Просмотреть файл

@ -1,3 +1,7 @@
<!-- 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/. -->
<html>
<head>
<title>GC uBench</title>

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
"use strict";

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
"use strict";

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
"use strict";

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
"use strict";

Просмотреть файл

@ -1,4 +1,8 @@
#!/bin/sh
/* 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/. */
set -e

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
loadRelativeToScript('utility.js');
loadRelativeToScript('annotations.js');
loadRelativeToScript('CFG.js');

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
"use strict";

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
"use strict";

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
"use strict";

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
// const cfg = loadCFG(scriptArgs[0]);
// dump_CFG(cfg);

Просмотреть файл

@ -1,4 +1,8 @@
#!/usr/bin/python3
# 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/.
from __future__ import print_function

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
"use strict";

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
"use strict";

Просмотреть файл

@ -1,4 +1,8 @@
#!/usr/bin/python -B
# 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/.
""" Usage: align_stack_comment.py FILE

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
extern crate binjs_meta;
extern crate clap;
extern crate env_logger;

Просмотреть файл

@ -1,3 +1,7 @@
/* 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/. */
use std::cell::RefCell;
use std::collections::{ HashMap, HashSet };
use std::rc::Rc;

Просмотреть файл

@ -1,3 +1,7 @@
# 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/.
# Apparently, there's simply no way to ask GDB to exit with a non-zero
# status when the script run with the --eval-command option fails. Thus, if
# we have --eval-command run prologue.py directly, syntax errors there will

Просмотреть файл

@ -1,3 +1,7 @@
# 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/.
# flake8: noqa: F821
import gdb

Просмотреть файл

@ -1,3 +1,7 @@
# 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/.
"""
All jitted code is allocated via the ExecutableAllocator class. Make GDB aware
of them, such that we can query for pages which are containing code which are

Просмотреть файл

@ -1,3 +1,7 @@
# 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/.
# Pretty-printers for GCCellPtr values.
import gdb

Просмотреть файл

@ -1,3 +1,7 @@
# 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/.
# Pretty-printers for InterpreterRegs.
import gdb

Просмотреть файл

@ -1,3 +1,7 @@
# 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/.
"""
Debugging JIT Compilations can be obscure without large context. This python
script provide commands to let GDB open an image viewer to display the graph of

Просмотреть файл

@ -1,3 +1,7 @@
# 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/.
# Pretty-printers for SpiderMonkey JSObjects.
import re

Просмотреть файл

@ -1,3 +1,7 @@
# 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/.
# Pretty-printers for SpiderMonkey strings.
import gdb

Просмотреть файл

@ -1,3 +1,7 @@
# 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/.
# Pretty-printer for SpiderMonkey symbols.
import mozilla.prettyprinters

Просмотреть файл

@ -1,3 +1,7 @@
# 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/.
# Pretty-printers and utilities for SpiderMonkey rooting templates:
# Rooted, Handle, MutableHandle, etc.

Просмотреть файл

@ -1 +1,5 @@
# 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/.
# Yes, Python, this is a package.

Просмотреть файл

@ -1,3 +1,7 @@
# 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/.
"""
In asm code, out-of-bounds heap accesses cause segfaults, which the engine
handles internally. Make GDB ignore them.

Просмотреть файл

@ -1,3 +1,7 @@
# 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/.
# mozilla/autoload.py: Autoload SpiderMonkey pretty-printers.
print("Loading JavaScript value pretty-printers; see js/src/gdb/README.")

Просмотреть файл

@ -1,3 +1,7 @@
# 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/.
# Pretty-printers for JSID values.
import gdb

Просмотреть файл

@ -1,3 +1,7 @@
# 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/.
# Pretty-printers for SpiderMonkey's JS::Value.
import gdb

Просмотреть файл

@ -1,3 +1,7 @@
# 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/.
# mozilla/prettyprinters.py --- infrastructure for SpiderMonkey's auto-loaded pretty-printers.
import gdb

Просмотреть файл

@ -1,3 +1,7 @@
# 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/.
# mozilla/unwind.py --- unwinder and frame filter for SpiderMonkey
import gdb

Просмотреть файл

@ -1,3 +1,7 @@
# 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/.
# flake8: noqa: F821
import fcntl

Просмотреть файл

@ -1,2 +1,6 @@
/* 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/. */
extern crate libz_sys;

Просмотреть файл

@ -1,4 +1,7 @@
#!/usr/bin/python -B
# 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/.
from __future__ import print_function
import re

Просмотреть файл

@ -1,4 +1,8 @@
#!/usr/bin/python -B
# 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/.
""" Usage: make_opcode_doc.py PATH_TO_MOZILLA_CENTRAL

Просмотреть файл

@ -2,6 +2,10 @@
from __future__ import absolute_import, print_function
# 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/.
import io
import os
import struct

Просмотреть файл

@ -9676,18 +9676,50 @@ CSSPoint nsLayoutUtils::GetCumulativeApzCallbackTransform(nsIFrame* aFrame) {
return delta;
}
nsIFrame* frame = aFrame;
nsCOMPtr<nsIContent> content = frame->GetContent();
nsCOMPtr<nsIContent> lastContent;
bool seenRcdRsf = false;
// Helper lambda to apply the callback transform for a single frame.
auto applyCallbackTransformForFrame = [&](nsIFrame* frame) {
if (frame) {
nsCOMPtr<nsIContent> content = frame->GetContent();
if (content && (content != lastContent)) {
void* property = content->GetProperty(nsGkAtoms::apzCallbackTransform);
if (property) {
delta += *static_cast<CSSPoint*>(property);
}
}
lastContent = content;
}
};
while (frame) {
if (content && (content != lastContent)) {
void* property = content->GetProperty(nsGkAtoms::apzCallbackTransform);
if (property) {
delta += *static_cast<CSSPoint*>(property);
// Apply the callback transform for the current frame.
applyCallbackTransformForFrame(frame);
// Keep track of whether we've encountered the RCD-RSF.
nsPresContext* pc = frame->PresContext();
if (nsIScrollableFrame* scrollFrame = do_QueryFrame(frame)) {
if (scrollFrame->IsRootScrollFrameOfDocument() &&
pc->IsRootContentDocument()) {
seenRcdRsf = true;
}
}
// If we reach the RCD's viewport frame, but have not encountered
// the RCD-RSF, we were inside fixed content in the RCD.
// We still want to apply the RCD-RSF's callback transform because
// it contains the offset between the visual and layout viewports
// which applies to fixed content as well.
ViewportFrame* viewportFrame = do_QueryFrame(frame);
if (viewportFrame) {
if (pc->IsRootContentDocument() && !seenRcdRsf) {
applyCallbackTransformForFrame(pc->PresShell()->GetRootScrollFrame());
}
}
// Proceed to the parent frame.
frame = GetCrossDocParentFrame(frame);
lastContent = content;
content = frame ? frame->GetContent() : nullptr;
}
return delta;
}

Просмотреть файл

@ -625,40 +625,26 @@ impl<'a> PathParser<'a> {
break;
}
match self.chars.next() {
Some(command) => {
let abs = if command.is_ascii_uppercase() {
IsAbsolute::Yes
} else {
IsAbsolute::No
};
macro_rules! parse_command {
( $($($p:pat)|+ => $parse_func:ident,)* ) => {
match command {
$(
$($p)|+ => {
skip_wsp(&mut self.chars);
self.$parse_func(abs)?;
},
)*
_ => return Err(()),
}
}
}
parse_command!(
b'Z' | b'z' => parse_closepath,
b'L' | b'l' => parse_lineto,
b'H' | b'h' => parse_h_lineto,
b'V' | b'v' => parse_v_lineto,
b'C' | b'c' => parse_curveto,
b'S' | b's' => parse_smooth_curveto,
b'Q' | b'q' => parse_quadratic_bezier_curveto,
b'T' | b't' => parse_smooth_quadratic_bezier_curveto,
b'A' | b'a' => parse_elliptical_arc,
);
},
_ => break, // no more commands.
}
let command = self.chars.next().unwrap();
let abs = if command.is_ascii_uppercase() {
IsAbsolute::Yes
} else {
IsAbsolute::No
};
skip_wsp(&mut self.chars);
match command {
b'Z' | b'z' => self.parse_closepath(),
b'L' | b'l' => self.parse_lineto(abs),
b'H' | b'h' => self.parse_h_lineto(abs),
b'V' | b'v' => self.parse_v_lineto(abs),
b'C' | b'c' => self.parse_curveto(abs),
b'S' | b's' => self.parse_smooth_curveto(abs),
b'Q' | b'q' => self.parse_quadratic_bezier_curveto(abs),
b'T' | b't' => self.parse_smooth_quadratic_bezier_curveto(abs),
b'A' | b'a' => self.parse_elliptical_arc(abs),
_ => return Err(()),
}?;
}
Ok(())
}
@ -692,7 +678,7 @@ impl<'a> PathParser<'a> {
}
/// Parse "closepath" command.
fn parse_closepath(&mut self, _absolute: IsAbsolute) -> Result<(), ()> {
fn parse_closepath(&mut self) -> Result<(), ()> {
self.path.push(PathCommand::ClosePath);
Ok(())
}

Просмотреть файл

@ -1,3 +1,4 @@
prefs: [dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.header.enabled:true, dom.security.featurePolicy.webidl.enabled:true]
lsan-allowed: [Alloc, CreateCDMProxy, MakeUnique, Malloc, NewPage, Realloc, mozilla::EMEDecryptor::EMEDecryptor, mozilla::SchedulerGroup::CreateEventTargetFor, mozilla::dom::MediaKeys::CreateCDMProxy, mozilla::dom::ContentChild::GetConstructedEventTarget]
leak-threshold: [default:51200]

Просмотреть файл

@ -2,6 +2,5 @@
[org.w3.clearkey test MediaKeySession closed event.]
expected:
if (os == "android") and not e10s: FAIL
if (os == "win") and (processor == "aarch64"): FAIL
if (os == "android") and e10s: FAIL

Просмотреть файл

@ -2,4 +2,4 @@
[Encrypted Media Extensions: Events with Clear Key]
expected:
if (os == "android"): FAIL
if (os == "win") and (processor == "aarch64"): FAIL

Просмотреть файл

@ -1,5 +1,5 @@
[clearkey-generate-request-disallowed-input.https.html]
expected:
if (os == "android") and not e10s: TIMEOUT
if (os == "win") and (processor == "aarch64"): TIMEOUT
if (os == "android") and e10s: TIMEOUT

Просмотреть файл

@ -2,6 +2,5 @@
[Update with invalid Clear Key license]
expected:
if (os == "android") and not e10s: FAIL
if (os == "win") and (processor == "aarch64"): FAIL
if (os == "android") and e10s: FAIL

Просмотреть файл

@ -2,4 +2,4 @@
[Encrypted Media Extensions: Verify MediaKeySession.keyStatuses with multiple sessions, Clear Key]
expected:
if (os == "android"): FAIL
if (os == "win") and (processor == "aarch64"): FAIL

Просмотреть файл

@ -2,4 +2,4 @@
[Encrypted Media Extensions: Verify MediaKeySession.keyStatuses with multiple sessions, Clear Key]
expected:
if (os == "android"): FAIL
if (os == "win") and (processor == "aarch64"): FAIL

Просмотреть файл

@ -1,2 +1,3 @@
[clearkey-mp4-playback-destroy-persistent-license.https.html]
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1313284

Просмотреть файл

@ -1,2 +1,3 @@
[clearkey-mp4-playback-persistent-license-events.https.html]
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1313284

Просмотреть файл

@ -1,2 +1,3 @@
[clearkey-mp4-playback-persistent-license.https.html]
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1313284

Просмотреть файл

@ -1,2 +1,3 @@
[clearkey-mp4-playback-persistent-usage-record-events.https.html]
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1313284

Просмотреть файл

@ -1,2 +1,3 @@
[clearkey-mp4-playback-persistent-usage-record.https.html]
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1313284

Просмотреть файл

@ -1,2 +1,3 @@
[clearkey-mp4-playback-retrieve-destroy-persistent-license.https.html]
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1313284

Просмотреть файл

@ -1,2 +1,3 @@
[clearkey-mp4-playback-retrieve-persistent-license.https.html]
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1313284

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше