зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to autoland. a=merge CLOSED TREE
This commit is contained in:
Коммит
eb4ef9681c
|
@ -1,9 +1,9 @@
|
|||
This is the debugger.html project output.
|
||||
See https://github.com/devtools-html/debugger.html
|
||||
|
||||
Version 41.0
|
||||
Version 42.0
|
||||
|
||||
Comparison: https://github.com/devtools-html/debugger.html/compare/release-40...release-41
|
||||
Comparison: https://github.com/devtools-html/debugger.html/compare/release-41...release-42
|
||||
|
||||
Packages:
|
||||
- babel-plugin-transform-es2015-modules-commonjs @6.26.0
|
||||
|
|
|
@ -2527,13 +2527,6 @@ button.jump-definition {
|
|||
* 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/>. */
|
||||
|
||||
.empty-line .CodeMirror-linenumber {
|
||||
opacity: 0.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/>. */
|
||||
|
||||
.conditional-breakpoint-panel {
|
||||
cursor: initial;
|
||||
margin: 1em 0;
|
||||
|
@ -2621,6 +2614,32 @@ html[dir="rtl"] .editor-mount {
|
|||
direction: ltr;
|
||||
}
|
||||
|
||||
.theme-light {
|
||||
--gutter-hover-background-color: #dde1e4;
|
||||
}
|
||||
|
||||
.theme-dark {
|
||||
--gutter-hover-background-color: #414141;
|
||||
}
|
||||
|
||||
:not(.empty-line):not(.new-breakpoint) > .CodeMirror-gutter-wrapper:hover {
|
||||
width: 60px;
|
||||
height: 13px;
|
||||
left: -55px !important;
|
||||
background-color: var(--gutter-hover-background-color) !important;
|
||||
mask: url("chrome://devtools/skin/images/debugger/breakpoint.svg") no-repeat;
|
||||
mask-size: 100%;
|
||||
mask-position: 0 1px;
|
||||
}
|
||||
|
||||
:not(.empty-line):not(.new-breakpoint)
|
||||
> .CodeMirror-gutter-wrapper:hover
|
||||
> .CodeMirror-linenumber {
|
||||
left: auto !important;
|
||||
right: 6px;
|
||||
color: var(--theme-body-color);
|
||||
}
|
||||
|
||||
.editor-wrapper .breakpoints {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
@ -2668,6 +2687,11 @@ html[dir="rtl"] .editor-mount {
|
|||
border: 1px solid #00b6ff;
|
||||
}
|
||||
|
||||
.editor .breakpoint {
|
||||
position: absolute;
|
||||
right: -2px;
|
||||
}
|
||||
|
||||
.editor.new-breakpoint.folding-enabled svg {
|
||||
right: -16px;
|
||||
}
|
||||
|
@ -2712,7 +2736,10 @@ html[dir="rtl"] .editor-mount {
|
|||
}
|
||||
|
||||
/* set the linenumber white when there is a breakpoint */
|
||||
.cm-s-mozilla .new-breakpoint .CodeMirror-gutter-wrapper .CodeMirror-linenumber {
|
||||
.cm-s-mozilla
|
||||
.new-breakpoint
|
||||
.CodeMirror-gutter-wrapper
|
||||
.CodeMirror-linenumber {
|
||||
color: white;
|
||||
}
|
||||
|
||||
|
|
|
@ -1615,13 +1615,6 @@ module.exports = "<!-- This Source Code Form is subject to the terms of the Mozi
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1330:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
// removed by extract-text-webpack-plugin
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1331:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
|
@ -4226,6 +4219,8 @@ const Services = __webpack_require__(22);
|
|||
const KeyShortcuts = __webpack_require__(1468);
|
||||
const { ZoomKeys } = __webpack_require__(1469);
|
||||
const EventEmitter = __webpack_require__(1382);
|
||||
const SourceUtils = __webpack_require__(3637);
|
||||
const { getUnicodeHostname, getUnicodeUrlPath, getUnicodeUrl } = __webpack_require__(3638);
|
||||
|
||||
module.exports = {
|
||||
KeyShortcuts,
|
||||
|
@ -4234,7 +4229,11 @@ module.exports = {
|
|||
PrefsHelper,
|
||||
Services,
|
||||
ZoomKeys,
|
||||
EventEmitter
|
||||
EventEmitter,
|
||||
SourceUtils,
|
||||
getUnicodeHostname,
|
||||
getUnicodeUrlPath,
|
||||
getUnicodeUrl
|
||||
};
|
||||
|
||||
/***/ }),
|
||||
|
@ -6549,9 +6548,7 @@ var _promise = __webpack_require__(1653);
|
|||
|
||||
var _devtoolsSourceMap = __webpack_require__(1360);
|
||||
|
||||
/* 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/>. */
|
||||
var _prefs = __webpack_require__(226);
|
||||
|
||||
function setSourceMetaData(sourceId) {
|
||||
return async ({ dispatch, getState }) => {
|
||||
|
@ -6570,7 +6567,9 @@ function setSourceMetaData(sourceId) {
|
|||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
} /* 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 setSymbols(sourceId) {
|
||||
return async ({ dispatch, getState }) => {
|
||||
|
@ -6620,7 +6619,7 @@ function setOutOfScopeLocations() {
|
|||
function setPausePoints(sourceId) {
|
||||
return async ({ dispatch, getState, client }) => {
|
||||
const source = (0, _selectors.getSource)(getState(), sourceId);
|
||||
if (!source || !source.text || source.isWasm) {
|
||||
if (!_prefs.features.pausePoints || !source || !source.text || source.isWasm) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -13332,10 +13331,6 @@ var _actions2 = _interopRequireDefault(_actions);
|
|||
|
||||
var _ShortcutsModal = __webpack_require__(1535);
|
||||
|
||||
var _VisibilityHandler = __webpack_require__(3611);
|
||||
|
||||
var _VisibilityHandler2 = _interopRequireDefault(_VisibilityHandler);
|
||||
|
||||
var _selectors = __webpack_require__(3590);
|
||||
|
||||
var _devtoolsModules = __webpack_require__(1376);
|
||||
|
@ -13384,11 +13379,9 @@ var _QuickOpenModal2 = _interopRequireDefault(_QuickOpenModal);
|
|||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/* 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 shortcuts = new _devtoolsModules.KeyShortcuts({ window });
|
||||
const shortcuts = new _devtoolsModules.KeyShortcuts({ window }); /* 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 { appinfo } = _devtoolsModules.Services;
|
||||
|
||||
|
@ -13589,18 +13582,14 @@ class App extends _react.Component {
|
|||
render() {
|
||||
const { quickOpenEnabled } = this.props;
|
||||
return _react2.default.createElement(
|
||||
_VisibilityHandler2.default,
|
||||
null,
|
||||
_react2.default.createElement(
|
||||
"div",
|
||||
{ className: "debugger" },
|
||||
this.renderLayout(),
|
||||
quickOpenEnabled === true && _react2.default.createElement(_QuickOpenModal2.default, {
|
||||
shortcutsModalEnabled: this.state.shortcutsModalEnabled,
|
||||
toggleShortcutsModal: () => this.toggleShortcutsModal()
|
||||
}),
|
||||
this.renderShortcutsModal()
|
||||
)
|
||||
"div",
|
||||
{ className: "debugger" },
|
||||
this.renderLayout(),
|
||||
quickOpenEnabled === true && _react2.default.createElement(_QuickOpenModal2.default, {
|
||||
shortcutsModalEnabled: this.state.shortcutsModalEnabled,
|
||||
toggleShortcutsModal: () => this.toggleShortcutsModal()
|
||||
}),
|
||||
this.renderShortcutsModal()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -22071,7 +22060,9 @@ var _selectors = __webpack_require__(3590);
|
|||
|
||||
var _editor = __webpack_require__(1358);
|
||||
|
||||
__webpack_require__(1330);
|
||||
/* 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/>. */
|
||||
|
||||
class EmptyLines extends _react.Component {
|
||||
|
||||
|
@ -22089,6 +22080,7 @@ class EmptyLines extends _react.Component {
|
|||
if (!emptyLines) {
|
||||
return;
|
||||
}
|
||||
|
||||
editor.codeMirror.operation(() => {
|
||||
emptyLines.forEach(emptyLine => {
|
||||
const line = (0, _editor.toEditorLine)(selectedSource.get("id"), emptyLine);
|
||||
|
@ -22114,9 +22106,7 @@ class EmptyLines extends _react.Component {
|
|||
render() {
|
||||
return null;
|
||||
}
|
||||
} /* 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/>. */
|
||||
}
|
||||
|
||||
exports.default = (0, _reactRedux.connect)(state => {
|
||||
const selectedSource = (0, _selectors.getSelectedSource)(state);
|
||||
|
@ -22866,6 +22856,10 @@ var _FrameworkComponent = __webpack_require__(3623);
|
|||
|
||||
var _FrameworkComponent2 = _interopRequireDefault(_FrameworkComponent);
|
||||
|
||||
var _ReactComponentStack = __webpack_require__(3639);
|
||||
|
||||
var _ReactComponentStack2 = _interopRequireDefault(_ReactComponentStack);
|
||||
|
||||
var _Scopes = __webpack_require__(1611);
|
||||
|
||||
var _Scopes2 = _interopRequireDefault(_Scopes);
|
||||
|
@ -22874,10 +22868,6 @@ __webpack_require__(1342);
|
|||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/* 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 debugBtn(onClick, type, className, tooltip) {
|
||||
return _react2.default.createElement(
|
||||
"button",
|
||||
|
@ -22889,7 +22879,9 @@ function debugBtn(onClick, type, className, tooltip) {
|
|||
},
|
||||
_react2.default.createElement(_Svg2.default, { name: type, title: tooltip, "aria-label": tooltip })
|
||||
);
|
||||
}
|
||||
} /* 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/>. */
|
||||
|
||||
class SecondaryPanes extends _react.Component {
|
||||
constructor(props) {
|
||||
|
@ -22962,6 +22954,17 @@ class SecondaryPanes extends _react.Component {
|
|||
};
|
||||
}
|
||||
|
||||
getComponentStackItem() {
|
||||
return {
|
||||
header: L10N.getStr("components.header"),
|
||||
component: _react2.default.createElement(_ReactComponentStack2.default, null),
|
||||
opened: _prefs.prefs.componentStackVisible,
|
||||
onToggle: opened => {
|
||||
_prefs.prefs.componentStackVisible = opened;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
getComponentItem() {
|
||||
const { extra: { react } } = this.props;
|
||||
|
||||
|
@ -23058,6 +23061,9 @@ class SecondaryPanes extends _react.Component {
|
|||
|
||||
if (this.props.horizontal) {
|
||||
if (extra && extra.react) {
|
||||
if (_prefs.features.componentStack && extra.react.componentStack.length > 1) {
|
||||
items.push(this.getComponentStackItem());
|
||||
}
|
||||
items.push(this.getComponentItem());
|
||||
}
|
||||
|
||||
|
@ -34291,6 +34297,7 @@ if (isDevelopment()) {
|
|||
pref("devtools.debugger.call-stack-visible", true);
|
||||
pref("devtools.debugger.scopes-visible", true);
|
||||
pref("devtools.debugger.component-visible", true);
|
||||
pref("devtools.debugger.component-stack-visible", false);
|
||||
pref("devtools.debugger.workers-visible", true);
|
||||
pref("devtools.debugger.expressions-visible", true);
|
||||
pref("devtools.debugger.breakpoints-visible", true);
|
||||
|
@ -34321,6 +34328,8 @@ if (isDevelopment()) {
|
|||
pref("devtools.debugger.features.outline", true);
|
||||
pref("devtools.debugger.features.column-breakpoints", true);
|
||||
pref("devtools.debugger.features.replay", true);
|
||||
pref("devtools.debugger.features.pause-points", true);
|
||||
pref("devtools.debugger.features.component-stack", true);
|
||||
}
|
||||
|
||||
const prefs = new PrefsHelper("devtools", {
|
||||
|
@ -34332,6 +34341,7 @@ const prefs = new PrefsHelper("devtools", {
|
|||
callStackVisible: ["Bool", "debugger.call-stack-visible"],
|
||||
scopesVisible: ["Bool", "debugger.scopes-visible"],
|
||||
componentVisible: ["Bool", "debugger.component-visible"],
|
||||
componentStackVisible: ["Bool", "debugger.component-stack-visible"],
|
||||
workersVisible: ["Bool", "debugger.workers-visible"],
|
||||
breakpointsVisible: ["Bool", "debugger.breakpoints-visible"],
|
||||
expressionsVisible: ["Bool", "debugger.expressions-visible"],
|
||||
|
@ -34365,7 +34375,9 @@ const features = new PrefsHelper("devtools.debugger.features", {
|
|||
eventListeners: ["Bool", "event-listeners"],
|
||||
outline: ["Bool", "outline"],
|
||||
codeFolding: ["Bool", "code-folding"],
|
||||
replay: ["Bool", "replay"]
|
||||
replay: ["Bool", "replay"],
|
||||
pausePoints: ["Bool", "pause-points"],
|
||||
componentStack: ["Bool", "component-stack"]
|
||||
});
|
||||
/* harmony export (immutable) */ __webpack_exports__["features"] = features;
|
||||
|
||||
|
@ -37932,75 +37944,6 @@ function formatCopyName(frame) {
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3611:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var _propTypes = __webpack_require__(20);
|
||||
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
var _react = __webpack_require__(0);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/* 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/>. */
|
||||
|
||||
/**
|
||||
* Helper class to disable panel rendering when it is in background.
|
||||
*
|
||||
* Toolbox code hides the iframes when switching to another panel
|
||||
* and triggers `visibilitychange` events.
|
||||
*
|
||||
* See devtools/client/framework/toolbox.js:setIframeVisible().
|
||||
*/
|
||||
|
||||
class VisibilityHandler extends _react.Component {
|
||||
static get propTypes() {
|
||||
return {
|
||||
children: _propTypes2.default.element.isRequired
|
||||
};
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.isVisible = true;
|
||||
this.onVisibilityChange = this.onVisibilityChange.bind(this);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
window.addEventListener("visibilitychange", this.onVisibilityChange);
|
||||
}
|
||||
|
||||
shouldComponentUpdate() {
|
||||
return document.visibilityState == "visible";
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("visibilitychange", this.onVisibilityChange);
|
||||
}
|
||||
|
||||
onVisibilityChange() {
|
||||
this.isVisible = false;
|
||||
if (document.visibilityState == "visible") {
|
||||
this.isVisible = true;
|
||||
}
|
||||
this.forceUpdate();
|
||||
}
|
||||
|
||||
render() {
|
||||
return this.isVisible ? this.props.children : null;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = VisibilityHandler;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3614:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
|
@ -39267,6 +39210,11 @@ function filterSortedArray(array, callback) {
|
|||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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/>. */
|
||||
|
||||
exports.fetchExtra = fetchExtra;
|
||||
exports.getExtra = getExtra;
|
||||
|
||||
|
@ -39277,14 +39225,28 @@ var _preview = __webpack_require__(1807);
|
|||
var _ast = __webpack_require__(1638);
|
||||
|
||||
async function getReactProps(evaluate) {
|
||||
const reactDisplayName = await evaluate("this.hasOwnProperty('_reactInternalFiber') ? " + "this._reactInternalFiber.type.name : " + "this._reactInternalInstance.getName()");
|
||||
|
||||
return {
|
||||
displayName: reactDisplayName.result
|
||||
};
|
||||
} /* 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 componentNames = await evaluate(`
|
||||
if(this.hasOwnProperty('_reactInternalFiber')) {
|
||||
let componentNames = [];
|
||||
let componentNode = this._reactInternalFiber;
|
||||
while(componentNode) {
|
||||
componentNames.push(componentNode.type.name);
|
||||
componentNode = componentNode._debugOwner
|
||||
}
|
||||
componentNames;
|
||||
}
|
||||
else {
|
||||
[this._reactInternalInstance.getName()];
|
||||
}
|
||||
`);
|
||||
const items = componentNames.result.preview && componentNames.result.preview.items;
|
||||
if (items) {
|
||||
return {
|
||||
displayName: items[0],
|
||||
componentStack: items
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
async function getImmutableProps(expression, evaluate) {
|
||||
const immutableEntries = await evaluate((exp => `${exp}.toJS()`)(expression));
|
||||
|
@ -39312,9 +39274,7 @@ async function getExtraProps(getState, expression, result, evaluate) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!props.react) {
|
||||
props.react = await getReactProps(evaluate);
|
||||
}
|
||||
props.react = _extends({}, (await getReactProps(evaluate)), props.react);
|
||||
}
|
||||
|
||||
if ((0, _preview.isImmutable)(result)) {
|
||||
|
@ -39350,6 +39310,501 @@ function getExtra(expression, result) {
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3637:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
/* 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/. */
|
||||
|
||||
// TODO : Localize this (was l10n.getStr("frame.unknownSource"))
|
||||
const UNKNOWN_SOURCE_STRING = "(unknown)";
|
||||
|
||||
// Character codes used in various parsing helper functions.
|
||||
const CHAR_CODE_A = "a".charCodeAt(0);
|
||||
const CHAR_CODE_B = "b".charCodeAt(0);
|
||||
const CHAR_CODE_C = "c".charCodeAt(0);
|
||||
const CHAR_CODE_D = "d".charCodeAt(0);
|
||||
const CHAR_CODE_E = "e".charCodeAt(0);
|
||||
const CHAR_CODE_F = "f".charCodeAt(0);
|
||||
const CHAR_CODE_H = "h".charCodeAt(0);
|
||||
const CHAR_CODE_I = "i".charCodeAt(0);
|
||||
const CHAR_CODE_J = "j".charCodeAt(0);
|
||||
const CHAR_CODE_L = "l".charCodeAt(0);
|
||||
const CHAR_CODE_M = "m".charCodeAt(0);
|
||||
const CHAR_CODE_N = "n".charCodeAt(0);
|
||||
const CHAR_CODE_O = "o".charCodeAt(0);
|
||||
const CHAR_CODE_P = "p".charCodeAt(0);
|
||||
const CHAR_CODE_R = "r".charCodeAt(0);
|
||||
const CHAR_CODE_S = "s".charCodeAt(0);
|
||||
const CHAR_CODE_T = "t".charCodeAt(0);
|
||||
const CHAR_CODE_U = "u".charCodeAt(0);
|
||||
const CHAR_CODE_W = "w".charCodeAt(0);
|
||||
const CHAR_CODE_COLON = ":".charCodeAt(0);
|
||||
const CHAR_CODE_DASH = "-".charCodeAt(0);
|
||||
const CHAR_CODE_L_SQUARE_BRACKET = "[".charCodeAt(0);
|
||||
const CHAR_CODE_SLASH = "/".charCodeAt(0);
|
||||
const CHAR_CODE_CAP_S = "S".charCodeAt(0);
|
||||
|
||||
// The cache used in the `parseURL` function.
|
||||
const gURLStore = new Map();
|
||||
// The cache used in the `getSourceNames` function.
|
||||
const gSourceNamesStore = new Map();
|
||||
|
||||
/**
|
||||
* Takes a string and returns an object containing all the properties
|
||||
* available on an URL instance, with additional properties (fileName),
|
||||
* Leverages caching.
|
||||
*
|
||||
* @param {String} location
|
||||
* @return {Object?} An object containing most properties available
|
||||
* in https://developer.mozilla.org/en-US/docs/Web/API/URL
|
||||
*/
|
||||
|
||||
function parseURL(location) {
|
||||
let url = gURLStore.get(location);
|
||||
|
||||
if (url !== void 0) {
|
||||
return url;
|
||||
}
|
||||
|
||||
try {
|
||||
url = new URL(location);
|
||||
// The callers were generally written to expect a URL from
|
||||
// sdk/url, which is subtly different. So, work around some
|
||||
// important differences here.
|
||||
url = {
|
||||
href: url.href,
|
||||
protocol: url.protocol,
|
||||
host: url.host,
|
||||
hostname: url.hostname,
|
||||
port: url.port || null,
|
||||
pathname: url.pathname,
|
||||
search: url.search,
|
||||
hash: url.hash,
|
||||
username: url.username,
|
||||
password: url.password,
|
||||
origin: url.origin
|
||||
};
|
||||
|
||||
// Definitions:
|
||||
// Example: https://foo.com:8888/file.js
|
||||
// `hostname`: "foo.com"
|
||||
// `host`: "foo.com:8888"
|
||||
let isChrome = isChromeScheme(location);
|
||||
|
||||
url.fileName = url.pathname ? url.pathname.slice(url.pathname.lastIndexOf("/") + 1) || "/" : "/";
|
||||
|
||||
if (isChrome) {
|
||||
url.hostname = null;
|
||||
url.host = null;
|
||||
}
|
||||
|
||||
gURLStore.set(location, url);
|
||||
return url;
|
||||
} catch (e) {
|
||||
gURLStore.set(location, null);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a source into a short and long name as well as a host name.
|
||||
*
|
||||
* @param {String} source
|
||||
* The source to parse. Can be a URI or names like "(eval)" or
|
||||
* "self-hosted".
|
||||
* @return {Object}
|
||||
* An object with the following properties:
|
||||
* - {String} short: A short name for the source.
|
||||
* - "http://page.com/test.js#go?q=query" -> "test.js"
|
||||
* - {String} long: The full, long name for the source, with
|
||||
hash/query stripped.
|
||||
* - "http://page.com/test.js#go?q=query" -> "http://page.com/test.js"
|
||||
* - {String?} host: If available, the host name for the source.
|
||||
* - "http://page.com/test.js#go?q=query" -> "page.com"
|
||||
*/
|
||||
function getSourceNames(source) {
|
||||
let data = gSourceNamesStore.get(source);
|
||||
|
||||
if (data) {
|
||||
return data;
|
||||
}
|
||||
|
||||
let short, long, host;
|
||||
const sourceStr = source ? String(source) : "";
|
||||
|
||||
// If `data:...` uri
|
||||
if (isDataScheme(sourceStr)) {
|
||||
let commaIndex = sourceStr.indexOf(",");
|
||||
if (commaIndex > -1) {
|
||||
// The `short` name for a data URI becomes `data:` followed by the actual
|
||||
// encoded content, omitting the MIME type, and charset.
|
||||
short = `data:${sourceStr.substring(commaIndex + 1)}`.slice(0, 100);
|
||||
let result = { short, long: sourceStr };
|
||||
gSourceNamesStore.set(source, result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
// If Scratchpad URI, like "Scratchpad/1"; no modifications,
|
||||
// and short/long are the same.
|
||||
if (isScratchpadScheme(sourceStr)) {
|
||||
let result = { short: sourceStr, long: sourceStr };
|
||||
gSourceNamesStore.set(source, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
const parsedUrl = parseURL(sourceStr);
|
||||
|
||||
if (!parsedUrl) {
|
||||
// Malformed URI.
|
||||
long = sourceStr;
|
||||
short = sourceStr.slice(0, 100);
|
||||
} else {
|
||||
host = parsedUrl.host;
|
||||
|
||||
long = parsedUrl.href;
|
||||
if (parsedUrl.hash) {
|
||||
long = long.replace(parsedUrl.hash, "");
|
||||
}
|
||||
if (parsedUrl.search) {
|
||||
long = long.replace(parsedUrl.search, "");
|
||||
}
|
||||
|
||||
short = parsedUrl.fileName;
|
||||
// If `short` is just a slash, and we actually have a path,
|
||||
// strip the slash and parse again to get a more useful short name.
|
||||
// e.g. "http://foo.com/bar/" -> "bar", rather than "/"
|
||||
if (short === "/" && parsedUrl.pathname !== "/") {
|
||||
short = parseURL(long.replace(/\/$/, "")).fileName;
|
||||
}
|
||||
}
|
||||
|
||||
if (!short) {
|
||||
if (!long) {
|
||||
long = UNKNOWN_SOURCE_STRING;
|
||||
}
|
||||
short = long.slice(0, 100);
|
||||
}
|
||||
|
||||
let result = { short, long, host };
|
||||
gSourceNamesStore.set(source, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
// For the functions below, we assume that we will never access the location
|
||||
// argument out of bounds, which is indeed the vast majority of cases.
|
||||
//
|
||||
// They are written this way because they are hot. Each frame is checked for
|
||||
// being content or chrome when processing the profile.
|
||||
|
||||
function isColonSlashSlash(location, i = 0) {
|
||||
return location.charCodeAt(++i) === CHAR_CODE_COLON && location.charCodeAt(++i) === CHAR_CODE_SLASH && location.charCodeAt(++i) === CHAR_CODE_SLASH;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for a Scratchpad URI, like "Scratchpad/1"
|
||||
*/
|
||||
function isScratchpadScheme(location, i = 0) {
|
||||
return location.charCodeAt(i) === CHAR_CODE_CAP_S && location.charCodeAt(++i) === CHAR_CODE_C && location.charCodeAt(++i) === CHAR_CODE_R && location.charCodeAt(++i) === CHAR_CODE_A && location.charCodeAt(++i) === CHAR_CODE_T && location.charCodeAt(++i) === CHAR_CODE_C && location.charCodeAt(++i) === CHAR_CODE_H && location.charCodeAt(++i) === CHAR_CODE_P && location.charCodeAt(++i) === CHAR_CODE_A && location.charCodeAt(++i) === CHAR_CODE_D && location.charCodeAt(++i) === CHAR_CODE_SLASH;
|
||||
}
|
||||
|
||||
function isDataScheme(location, i = 0) {
|
||||
return location.charCodeAt(i) === CHAR_CODE_D && location.charCodeAt(++i) === CHAR_CODE_A && location.charCodeAt(++i) === CHAR_CODE_T && location.charCodeAt(++i) === CHAR_CODE_A && location.charCodeAt(++i) === CHAR_CODE_COLON;
|
||||
}
|
||||
|
||||
function isContentScheme(location, i = 0) {
|
||||
let firstChar = location.charCodeAt(i);
|
||||
|
||||
switch (firstChar) {
|
||||
// "http://" or "https://"
|
||||
case CHAR_CODE_H:
|
||||
if (location.charCodeAt(++i) === CHAR_CODE_T && location.charCodeAt(++i) === CHAR_CODE_T && location.charCodeAt(++i) === CHAR_CODE_P) {
|
||||
if (location.charCodeAt(i + 1) === CHAR_CODE_S) {
|
||||
++i;
|
||||
}
|
||||
return isColonSlashSlash(location, i);
|
||||
}
|
||||
return false;
|
||||
|
||||
// "file://"
|
||||
case CHAR_CODE_F:
|
||||
if (location.charCodeAt(++i) === CHAR_CODE_I && location.charCodeAt(++i) === CHAR_CODE_L && location.charCodeAt(++i) === CHAR_CODE_E) {
|
||||
return isColonSlashSlash(location, i);
|
||||
}
|
||||
return false;
|
||||
|
||||
// "app://"
|
||||
case CHAR_CODE_A:
|
||||
if (location.charCodeAt(++i) == CHAR_CODE_P && location.charCodeAt(++i) == CHAR_CODE_P) {
|
||||
return isColonSlashSlash(location, i);
|
||||
}
|
||||
return false;
|
||||
|
||||
// "blob:"
|
||||
case CHAR_CODE_B:
|
||||
if (location.charCodeAt(++i) == CHAR_CODE_L && location.charCodeAt(++i) == CHAR_CODE_O && location.charCodeAt(++i) == CHAR_CODE_B && location.charCodeAt(++i) == CHAR_CODE_COLON) {
|
||||
return isContentScheme(location, i + 1);
|
||||
}
|
||||
return false;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isChromeScheme(location, i = 0) {
|
||||
let firstChar = location.charCodeAt(i);
|
||||
|
||||
switch (firstChar) {
|
||||
// "chrome://"
|
||||
case CHAR_CODE_C:
|
||||
if (location.charCodeAt(++i) === CHAR_CODE_H && location.charCodeAt(++i) === CHAR_CODE_R && location.charCodeAt(++i) === CHAR_CODE_O && location.charCodeAt(++i) === CHAR_CODE_M && location.charCodeAt(++i) === CHAR_CODE_E) {
|
||||
return isColonSlashSlash(location, i);
|
||||
}
|
||||
return false;
|
||||
|
||||
// "resource://"
|
||||
case CHAR_CODE_R:
|
||||
if (location.charCodeAt(++i) === CHAR_CODE_E && location.charCodeAt(++i) === CHAR_CODE_S && location.charCodeAt(++i) === CHAR_CODE_O && location.charCodeAt(++i) === CHAR_CODE_U && location.charCodeAt(++i) === CHAR_CODE_R && location.charCodeAt(++i) === CHAR_CODE_C && location.charCodeAt(++i) === CHAR_CODE_E) {
|
||||
return isColonSlashSlash(location, i);
|
||||
}
|
||||
return false;
|
||||
|
||||
// "jar:file://"
|
||||
case CHAR_CODE_J:
|
||||
if (location.charCodeAt(++i) === CHAR_CODE_A && location.charCodeAt(++i) === CHAR_CODE_R && location.charCodeAt(++i) === CHAR_CODE_COLON && location.charCodeAt(++i) === CHAR_CODE_F && location.charCodeAt(++i) === CHAR_CODE_I && location.charCodeAt(++i) === CHAR_CODE_L && location.charCodeAt(++i) === CHAR_CODE_E) {
|
||||
return isColonSlashSlash(location, i);
|
||||
}
|
||||
return false;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isWASM(location, i = 0) {
|
||||
return (
|
||||
// "wasm-function["
|
||||
location.charCodeAt(i) === CHAR_CODE_W && location.charCodeAt(++i) === CHAR_CODE_A && location.charCodeAt(++i) === CHAR_CODE_S && location.charCodeAt(++i) === CHAR_CODE_M && location.charCodeAt(++i) === CHAR_CODE_DASH && location.charCodeAt(++i) === CHAR_CODE_F && location.charCodeAt(++i) === CHAR_CODE_U && location.charCodeAt(++i) === CHAR_CODE_N && location.charCodeAt(++i) === CHAR_CODE_C && location.charCodeAt(++i) === CHAR_CODE_T && location.charCodeAt(++i) === CHAR_CODE_I && location.charCodeAt(++i) === CHAR_CODE_O && location.charCodeAt(++i) === CHAR_CODE_N && location.charCodeAt(++i) === CHAR_CODE_L_SQUARE_BRACKET
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A utility method to get the file name from a sourcemapped location
|
||||
* The sourcemap location can be in any form. This method returns a
|
||||
* formatted file name for different cases like Windows or OSX.
|
||||
* @param source
|
||||
* @returns String
|
||||
*/
|
||||
function getSourceMappedFile(source) {
|
||||
// If sourcemapped source is a OSX path, return
|
||||
// the characters after last "/".
|
||||
// If sourcemapped source is a Windowss path, return
|
||||
// the characters after last "\\".
|
||||
if (source.lastIndexOf("/") >= 0) {
|
||||
source = source.slice(source.lastIndexOf("/") + 1);
|
||||
} else if (source.lastIndexOf("\\") >= 0) {
|
||||
source = source.slice(source.lastIndexOf("\\") + 1);
|
||||
}
|
||||
return source;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
parseURL,
|
||||
getSourceNames,
|
||||
isScratchpadScheme,
|
||||
isChromeScheme,
|
||||
isContentScheme,
|
||||
isWASM,
|
||||
isDataScheme,
|
||||
getSourceMappedFile
|
||||
};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3638:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* 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/. */
|
||||
|
||||
// This file is a chrome-API-free version of the module
|
||||
// devtools/client/shared/unicode-url.js in the mozilla-central repository, so
|
||||
// that it can be used in Chrome-API-free applications, such as the Launchpad.
|
||||
// But because of this, it cannot take advantage of utilizing chrome APIs and
|
||||
// should implement the similar functionalities on its own.
|
||||
//
|
||||
// Please keep in mind that if the feature in this file has changed, don't
|
||||
// forget to also change that accordingly in
|
||||
// devtools/client/shared/unicode-url.js in the mozilla-central repository.
|
||||
|
||||
|
||||
|
||||
const punycode = __webpack_require__(916);
|
||||
|
||||
/**
|
||||
* Gets a readble Unicode hostname from a hostname.
|
||||
*
|
||||
* If the `hostname` is a readable ASCII hostname, such as example.org, then
|
||||
* this function will simply return the original `hostname`.
|
||||
*
|
||||
* If the `hostname` is a Punycode hostname representing a Unicode domain name,
|
||||
* such as xn--g6w.xn--8pv, then this function will return the readable Unicode
|
||||
* domain name by decoding the Punycode hostname.
|
||||
*
|
||||
* @param {string} hostname
|
||||
* the hostname from which the Unicode hostname will be
|
||||
* parsed, such as example.org, xn--g6w.xn--8pv.
|
||||
* @return {string} The Unicode hostname. It may be the same as the `hostname`
|
||||
* passed to this function if the `hostname` itself is
|
||||
* a readable ASCII hostname or a Unicode hostname.
|
||||
*/
|
||||
function getUnicodeHostname(hostname) {
|
||||
try {
|
||||
return punycode.toUnicode(hostname);
|
||||
} catch (err) {}
|
||||
return hostname;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a readble Unicode URL pathname from a URL pathname.
|
||||
*
|
||||
* If the `urlPath` is a readable ASCII URL pathname, such as /a/b/c.js, then
|
||||
* this function will simply return the original `urlPath`.
|
||||
*
|
||||
* If the `urlPath` is a URI-encoded pathname, such as %E8%A9%A6/%E6%B8%AC.js,
|
||||
* then this function will return the readable Unicode pathname.
|
||||
*
|
||||
* If the `urlPath` is a malformed URL pathname, then this function will simply
|
||||
* return the original `urlPath`.
|
||||
*
|
||||
* @param {string} urlPath
|
||||
* the URL path from which the Unicode URL path will be parsed,
|
||||
* such as /a/b/c.js, %E8%A9%A6/%E6%B8%AC.js.
|
||||
* @return {string} The Unicode URL Path. It may be the same as the `urlPath`
|
||||
* passed to this function if the `urlPath` itself is a readable
|
||||
* ASCII url or a Unicode url.
|
||||
*/
|
||||
function getUnicodeUrlPath(urlPath) {
|
||||
try {
|
||||
return decodeURIComponent(urlPath);
|
||||
} catch (err) {}
|
||||
return urlPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a readable Unicode URL from a URL.
|
||||
*
|
||||
* If the `url` is a readable ASCII URL, such as http://example.org/a/b/c.js,
|
||||
* then this function will simply return the original `url`.
|
||||
*
|
||||
* If the `url` includes either an unreadable Punycode domain name or an
|
||||
* unreadable URI-encoded pathname, such as
|
||||
* http://xn--g6w.xn--8pv/%E8%A9%A6/%E6%B8%AC.js, then this function will return
|
||||
* the readable URL by decoding all its unreadable URL components to Unicode
|
||||
* characters.
|
||||
*
|
||||
* If the `url` is a malformed URL, then this function will return the original
|
||||
* `url`.
|
||||
*
|
||||
* If the `url` is a data: URI, then this function will return the original
|
||||
* `url`.
|
||||
*
|
||||
* @param {string} url
|
||||
* the full URL, or a data: URI. from which the readable URL
|
||||
* will be parsed, such as, http://example.org/a/b/c.js,
|
||||
* http://xn--g6w.xn--8pv/%E8%A9%A6/%E6%B8%AC.js
|
||||
* @return {string} The readable URL. It may be the same as the `url` passed to
|
||||
* this function if the `url` itself is readable.
|
||||
*/
|
||||
function getUnicodeUrl(url) {
|
||||
try {
|
||||
const { protocol, hostname } = new URL(url);
|
||||
if (protocol === "data:") {
|
||||
// Never convert a data: URI.
|
||||
return url;
|
||||
}
|
||||
const readableHostname = getUnicodeHostname(hostname);
|
||||
url = decodeURIComponent(url);
|
||||
return url.replace(hostname, readableHostname);
|
||||
} catch (err) {}
|
||||
return url;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getUnicodeHostname,
|
||||
getUnicodeUrlPath,
|
||||
getUnicodeUrl
|
||||
};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3639:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _react = __webpack_require__(0);
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _redux = __webpack_require__(3593);
|
||||
|
||||
var _reactRedux = __webpack_require__(3592);
|
||||
|
||||
var _actions = __webpack_require__(1354);
|
||||
|
||||
var _actions2 = _interopRequireDefault(_actions);
|
||||
|
||||
var _selectors = __webpack_require__(3590);
|
||||
|
||||
__webpack_require__(1338);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/* 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/>. */
|
||||
|
||||
class ReactComponentStack extends _react.PureComponent {
|
||||
render() {
|
||||
const { componentStack } = this.props.extra.react;
|
||||
return _react2.default.createElement(
|
||||
"div",
|
||||
{ className: "pane frames" },
|
||||
_react2.default.createElement(
|
||||
"ul",
|
||||
null,
|
||||
componentStack.slice().reverse().map((component, index) => _react2.default.createElement(
|
||||
"li",
|
||||
{ key: index },
|
||||
component
|
||||
))
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = (0, _reactRedux.connect)(state => {
|
||||
return {
|
||||
extra: (0, _selectors.getExtra)(state)
|
||||
};
|
||||
}, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(ReactComponentStack);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 364:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// This test can be really slow on debug platforms
|
||||
requestLongerTimeout(3);
|
||||
requestLongerTimeout(5);
|
||||
|
||||
add_task(async function test() {
|
||||
const dbg = await initDebugger("big-sourcemap.html", "big-sourcemap");
|
||||
|
|
|
@ -269,6 +269,7 @@ devtools.jar:
|
|||
skin/images/debugger/arrow.svg (themes/images/debugger/arrow.svg)
|
||||
skin/images/debugger/back.svg (themes/images/debugger/back.svg)
|
||||
skin/images/debugger/blackBox.svg (themes/images/debugger/blackBox.svg)
|
||||
skin/images/debugger/breakpoint.svg (themes/images/debugger/breakpoint.svg)
|
||||
skin/images/debugger/close.svg (themes/images/debugger/close.svg)
|
||||
skin/images/debugger/coffeescript.svg (themes/images/debugger/coffeescript.svg)
|
||||
skin/images/debugger/domain.svg (themes/images/debugger/domain.svg)
|
||||
|
|
|
@ -393,6 +393,10 @@ callStack.collapse=Collapse rows
|
|||
# message to show more of the frames.
|
||||
callStack.expand=Expand rows
|
||||
|
||||
# LOCALIZATION NOTE (components.header): Header for the
|
||||
# Framework Components pane in the right sidebar.
|
||||
components.header=Components
|
||||
|
||||
# LOCALIZATION NOTE (editor.searchResults): Editor Search bar message
|
||||
# for the summarizing the selected search result. e.g. 5 of 10 results.
|
||||
editor.searchResults=%d of %d results
|
||||
|
|
|
@ -28,6 +28,7 @@ pref("devtools.debugger.ui.variables-only-enum-visible", false);
|
|||
pref("devtools.debugger.ui.variables-searchbox-visible", false);
|
||||
pref("devtools.debugger.ui.framework-grouping-on", true);
|
||||
pref("devtools.debugger.call-stack-visible", true);
|
||||
pref("devtools.debugger.component-stack-visible", true);
|
||||
pref("devtools.debugger.scopes-visible", true);
|
||||
pref("devtools.debugger.component-visible", true);
|
||||
pref("devtools.debugger.workers-visible", true);
|
||||
|
@ -59,3 +60,5 @@ pref("devtools.debugger.features.event-listeners", false);
|
|||
pref("devtools.debugger.features.code-folding", false);
|
||||
pref("devtools.debugger.features.outline", true);
|
||||
pref("devtools.debugger.features.replay", false);
|
||||
pref("devtools.debugger.features.pause-points", true);
|
||||
pref("devtools.debugger.features.component-stack", false);
|
||||
|
|
|
@ -0,0 +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/. -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 60 12">
|
||||
<path id="base-path" d="M53.9,0H1C0.4,0,0,0.4,0,1v10c0,0.6,0.4,1,1,1h52.9c0.6,0,1.2-0.3,1.5-0.7L60,6l-4.4-5.3C55,0.3,54.5,0,53.9,0z"/>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 460 B |
|
@ -1098,9 +1098,10 @@ nsTreeSanitizer::SanitizeStyleSheet(const nsAString& aOriginal,
|
|||
sheet->SetURIs(aDocument->GetDocumentURI(), nullptr, aBaseURI);
|
||||
sheet->SetPrincipal(aDocument->NodePrincipal());
|
||||
sheet->AsServo()->ParseSheetSync(
|
||||
aDocument->CSSLoader(), NS_ConvertUTF16toUTF8(aOriginal),
|
||||
aDocument->GetDocumentURI(), aBaseURI, aDocument->NodePrincipal(),
|
||||
/* aLoadData = */ nullptr, 0, aDocument->GetCompatibilityMode());
|
||||
aDocument->CSSLoader(),
|
||||
NS_ConvertUTF16toUTF8(aOriginal),
|
||||
/* aLoadData = */ nullptr,
|
||||
/* aLineNumber = */ 0);
|
||||
NS_ENSURE_SUCCESS(rv, true);
|
||||
// Mark the sheet as complete.
|
||||
MOZ_ASSERT(!sheet->HasForcedUniqueInner(),
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
real(Float32Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Float32)) \
|
||||
real(Float64Array, InitViaClassSpec, TYPED_ARRAY_CLASP(Float64)) \
|
||||
real(Uint8ClampedArray, InitViaClassSpec, TYPED_ARRAY_CLASP(Uint8Clamped)) \
|
||||
real(Proxy, InitProxyClass, js::ProxyClassPtr) \
|
||||
real(Proxy, InitProxyClass, &js::ProxyClass) \
|
||||
real(WeakMap, InitWeakMapClass, OCLASP(WeakMap)) \
|
||||
real(Map, InitViaClassSpec, OCLASP(Map)) \
|
||||
real(Set, InitViaClassSpec, OCLASP(Set)) \
|
||||
|
|
|
@ -352,7 +352,7 @@ class JS_FRIEND_API(BaseProxyHandler)
|
|||
virtual bool isScripted() const { return false; }
|
||||
};
|
||||
|
||||
extern JS_FRIEND_DATA(const js::Class* const) ProxyClassPtr;
|
||||
extern JS_FRIEND_DATA(const js::Class) ProxyClass;
|
||||
|
||||
inline bool IsProxy(const JSObject* obj)
|
||||
{
|
||||
|
@ -547,13 +547,13 @@ class MOZ_STACK_CLASS ProxyOptions {
|
|||
explicit ProxyOptions(bool singletonArg, bool lazyProtoArg = false)
|
||||
: singleton_(singletonArg),
|
||||
lazyProto_(lazyProtoArg),
|
||||
clasp_(ProxyClassPtr)
|
||||
clasp_(&ProxyClass)
|
||||
{}
|
||||
|
||||
public:
|
||||
ProxyOptions() : singleton_(false),
|
||||
lazyProto_(false),
|
||||
clasp_(ProxyClassPtr)
|
||||
clasp_(&ProxyClass)
|
||||
{}
|
||||
|
||||
bool singleton() const { return singleton_; }
|
||||
|
|
|
@ -155,7 +155,7 @@ class JS_FRIEND_API(Wrapper) : public ForwardingProxyHandler
|
|||
static const Wrapper singleton;
|
||||
static const Wrapper singletonWithPrototype;
|
||||
|
||||
static JSObject* defaultProto;
|
||||
static JSObject* const defaultProto;
|
||||
};
|
||||
|
||||
inline JSObject*
|
||||
|
|
|
@ -32,6 +32,8 @@ class BitArray
|
|||
WordT map[numSlots];
|
||||
|
||||
public:
|
||||
constexpr BitArray() : map() {};
|
||||
|
||||
void clear(bool value) {
|
||||
memset(map, value ? 0xFF : 0, sizeof(map));
|
||||
if (value)
|
||||
|
|
|
@ -115,14 +115,6 @@ StoreBuffer::addSizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf, JS::GCSi
|
|||
|
||||
ArenaCellSet ArenaCellSet::Empty;
|
||||
|
||||
ArenaCellSet::ArenaCellSet()
|
||||
: arena(nullptr)
|
||||
, next(nullptr)
|
||||
#ifdef DEBUG
|
||||
, minorGCNumberAtCreation(0)
|
||||
#endif
|
||||
{}
|
||||
|
||||
ArenaCellSet::ArenaCellSet(Arena* arena, ArenaCellSet* next)
|
||||
: arena(arena)
|
||||
, next(next)
|
||||
|
@ -131,7 +123,7 @@ ArenaCellSet::ArenaCellSet(Arena* arena, ArenaCellSet* next)
|
|||
#endif
|
||||
{
|
||||
MOZ_ASSERT(arena);
|
||||
bits.clear(false);
|
||||
MOZ_ASSERT(bits.isAllClear());
|
||||
}
|
||||
|
||||
ArenaCellSet*
|
||||
|
|
|
@ -525,7 +525,13 @@ class ArenaCellSet
|
|||
#endif
|
||||
|
||||
// Construct the empty sentinel object.
|
||||
ArenaCellSet();
|
||||
constexpr ArenaCellSet()
|
||||
: arena(nullptr)
|
||||
, next(nullptr)
|
||||
#ifdef DEBUG
|
||||
, minorGCNumberAtCreation(0)
|
||||
#endif
|
||||
{}
|
||||
|
||||
public:
|
||||
ArenaCellSet(Arena* arena, ArenaCellSet* next);
|
||||
|
|
|
@ -44,13 +44,6 @@ AutoDetectInvalidation::AutoDetectInvalidation(JSContext* cx, MutableHandleValue
|
|||
disabled_(false)
|
||||
{ }
|
||||
|
||||
void
|
||||
VMFunction::addToFunctions()
|
||||
{
|
||||
this->next = functions;
|
||||
functions = this;
|
||||
}
|
||||
|
||||
bool
|
||||
InvokeFunction(JSContext* cx, HandleObject obj, bool constructing, bool ignoresReturnValue,
|
||||
uint32_t argc, Value* argv, MutableHandleValue rval)
|
||||
|
|
|
@ -261,7 +261,7 @@ struct VMFunction
|
|||
{ }
|
||||
|
||||
VMFunction(const VMFunction& o)
|
||||
: next(nullptr),
|
||||
: next(functions),
|
||||
wrapped(o.wrapped),
|
||||
#ifdef JS_TRACE_LOGGING
|
||||
name_(o.name_),
|
||||
|
@ -276,6 +276,9 @@ struct VMFunction
|
|||
extraValuesToPop(o.extraValuesToPop),
|
||||
expectTailCall(o.expectTailCall)
|
||||
{
|
||||
// Add this to the global list of VMFunctions.
|
||||
functions = this;
|
||||
|
||||
// Check for valid failure/return type.
|
||||
MOZ_ASSERT_IF(outParam != Type_Void,
|
||||
returnType == Type_Void ||
|
||||
|
@ -283,7 +286,6 @@ struct VMFunction
|
|||
MOZ_ASSERT(returnType == Type_Void ||
|
||||
returnType == Type_Bool ||
|
||||
returnType == Type_Object);
|
||||
addToFunctions();
|
||||
}
|
||||
|
||||
typedef const VMFunction* Lookup;
|
||||
|
@ -317,10 +319,6 @@ struct VMFunction
|
|||
MOZ_ASSERT(f1->outParamRootType == f2->outParamRootType);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
// Add this to the global list of VMFunctions.
|
||||
void addToFunctions();
|
||||
};
|
||||
|
||||
template <class> struct TypeToDataType { /* Unexpected return type for a VMFunction. */ };
|
||||
|
|
|
@ -809,13 +809,11 @@ const ObjectOps js::ProxyObjectOps = {
|
|||
Proxy::fun_toString
|
||||
};
|
||||
|
||||
const Class js::ProxyObject::proxyClass =
|
||||
const Class js::ProxyClass =
|
||||
PROXY_CLASS_DEF("Proxy",
|
||||
JSCLASS_HAS_CACHED_PROTO(JSProto_Proxy) |
|
||||
JSCLASS_HAS_RESERVED_SLOTS(2));
|
||||
|
||||
const Class* const js::ProxyClassPtr = &js::ProxyObject::proxyClass;
|
||||
|
||||
JS_FRIEND_API(JSObject*)
|
||||
js::NewProxyObject(JSContext* cx, const BaseProxyHandler* handler, HandleValue priv, JSObject* proto_,
|
||||
const ProxyOptions& options)
|
||||
|
@ -833,7 +831,7 @@ ProxyObject::renew(const BaseProxyHandler* handler, const Value& priv)
|
|||
{
|
||||
MOZ_ASSERT(!IsInsideNursery(this));
|
||||
MOZ_ASSERT_IF(IsCrossCompartmentWrapper(this), IsDeadProxyObject(this));
|
||||
MOZ_ASSERT(getClass() == &ProxyObject::proxyClass);
|
||||
MOZ_ASSERT(getClass() == &ProxyClass);
|
||||
MOZ_ASSERT(!IsWindowProxy(this));
|
||||
MOZ_ASSERT(hasDynamicPrototype());
|
||||
|
||||
|
|
|
@ -429,7 +429,7 @@ js::ReportAccessDenied(JSContext* cx)
|
|||
const char Wrapper::family = 0;
|
||||
const Wrapper Wrapper::singleton((unsigned)0);
|
||||
const Wrapper Wrapper::singletonWithPrototype((unsigned)0, true);
|
||||
JSObject* Wrapper::defaultProto = TaggedProto::LazyProto;
|
||||
JSObject* const Wrapper::defaultProto = TaggedProto::LazyProto;
|
||||
|
||||
/* Compartments. */
|
||||
|
||||
|
|
|
@ -46,11 +46,6 @@ private:
|
|||
|
||||
namespace js {
|
||||
|
||||
GenericPrinter::GenericPrinter()
|
||||
: hadOOM_(false)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
GenericPrinter::reportOutOfMemory()
|
||||
{
|
||||
|
@ -397,15 +392,12 @@ Fprinter::Fprinter(FILE* fp)
|
|||
init(fp);
|
||||
}
|
||||
|
||||
Fprinter::Fprinter()
|
||||
: file_(nullptr),
|
||||
init_(false)
|
||||
{ }
|
||||
|
||||
#ifdef DEBUG
|
||||
Fprinter::~Fprinter()
|
||||
{
|
||||
MOZ_ASSERT_IF(init_, !file_);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool
|
||||
Fprinter::init(const char* path)
|
||||
|
|
|
@ -30,7 +30,9 @@ class GenericPrinter
|
|||
protected:
|
||||
bool hadOOM_; // whether reportOutOfMemory() has been called.
|
||||
|
||||
GenericPrinter();
|
||||
constexpr GenericPrinter()
|
||||
: hadOOM_(false)
|
||||
{}
|
||||
|
||||
public:
|
||||
// Puts |len| characters from |s| at the current position and
|
||||
|
@ -139,8 +141,15 @@ class Fprinter final : public GenericPrinter
|
|||
|
||||
public:
|
||||
explicit Fprinter(FILE* fp);
|
||||
Fprinter();
|
||||
|
||||
constexpr Fprinter()
|
||||
: file_(nullptr),
|
||||
init_(false)
|
||||
{}
|
||||
|
||||
#ifdef DEBUG
|
||||
~Fprinter();
|
||||
#endif
|
||||
|
||||
// Initialize this printer, returns false on error.
|
||||
MOZ_MUST_USE bool init(const char* path);
|
||||
|
|
|
@ -18,6 +18,10 @@ namespace js {
|
|||
*
|
||||
* Proxy objects use ShapedObject::shape_ primarily to record flags. Property
|
||||
* information, &c. is all dynamically computed.
|
||||
*
|
||||
* There is no class_ member to force specialization of JSObject::is<T>().
|
||||
* The implementation in JSObject is incorrect for proxies since it doesn't
|
||||
* take account of the handler type.
|
||||
*/
|
||||
class ProxyObject : public ShapedObject
|
||||
{
|
||||
|
@ -127,11 +131,6 @@ class ProxyObject : public ShapedObject
|
|||
static void traceEdgeToTarget(JSTracer* trc, ProxyObject* obj);
|
||||
|
||||
void nuke();
|
||||
|
||||
// There is no class_ member to force specialization of JSObject::is<T>().
|
||||
// The implementation in JSObject is incorrect for proxies since it doesn't
|
||||
// take account of the handler type.
|
||||
static const Class proxyClass;
|
||||
};
|
||||
|
||||
inline bool
|
||||
|
|
|
@ -1635,16 +1635,7 @@ Loader::DoParseSheetServo(ServoStyleSheet* aSheet,
|
|||
// Some cases, like inline style and UA stylesheets, need to be parsed
|
||||
// synchronously. The former may trigger child loads, the latter must not.
|
||||
if (aLoadData->mSyncLoad || !aAllowAsync) {
|
||||
aSheet->ParseSheetSync(
|
||||
this,
|
||||
aBytes,
|
||||
aSheet->GetSheetURI(),
|
||||
aSheet->GetBaseURI(),
|
||||
aSheet->Principal(),
|
||||
aLoadData,
|
||||
aLoadData->mLineNumber,
|
||||
GetCompatibilityMode()
|
||||
);
|
||||
aSheet->ParseSheetSync(this, aBytes, aLoadData, aLoadData->mLineNumber);
|
||||
aLoadData->mIsBeingParsed = false;
|
||||
|
||||
bool noPendingChildren = aLoadData->mPendingChildren == 0;
|
||||
|
@ -1664,27 +1655,18 @@ Loader::DoParseSheetServo(ServoStyleSheet* aSheet,
|
|||
BlockOnload();
|
||||
RefPtr<SheetLoadData> loadData = aLoadData;
|
||||
nsCOMPtr<nsISerialEventTarget> target = DispatchTarget();
|
||||
aSheet->ParseSheet(
|
||||
this,
|
||||
aBytes,
|
||||
aSheet->GetSheetURI(),
|
||||
aSheet->GetBaseURI(),
|
||||
aSheet->Principal(),
|
||||
aLoadData,
|
||||
aLoadData->mLineNumber,
|
||||
GetCompatibilityMode()
|
||||
)->Then(target, __func__,
|
||||
[loadData](bool aDummy) {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
loadData->mIsBeingParsed = false;
|
||||
loadData->mLoader->UnblockOnload(/* aFireSync = */ false);
|
||||
// If there are no child sheets outstanding, mark us as complete.
|
||||
// Otherwise, the children are holding strong refs to the data and
|
||||
// will call SheetComplete() on it when they complete.
|
||||
if (loadData->mPendingChildren == 0) {
|
||||
loadData->mLoader->SheetComplete(loadData, NS_OK);
|
||||
}
|
||||
}, [] { MOZ_CRASH("rejected parse promise"); }
|
||||
aSheet->ParseSheet(this, aBytes, aLoadData)->Then(target, __func__,
|
||||
[loadData = Move(loadData)](bool aDummy) {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
loadData->mIsBeingParsed = false;
|
||||
loadData->mLoader->UnblockOnload(/* aFireSync = */ false);
|
||||
// If there are no child sheets outstanding, mark us as complete.
|
||||
// Otherwise, the children are holding strong refs to the data and
|
||||
// will call SheetComplete() on it when they complete.
|
||||
if (loadData->mPendingChildren == 0) {
|
||||
loadData->mLoader->SheetComplete(loadData, NS_OK);
|
||||
}
|
||||
}, [] { MOZ_CRASH("rejected parse promise"); }
|
||||
);
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -234,18 +234,16 @@ AllowParallelParse(css::Loader* aLoader, nsIURI* aSheetURI)
|
|||
RefPtr<StyleSheetParsePromise>
|
||||
ServoStyleSheet::ParseSheet(css::Loader* aLoader,
|
||||
const nsACString& aBytes,
|
||||
nsIURI* aSheetURI,
|
||||
nsIURI* aBaseURI,
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
css::SheetLoadData* aLoadData,
|
||||
uint32_t aLineNumber,
|
||||
nsCompatibility aCompatMode)
|
||||
css::SheetLoadData* aLoadData)
|
||||
{
|
||||
MOZ_ASSERT(aLoader);
|
||||
MOZ_ASSERT(aLoadData);
|
||||
MOZ_ASSERT(mParsePromise.IsEmpty());
|
||||
RefPtr<StyleSheetParsePromise> p = mParsePromise.Ensure(__func__);
|
||||
Inner()->mURLData = new URLExtraData(aBaseURI, aSheetURI, aSheetPrincipal); // RefPtr
|
||||
Inner()->mURLData =
|
||||
new URLExtraData(GetBaseURI(), GetSheetURI(), Principal()); // RefPtr
|
||||
|
||||
if (!AllowParallelParse(aLoader, aSheetURI)) {
|
||||
if (!AllowParallelParse(aLoader, GetSheetURI())) {
|
||||
RefPtr<RawServoStyleSheetContents> contents =
|
||||
Servo_StyleSheet_FromUTF8Bytes(aLoader,
|
||||
this,
|
||||
|
@ -253,8 +251,8 @@ ServoStyleSheet::ParseSheet(css::Loader* aLoader,
|
|||
&aBytes,
|
||||
mParsingMode,
|
||||
Inner()->mURLData,
|
||||
aLineNumber,
|
||||
aCompatMode,
|
||||
aLoadData->mLineNumber,
|
||||
aLoader->GetCompatibilityMode(),
|
||||
/* reusable_sheets = */ nullptr)
|
||||
.Consume();
|
||||
FinishAsyncParse(contents.forget());
|
||||
|
@ -265,8 +263,8 @@ ServoStyleSheet::ParseSheet(css::Loader* aLoader,
|
|||
Inner()->mURLData,
|
||||
&aBytes,
|
||||
mParsingMode,
|
||||
aLineNumber,
|
||||
aCompatMode);
|
||||
aLoadData->mLineNumber,
|
||||
aLoader->GetCompatibilityMode());
|
||||
}
|
||||
|
||||
return Move(p);
|
||||
|
@ -286,16 +284,14 @@ ServoStyleSheet::FinishAsyncParse(already_AddRefed<RawServoStyleSheetContents> a
|
|||
void
|
||||
ServoStyleSheet::ParseSheetSync(css::Loader* aLoader,
|
||||
const nsACString& aBytes,
|
||||
nsIURI* aSheetURI,
|
||||
nsIURI* aBaseURI,
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
css::SheetLoadData* aLoadData,
|
||||
uint32_t aLineNumber,
|
||||
nsCompatibility aCompatMode,
|
||||
css::LoaderReusableStyleSheets* aReusableSheets)
|
||||
{
|
||||
Inner()->mURLData = new URLExtraData(aBaseURI, aSheetURI, aSheetPrincipal); // RefPtr
|
||||
nsCompatibility compatMode =
|
||||
aLoader ? aLoader->GetCompatibilityMode() : eCompatibility_FullStandards;
|
||||
|
||||
Inner()->mURLData = new URLExtraData(GetBaseURI(), GetSheetURI(), Principal()); // RefPtr
|
||||
Inner()->mContents = Servo_StyleSheet_FromUTF8Bytes(aLoader,
|
||||
this,
|
||||
aLoadData,
|
||||
|
@ -303,7 +299,7 @@ ServoStyleSheet::ParseSheetSync(css::Loader* aLoader,
|
|||
mParsingMode,
|
||||
Inner()->mURLData,
|
||||
aLineNumber,
|
||||
aCompatMode,
|
||||
compatMode,
|
||||
aReusableSheets)
|
||||
.Consume();
|
||||
|
||||
|
@ -390,12 +386,8 @@ ServoStyleSheet::ReparseSheet(const nsAString& aInput)
|
|||
|
||||
ParseSheetSync(loader,
|
||||
NS_ConvertUTF16toUTF8(aInput),
|
||||
mInner->mSheetURI,
|
||||
mInner->mBaseURI,
|
||||
mInner->mPrincipal,
|
||||
/* aLoadData = */ nullptr,
|
||||
lineNumber,
|
||||
eCompatibility_FullStandards,
|
||||
&reusableSheets);
|
||||
DidDirty();
|
||||
|
||||
|
|
|
@ -94,12 +94,7 @@ public:
|
|||
RefPtr<StyleSheetParsePromise>
|
||||
ParseSheet(css::Loader* aLoader,
|
||||
const nsACString& aBytes,
|
||||
nsIURI* aSheetURI,
|
||||
nsIURI* aBaseURI,
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
css::SheetLoadData* aLoadData,
|
||||
uint32_t aLineNumber,
|
||||
nsCompatibility aCompatMode);
|
||||
css::SheetLoadData* aLoadData);
|
||||
|
||||
// Common code that needs to be called after servo finishes parsing. This is
|
||||
// shared between the parallel and sequential paths.
|
||||
|
@ -110,12 +105,8 @@ public:
|
|||
void
|
||||
ParseSheetSync(css::Loader* aLoader,
|
||||
const nsACString& aBytes,
|
||||
nsIURI* aSheetURI,
|
||||
nsIURI* aBaseURI,
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
css::SheetLoadData* aLoadData,
|
||||
uint32_t aLineNumber,
|
||||
nsCompatibility aCompatMode,
|
||||
css::LoaderReusableStyleSheets* aReusableSheets = nullptr);
|
||||
|
||||
nsresult ReparseSheet(const nsAString& aInput);
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
<!doctype html>
|
||||
<script>
|
||||
try { o1 = document.createElement('c') } catch(e) { }
|
||||
try { o2 = document.createElement('p') } catch(e) { }
|
||||
try { o3 = document.createElement('progress') } catch(e) { }
|
||||
try { o4 = document.createElement('legend') } catch(e) { }
|
||||
try { o5 = document.createElement('m') } catch(e) { }
|
||||
try { o6 = new Range() } catch(e) { }
|
||||
try { o7 = window.getSelection() } catch(e) { }
|
||||
try { document.documentElement.appendChild(o1) } catch(e) { }
|
||||
try { document.documentElement.appendChild(o2) } catch(e) { }
|
||||
try { document.documentElement.appendChild(o3) } catch(e) { }
|
||||
try { o1.scrollTopMax } catch(e) { }
|
||||
try { o2.outerHTML = '<b contenteditable="">' } catch(e) { }
|
||||
try { o7.modify('move', 'right', 'line') } catch(e) { }
|
||||
try { o1.prepend(o4) } catch(e) { }
|
||||
try { document.documentElement.appendChild(o5) } catch(e) { }
|
||||
try { o5.scrollLeft = 8 } catch(e) { }
|
||||
try { document.designMode = 'on'; } catch(e) { }
|
||||
try { o7.addRange(o6); } catch(e) { }
|
||||
try { document.execCommand('inserttext') } catch(e) { }
|
||||
</script>
|
|
@ -257,6 +257,7 @@ load 1409502.html
|
|||
load 1409931.html
|
||||
load 1410226-1.html
|
||||
load 1410226-2.html
|
||||
load 1411008.html
|
||||
load 1411143.html
|
||||
load 1411478.html
|
||||
load 1413288.html
|
||||
|
|
|
@ -888,10 +888,11 @@ nsLayoutStylesheetCache::BuildPreferenceSheet(RefPtr<StyleSheet>* aSheet,
|
|||
"sheet without reallocation");
|
||||
|
||||
ServoStyleSheet* servoSheet = sheet->AsServo();
|
||||
// NB: The pref sheet never has @import rules.
|
||||
servoSheet->ParseSheetSync(nullptr, sheetText, uri, uri, nullptr,
|
||||
/* aLoadData = */ nullptr, 0,
|
||||
eCompatibility_FullStandards);
|
||||
// NB: The pref sheet never has @import rules, thus no loader.
|
||||
servoSheet->ParseSheetSync(nullptr,
|
||||
sheetText,
|
||||
/* aLoadData = */ nullptr,
|
||||
/* aLineNumber = */ 0);
|
||||
|
||||
#undef NS_GET_R_G_B
|
||||
}
|
||||
|
|
|
@ -282,6 +282,13 @@
|
|||
<!ENTITY pref_whats_new_notification "What\'s new in &brandShortName;">
|
||||
<!ENTITY pref_whats_new_notification_summary "Learn about new features after an update">
|
||||
|
||||
<!-- Localization note (pref_feature_tips_notification): Title of a new toggleable setting in Settings-Notifications screen.
|
||||
Similar to the already existing "pref_whats_new_notification"-->
|
||||
<!ENTITY pref_feature_tips_notification "Product and feature tips">
|
||||
<!-- Localization note (pref_feature_tips_notification_summary): Description of a new toggleable setting in Settings-Notifications screen.
|
||||
Similar to the already existing "pref_whats_new_notification_summary"-->
|
||||
<!ENTITY pref_feature_tips_notification_summary "Learn more about using &brandShortName; and other &vendorShortName; products">
|
||||
|
||||
<!-- Localization note (pref_category_experimental): Title of a sub category in the 'advanced' category
|
||||
for experimental features. -->
|
||||
<!ENTITY pref_category_experimental "Experimental features">
|
||||
|
|
|
@ -225,6 +225,10 @@
|
|||
<string name="pref_whats_new_notification">&pref_whats_new_notification;</string>
|
||||
<string name="pref_whats_new_notification_summary">&pref_whats_new_notification_summary;</string>
|
||||
|
||||
|
||||
<string name="pref_feature_tips_notification">&pref_feature_tips_notification;</string>
|
||||
<string name="pref_feature_tips_notification_summary">&pref_feature_tips_notification_summary;</string>
|
||||
|
||||
<string name="pref_category_experimental">&pref_category_experimental;</string>
|
||||
|
||||
<string name="pref_custom_tabs">&pref_custom_tabs2;</string>
|
||||
|
|
|
@ -2459,7 +2459,7 @@ pref("security.csp.experimentalEnabled", false);
|
|||
pref("security.csp.enableStrictDynamic", true);
|
||||
|
||||
#if defined(DEBUG) && !defined(ANDROID)
|
||||
pref("csp.content_privileged_about_uris_without_csp", "blank,cache,certerror,checkerboard,credits,home,logo,neterror,newtab,printpreview,srcdoc,studies");
|
||||
pref("csp.content_privileged_about_uris_without_csp", "blank,cache,certerror,credits,home,logo,neterror,newtab,printpreview,srcdoc,studies");
|
||||
#endif
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
|
|
|
@ -47,3 +47,11 @@ iframe {
|
|||
#trace {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#enabled {
|
||||
color: red;
|
||||
}
|
||||
|
||||
#enabled.enabled {
|
||||
color: green;
|
||||
}
|
||||
|
|
|
@ -26,13 +26,13 @@ function onLoad() {
|
|||
|
||||
function updateEnabled() {
|
||||
let enabled = document.getElementById("enabled");
|
||||
if (service.isRecordingEnabled()) {
|
||||
let isEnabled = service.isRecordingEnabled();
|
||||
if (isEnabled) {
|
||||
enabled.textContent = "enabled";
|
||||
enabled.style.color = "green";
|
||||
} else {
|
||||
enabled.textContent = "disabled";
|
||||
enabled.style.color = "red";
|
||||
}
|
||||
enabled.classList.toggle("enabled", isEnabled);
|
||||
}
|
||||
|
||||
function toggleEnabled() {
|
||||
|
@ -274,3 +274,23 @@ function stopPlay() {
|
|||
currentFrame = 0;
|
||||
renderFrame();
|
||||
}
|
||||
|
||||
document.getElementById("pauseButton").addEventListener("click", togglePlay);
|
||||
document.getElementById("stopButton").addEventListener("click", stopPlay);
|
||||
document.getElementById("enableToggleButton").addEventListener("click", toggleEnabled);
|
||||
document.getElementById("flushReportsButton").addEventListener("click", flushReports);
|
||||
document.getElementById("excludePageFromZoom").addEventListener("click", loadData);
|
||||
document.getElementById("stepForwardButton").addEventListener("click", function() {
|
||||
step(false);
|
||||
});
|
||||
document.getElementById("forwardButton").addEventListener("click", function() {
|
||||
reset(false);
|
||||
});
|
||||
document.getElementById("rewindButton").addEventListener("click", function() {
|
||||
reset(true);
|
||||
});
|
||||
document.getElementById("stepBackButton").addEventListener("click", function() {
|
||||
step(true);
|
||||
});
|
||||
window.addEventListener("load", onLoad);
|
||||
|
||||
|
|
|
@ -6,16 +6,16 @@
|
|||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src chrome:" />
|
||||
<meta name="viewport" content="width=device-width"/>
|
||||
<link rel="stylesheet" href="chrome://global/content/aboutCheckerboard.css" type="text/css"/>
|
||||
<script type="text/javascript" src="chrome://global/content/aboutCheckerboard.js"></script>
|
||||
</head>
|
||||
|
||||
<body onload="onLoad()">
|
||||
<p>Checkerboard recording is <span id="enabled" style="color: red">undetermined</span>.
|
||||
<button onclick="toggleEnabled()">Toggle it!</button>.</p>
|
||||
<body>
|
||||
<p>Checkerboard recording is <span id="enabled">undetermined</span>.
|
||||
<button id="enableToggleButton">Toggle it!</button>.</p>
|
||||
<p>If there are active reports in progress, you can stop and flush them by clicking here:
|
||||
<button onclick="flushReports()">Flush active reports</button></p>
|
||||
<button id="flushReportsButton">Flush active reports</button></p>
|
||||
<table class="listing" cellspacing="0">
|
||||
<tr>
|
||||
<th>Most severe checkerboarding reports</th>
|
||||
|
@ -31,12 +31,12 @@
|
|||
|
||||
<div id="player">
|
||||
<div id="controls">
|
||||
<button onclick="reset(true)">«</button><!-- rewind button -->
|
||||
<button onclick="step(true)"><</button><!-- step back button -->
|
||||
<button onclick="togglePlay()">|| ▶</button><!-- pause button -->
|
||||
<button onclick="stopPlay()">☐</button><!-- stop button -->
|
||||
<button onclick="step(false)">></button><!-- step forward button -->
|
||||
<button onclick="reset(false)">»</button><!-- forward button -->
|
||||
<button id="rewindButton">«</button><!-- rewind button -->
|
||||
<button id="stepBackButton"><</button><!-- step back button -->
|
||||
<button id="pauseButton">|| ▶</button><!-- pause button -->
|
||||
<button id="stopButton">☐</button><!-- stop button -->
|
||||
<button id="stepForwardButton">></button><!-- step forward button -->
|
||||
<button id="forwardButton">»</button><!-- forward button -->
|
||||
</div>
|
||||
<canvas id="canvas" width="800" height="600">Canvas not supported!</canvas>
|
||||
<pre id="active">(Details for currently visible replay frame)</pre>
|
||||
|
@ -48,8 +48,9 @@
|
|||
Raw log:<br/>
|
||||
<textarea id="trace" rows="10"></textarea>
|
||||
<div>
|
||||
<input type="checkbox" id="excludePageFromZoom" onclick="loadData()"/><label for="excludePageFromZoom">Exclude page coordinates from zoom calculations</label><br/>
|
||||
<input type="checkbox" id="excludePageFromZoom"/><label for="excludePageFromZoom">Exclude page coordinates from zoom calculations</label><br/>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script type="text/javascript" src="chrome://global/content/aboutCheckerboard.js"></script>
|
||||
</html>
|
||||
|
|
|
@ -37,25 +37,25 @@ namespace {
|
|||
|
||||
#if defined(_M_IX86) && defined(XP_WIN)
|
||||
|
||||
// Fire a low-memory notification if we have less than this many MiB of virtual
|
||||
// address space available.
|
||||
static const uint32_t kLowVirtualMemoryThresholdMiB = 256;
|
||||
// Fire a low-memory notification if we have less than this many bytes of
|
||||
// virtual address space available.
|
||||
static const size_t kLowVirtualMemoryThreshold = 256 * 1024 * 1024;
|
||||
|
||||
// Fire a low-memory notification if we have less than this many MiB of commit
|
||||
// Fire a low-memory notification if we have less than this many bytes of commit
|
||||
// space (physical memory plus page file) left.
|
||||
static const uint32_t kLowCommitSpaceThresholdMiB = 256;
|
||||
static const size_t kLowCommitSpaceThreshold = 256 * 1024 * 1024;
|
||||
|
||||
// Fire a low-memory notification if we have less than this many MiB of
|
||||
// Fire a low-memory notification if we have less than this many bytes of
|
||||
// physical memory available on the whole machine.
|
||||
static const uint32_t kLowPhysicalMemoryThresholdMiB = 0;
|
||||
static const size_t kLowPhysicalMemoryThreshold = 0;
|
||||
|
||||
// Don't fire a low-memory notification because of low available physical
|
||||
// memory or low commit space more often than this interval.
|
||||
static const uint32_t kLowMemoryNotificationIntervalMS = 10000;
|
||||
|
||||
Atomic<uint32_t> sNumLowVirtualMemEvents;
|
||||
Atomic<uint32_t> sNumLowCommitSpaceEvents;
|
||||
Atomic<uint32_t> sNumLowPhysicalMemEvents;
|
||||
Atomic<uint32_t, MemoryOrdering::Relaxed> sNumLowVirtualMemEvents;
|
||||
Atomic<uint32_t, MemoryOrdering::Relaxed> sNumLowCommitSpaceEvents;
|
||||
Atomic<uint32_t, MemoryOrdering::Relaxed> sNumLowPhysicalMemEvents;
|
||||
|
||||
WindowsDllInterceptor sKernel32Intercept;
|
||||
WindowsDllInterceptor sGdi32Intercept;
|
||||
|
@ -68,7 +68,7 @@ bool sHooksActive = false;
|
|||
|
||||
// Alas, we'd like to use mozilla::TimeStamp, but we can't, because it acquires
|
||||
// a lock!
|
||||
volatile bool sHasScheduledOneLowMemoryNotification = false;
|
||||
volatile bool sUnderMemoryPressure = false;
|
||||
volatile PRIntervalTime sLastLowMemoryNotificationTime;
|
||||
|
||||
// These are function pointers to the functions we wrap in Init().
|
||||
|
@ -85,19 +85,26 @@ HBITMAP(WINAPI* sCreateDIBSectionOrig)(HDC aDC, const BITMAPINFO* aBitmapInfo,
|
|||
HANDLE aSection, DWORD aOffset);
|
||||
|
||||
/**
|
||||
* Fire a memory pressure event if it's been long enough since the last one we
|
||||
* Fire a memory pressure event if we were not under memory pressure yet, or
|
||||
* fire an ongoing one if it's been long enough since the last one we
|
||||
* fired.
|
||||
*/
|
||||
bool
|
||||
MaybeScheduleMemoryPressureEvent()
|
||||
{
|
||||
MemoryPressureState state = MemPressure_New;
|
||||
PRIntervalTime now = PR_IntervalNow();
|
||||
|
||||
// If this interval rolls over, we may fire an extra memory pressure
|
||||
// event, but that's not a big deal.
|
||||
PRIntervalTime interval = PR_IntervalNow() - sLastLowMemoryNotificationTime;
|
||||
if (sHasScheduledOneLowMemoryNotification &&
|
||||
PR_IntervalToMilliseconds(interval) < kLowMemoryNotificationIntervalMS) {
|
||||
PRIntervalTime interval = now - sLastLowMemoryNotificationTime;
|
||||
if (sUnderMemoryPressure) {
|
||||
if (PR_IntervalToMilliseconds(interval) <
|
||||
kLowMemoryNotificationIntervalMS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
state = MemPressure_Ongoing;
|
||||
}
|
||||
|
||||
// There's a bit of a race condition here, since an interval may be a
|
||||
|
@ -106,13 +113,28 @@ MaybeScheduleMemoryPressureEvent()
|
|||
// experiencing memory pressure and firing notifications, so the worst
|
||||
// thing that can happen is that we fire two notifications when we
|
||||
// should have fired only one.
|
||||
sHasScheduledOneLowMemoryNotification = true;
|
||||
sLastLowMemoryNotificationTime = PR_IntervalNow();
|
||||
sUnderMemoryPressure = true;
|
||||
sLastLowMemoryNotificationTime = now;
|
||||
|
||||
NS_DispatchEventualMemoryPressure(MemPressure_New);
|
||||
NS_DispatchEventualMemoryPressure(state);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
CheckLowMemory(DWORDLONG available, size_t threshold,
|
||||
Atomic<uint32_t, MemoryOrdering::Relaxed>& counter)
|
||||
{
|
||||
if (available < threshold) {
|
||||
if (MaybeScheduleMemoryPressureEvent()) {
|
||||
counter++;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
CheckMemAvailable()
|
||||
{
|
||||
|
@ -125,22 +147,15 @@ CheckMemAvailable()
|
|||
bool success = GlobalMemoryStatusEx(&stat);
|
||||
|
||||
if (success) {
|
||||
// kLowVirtualMemoryThresholdMiB is in MiB, but ullAvailVirtual is in bytes.
|
||||
if (stat.ullAvailVirtual < kLowVirtualMemoryThresholdMiB * 1024 * 1024) {
|
||||
// If we're running low on virtual memory, unconditionally schedule the
|
||||
// notification. We'll probably crash if we run out of virtual memory,
|
||||
// so don't worry about firing this notification too often.
|
||||
++sNumLowVirtualMemEvents;
|
||||
NS_DispatchEventualMemoryPressure(MemPressure_New);
|
||||
} else if (stat.ullAvailPageFile < kLowCommitSpaceThresholdMiB * 1024 * 1024) {
|
||||
if (MaybeScheduleMemoryPressureEvent()) {
|
||||
++sNumLowCommitSpaceEvents;
|
||||
}
|
||||
} else if (stat.ullAvailPhys < kLowPhysicalMemoryThresholdMiB * 1024 * 1024) {
|
||||
if (MaybeScheduleMemoryPressureEvent()) {
|
||||
++sNumLowPhysicalMemEvents;
|
||||
}
|
||||
}
|
||||
bool lowMemory = CheckLowMemory(stat.ullAvailVirtual,
|
||||
kLowVirtualMemoryThreshold,
|
||||
sNumLowVirtualMemEvents);
|
||||
lowMemory |= CheckLowMemory(stat.ullAvailPageFile, kLowCommitSpaceThreshold,
|
||||
sNumLowCommitSpaceEvents);
|
||||
lowMemory |= CheckLowMemory(stat.ullAvailPhys, kLowPhysicalMemoryThreshold,
|
||||
sNumLowPhysicalMemEvents);
|
||||
|
||||
sUnderMemoryPressure = lowMemory;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -166,8 +181,9 @@ VirtualAllocHook(LPVOID aAddress, SIZE_T aSize,
|
|||
// Don't call CheckMemAvailable for MEM_RESERVE if we're not tracking low
|
||||
// virtual memory. Similarly, don't call CheckMemAvailable for MEM_COMMIT if
|
||||
// we're not tracking low physical memory.
|
||||
if ((kLowVirtualMemoryThresholdMiB != 0 && aAllocationType & MEM_RESERVE) ||
|
||||
(kLowPhysicalMemoryThresholdMiB != 0 && aAllocationType & MEM_COMMIT)) {
|
||||
if ((kLowVirtualMemoryThreshold != 0 && aAllocationType & MEM_RESERVE) ||
|
||||
((kLowCommitSpaceThreshold != 0 || kLowPhysicalMemoryThreshold != 0) &&
|
||||
aAllocationType & MEM_COMMIT)) {
|
||||
CheckMemAvailable();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче