зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to autoland. a=merge CLOSED TREE
This commit is contained in:
Коммит
2a77281049
|
@ -119,6 +119,7 @@ skip-if = (os == 'win' && ccov) # Bug 1423667
|
|||
[browser_ext_popup_background.js]
|
||||
[browser_ext_popup_corners.js]
|
||||
[browser_ext_popup_focus.js]
|
||||
disabled = bug 1438663
|
||||
[browser_ext_popup_sendMessage.js]
|
||||
[browser_ext_popup_shutdown.js]
|
||||
[browser_ext_runtime_openOptionsPage.js]
|
||||
|
|
|
@ -123,8 +123,8 @@ support-files =
|
|||
[browser_switch_remoteness.js]
|
||||
run-if = e10s
|
||||
[browser_upgrade_backup.js]
|
||||
skip-if = os == 'linux' && (asan || debug) # Bug 1435394 disabled on Linux
|
||||
[browser_windowRestore_perwindowpb.js]
|
||||
|
||||
[browser_248970_b_perwindowpb.js]
|
||||
# Disabled because of leaks.
|
||||
# Re-enabling and rewriting this test is tracked in bug 936919.
|
||||
|
|
|
@ -61,7 +61,7 @@ included_inclnames_to_ignore = set([
|
|||
'ffi.h', # generated in ctypes/libffi/
|
||||
'devtools/sharkctl.h', # we ignore devtools/ in general
|
||||
'devtools/Instruments.h', # we ignore devtools/ in general
|
||||
'double-conversion.h', # strange MFBT case
|
||||
'double-conversion/double-conversion.h', # strange MFBT case
|
||||
'javascript-trace.h', # generated in $OBJDIR if HAVE_DTRACE is defined
|
||||
'frontend/ReservedWordsGenerated.h', # generated in $OBJDIR
|
||||
'gc/StatsPhasesGenerated.h', # generated in $OBJDIR
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
This is the debugger.html project output.
|
||||
See https://github.com/devtools-html/debugger.html
|
||||
|
||||
Version 17.0
|
||||
Comparison: https://github.com/devtools-html/debugger.html/compare/release-16...release-17
|
||||
Version 18.0
|
||||
Comparison: https://github.com/devtools-html/debugger.html/compare/release-17...release-18
|
||||
|
||||
Packages:
|
||||
- babel-plugin-transform-es2015-modules-commonjs @6.26.0
|
||||
|
|
|
@ -1652,7 +1652,7 @@ html[dir="rtl"] .arrow svg,
|
|||
background-color: white;
|
||||
}
|
||||
|
||||
.tree-node[data-expandable="false"] .tree-indent:last-of-type {
|
||||
.tree:not(.object-inspector) .tree-node[data-expandable="false"] .tree-indent:last-of-type {
|
||||
margin-inline-end: 4px;
|
||||
}
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
|
@ -2109,6 +2109,12 @@ html .toggle-button.end.vertical svg {
|
|||
|
||||
.objectBox-string a, .objectBox-string a:visited {
|
||||
color: currentColor;
|
||||
text-decoration: none;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.objectBox-string a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.objectBox-function,
|
||||
|
@ -3711,14 +3717,6 @@ img.ignore-exceptions {
|
|||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.object-node {
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
html[dir="rtl"] .object-node {
|
||||
padding-right: 4px;
|
||||
}
|
||||
|
||||
.object-label {
|
||||
color: var(--theme-highlight-blue);
|
||||
}
|
||||
|
@ -3742,6 +3740,10 @@ html[dir="rtl"] .object-node {
|
|||
overflow: auto;
|
||||
}
|
||||
|
||||
.scopes-list {
|
||||
padding-inline-start: 4px;
|
||||
}
|
||||
|
||||
.scopes-list .tree:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
|
|
@ -18654,7 +18654,6 @@ __webpack_require__(1324);
|
|||
const Undefined = __webpack_require__(1560);
|
||||
const Null = __webpack_require__(1561);
|
||||
const StringRep = __webpack_require__(1447);
|
||||
const LongStringRep = __webpack_require__(1562);
|
||||
const Number = __webpack_require__(1563);
|
||||
const ArrayRep = __webpack_require__(1448);
|
||||
const Obj = __webpack_require__(1564);
|
||||
|
@ -18687,7 +18686,7 @@ const Grip = __webpack_require__(1409);
|
|||
// List of all registered template.
|
||||
// XXX there should be a way for extensions to register a new
|
||||
// or modify an existing rep.
|
||||
let reps = [RegExp, StyleSheet, Event, DateTime, CommentNode, ElementNode, TextNode, Attribute, LongStringRep, Func, PromiseRep, ArrayRep, Document, Window, ObjectWithText, ObjectWithURL, ErrorRep, GripArray, GripMap, GripMapEntry, Grip, Undefined, Null, StringRep, Number, SymbolRep, InfinityRep, NaNRep, Accessor];
|
||||
let reps = [RegExp, StyleSheet, Event, DateTime, CommentNode, ElementNode, TextNode, Attribute, Func, PromiseRep, ArrayRep, Document, Window, ObjectWithText, ObjectWithURL, ErrorRep, GripArray, GripMap, GripMapEntry, Grip, Undefined, Null, StringRep, Number, SymbolRep, InfinityRep, NaNRep, Accessor];
|
||||
|
||||
/**
|
||||
* Generic rep that is using for rendering native JS types or an object.
|
||||
|
@ -18755,7 +18754,6 @@ module.exports = {
|
|||
GripMap,
|
||||
GripMapEntry,
|
||||
InfinityRep,
|
||||
LongStringRep,
|
||||
NaNRep,
|
||||
Null,
|
||||
Number,
|
||||
|
@ -22423,6 +22421,10 @@ function supportsObject(object, noGrip = false) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (object.class === "DeadObject") {
|
||||
return true;
|
||||
}
|
||||
|
||||
return object.preview ? typeof object.preview.ownProperties !== "undefined" : typeof object.ownPropertyLength !== "undefined";
|
||||
}
|
||||
|
||||
|
@ -25210,6 +25212,7 @@ const {
|
|||
rawCropString,
|
||||
sanitizeString,
|
||||
wrapRender,
|
||||
isGrip,
|
||||
tokenSplitRegex,
|
||||
ELLIPSIS
|
||||
} = __webpack_require__(1353);
|
||||
|
@ -25224,9 +25227,9 @@ StringRep.propTypes = {
|
|||
useQuotes: PropTypes.bool,
|
||||
escapeWhitespace: PropTypes.bool,
|
||||
style: PropTypes.object,
|
||||
object: PropTypes.string.isRequired,
|
||||
member: PropTypes.any,
|
||||
cropLimit: PropTypes.number,
|
||||
cropLimit: PropTypes.number.isRequired,
|
||||
member: PropTypes.string,
|
||||
object: PropTypes.object.isRequired,
|
||||
openLink: PropTypes.func,
|
||||
className: PropTypes.string,
|
||||
omitLinkHref: PropTypes.bool
|
||||
|
@ -25235,40 +25238,118 @@ StringRep.propTypes = {
|
|||
function StringRep(props) {
|
||||
let {
|
||||
className,
|
||||
cropLimit,
|
||||
object: text,
|
||||
member,
|
||||
style,
|
||||
cropLimit,
|
||||
object,
|
||||
useQuotes = true,
|
||||
escapeWhitespace = true,
|
||||
member,
|
||||
openLink,
|
||||
omitLinkHref = true
|
||||
} = props;
|
||||
|
||||
let text = object;
|
||||
|
||||
const isLong = isLongString(object);
|
||||
const shouldCrop = (!member || !member.open) && cropLimit && text.length > cropLimit;
|
||||
|
||||
if (isLong) {
|
||||
text = maybeCropLongString({
|
||||
shouldCrop,
|
||||
cropLimit
|
||||
}, text);
|
||||
}
|
||||
|
||||
text = formatText({
|
||||
useQuotes,
|
||||
escapeWhitespace
|
||||
}, text);
|
||||
|
||||
const config = getElementConfig({
|
||||
className,
|
||||
style,
|
||||
actor: object.actor
|
||||
});
|
||||
|
||||
if (!isLong) {
|
||||
if (containsURL(text)) {
|
||||
return span(config, ...getLinkifiedElements(text, shouldCrop && cropLimit, omitLinkHref, openLink));
|
||||
}
|
||||
|
||||
// Cropping of longString has been handled before formatting.
|
||||
text = maybeCropString({
|
||||
isLong,
|
||||
shouldCrop,
|
||||
cropLimit
|
||||
}, text);
|
||||
}
|
||||
|
||||
return span(config, text);
|
||||
}
|
||||
|
||||
function maybeCropLongString(opts, text) {
|
||||
const {
|
||||
shouldCrop,
|
||||
cropLimit
|
||||
} = opts;
|
||||
|
||||
const {
|
||||
fullText,
|
||||
initial,
|
||||
length
|
||||
} = text;
|
||||
|
||||
text = shouldCrop ? initial.substring(0, cropLimit) : fullText || initial;
|
||||
|
||||
if (text.length < length) {
|
||||
text += ELLIPSIS;
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
function formatText(opts, text) {
|
||||
let {
|
||||
useQuotes,
|
||||
escapeWhitespace
|
||||
} = opts;
|
||||
|
||||
return useQuotes ? escapeString(text, escapeWhitespace) : sanitizeString(text);
|
||||
}
|
||||
|
||||
function getElementConfig(opts) {
|
||||
const {
|
||||
className,
|
||||
style,
|
||||
actor
|
||||
} = opts;
|
||||
|
||||
const config = {};
|
||||
|
||||
if (actor) {
|
||||
config["data-link-actor-id"] = actor;
|
||||
}
|
||||
|
||||
const classNames = ["objectBox", "objectBox-string"];
|
||||
if (className) {
|
||||
classNames.push(className);
|
||||
}
|
||||
let config = { className: classNames.join(" ") };
|
||||
config.className = classNames.join(" ");
|
||||
|
||||
if (style) {
|
||||
config.style = style;
|
||||
}
|
||||
|
||||
if (useQuotes) {
|
||||
text = escapeString(text, escapeWhitespace);
|
||||
} else {
|
||||
text = sanitizeString(text);
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
||||
const shouldCrop = (!member || !member.open) && cropLimit && text.length > cropLimit;
|
||||
if (!containsURL(text)) {
|
||||
if (shouldCrop) {
|
||||
text = rawCropString(text, cropLimit);
|
||||
}
|
||||
return span(config, text);
|
||||
}
|
||||
function maybeCropString(opts, text) {
|
||||
const {
|
||||
shouldCrop,
|
||||
cropLimit
|
||||
} = opts;
|
||||
|
||||
return span(config, ...getLinkifiedElements(text, shouldCrop && cropLimit, omitLinkHref, openLink));
|
||||
return shouldCrop ? rawCropString(text, cropLimit) : text;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -25377,7 +25458,15 @@ function getCroppedString(text, offset = 0, startCropIndex, endCropIndex) {
|
|||
return text;
|
||||
}
|
||||
|
||||
function isLongString(object) {
|
||||
return object && object.type === "longString";
|
||||
}
|
||||
|
||||
function supportsObject(object, noGrip = false) {
|
||||
if (noGrip === false && isGrip(object)) {
|
||||
return isLongString(object);
|
||||
}
|
||||
|
||||
return getGripType(object, noGrip) == "string";
|
||||
}
|
||||
|
||||
|
@ -29620,7 +29709,7 @@ function evaluateInFrame(frameId, script) {
|
|||
|
||||
function evaluate(script, { frameId } = {}) {
|
||||
const params = frameId ? { frameActor: frameId } : {};
|
||||
if (!tabTarget || !tabTarget.activeConsole) {
|
||||
if (!tabTarget || !tabTarget.activeConsole || !script) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
|
@ -35998,83 +36087,7 @@ module.exports = {
|
|||
};
|
||||
|
||||
/***/ }),
|
||||
/* 1562 */
|
||||
/***/ (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/. */
|
||||
|
||||
// Dependencies
|
||||
const PropTypes = __webpack_require__(20);
|
||||
const {
|
||||
escapeString,
|
||||
sanitizeString,
|
||||
isGrip,
|
||||
wrapRender
|
||||
} = __webpack_require__(1353);
|
||||
|
||||
const dom = __webpack_require__(1758);
|
||||
const { span } = dom;
|
||||
|
||||
/**
|
||||
* Renders a long string grip.
|
||||
*/
|
||||
LongStringRep.propTypes = {
|
||||
useQuotes: PropTypes.bool,
|
||||
escapeWhitespace: PropTypes.bool,
|
||||
style: PropTypes.object,
|
||||
cropLimit: PropTypes.number.isRequired,
|
||||
member: PropTypes.string,
|
||||
object: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
function LongStringRep(props) {
|
||||
let {
|
||||
cropLimit,
|
||||
member,
|
||||
object,
|
||||
style,
|
||||
useQuotes = true,
|
||||
escapeWhitespace = true
|
||||
} = props;
|
||||
let { fullText, initial, length } = object;
|
||||
|
||||
let config = {
|
||||
"data-link-actor-id": object.actor,
|
||||
className: "objectBox objectBox-string"
|
||||
};
|
||||
|
||||
if (style) {
|
||||
config.style = style;
|
||||
}
|
||||
|
||||
let string = member && member.open ? fullText || initial : initial.substring(0, cropLimit);
|
||||
|
||||
if (string.length < length) {
|
||||
string += "\u2026";
|
||||
}
|
||||
let formattedString = useQuotes ? escapeString(string, escapeWhitespace) : sanitizeString(string);
|
||||
return span(config, formattedString);
|
||||
}
|
||||
|
||||
function supportsObject(object, noGrip = false) {
|
||||
if (noGrip === true || !isGrip(object)) {
|
||||
return false;
|
||||
}
|
||||
return object.type === "longString";
|
||||
}
|
||||
|
||||
// Exports from this module
|
||||
module.exports = {
|
||||
rep: wrapRender(LongStringRep),
|
||||
supportsObject
|
||||
};
|
||||
|
||||
/***/ }),
|
||||
/* 1562 */,
|
||||
/* 1563 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
|
@ -36193,7 +36206,7 @@ function getTitleElement(props, object) {
|
|||
}
|
||||
|
||||
function getTitle(props, object) {
|
||||
return props.title || object.class || DEFAULT_TITLE;
|
||||
return props.title || DEFAULT_TITLE;
|
||||
}
|
||||
|
||||
function safePropIterator(props, object, max) {
|
||||
|
@ -36690,7 +36703,8 @@ function supportsObject(object, noGrip = false) {
|
|||
return false;
|
||||
}
|
||||
|
||||
return object.preview && getGripType(object, noGrip) == "HTMLDocument";
|
||||
const type = getGripType(object, noGrip);
|
||||
return object.preview && (type === "HTMLDocument" || type === "XULDocument");
|
||||
}
|
||||
|
||||
// Exports from this module
|
||||
|
@ -38074,6 +38088,9 @@ const {
|
|||
nodeIsPrimitive,
|
||||
nodeIsPrototype,
|
||||
nodeIsSetter,
|
||||
nodeIsUninitializedBinding,
|
||||
nodeIsUnmappedBinding,
|
||||
nodeIsUnscopedBinding,
|
||||
nodeIsWindow
|
||||
} = Utils.node;
|
||||
|
||||
|
@ -38266,7 +38283,13 @@ class ObjectInspector extends Component {
|
|||
|
||||
const unavailable = isPrimitive && itemValue && itemValue.hasOwnProperty && itemValue.hasOwnProperty("unavailable");
|
||||
|
||||
if (nodeIsOptimizedOut(item)) {
|
||||
if (nodeIsUninitializedBinding(item)) {
|
||||
objectValue = dom.span({ className: "unavailable" }, "(uninitialized)");
|
||||
} else if (nodeIsUnmappedBinding(item)) {
|
||||
objectValue = dom.span({ className: "unavailable" }, "(unmapped)");
|
||||
} else if (nodeIsUnscopedBinding(item)) {
|
||||
objectValue = dom.span({ className: "unavailable" }, "(unscoped)");
|
||||
} else if (nodeIsOptimizedOut(item)) {
|
||||
objectValue = dom.span({ className: "unavailable" }, "(optimized away)");
|
||||
} else if (nodeIsMissingArguments(item) || unavailable) {
|
||||
objectValue = dom.span({ className: "unavailable" }, "(unavailable)");
|
||||
|
@ -39948,6 +39971,13 @@ class ConditionalPanel extends _react.PureComponent {
|
|||
}
|
||||
|
||||
renderToWidget(props) {
|
||||
if (this.cbPanel) {
|
||||
if (this.props.line && this.props.line == props.line) {
|
||||
return props.closeConditionalPanel();
|
||||
}
|
||||
this.clearConditionalPanel();
|
||||
}
|
||||
|
||||
const { selectedLocation, line, editor } = props;
|
||||
const sourceId = selectedLocation ? selectedLocation.sourceId : "";
|
||||
|
||||
|
@ -49471,6 +49501,27 @@ function nodeIsOptimizedOut(item) {
|
|||
return !nodeHasChildren(item) && value && value.optimizedOut;
|
||||
}
|
||||
|
||||
function nodeIsUninitializedBinding(item) {
|
||||
const value = getValue(item);
|
||||
return value && value.uninitialized;
|
||||
}
|
||||
|
||||
// Used to check if an item represents a binding that exists in a sourcemap's
|
||||
// original file content, but does not match up with a binding found in the
|
||||
// generated code.
|
||||
function nodeIsUnmappedBinding(item) {
|
||||
const value = getValue(item);
|
||||
return value && value.unmapped;
|
||||
}
|
||||
|
||||
// Used to check if an item represents a binding that exists in the debugger's
|
||||
// parser result, but does not match up with a binding returned by the
|
||||
// debugger server.
|
||||
function nodeIsUnscopedBinding(item) {
|
||||
const value = getValue(item);
|
||||
return value && value.unscoped;
|
||||
}
|
||||
|
||||
function nodeIsMissingArguments(item) {
|
||||
const value = getValue(item);
|
||||
return !nodeHasChildren(item) && value && value.missingArguments;
|
||||
|
@ -49995,6 +50046,9 @@ module.exports = {
|
|||
nodeIsPrototype,
|
||||
nodeIsProxy,
|
||||
nodeIsSetter,
|
||||
nodeIsUninitializedBinding,
|
||||
nodeIsUnmappedBinding,
|
||||
nodeIsUnscopedBinding,
|
||||
nodeIsWindow,
|
||||
nodeNeedsNumericalBuckets,
|
||||
nodeSupportsNumericalBucketing,
|
||||
|
@ -52024,7 +52078,7 @@ function tokenAtTextPosition(cm, { line, column }) {
|
|||
function getExpressionFromCoords(cm, coord) {
|
||||
const token = tokenAtTextPosition(cm, coord);
|
||||
if (!token) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
let startHighlight = token.startColumn;
|
||||
|
@ -52044,6 +52098,11 @@ function getExpressionFromCoords(cm, coord) {
|
|||
startHighlight = tokenBefore.startColumn;
|
||||
}
|
||||
const expression = line.substring(startHighlight, endHighlight);
|
||||
|
||||
if (!expression) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const location = {
|
||||
start: { line: lineNumber, column: startHighlight },
|
||||
end: { line: lineNumber, column: endHighlight }
|
||||
|
|
|
@ -6,6 +6,7 @@ support-files =
|
|||
head.js
|
||||
!/devtools/client/commandline/test/helpers.js
|
||||
!/devtools/client/framework/test/shared-head.js
|
||||
examples/babel/polyfill-bundle.js
|
||||
examples/babel/fixtures/for-of/output.js
|
||||
examples/babel/fixtures/for-of/output.js.map
|
||||
examples/babel/fixtures/shadowed-vars/output.js
|
||||
|
@ -26,6 +27,18 @@ support-files =
|
|||
examples/babel/fixtures/modules/output.js.map
|
||||
examples/babel/fixtures/non-modules/output.js
|
||||
examples/babel/fixtures/non-modules/output.js.map
|
||||
examples/babel/fixtures/step-over-for-of/output.js
|
||||
examples/babel/fixtures/step-over-for-of/output.js.map
|
||||
examples/babel/fixtures/step-over-for-of-closure/output.js
|
||||
examples/babel/fixtures/step-over-for-of-closure/output.js.map
|
||||
examples/babel/fixtures/step-over-for-of-array/output.js
|
||||
examples/babel/fixtures/step-over-for-of-array/output.js.map
|
||||
examples/babel/fixtures/step-over-for-of-array-closure/output.js
|
||||
examples/babel/fixtures/step-over-for-of-array-closure/output.js.map
|
||||
examples/babel/fixtures/step-over-function-params/output.js
|
||||
examples/babel/fixtures/step-over-function-params/output.js.map
|
||||
examples/babel/fixtures/step-over-regenerator-await/output.js
|
||||
examples/babel/fixtures/step-over-regenerator-await/output.js.map
|
||||
examples/babel/fixtures/switches/output.js
|
||||
examples/babel/fixtures/switches/output.js.map
|
||||
examples/babel/fixtures/try-catches/output.js
|
||||
|
|
|
@ -72,7 +72,11 @@ async function assertScopes(dbg, items) {
|
|||
for (const [i, val] of items.entries()) {
|
||||
if (Array.isArray(val)) {
|
||||
is(getScopeLabel(dbg, i + 1), val[0]);
|
||||
is(getScopeValue(dbg, i + 1), val[1]);
|
||||
is(
|
||||
getScopeValue(dbg, i + 1),
|
||||
val[1],
|
||||
`"${val[0]}" has the expected "${val[1]}" value`
|
||||
);
|
||||
} else {
|
||||
is(getScopeLabel(dbg, i + 1), val);
|
||||
}
|
||||
|
@ -140,7 +144,7 @@ add_task(async function() {
|
|||
{ line: 8, column: 6 },
|
||||
[
|
||||
"arrow",
|
||||
["argArrow", "(unavailable)"],
|
||||
["argArrow", "(unmapped)"],
|
||||
"Block",
|
||||
"arrow()",
|
||||
"fn",
|
||||
|
@ -157,15 +161,15 @@ add_task(async function() {
|
|||
// The call-based ones work, but the single-identifier ones do not.
|
||||
await breakpointScopes(dbg, "imported-bindings", { line: 17, column: 2 }, [
|
||||
"Module",
|
||||
["aDefault", "(unavailable)"],
|
||||
["aDefault", "(unmapped)"],
|
||||
["aDefault2", '"a-default2"'],
|
||||
["aDefault3", "(unavailable)"],
|
||||
["anAliased", "(unavailable)"],
|
||||
["aDefault3", "(unmapped)"],
|
||||
["anAliased", "(unmapped)"],
|
||||
["anAliased2", '"an-original2"'],
|
||||
["anAliased3", "(unavailable)"],
|
||||
["aNamed", "(unavailable)"],
|
||||
["anAliased3", "(unmapped)"],
|
||||
["aNamed", "(unmapped)"],
|
||||
["aNamed2", '"a-named2"'],
|
||||
["aNamed3", "(unavailable)"],
|
||||
["aNamed3", "(unmapped)"],
|
||||
["aNamespace", "{\u2026}"],
|
||||
["aNamespace2", "{\u2026}"],
|
||||
["aNamespace3", "{\u2026}"],
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
// Babel will optimize this for..of because it call tell the value is an array.
|
||||
export default function root() {
|
||||
console.log("pause here");
|
||||
|
||||
for (const val of [1, 2]) {
|
||||
console.log("pause again", (() => val)());
|
||||
}
|
||||
|
||||
console.log("done");
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
var stepOverForOfArrayClosure =
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 0);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([
|
||||
/* 0 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = root;
|
||||
// Babel will optimize this for..of because it call tell the value is an array.
|
||||
function root() {
|
||||
console.log("pause here");
|
||||
|
||||
var _loop = function _loop(val) {
|
||||
console.log("pause again", function () {
|
||||
return val;
|
||||
}());
|
||||
};
|
||||
|
||||
var _arr = [1, 2];
|
||||
for (var _i = 0; _i < _arr.length; _i++) {
|
||||
var val = _arr[_i];
|
||||
_loop(val);
|
||||
}
|
||||
|
||||
console.log("done");
|
||||
}
|
||||
module.exports = exports["default"];
|
||||
|
||||
/***/ })
|
||||
/******/ ]);
|
||||
//# sourceMappingURL=output.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["webpack:///webpack/bootstrap 8007c2ba9751c074d10b","webpack:///./fixtures/step-over-for-of-array-closure/input.js"],"names":["root","console","log","val"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;kBC5DwBA,I;AADxB;AACe,SAASA,IAAT,GAAgB;AAC7BC,UAAQC,GAAR,CAAY,YAAZ;;AAD6B,6BAGlBC,GAHkB;AAI3BF,YAAQC,GAAR,CAAY,aAAZ,EAA4B;AAAA,aAAMC,GAAN;AAAA,KAAD,EAA3B;AAJ2B;;AAAA,aAGX,CAAC,CAAD,EAAI,CAAJ,CAHW;AAG7B,2CAA0B;AAArB,QAAMA,cAAN;AAAqB,UAAfA,GAAe;AAEzB;;AAEDF,UAAQC,GAAR,CAAY,MAAZ;AACD","file":"fixtures/step-over-for-of-array-closure/output.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 8007c2ba9751c074d10b","// Babel will optimize this for..of because it call tell the value is an array.\nexport default function root() {\n console.log(\"pause here\");\n\n for (const val of [1, 2]) {\n console.log(\"pause again\", (() => val)());\n }\n\n console.log(\"done\");\n}\n\n\n\n// WEBPACK FOOTER //\n// ./fixtures/step-over-for-of-array-closure/input.js"],"sourceRoot":""}
|
|
@ -0,0 +1,10 @@
|
|||
// Babel will optimize this for..of because it call tell the value is an array.
|
||||
export default function root() {
|
||||
console.log("pause here");
|
||||
|
||||
for (const val of [1, 2]) {
|
||||
console.log("pause again", val);
|
||||
}
|
||||
|
||||
console.log("done");
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
var stepOverForOfArray =
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 0);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([
|
||||
/* 0 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = root;
|
||||
// Babel will optimize this for..of because it call tell the value is an array.
|
||||
function root() {
|
||||
console.log("pause here");
|
||||
|
||||
var _arr = [1, 2];
|
||||
for (var _i = 0; _i < _arr.length; _i++) {
|
||||
var val = _arr[_i];
|
||||
console.log("pause again", val);
|
||||
}
|
||||
|
||||
console.log("done");
|
||||
}
|
||||
module.exports = exports["default"];
|
||||
|
||||
/***/ })
|
||||
/******/ ]);
|
||||
//# sourceMappingURL=output.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["webpack:///webpack/bootstrap 7b3f661ba4b415ad82ac","webpack:///./fixtures/step-over-for-of-array/input.js"],"names":["root","console","log","val"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;kBC5DwBA,I;AADxB;AACe,SAASA,IAAT,GAAgB;AAC7BC,UAAQC,GAAR,CAAY,YAAZ;;AAD6B,aAGX,CAAC,CAAD,EAAI,CAAJ,CAHW;AAG7B,2CAA0B;AAArB,QAAMC,cAAN;AACHF,YAAQC,GAAR,CAAY,aAAZ,EAA2BC,GAA3B;AACD;;AAEDF,UAAQC,GAAR,CAAY,MAAZ;AACD","file":"fixtures/step-over-for-of-array/output.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 7b3f661ba4b415ad82ac","// Babel will optimize this for..of because it call tell the value is an array.\nexport default function root() {\n console.log(\"pause here\");\n\n for (const val of [1, 2]) {\n console.log(\"pause again\", val);\n }\n\n console.log(\"done\");\n}\n\n\n\n// WEBPACK FOOTER //\n// ./fixtures/step-over-for-of-array/input.js"],"sourceRoot":""}
|
|
@ -0,0 +1,13 @@
|
|||
// Babel will convert the loop body to a function to handle the 'val' lexical
|
||||
// enclosure behavior.
|
||||
const vals = [1, 2];
|
||||
|
||||
export default function root() {
|
||||
console.log("pause here");
|
||||
|
||||
for (const val of vals) {
|
||||
console.log("pause again", (() => val)());
|
||||
}
|
||||
|
||||
console.log("done");
|
||||
}
|
|
@ -0,0 +1,122 @@
|
|||
var stepOverForOfClosure =
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 0);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([
|
||||
/* 0 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = root;
|
||||
// Babel will convert the loop body to a function to handle the 'val' lexical
|
||||
// enclosure behavior.
|
||||
var vals = [1, 2];
|
||||
|
||||
function root() {
|
||||
console.log("pause here");
|
||||
|
||||
var _loop = function _loop(val) {
|
||||
console.log("pause again", function () {
|
||||
return val;
|
||||
}());
|
||||
};
|
||||
|
||||
var _iteratorNormalCompletion = true;
|
||||
var _didIteratorError = false;
|
||||
var _iteratorError = undefined;
|
||||
|
||||
try {
|
||||
for (var _iterator = vals[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
||||
var val = _step.value;
|
||||
|
||||
_loop(val);
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError = true;
|
||||
_iteratorError = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion && _iterator.return) {
|
||||
_iterator.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log("done");
|
||||
}
|
||||
module.exports = exports["default"];
|
||||
|
||||
/***/ })
|
||||
/******/ ]);
|
||||
//# sourceMappingURL=output.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["webpack:///webpack/bootstrap e895e81ab9bbafd478e1","webpack:///./fixtures/step-over-for-of-closure/input.js"],"names":["root","vals","console","log","val"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;kBCzDwBA,I;AAJxB;AACA;AACA,IAAMC,OAAO,CAAC,CAAD,EAAI,CAAJ,CAAb;;AAEe,SAASD,IAAT,GAAgB;AAC7BE,UAAQC,GAAR,CAAY,YAAZ;;AAD6B,6BAGlBC,GAHkB;AAI3BF,YAAQC,GAAR,CAAY,aAAZ,EAA4B;AAAA,aAAMC,GAAN;AAAA,KAAD,EAA3B;AAJ2B;;AAAA;AAAA;AAAA;;AAAA;AAG7B,yBAAkBH,IAAlB,8HAAwB;AAAA,UAAbG,GAAa;;AAAA,YAAbA,GAAa;AAEvB;AAL4B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAO7BF,UAAQC,GAAR,CAAY,MAAZ;AACD","file":"fixtures/step-over-for-of-closure/output.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap e895e81ab9bbafd478e1","// Babel will convert the loop body to a function to handle the 'val' lexical\n// enclosure behavior.\nconst vals = [1, 2];\n\nexport default function root() {\n console.log(\"pause here\");\n\n for (const val of vals) {\n console.log(\"pause again\", (() => val)());\n }\n\n console.log(\"done\");\n}\n\n\n\n// WEBPACK FOOTER //\n// ./fixtures/step-over-for-of-closure/input.js"],"sourceRoot":""}
|
|
@ -0,0 +1,11 @@
|
|||
const vals = [1, 2];
|
||||
|
||||
export default function root() {
|
||||
console.log("pause here");
|
||||
|
||||
for (const val of vals) {
|
||||
console.log("pause again", val);
|
||||
}
|
||||
|
||||
console.log("done");
|
||||
}
|
|
@ -0,0 +1,114 @@
|
|||
var stepOverForOf =
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 0);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([
|
||||
/* 0 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = root;
|
||||
var vals = [1, 2];
|
||||
|
||||
function root() {
|
||||
console.log("pause here");
|
||||
|
||||
var _iteratorNormalCompletion = true;
|
||||
var _didIteratorError = false;
|
||||
var _iteratorError = undefined;
|
||||
|
||||
try {
|
||||
for (var _iterator = vals[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
||||
var val = _step.value;
|
||||
|
||||
console.log("pause again", val);
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError = true;
|
||||
_iteratorError = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion && _iterator.return) {
|
||||
_iterator.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log("done");
|
||||
}
|
||||
module.exports = exports["default"];
|
||||
|
||||
/***/ })
|
||||
/******/ ]);
|
||||
//# sourceMappingURL=output.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["webpack:///webpack/bootstrap fa9cfb0ec21ed77afaea","webpack:///./fixtures/step-over-for-of/input.js"],"names":["root","vals","console","log","val"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;kBC3DwBA,I;AAFxB,IAAMC,OAAO,CAAC,CAAD,EAAI,CAAJ,CAAb;;AAEe,SAASD,IAAT,GAAgB;AAC7BE,UAAQC,GAAR,CAAY,YAAZ;;AAD6B;AAAA;AAAA;;AAAA;AAG7B,yBAAkBF,IAAlB,8HAAwB;AAAA,UAAbG,GAAa;;AACtBF,cAAQC,GAAR,CAAY,aAAZ,EAA2BC,GAA3B;AACD;AAL4B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAO7BF,UAAQC,GAAR,CAAY,MAAZ;AACD","file":"fixtures/step-over-for-of/output.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap fa9cfb0ec21ed77afaea","const vals = [1, 2];\n\nexport default function root() {\n console.log(\"pause here\");\n\n for (const val of vals) {\n console.log(\"pause again\", val);\n }\n\n console.log(\"done\");\n}\n\n\n\n// WEBPACK FOOTER //\n// ./fixtures/step-over-for-of/input.js"],"sourceRoot":""}
|
|
@ -0,0 +1,8 @@
|
|||
function test(a1, a2 = 45, { a3, a4, a5: { a6: a7 } = {} } = {}) {
|
||||
console.log("pause next here");
|
||||
}
|
||||
|
||||
export default function fn() {
|
||||
console.log("pause here");
|
||||
test("1", undefined, { a3: "3", a4: "4", a5: { a6: "7" } });
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
var stepOverFunctionParams =
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 0);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([
|
||||
/* 0 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = fn;
|
||||
function test(a1) {
|
||||
var a2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 45;
|
||||
|
||||
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
||||
a3 = _ref.a3,
|
||||
a4 = _ref.a4,
|
||||
_ref$a = _ref.a5;
|
||||
|
||||
_ref$a = _ref$a === undefined ? {} : _ref$a;
|
||||
var a7 = _ref$a.a6;
|
||||
|
||||
console.log("pause next here");
|
||||
}
|
||||
|
||||
function fn() {
|
||||
console.log("pause here");
|
||||
test("1", undefined, { a3: "3", a4: "4", a5: { a6: "7" } });
|
||||
}
|
||||
module.exports = exports["default"];
|
||||
|
||||
/***/ })
|
||||
/******/ ]);
|
||||
//# sourceMappingURL=output.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["webpack:///webpack/bootstrap ae78a42f9270b2bb1f11","webpack:///./fixtures/step-over-function-params/input.js"],"names":["fn","test","a1","a2","a3","a4","a5","a7","a6","console","log","undefined"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;kBCzDwBA,E;AAJxB,SAASC,IAAT,CAAcC,EAAd,EAAiE;AAAA,MAA/CC,EAA+C,uEAA1C,EAA0C;;AAAA,iFAAJ,EAAI;AAAA,MAApCC,EAAoC,QAApCA,EAAoC;AAAA,MAAhCC,EAAgC,QAAhCA,EAAgC;AAAA,oBAA5BC,EAA4B;;AAAA,kCAAX,EAAW;AAAA,MAAlBC,EAAkB,UAAtBC,EAAsB;;AAC/DC,UAAQC,GAAR,CAAY,iBAAZ;AACD;;AAEc,SAASV,EAAT,GAAc;AAC3BS,UAAQC,GAAR,CAAY,YAAZ;AACAT,OAAK,GAAL,EAAUU,SAAV,EAAqB,EAAEP,IAAI,GAAN,EAAWC,IAAI,GAAf,EAAoBC,IAAI,EAAEE,IAAI,GAAN,EAAxB,EAArB;AACD","file":"fixtures/step-over-function-params/output.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap ae78a42f9270b2bb1f11","function test(a1, a2 = 45, { a3, a4, a5: { a6: a7 } = {} } = {}) {\n console.log(\"pause next here\");\n}\n\nexport default function fn() {\n console.log(\"pause here\");\n test(\"1\", undefined, { a3: \"3\", a4: \"4\", a5: { a6: \"7\" } });\n}\n\n\n\n// WEBPACK FOOTER //\n// ./fixtures/step-over-function-params/input.js"],"sourceRoot":""}
|
|
@ -0,0 +1,15 @@
|
|||
var fn = async function fn() {
|
||||
console.log("pause here");
|
||||
|
||||
await doAsync();
|
||||
|
||||
console.log("stopped here");
|
||||
};
|
||||
|
||||
function doAsync() {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
export default function root() {
|
||||
fn();
|
||||
}
|
|
@ -0,0 +1,122 @@
|
|||
var stepOverRegeneratorAwait =
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 0);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([
|
||||
/* 0 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = root;
|
||||
|
||||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
|
||||
|
||||
var fn = function () {
|
||||
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
console.log("pause here");
|
||||
|
||||
_context.next = 3;
|
||||
return doAsync();
|
||||
|
||||
case 3:
|
||||
|
||||
console.log("stopped here");
|
||||
|
||||
case 4:
|
||||
case "end":
|
||||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee, this);
|
||||
}));
|
||||
|
||||
function fn() {
|
||||
return _ref.apply(this, arguments);
|
||||
}
|
||||
|
||||
return fn;
|
||||
}();
|
||||
|
||||
function doAsync() {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
function root() {
|
||||
fn();
|
||||
}
|
||||
module.exports = exports["default"];
|
||||
|
||||
/***/ })
|
||||
/******/ ]);
|
||||
//# sourceMappingURL=output.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["webpack:///webpack/bootstrap e79f18ff625eb9f2cbed","webpack:///./fixtures/step-over-regenerator-await/input.js"],"names":["root","fn","console","log","doAsync","Promise","resolve"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;kBCjDwBA,I;;;;AAZxB,IAAIC;AAAA,qEAAK;AAAA;AAAA;AAAA;AAAA;AACPC,oBAAQC,GAAR,CAAY,YAAZ;;AADO;AAAA,mBAGDC,SAHC;;AAAA;;AAKPF,oBAAQC,GAAR,CAAY,cAAZ;;AALO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAAL;;AAAA,WAAoBF,EAApB;AAAA;AAAA;;AAAA,SAAoBA,EAApB;AAAA,GAAJ;;AAQA,SAASG,OAAT,GAAmB;AACjB,SAAOC,QAAQC,OAAR,EAAP;AACD;;AAEc,SAASN,IAAT,GAAgB;AAC7BC;AACD","file":"fixtures/step-over-regenerator-await/output.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap e79f18ff625eb9f2cbed","var fn = async function fn() {\n console.log(\"pause here\");\n\n await doAsync();\n\n console.log(\"stopped here\");\n};\n\nfunction doAsync() {\n return Promise.resolve();\n}\n\nexport default function root() {\n fn();\n}\n\n\n\n// WEBPACK FOOTER //\n// ./fixtures/step-over-regenerator-await/input.js"],"sourceRoot":""}
|
|
@ -17,6 +17,7 @@
|
|||
"webpack": "^3.7.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"lodash": "^4.17.5"
|
||||
}
|
||||
}
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -38,36 +38,46 @@ fs.writeFileSync(
|
|||
)
|
||||
);
|
||||
|
||||
module.exports = tests.map(({ name, dirname, input, output }) => {
|
||||
const babelEnv = name !== "webpackModulesEs6";
|
||||
const babelModules = name !== "webpackModules";
|
||||
|
||||
return {
|
||||
module.exports = [
|
||||
{
|
||||
context: __dirname,
|
||||
entry: input,
|
||||
entry: "babel-polyfill",
|
||||
output: {
|
||||
path: __dirname,
|
||||
filename: output,
|
||||
|
||||
libraryTarget: "var",
|
||||
library: name
|
||||
},
|
||||
devtool: "sourcemap",
|
||||
module: {
|
||||
loaders: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
loader: "babel-loader",
|
||||
options: {
|
||||
babelrc: false,
|
||||
presets: babelEnv
|
||||
? [["env", { modules: babelModules ? "commonjs" : false }]]
|
||||
: [],
|
||||
plugins: babelEnv && babelModules ? ["add-module-exports"] : []
|
||||
}
|
||||
}
|
||||
]
|
||||
filename: "polyfill-bundle.js"
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
].concat(
|
||||
tests.map(({ name, dirname, input, output }) => {
|
||||
const babelEnv = name !== "webpackModulesEs6";
|
||||
const babelModules = name !== "webpackModules";
|
||||
|
||||
return {
|
||||
context: __dirname,
|
||||
entry: input,
|
||||
output: {
|
||||
path: __dirname,
|
||||
filename: output,
|
||||
|
||||
libraryTarget: "var",
|
||||
library: name
|
||||
},
|
||||
devtool: "sourcemap",
|
||||
module: {
|
||||
loaders: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
loader: "babel-loader",
|
||||
options: {
|
||||
babelrc: false,
|
||||
presets: babelEnv
|
||||
? [["env", { modules: babelModules ? "commonjs" : false }]]
|
||||
: [],
|
||||
plugins: babelEnv && babelModules ? ["add-module-exports"] : []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
})
|
||||
);
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<script src="babel/polyfill-bundle.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- INJECTED-START -->
|
||||
|
@ -30,6 +31,18 @@
|
|||
<button onclick="nonModules()">Run nonModules</button>
|
||||
<script src="babel/fixtures/shadowed-vars/output.js"></script>
|
||||
<button onclick="shadowedVars()">Run shadowedVars</button>
|
||||
<script src="babel/fixtures/step-over-for-of/output.js"></script>
|
||||
<button onclick="stepOverForOf()">Run stepOverForOf</button>
|
||||
<script src="babel/fixtures/step-over-for-of-array/output.js"></script>
|
||||
<button onclick="stepOverForOfArray()">Run stepOverForOfArray</button>
|
||||
<script src="babel/fixtures/step-over-for-of-array-closure/output.js"></script>
|
||||
<button onclick="stepOverForOfArrayClosure()">Run stepOverForOfArrayClosure</button>
|
||||
<script src="babel/fixtures/step-over-for-of-closure/output.js"></script>
|
||||
<button onclick="stepOverForOfClosure()">Run stepOverForOfClosure</button>
|
||||
<script src="babel/fixtures/step-over-function-params/output.js"></script>
|
||||
<button onclick="stepOverFunctionParams()">Run stepOverFunctionParams</button>
|
||||
<script src="babel/fixtures/step-over-regenerator-await/output.js"></script>
|
||||
<button onclick="stepOverRegeneratorAwait()">Run stepOverRegeneratorAwait</button>
|
||||
<script src="babel/fixtures/switches/output.js"></script>
|
||||
<button onclick="switches()">Run switches</button>
|
||||
<script src="babel/fixtures/this-arguments-bindings/output.js"></script>
|
||||
|
|
|
@ -109,6 +109,55 @@ nsContentSecurityManager::AllowTopLevelNavigationToDataURI(nsIChannel* aChannel)
|
|||
return false;
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
nsContentSecurityManager::AllowInsecureRedirectToDataURI(nsIChannel* aNewChannel)
|
||||
{
|
||||
nsCOMPtr<nsILoadInfo> loadInfo = aNewChannel->GetLoadInfo();
|
||||
if (!loadInfo) {
|
||||
return true;
|
||||
}
|
||||
if (loadInfo->GetExternalContentPolicyType() != nsIContentPolicy::TYPE_SCRIPT) {
|
||||
return true;
|
||||
}
|
||||
nsCOMPtr<nsIURI> newURI;
|
||||
nsresult rv = NS_GetFinalChannelURI(aNewChannel, getter_AddRefs(newURI));
|
||||
if (NS_FAILED(rv) || !newURI) {
|
||||
return true;
|
||||
}
|
||||
bool isDataURI = (NS_SUCCEEDED(newURI->SchemeIs("data", &isDataURI)) && isDataURI);
|
||||
if (!isDataURI) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Web Extensions are exempt from that restriction and are allowed to redirect
|
||||
// a channel to a data: URI. When a web extension redirects a channel, we set
|
||||
// a flag on the loadInfo which allows us to identify such redirects here.
|
||||
if (loadInfo->GetAllowInsecureRedirectToDataURI()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
nsAutoCString dataSpec;
|
||||
newURI->GetSpec(dataSpec);
|
||||
if (dataSpec.Length() > 50) {
|
||||
dataSpec.Truncate(50);
|
||||
dataSpec.AppendLiteral("...");
|
||||
}
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
nsINode* node = loadInfo->LoadingNode();
|
||||
if (node) {
|
||||
doc = node->OwnerDoc();
|
||||
}
|
||||
NS_ConvertUTF8toUTF16 specUTF16(NS_UnescapeURL(dataSpec));
|
||||
const char16_t* params[] = { specUTF16.get() };
|
||||
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
|
||||
NS_LITERAL_CSTRING("DATA_URI_BLOCKED"),
|
||||
doc,
|
||||
nsContentUtils::eSECURITY_PROPERTIES,
|
||||
"BlockSubresourceRedirectToData",
|
||||
params, ArrayLength(params));
|
||||
return false;
|
||||
}
|
||||
|
||||
static nsresult
|
||||
ValidateSecurityFlags(nsILoadInfo* aLoadInfo)
|
||||
{
|
||||
|
@ -608,33 +657,10 @@ nsContentSecurityManager::AsyncOnChannelRedirect(nsIChannel* aOldChannel,
|
|||
NS_ENSURE_STATE(oldPrincipal && newURI);
|
||||
|
||||
// Do not allow insecure redirects to data: URIs
|
||||
if (loadInfo && loadInfo->GetExternalContentPolicyType() == nsIContentPolicy::TYPE_SCRIPT) {
|
||||
bool isDataURI = (NS_SUCCEEDED(newURI->SchemeIs("data", &isDataURI)) && isDataURI);
|
||||
if (isDataURI) {
|
||||
nsAutoCString dataSpec;
|
||||
newURI->GetSpec(dataSpec);
|
||||
if (dataSpec.Length() > 50) {
|
||||
dataSpec.Truncate(50);
|
||||
dataSpec.AppendLiteral("...");
|
||||
}
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
nsINode* node = loadInfo->LoadingNode();
|
||||
if (node) {
|
||||
doc = node->OwnerDoc();
|
||||
}
|
||||
NS_ConvertUTF8toUTF16 specUTF16(NS_UnescapeURL(dataSpec));
|
||||
const char16_t* params[] = { specUTF16.get() };
|
||||
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
|
||||
NS_LITERAL_CSTRING("DATA_URI_BLOCKED"),
|
||||
doc,
|
||||
nsContentUtils::eSECURITY_PROPERTIES,
|
||||
"BlockSubresourceRedirectToData",
|
||||
params, ArrayLength(params));
|
||||
|
||||
// cancel the old channel and return an error
|
||||
aOldChannel->Cancel(NS_ERROR_CONTENT_BLOCKED);
|
||||
return NS_ERROR_CONTENT_BLOCKED;
|
||||
}
|
||||
if (!AllowInsecureRedirectToDataURI(aNewChannel)) {
|
||||
// cancel the old channel and return an error
|
||||
aOldChannel->Cancel(NS_ERROR_CONTENT_BLOCKED);
|
||||
return NS_ERROR_CONTENT_BLOCKED;
|
||||
}
|
||||
|
||||
const uint32_t flags =
|
||||
|
|
|
@ -34,6 +34,7 @@ public:
|
|||
nsCOMPtr<nsIStreamListener>& aInAndOutListener);
|
||||
|
||||
static bool AllowTopLevelNavigationToDataURI(nsIChannel* aChannel);
|
||||
static bool AllowInsecureRedirectToDataURI(nsIChannel* aNewChannel);
|
||||
|
||||
private:
|
||||
static nsresult CheckChannel(nsIChannel* aChannel);
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "mozilla/dom/U2FHIDTokenManager.h"
|
||||
#include "mozilla/ipc/BackgroundParent.h"
|
||||
#include "mozilla/StaticMutex.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -23,7 +24,7 @@ u2f_register_callback(uint64_t aTransactionId, rust_u2f_result* aResult)
|
|||
}
|
||||
|
||||
UniquePtr<U2FResult> rv = MakeUnique<U2FResult>(aTransactionId, aResult);
|
||||
nsCOMPtr<nsIRunnable> r(NewNonOwningRunnableMethod<UniquePtr<U2FResult>&&>(
|
||||
nsCOMPtr<nsIRunnable> r(NewRunnableMethod<UniquePtr<U2FResult>&&>(
|
||||
"U2FHIDTokenManager::HandleRegisterResult", gInstance,
|
||||
&U2FHIDTokenManager::HandleRegisterResult, Move(rv)));
|
||||
|
||||
|
@ -40,7 +41,7 @@ u2f_sign_callback(uint64_t aTransactionId, rust_u2f_result* aResult)
|
|||
}
|
||||
|
||||
UniquePtr<U2FResult> rv = MakeUnique<U2FResult>(aTransactionId, aResult);
|
||||
nsCOMPtr<nsIRunnable> r(NewNonOwningRunnableMethod<UniquePtr<U2FResult>&&>(
|
||||
nsCOMPtr<nsIRunnable> r(NewRunnableMethod<UniquePtr<U2FResult>&&>(
|
||||
"U2FHIDTokenManager::HandleSignResult", gInstance,
|
||||
&U2FHIDTokenManager::HandleSignResult, Move(rv)));
|
||||
|
||||
|
@ -51,8 +52,8 @@ u2f_sign_callback(uint64_t aTransactionId, rust_u2f_result* aResult)
|
|||
U2FHIDTokenManager::U2FHIDTokenManager() : mTransactionId(0)
|
||||
{
|
||||
StaticMutexAutoLock lock(gInstanceMutex);
|
||||
mozilla::ipc::AssertIsOnBackgroundThread();
|
||||
MOZ_ASSERT(XRE_IsParentProcess());
|
||||
MOZ_ASSERT(!NS_IsMainThread());
|
||||
MOZ_ASSERT(!gInstance);
|
||||
|
||||
mU2FManager = rust_u2f_mgr_new();
|
||||
|
@ -61,11 +62,12 @@ U2FHIDTokenManager::U2FHIDTokenManager() : mTransactionId(0)
|
|||
gInstance = this;
|
||||
}
|
||||
|
||||
U2FHIDTokenManager::~U2FHIDTokenManager()
|
||||
void
|
||||
U2FHIDTokenManager::Drop()
|
||||
{
|
||||
{
|
||||
StaticMutexAutoLock lock(gInstanceMutex);
|
||||
MOZ_ASSERT(NS_GetCurrentThread() == gPBackgroundThread);
|
||||
mozilla::ipc::AssertIsOnBackgroundThread();
|
||||
|
||||
mRegisterPromise.RejectIfExists(NS_ERROR_DOM_UNKNOWN_ERR, __func__);
|
||||
mSignPromise.RejectIfExists(NS_ERROR_DOM_UNKNOWN_ERR, __func__);
|
||||
|
@ -78,6 +80,9 @@ U2FHIDTokenManager::~U2FHIDTokenManager()
|
|||
// u2f_{register,sign}_callback to lock and return.
|
||||
rust_u2f_mgr_free(mU2FManager);
|
||||
mU2FManager = nullptr;
|
||||
|
||||
// Reset transaction ID so that queued runnables exit early.
|
||||
mTransactionId = 0;
|
||||
}
|
||||
|
||||
// A U2F Register operation causes a new key pair to be generated by the token.
|
||||
|
@ -106,7 +111,7 @@ U2FHIDTokenManager::Register(const nsTArray<WebAuthnScopedCredential>& aCredenti
|
|||
const nsTArray<uint8_t>& aChallenge,
|
||||
uint32_t aTimeoutMS)
|
||||
{
|
||||
MOZ_ASSERT(NS_GetCurrentThread() == gPBackgroundThread);
|
||||
mozilla::ipc::AssertIsOnBackgroundThread();
|
||||
|
||||
uint64_t registerFlags = 0;
|
||||
|
||||
|
@ -162,7 +167,7 @@ U2FHIDTokenManager::Sign(const nsTArray<WebAuthnScopedCredential>& aCredentials,
|
|||
bool aRequireUserVerification,
|
||||
uint32_t aTimeoutMS)
|
||||
{
|
||||
MOZ_ASSERT(NS_GetCurrentThread() == gPBackgroundThread);
|
||||
mozilla::ipc::AssertIsOnBackgroundThread();
|
||||
|
||||
uint64_t signFlags = 0;
|
||||
|
||||
|
@ -191,7 +196,7 @@ U2FHIDTokenManager::Sign(const nsTArray<WebAuthnScopedCredential>& aCredentials,
|
|||
void
|
||||
U2FHIDTokenManager::Cancel()
|
||||
{
|
||||
MOZ_ASSERT(NS_GetCurrentThread() == gPBackgroundThread);
|
||||
mozilla::ipc::AssertIsOnBackgroundThread();
|
||||
|
||||
ClearPromises();
|
||||
mTransactionId = rust_u2f_mgr_cancel(mU2FManager);
|
||||
|
@ -200,7 +205,7 @@ U2FHIDTokenManager::Cancel()
|
|||
void
|
||||
U2FHIDTokenManager::HandleRegisterResult(UniquePtr<U2FResult>&& aResult)
|
||||
{
|
||||
MOZ_ASSERT(NS_GetCurrentThread() == gPBackgroundThread);
|
||||
mozilla::ipc::AssertIsOnBackgroundThread();
|
||||
|
||||
if (aResult->GetTransactionId() != mTransactionId) {
|
||||
return;
|
||||
|
@ -221,7 +226,7 @@ U2FHIDTokenManager::HandleRegisterResult(UniquePtr<U2FResult>&& aResult)
|
|||
void
|
||||
U2FHIDTokenManager::HandleSignResult(UniquePtr<U2FResult>&& aResult)
|
||||
{
|
||||
MOZ_ASSERT(NS_GetCurrentThread() == gPBackgroundThread);
|
||||
mozilla::ipc::AssertIsOnBackgroundThread();
|
||||
|
||||
if (aResult->GetTransactionId() != mTransactionId) {
|
||||
return;
|
||||
|
|
|
@ -93,14 +93,14 @@ class U2FHIDTokenManager final : public U2FTokenTransport
|
|||
public:
|
||||
explicit U2FHIDTokenManager();
|
||||
|
||||
virtual RefPtr<U2FRegisterPromise>
|
||||
RefPtr<U2FRegisterPromise>
|
||||
Register(const nsTArray<WebAuthnScopedCredential>& aCredentials,
|
||||
const WebAuthnAuthenticatorSelection &aAuthenticatorSelection,
|
||||
const nsTArray<uint8_t>& aApplication,
|
||||
const nsTArray<uint8_t>& aChallenge,
|
||||
uint32_t aTimeoutMS) override;
|
||||
|
||||
virtual RefPtr<U2FSignPromise>
|
||||
RefPtr<U2FSignPromise>
|
||||
Sign(const nsTArray<WebAuthnScopedCredential>& aCredentials,
|
||||
const nsTArray<uint8_t>& aApplication,
|
||||
const nsTArray<uint8_t>& aChallenge,
|
||||
|
@ -108,12 +108,13 @@ public:
|
|||
uint32_t aTimeoutMS) override;
|
||||
|
||||
void Cancel() override;
|
||||
void Drop() override;
|
||||
|
||||
void HandleRegisterResult(UniquePtr<U2FResult>&& aResult);
|
||||
void HandleSignResult(UniquePtr<U2FResult>&& aResult);
|
||||
|
||||
private:
|
||||
~U2FHIDTokenManager();
|
||||
~U2FHIDTokenManager() { }
|
||||
|
||||
void ClearPromises() {
|
||||
mRegisterPromise.RejectIfExists(NS_ERROR_DOM_UNKNOWN_ERR, __func__);
|
||||
|
|
|
@ -23,21 +23,21 @@ class U2FSoftTokenManager final : public U2FTokenTransport
|
|||
public:
|
||||
explicit U2FSoftTokenManager(uint32_t aCounter);
|
||||
|
||||
virtual RefPtr<U2FRegisterPromise>
|
||||
RefPtr<U2FRegisterPromise>
|
||||
Register(const nsTArray<WebAuthnScopedCredential>& aCredentials,
|
||||
const WebAuthnAuthenticatorSelection &aAuthenticatorSelection,
|
||||
const nsTArray<uint8_t>& aApplication,
|
||||
const nsTArray<uint8_t>& aChallenge,
|
||||
uint32_t aTimeoutMS) override;
|
||||
|
||||
virtual RefPtr<U2FSignPromise>
|
||||
RefPtr<U2FSignPromise>
|
||||
Sign(const nsTArray<WebAuthnScopedCredential>& aCredentials,
|
||||
const nsTArray<uint8_t>& aApplication,
|
||||
const nsTArray<uint8_t>& aChallenge,
|
||||
bool aRequireUserVerification,
|
||||
uint32_t aTimeoutMS) override;
|
||||
|
||||
virtual void Cancel() override;
|
||||
void Cancel() override;
|
||||
|
||||
private:
|
||||
~U2FSoftTokenManager() {}
|
||||
|
|
|
@ -180,7 +180,10 @@ U2FTokenManager::ClearTransaction()
|
|||
{
|
||||
mTransactionParent = nullptr;
|
||||
// Drop managers at the end of all transactions
|
||||
mTokenManagerImpl = nullptr;
|
||||
if (mTokenManagerImpl) {
|
||||
mTokenManagerImpl->Drop();
|
||||
mTokenManagerImpl = nullptr;
|
||||
}
|
||||
// Forget promises, if necessary.
|
||||
mRegisterPromise.DisconnectIfExists();
|
||||
mSignPromise.DisconnectIfExists();
|
||||
|
|
|
@ -43,6 +43,8 @@ public:
|
|||
|
||||
virtual void Cancel() = 0;
|
||||
|
||||
virtual void Drop() { }
|
||||
|
||||
protected:
|
||||
virtual ~U2FTokenTransport() = default;
|
||||
};
|
||||
|
|
|
@ -730,58 +730,11 @@ ContainerLayerComposite::CleanupResources()
|
|||
}
|
||||
}
|
||||
|
||||
static LayerIntRect
|
||||
TransformRect(const LayerIntRect& aRect, const Matrix4x4& aTransform)
|
||||
{
|
||||
if (aRect.IsEmpty()) {
|
||||
return LayerIntRect();
|
||||
}
|
||||
|
||||
Rect rect(aRect.X(), aRect.Y(), aRect.Width(), aRect.Height());
|
||||
rect = aTransform.TransformAndClipBounds(rect, Rect::MaxIntRect());
|
||||
rect.RoundOut();
|
||||
|
||||
IntRect intRect;
|
||||
if (!gfxUtils::GfxRectToIntRect(ThebesRect(rect), &intRect)) {
|
||||
return LayerIntRect();
|
||||
}
|
||||
|
||||
return ViewAs<LayerPixel>(intRect);
|
||||
}
|
||||
|
||||
static void
|
||||
AddTransformedRegion(LayerIntRegion& aDest, const LayerIntRegion& aSource, const Matrix4x4& aTransform)
|
||||
{
|
||||
for (auto iter = aSource.RectIter(); !iter.Done(); iter.Next()) {
|
||||
aDest.Or(aDest, TransformRect(iter.Get(), aTransform));
|
||||
}
|
||||
aDest.SimplifyOutward(20);
|
||||
}
|
||||
|
||||
// Async animations can move child layers without updating our visible region.
|
||||
// PostProcessLayers will recompute visible regions for layers with an intermediate
|
||||
// surface, but otherwise we need to do it now.
|
||||
void
|
||||
ComputeVisibleRegionForChildren(ContainerLayer* aContainer, LayerIntRegion& aResult)
|
||||
{
|
||||
for (Layer* l = aContainer->GetFirstChild(); l; l = l->GetNextSibling()) {
|
||||
if (l->Extend3DContext()) {
|
||||
MOZ_ASSERT(l->AsContainerLayer());
|
||||
ComputeVisibleRegionForChildren(l->AsContainerLayer(), aResult);
|
||||
} else {
|
||||
AddTransformedRegion(aResult,
|
||||
l->GetLocalVisibleRegion(),
|
||||
l->ComputeTransformToPreserve3DRoot());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const LayerIntRegion&
|
||||
ContainerLayerComposite::GetShadowVisibleRegion()
|
||||
{
|
||||
if (!UseIntermediateSurface()) {
|
||||
mShadowVisibleRegion.SetEmpty();
|
||||
ComputeVisibleRegionForChildren(this, mShadowVisibleRegion);
|
||||
RecomputeShadowVisibleRegionFromChildren();
|
||||
}
|
||||
|
||||
return mShadowVisibleRegion;
|
||||
|
@ -791,8 +744,7 @@ const LayerIntRegion&
|
|||
RefLayerComposite::GetShadowVisibleRegion()
|
||||
{
|
||||
if (!UseIntermediateSurface()) {
|
||||
mShadowVisibleRegion.SetEmpty();
|
||||
ComputeVisibleRegionForChildren(this, mShadowVisibleRegion);
|
||||
RecomputeShadowVisibleRegionFromChildren();
|
||||
}
|
||||
|
||||
return mShadowVisibleRegion;
|
||||
|
|
|
@ -1487,6 +1487,63 @@ HostLayer::GetShadowTransform() {
|
|||
return transform;
|
||||
}
|
||||
|
||||
static LayerIntRect
|
||||
TransformRect(const LayerIntRect& aRect, const Matrix4x4& aTransform)
|
||||
{
|
||||
if (aRect.IsEmpty()) {
|
||||
return LayerIntRect();
|
||||
}
|
||||
|
||||
Rect rect(aRect.X(), aRect.Y(), aRect.Width(), aRect.Height());
|
||||
rect = aTransform.TransformAndClipBounds(rect, Rect::MaxIntRect());
|
||||
rect.RoundOut();
|
||||
|
||||
IntRect intRect;
|
||||
if (!gfxUtils::GfxRectToIntRect(ThebesRect(rect), &intRect)) {
|
||||
return LayerIntRect();
|
||||
}
|
||||
|
||||
return ViewAs<LayerPixel>(intRect);
|
||||
}
|
||||
|
||||
static void
|
||||
AddTransformedRegion(LayerIntRegion& aDest, const LayerIntRegion& aSource, const Matrix4x4& aTransform)
|
||||
{
|
||||
for (auto iter = aSource.RectIter(); !iter.Done(); iter.Next()) {
|
||||
aDest.Or(aDest, TransformRect(iter.Get(), aTransform));
|
||||
}
|
||||
aDest.SimplifyOutward(20);
|
||||
}
|
||||
|
||||
// Async animations can move child layers without updating our visible region.
|
||||
// PostProcessLayers will recompute visible regions for layers with an intermediate
|
||||
// surface, but otherwise we need to do it now.
|
||||
void
|
||||
ComputeVisibleRegionForChildren(ContainerLayer* aContainer, LayerIntRegion& aResult)
|
||||
{
|
||||
for (Layer* l = aContainer->GetFirstChild(); l; l = l->GetNextSibling()) {
|
||||
if (l->Extend3DContext()) {
|
||||
MOZ_ASSERT(l->AsContainerLayer());
|
||||
ComputeVisibleRegionForChildren(l->AsContainerLayer(), aResult);
|
||||
} else {
|
||||
AddTransformedRegion(aResult,
|
||||
l->GetLocalVisibleRegion(),
|
||||
l->ComputeTransformToPreserve3DRoot());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
HostLayer::RecomputeShadowVisibleRegionFromChildren()
|
||||
{
|
||||
mShadowVisibleRegion.SetEmpty();
|
||||
ContainerLayer* container = GetLayer()->AsContainerLayer();
|
||||
MOZ_ASSERT(container);
|
||||
if (container) {
|
||||
ComputeVisibleRegionForChildren(container, mShadowVisibleRegion);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
LayerComposite::HasStaleCompositor() const
|
||||
{
|
||||
|
|
|
@ -613,6 +613,8 @@ public:
|
|||
bool GetShadowTransformSetByAnimation() { return mShadowTransformSetByAnimation; }
|
||||
bool GetShadowOpacitySetByAnimation() { return mShadowOpacitySetByAnimation; }
|
||||
|
||||
void RecomputeShadowVisibleRegionFromChildren();
|
||||
|
||||
protected:
|
||||
HostLayerManager* mCompositorManager;
|
||||
|
||||
|
|
|
@ -244,5 +244,25 @@ ContainerLayerMLGPU::IsContentOpaque()
|
|||
return LayerMLGPU::IsContentOpaque();
|
||||
}
|
||||
|
||||
const LayerIntRegion&
|
||||
ContainerLayerMLGPU::GetShadowVisibleRegion()
|
||||
{
|
||||
if (!UseIntermediateSurface()) {
|
||||
RecomputeShadowVisibleRegionFromChildren();
|
||||
}
|
||||
|
||||
return mShadowVisibleRegion;
|
||||
}
|
||||
|
||||
const LayerIntRegion&
|
||||
RefLayerMLGPU::GetShadowVisibleRegion()
|
||||
{
|
||||
if (!UseIntermediateSurface()) {
|
||||
RecomputeShadowVisibleRegionFromChildren();
|
||||
}
|
||||
|
||||
return mShadowVisibleRegion;
|
||||
}
|
||||
|
||||
} // namespace layers
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -35,6 +35,8 @@ public:
|
|||
void SetInvalidCompositeRect(const gfx::IntRect* aRect) override;
|
||||
void ClearCachedResources() override;
|
||||
|
||||
const LayerIntRegion& GetShadowVisibleRegion() override;
|
||||
|
||||
RefPtr<MLGRenderTarget> UpdateRenderTarget(
|
||||
MLGDevice* aDevice,
|
||||
MLGRenderTargetFlags aFlags);
|
||||
|
|
|
@ -151,6 +151,8 @@ public:
|
|||
DefaultComputeEffectiveTransforms(aTransformToSurface);
|
||||
}
|
||||
|
||||
const LayerIntRegion& GetShadowVisibleRegion() override;
|
||||
|
||||
MOZ_LAYER_DECL_NAME("RefLayerMLGPU", TYPE_REF)
|
||||
};
|
||||
|
||||
|
|
|
@ -408,6 +408,7 @@ LoadInfoToLoadInfoArgs(nsILoadInfo *aLoadInfo,
|
|||
aLoadInfo->GetEnforceSRI(),
|
||||
aLoadInfo->GetAllowDocumentToBeAgnosticToCSP(),
|
||||
aLoadInfo->GetForceAllowDataURI(),
|
||||
aLoadInfo->GetAllowInsecureRedirectToDataURI(),
|
||||
aLoadInfo->GetForceInheritPrincipalDropped(),
|
||||
aLoadInfo->GetInnerWindowID(),
|
||||
aLoadInfo->GetOuterWindowID(),
|
||||
|
@ -554,6 +555,7 @@ LoadInfoArgsToLoadInfo(const OptionalLoadInfoArgs& aOptionalLoadInfoArgs,
|
|||
loadInfoArgs.enforceSRI(),
|
||||
loadInfoArgs.allowDocumentToBeAgnosticToCSP(),
|
||||
loadInfoArgs.forceAllowDataURI(),
|
||||
loadInfoArgs.allowInsecureRedirectToDataURI(),
|
||||
loadInfoArgs.forceInheritPrincipalDropped(),
|
||||
loadInfoArgs.innerWindowID(),
|
||||
loadInfoArgs.outerWindowID(),
|
||||
|
|
|
@ -39,19 +39,9 @@ using mozilla::AssertedCast;
|
|||
using JS::CanonicalizeNaN;
|
||||
using JS::ToInt32;
|
||||
|
||||
static NewObjectKind
|
||||
DataViewNewObjectKind(JSContext* cx)
|
||||
{
|
||||
jsbytecode* pc;
|
||||
JSScript* script = cx->currentScript(&pc);
|
||||
if (script && ObjectGroup::useSingletonForAllocationSite(script, pc, &DataViewObject::class_))
|
||||
return SingletonObject;
|
||||
return GenericObject;
|
||||
}
|
||||
|
||||
DataViewObject*
|
||||
DataViewObject::create(JSContext* cx, uint32_t byteOffset, uint32_t byteLength,
|
||||
Handle<ArrayBufferObjectMaybeShared*> arrayBuffer, JSObject* protoArg)
|
||||
Handle<ArrayBufferObjectMaybeShared*> arrayBuffer, HandleObject proto)
|
||||
{
|
||||
if (arrayBuffer->isDetached()) {
|
||||
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_TYPED_ARRAY_DETACHED);
|
||||
|
@ -62,52 +52,32 @@ DataViewObject::create(JSContext* cx, uint32_t byteOffset, uint32_t byteLength,
|
|||
MOZ_ASSERT(byteLength <= INT32_MAX);
|
||||
MOZ_ASSERT(byteOffset + byteLength < UINT32_MAX);
|
||||
|
||||
RootedObject proto(cx, protoArg);
|
||||
RootedObject obj(cx);
|
||||
|
||||
NewObjectKind newKind = DataViewNewObjectKind(cx);
|
||||
obj = NewObjectWithClassProto(cx, &class_, proto, newKind);
|
||||
DataViewObject* obj = NewObjectWithClassProto<DataViewObject>(cx, proto);
|
||||
if (!obj)
|
||||
return nullptr;
|
||||
|
||||
if (!proto) {
|
||||
if (byteLength >= TypedArrayObject::SINGLETON_BYTE_LENGTH) {
|
||||
MOZ_ASSERT(obj->isSingleton());
|
||||
} else {
|
||||
jsbytecode* pc;
|
||||
RootedScript script(cx, cx->currentScript(&pc));
|
||||
if (script && !ObjectGroup::setAllocationSiteObjectGroup(cx, script, pc, obj,
|
||||
newKind == SingletonObject))
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Caller should have established these preconditions, and no
|
||||
// (non-self-hosted) JS code has had an opportunity to run so nothing can
|
||||
// have invalidated them.
|
||||
MOZ_ASSERT(byteOffset <= arrayBuffer->byteLength());
|
||||
MOZ_ASSERT(byteOffset + byteLength <= arrayBuffer->byteLength());
|
||||
|
||||
DataViewObject& dvobj = obj->as<DataViewObject>();
|
||||
|
||||
// The isSharedMemory property is invariant. Self-hosting code that sets
|
||||
// BUFFER_SLOT or the private slot (if it does) must maintain it by always
|
||||
// setting those to reference shared memory.
|
||||
bool isSharedMemory = IsSharedArrayBuffer(arrayBuffer.get());
|
||||
if (isSharedMemory)
|
||||
dvobj.setIsSharedMemory();
|
||||
obj->setIsSharedMemory();
|
||||
|
||||
dvobj.setFixedSlot(TypedArrayObject::BYTEOFFSET_SLOT, Int32Value(byteOffset));
|
||||
dvobj.setFixedSlot(TypedArrayObject::LENGTH_SLOT, Int32Value(byteLength));
|
||||
dvobj.setFixedSlot(TypedArrayObject::BUFFER_SLOT, ObjectValue(*arrayBuffer));
|
||||
obj->setFixedSlot(TypedArrayObject::BYTEOFFSET_SLOT, Int32Value(byteOffset));
|
||||
obj->setFixedSlot(TypedArrayObject::LENGTH_SLOT, Int32Value(byteLength));
|
||||
obj->setFixedSlot(TypedArrayObject::BUFFER_SLOT, ObjectValue(*arrayBuffer));
|
||||
|
||||
SharedMem<uint8_t*> ptr = arrayBuffer->dataPointerEither();
|
||||
// A pointer to raw shared memory is exposed through the private slot. This
|
||||
// is safe so long as getPrivate() is not used willy-nilly. It is wrapped in
|
||||
// other accessors in TypedArrayObject.h.
|
||||
dvobj.initPrivate(ptr.unwrap(/*safe - see above*/) + byteOffset);
|
||||
obj->initPrivate(ptr.unwrap(/*safe - see above*/) + byteOffset);
|
||||
|
||||
// Include a barrier if the data view's data pointer is in the nursery, as
|
||||
// is done for typed arrays.
|
||||
|
@ -126,14 +96,14 @@ DataViewObject::create(JSContext* cx, uint32_t byteOffset, uint32_t byteLength,
|
|||
}
|
||||
|
||||
// Verify that the private slot is at the expected place
|
||||
MOZ_ASSERT(dvobj.numFixedSlots() == TypedArrayObject::DATA_SLOT);
|
||||
MOZ_ASSERT(obj->numFixedSlots() == TypedArrayObject::DATA_SLOT);
|
||||
|
||||
if (arrayBuffer->is<ArrayBufferObject>()) {
|
||||
if (!arrayBuffer->as<ArrayBufferObject>().addView(cx, &dvobj))
|
||||
if (!arrayBuffer->as<ArrayBufferObject>().addView(cx, obj))
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return &dvobj;
|
||||
return obj;
|
||||
}
|
||||
|
||||
// ES2017 draft rev 931261ecef9b047b14daacf82884134da48dfe0f
|
||||
|
|
|
@ -56,7 +56,7 @@ class DataViewObject : public NativeObject
|
|||
|
||||
static DataViewObject*
|
||||
create(JSContext* cx, uint32_t byteOffset, uint32_t byteLength,
|
||||
Handle<ArrayBufferObjectMaybeShared*> arrayBuffer, JSObject* proto);
|
||||
Handle<ArrayBufferObjectMaybeShared*> arrayBuffer, HandleObject proto);
|
||||
|
||||
public:
|
||||
static const Class class_;
|
||||
|
|
|
@ -245,11 +245,14 @@ ProtectionSettingToFlags(ProtectionSetting protection)
|
|||
MOZ_CRASH();
|
||||
}
|
||||
|
||||
static void
|
||||
static MOZ_MUST_USE bool
|
||||
CommitPages(void* addr, size_t bytes, ProtectionSetting protection)
|
||||
{
|
||||
if (!VirtualAlloc(addr, bytes, MEM_COMMIT, ProtectionSettingToFlags(protection)))
|
||||
MOZ_CRASH_UNSAFE_PRINTF("CommitPages failed! Error code: %lu", GetLastError());
|
||||
void* p = VirtualAlloc(addr, bytes, MEM_COMMIT, ProtectionSettingToFlags(protection));
|
||||
if (!p)
|
||||
return false;
|
||||
MOZ_RELEASE_ASSERT(p == addr);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -330,13 +333,16 @@ ProtectionSettingToFlags(ProtectionSetting protection)
|
|||
MOZ_CRASH();
|
||||
}
|
||||
|
||||
static void
|
||||
static MOZ_MUST_USE bool
|
||||
CommitPages(void* addr, size_t bytes, ProtectionSetting protection)
|
||||
{
|
||||
void* p = MozTaggedAnonymousMmap(addr, bytes, ProtectionSettingToFlags(protection),
|
||||
MAP_FIXED | MAP_PRIVATE | MAP_ANON,
|
||||
-1, 0, "js-executable-memory");
|
||||
MOZ_RELEASE_ASSERT(addr == p);
|
||||
if (p == MAP_FAILED)
|
||||
return false;
|
||||
MOZ_RELEASE_ASSERT(p == addr);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -494,7 +500,7 @@ class ProcessExecutableMemory
|
|||
}
|
||||
|
||||
void* allocate(size_t bytes, ProtectionSetting protection);
|
||||
void deallocate(void* addr, size_t bytes);
|
||||
void deallocate(void* addr, size_t bytes, bool decommit);
|
||||
};
|
||||
|
||||
void*
|
||||
|
@ -559,12 +565,16 @@ ProcessExecutableMemory::allocate(size_t bytes, ProtectionSetting protection)
|
|||
}
|
||||
|
||||
// Commit the pages after releasing the lock.
|
||||
CommitPages(p, bytes, protection);
|
||||
if (!CommitPages(p, bytes, protection)) {
|
||||
deallocate(p, bytes, /* decommit = */ false);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
void
|
||||
ProcessExecutableMemory::deallocate(void* addr, size_t bytes)
|
||||
ProcessExecutableMemory::deallocate(void* addr, size_t bytes, bool decommit)
|
||||
{
|
||||
MOZ_ASSERT(initialized());
|
||||
MOZ_ASSERT(addr);
|
||||
|
@ -578,7 +588,8 @@ ProcessExecutableMemory::deallocate(void* addr, size_t bytes)
|
|||
size_t numPages = bytes / ExecutableCodePageSize;
|
||||
|
||||
// Decommit before taking the lock.
|
||||
DecommitPages(addr, bytes);
|
||||
if (decommit)
|
||||
DecommitPages(addr, bytes);
|
||||
|
||||
LockGuard<Mutex> guard(lock_);
|
||||
MOZ_ASSERT(numPages <= pagesAllocated_);
|
||||
|
@ -604,7 +615,7 @@ js::jit::AllocateExecutableMemory(size_t bytes, ProtectionSetting protection)
|
|||
void
|
||||
js::jit::DeallocateExecutableMemory(void* addr, size_t bytes)
|
||||
{
|
||||
execMemory.deallocate(addr, bytes);
|
||||
execMemory.deallocate(addr, bytes, /* decommit = */ true);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "jsnum.h"
|
||||
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
#include "mozilla/double-conversion.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "mozilla/RangedPtr.h"
|
||||
|
||||
|
@ -24,6 +23,7 @@
|
|||
#include "jsstr.h"
|
||||
#include "jstypes.h"
|
||||
|
||||
#include "double-conversion/double-conversion.h"
|
||||
#include "js/Conversions.h"
|
||||
#include "util/DoubleToString.h"
|
||||
#include "vm/GlobalObject.h"
|
||||
|
|
|
@ -1643,6 +1643,11 @@ function test(sharedMem) {
|
|||
dv = 1;
|
||||
gc();
|
||||
|
||||
// Bug 1438569.
|
||||
dv = new DataView(new ArrayBuffer(20 * 1024 * 1024));
|
||||
dv.setInt8(dv.byteLength - 10, 99);
|
||||
assertEq(dv.getInt8(dv.byteLength - 10), 99);
|
||||
|
||||
reportCompare(0, 0, 'done.');
|
||||
}
|
||||
|
||||
|
|
|
@ -5217,8 +5217,8 @@ PresShell::AddPrintPreviewBackgroundItem(nsDisplayListBuilder& aBuilder,
|
|||
nsIFrame* aFrame,
|
||||
const nsRect& aBounds)
|
||||
{
|
||||
aList.AppendToBottom(new (&aBuilder)
|
||||
nsDisplaySolidColor(&aBuilder, aFrame, aBounds, NS_RGB(115, 115, 115)));
|
||||
aList.AppendToBottom(
|
||||
MakeDisplayItem<nsDisplaySolidColor>(&aBuilder, aFrame, aBounds, NS_RGB(115, 115, 115)));
|
||||
}
|
||||
|
||||
static bool
|
||||
|
@ -5308,7 +5308,7 @@ PresShell::AddCanvasBackgroundColorItem(nsDisplayListBuilder& aBuilder,
|
|||
|
||||
if (!addedScrollingBackgroundColor || forceUnscrolledItem) {
|
||||
aList.AppendToBottom(
|
||||
new (&aBuilder) nsDisplaySolidColor(&aBuilder, aFrame, aBounds, bgcolor));
|
||||
MakeDisplayItem<nsDisplaySolidColor>(&aBuilder, aFrame, aBounds, bgcolor));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3021,7 +3021,7 @@ nsLayoutUtils::GetLayerTransformForFrame(nsIFrame* aFrame,
|
|||
builder.BeginFrame();
|
||||
nsDisplayList list;
|
||||
nsDisplayTransform* item =
|
||||
new (&builder) nsDisplayTransform(&builder, aFrame, &list, nsRect());
|
||||
MakeDisplayItem<nsDisplayTransform>(&builder, aFrame, &list, nsRect());
|
||||
|
||||
*aTransform = item->GetTransform();
|
||||
item->Destroy(&builder);
|
||||
|
|
|
@ -477,8 +477,8 @@ nsButtonFrameRenderer::DisplayButton(nsDisplayListBuilder* aBuilder,
|
|||
nsDisplayList* aForeground)
|
||||
{
|
||||
if (mFrame->StyleEffects()->mBoxShadow) {
|
||||
aBackground->AppendToTop(new (aBuilder)
|
||||
nsDisplayButtonBoxShadowOuter(aBuilder, this));
|
||||
aBackground->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayButtonBoxShadowOuter>(aBuilder, this));
|
||||
}
|
||||
|
||||
nsRect buttonRect = mFrame->GetRectRelativeToSelf();
|
||||
|
@ -486,14 +486,14 @@ nsButtonFrameRenderer::DisplayButton(nsDisplayListBuilder* aBuilder,
|
|||
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
|
||||
aBuilder, mFrame, buttonRect, aBackground);
|
||||
|
||||
aBackground->AppendToTop(new (aBuilder)
|
||||
nsDisplayButtonBorder(aBuilder, this));
|
||||
aBackground->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayButtonBorder>(aBuilder, this));
|
||||
|
||||
// Only display focus rings if we actually have them. Since at most one
|
||||
// button would normally display a focus ring, most buttons won't have them.
|
||||
if (mInnerFocusStyle && mInnerFocusStyle->StyleBorder()->HasBorder()) {
|
||||
aForeground->AppendToTop(new (aBuilder)
|
||||
nsDisplayButtonForeground(aBuilder, this));
|
||||
aForeground->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayButtonForeground>(aBuilder, this));
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -1599,7 +1599,7 @@ nsComboboxControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
!presContext->GetTheme()->ThemeDrawsFocusForWidget(disp->mAppearance)) &&
|
||||
mDisplayFrame && IsVisibleForPainting(aBuilder)) {
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayComboboxFocus(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayComboboxFocus>(aBuilder, this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -196,8 +196,8 @@ nsFieldSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
if (!(GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER) &&
|
||||
IsVisibleForPainting(aBuilder)) {
|
||||
if (StyleEffects()->mBoxShadow) {
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayBoxShadowOuter(aBuilder, this));
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayBoxShadowOuter>(aBuilder, this));
|
||||
}
|
||||
|
||||
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
|
||||
|
@ -205,8 +205,8 @@ nsFieldSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
aLists.BorderBackground(),
|
||||
/* aAllowWillPaintBorderOptimization = */ false);
|
||||
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayFieldSetBorder(aBuilder, this));
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayFieldSetBorder>(aBuilder, this));
|
||||
|
||||
DisplayOutlineUnconditional(aBuilder, aLists);
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ nsListControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
// this frame as the root of a stacking context we need make sure to draw
|
||||
// some opaque color over the whole widget. (Bug 511323)
|
||||
aLists.BorderBackground()->AppendToBottom(
|
||||
new (aBuilder) nsDisplaySolidColor(aBuilder,
|
||||
MakeDisplayItem<nsDisplaySolidColor>(aBuilder,
|
||||
this, nsRect(aBuilder->ToReferenceFrame(this), GetSize()),
|
||||
mLastDropdownBackstopColor));
|
||||
}
|
||||
|
|
|
@ -305,7 +305,7 @@ nsRangeFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
}
|
||||
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayRangeFocusRing(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayRangeFocusRing>(aBuilder, this));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -75,11 +75,11 @@ public:
|
|||
nsOptionEventGrabberWrapper() {}
|
||||
virtual nsDisplayItem* WrapList(nsDisplayListBuilder* aBuilder,
|
||||
nsIFrame* aFrame, nsDisplayList* aList) override {
|
||||
return new (aBuilder) nsDisplayOptionEventGrabber(aBuilder, aFrame, aList);
|
||||
return MakeDisplayItem<nsDisplayOptionEventGrabber>(aBuilder, aFrame, aList);
|
||||
}
|
||||
virtual nsDisplayItem* WrapItem(nsDisplayListBuilder* aBuilder,
|
||||
nsDisplayItem* aItem) override {
|
||||
return new (aBuilder) nsDisplayOptionEventGrabber(aBuilder, aItem->Frame(), aItem);
|
||||
return MakeDisplayItem<nsDisplayOptionEventGrabber>(aBuilder, aItem->Frame(), aItem);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -154,8 +154,8 @@ nsSelectsAreaFrame::BuildDisplayListInternal(nsDisplayListBuilder* aBuilder,
|
|||
// we can't just associate the display item with the list frame,
|
||||
// because then the list's scrollframe won't clip it (the scrollframe
|
||||
// only clips contained descendants).
|
||||
aLists.Outlines()->AppendToTop(new (aBuilder)
|
||||
nsDisplayListFocus(aBuilder, this));
|
||||
aLists.Outlines()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayListFocus>(aBuilder, this));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -861,9 +861,10 @@ TextOverflow::CreateMarkers(const nsLineBox* aLine,
|
|||
markerLogicalRect.GetPhysicalRect(mBlockWM, mBlockSize) + offset;
|
||||
ClipMarker(aContentArea.GetPhysicalRect(mBlockWM, mBlockSize) + offset,
|
||||
markerRect, clipState);
|
||||
nsDisplayItem* marker = new (mBuilder)
|
||||
nsDisplayTextOverflowMarker(mBuilder, mBlock, markerRect,
|
||||
aLine->GetLogicalAscent(), mIStart.mStyle, aLineNumber, 0);
|
||||
nsDisplayItem* marker =
|
||||
MakeDisplayItem<nsDisplayTextOverflowMarker>(mBuilder, mBlock, markerRect,
|
||||
aLine->GetLogicalAscent(), mIStart.mStyle,
|
||||
aLineNumber, 0);
|
||||
mMarkerList.AppendToTop(marker);
|
||||
}
|
||||
|
||||
|
@ -878,9 +879,10 @@ TextOverflow::CreateMarkers(const nsLineBox* aLine,
|
|||
markerLogicalRect.GetPhysicalRect(mBlockWM, mBlockSize) + offset;
|
||||
ClipMarker(aContentArea.GetPhysicalRect(mBlockWM, mBlockSize) + offset,
|
||||
markerRect, clipState);
|
||||
nsDisplayItem* marker = new (mBuilder)
|
||||
nsDisplayTextOverflowMarker(mBuilder, mBlock, markerRect,
|
||||
aLine->GetLogicalAscent(), mIEnd.mStyle, aLineNumber, 1);
|
||||
nsDisplayItem* marker =
|
||||
MakeDisplayItem<nsDisplayTextOverflowMarker>(mBuilder, mBlock, markerRect,
|
||||
aLine->GetLogicalAscent(), mIEnd.mStyle,
|
||||
aLineNumber, 1);
|
||||
mMarkerList.AppendToTop(marker);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ ViewportFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
// Wrap the whole top layer in a single item with maximum z-index,
|
||||
// and append it at the very end, so that it stays at the topmost.
|
||||
nsDisplayWrapList* wrapList =
|
||||
new (aBuilder) nsDisplayWrapList(aBuilder, this, &topLayerList);
|
||||
MakeDisplayItem<nsDisplayWrapList>(aBuilder, this, &topLayerList);
|
||||
wrapList->SetOverrideZIndex(
|
||||
std::numeric_limits<decltype(wrapList->ZIndex())>::max());
|
||||
aLists.PositionedDescendants()->AppendToTop(wrapList);
|
||||
|
|
|
@ -789,7 +789,7 @@ nsBulletFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
DO_GLOBAL_REFLOW_COUNT_DSP("nsBulletFrame");
|
||||
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayBullet(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayBullet>(aBuilder, this));
|
||||
}
|
||||
|
||||
Maybe<BulletRenderer>
|
||||
|
|
|
@ -470,11 +470,11 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
}
|
||||
}
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
new (aBuilder) nsDisplayCanvasBackgroundColor(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayCanvasBackgroundColor>(aBuilder, this));
|
||||
|
||||
if (isThemed) {
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
new (aBuilder) nsDisplayCanvasThemedBackground(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayCanvasThemedBackground>(aBuilder, this));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -528,14 +528,14 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
{
|
||||
DisplayListClipState::AutoSaveRestore bgImageClip(aBuilder);
|
||||
bgImageClip.Clear();
|
||||
bgItem = new (aBuilder) nsDisplayCanvasBackgroundImage(bgData);
|
||||
bgItem = MakeDisplayItem<nsDisplayCanvasBackgroundImage>(aBuilder, bgData);
|
||||
bgItem->SetDependentFrame(aBuilder, dependentFrame);
|
||||
}
|
||||
thisItemList.AppendToTop(
|
||||
nsDisplayFixedPosition::CreateForFixedBackground(aBuilder, this, bgItem, i));
|
||||
|
||||
} else {
|
||||
nsDisplayCanvasBackgroundImage* bgItem = new (aBuilder) nsDisplayCanvasBackgroundImage(bgData);
|
||||
nsDisplayCanvasBackgroundImage* bgItem = MakeDisplayItem<nsDisplayCanvasBackgroundImage>(aBuilder, bgData);
|
||||
bgItem->SetDependentFrame(aBuilder, dependentFrame);
|
||||
thisItemList.AppendToTop(bgItem);
|
||||
}
|
||||
|
@ -543,9 +543,9 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
if (layers.mLayers[i].mBlendMode != NS_STYLE_BLEND_NORMAL) {
|
||||
DisplayListClipState::AutoSaveRestore blendClip(aBuilder);
|
||||
thisItemList.AppendToTop(
|
||||
new (aBuilder) nsDisplayBlendMode(aBuilder, this, &thisItemList,
|
||||
layers.mLayers[i].mBlendMode,
|
||||
thisItemASR, i + 1));
|
||||
MakeDisplayItem<nsDisplayBlendMode>(aBuilder, this, &thisItemList,
|
||||
layers.mLayers[i].mBlendMode,
|
||||
thisItemASR, i + 1));
|
||||
}
|
||||
aLists.BorderBackground()->AppendToTop(&thisItemList);
|
||||
}
|
||||
|
@ -591,8 +591,8 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
if (!StyleVisibility()->IsVisible())
|
||||
return;
|
||||
|
||||
aLists.Outlines()->AppendToTop(new (aBuilder)
|
||||
nsDisplayCanvasFocus(aBuilder, this));
|
||||
aLists.Outlines()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayCanvasFocus>(aBuilder, this));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -190,8 +190,8 @@ public:
|
|||
|
||||
class nsDisplayCanvasBackgroundImage : public nsDisplayBackgroundImage {
|
||||
public:
|
||||
explicit nsDisplayCanvasBackgroundImage(const InitData& aInitData)
|
||||
: nsDisplayBackgroundImage(aInitData)
|
||||
explicit nsDisplayCanvasBackgroundImage(nsDisplayListBuilder* aBuilder, const InitData& aInitData)
|
||||
: nsDisplayBackgroundImage(aBuilder, aInitData)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -1280,7 +1280,7 @@ nsColumnSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
if (IsVisibleForPainting(aBuilder)) {
|
||||
aLists.BorderBackground()->
|
||||
AppendToTop(new (aBuilder) nsDisplayColumnRule(aBuilder, this));
|
||||
AppendToTop(MakeDisplayItem<nsDisplayColumnRule>(aBuilder, this));
|
||||
}
|
||||
|
||||
// Our children won't have backgrounds so it doesn't matter where we put them.
|
||||
|
|
|
@ -2318,8 +2318,8 @@ nsFrame::DisplaySelectionOverlay(nsDisplayListBuilder* aBuilder,
|
|||
return;
|
||||
}
|
||||
|
||||
aList->AppendToTop(new (aBuilder)
|
||||
nsDisplaySelectionOverlay(aBuilder, this, selectionValue));
|
||||
aList->AppendToTop(
|
||||
MakeDisplayItem<nsDisplaySelectionOverlay>(aBuilder, this, selectionValue));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2331,7 +2331,7 @@ nsFrame::DisplayOutlineUnconditional(nsDisplayListBuilder* aBuilder,
|
|||
}
|
||||
|
||||
aLists.Outlines()->AppendToTop(
|
||||
new (aBuilder) nsDisplayOutline(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayOutline>(aBuilder, this));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2351,7 +2351,7 @@ nsIFrame::DisplayCaret(nsDisplayListBuilder* aBuilder,
|
|||
if (!IsVisibleForPainting(aBuilder))
|
||||
return;
|
||||
|
||||
aList->AppendToTop(new (aBuilder) nsDisplayCaret(aBuilder, this));
|
||||
aList->AppendToTop(MakeDisplayItem<nsDisplayCaret>(aBuilder, this));
|
||||
}
|
||||
|
||||
nscolor
|
||||
|
@ -2390,23 +2390,23 @@ nsFrame::DisplayBorderBackgroundOutline(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
nsCSSShadowArray* shadows = StyleEffects()->mBoxShadow;
|
||||
if (shadows && shadows->HasShadowWithInset(false)) {
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayBoxShadowOuter(aBuilder, this));
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayBoxShadowOuter>(aBuilder, this));
|
||||
}
|
||||
|
||||
bool bgIsThemed = DisplayBackgroundUnconditional(aBuilder, aLists,
|
||||
aForceBackground);
|
||||
|
||||
if (shadows && shadows->HasShadowWithInset(true)) {
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayBoxShadowInner(aBuilder, this));
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayBoxShadowInner>(aBuilder, this));
|
||||
}
|
||||
|
||||
// If there's a themed background, we should not create a border item.
|
||||
// It won't be rendered.
|
||||
if (!bgIsThemed && StyleBorder()->HasBorder()) {
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayBorder(aBuilder, this));
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayBorder>(aBuilder, this));
|
||||
}
|
||||
|
||||
DisplayOutlineUnconditional(aBuilder, aLists);
|
||||
|
@ -2541,16 +2541,16 @@ DisplayDebugBorders(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
|
|||
// Draw a border around the child
|
||||
// REVIEW: From nsContainerFrame::PaintChild
|
||||
if (nsFrame::GetShowFrameBorders() && !aFrame->GetRect().IsEmpty()) {
|
||||
aLists.Outlines()->AppendToTop(new (aBuilder)
|
||||
nsDisplayGeneric(aBuilder, aFrame, PaintDebugBorder, "DebugBorder",
|
||||
DisplayItemType::TYPE_DEBUG_BORDER));
|
||||
aLists.Outlines()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayGeneric>(aBuilder, aFrame, PaintDebugBorder, "DebugBorder",
|
||||
DisplayItemType::TYPE_DEBUG_BORDER));
|
||||
}
|
||||
// Draw a border around the current event target
|
||||
if (nsFrame::GetShowEventTargetFrameBorder() &&
|
||||
aFrame->PresShell()->GetDrawEventTargetFrame() == aFrame) {
|
||||
aLists.Outlines()->AppendToTop(new (aBuilder)
|
||||
nsDisplayGeneric(aBuilder, aFrame, PaintEventTargetBorder, "EventTargetBorder",
|
||||
DisplayItemType::TYPE_EVENT_TARGET_BORDER));
|
||||
aLists.Outlines()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayGeneric>(aBuilder, aFrame, PaintEventTargetBorder, "EventTargetBorder",
|
||||
DisplayItemType::TYPE_EVENT_TARGET_BORDER));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -2654,7 +2654,7 @@ WrapSeparatorTransform(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
|
|||
int aIndex) {
|
||||
if (!aSource->IsEmpty()) {
|
||||
nsDisplayTransform *sepIdItem =
|
||||
new (aBuilder) nsDisplayTransform(aBuilder, aFrame, aSource,
|
||||
MakeDisplayItem<nsDisplayTransform>(aBuilder, aFrame, aSource,
|
||||
aBuilder->GetVisibleRect(), Matrix4x4(), aIndex);
|
||||
sepIdItem->SetNoExtendContext();
|
||||
aTarget->AppendToTop(sepIdItem);
|
||||
|
@ -3031,7 +3031,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
nsDisplayLayerEventRegions* eventRegions = nullptr;
|
||||
if (aBuilder->IsBuildingLayerEventRegions()) {
|
||||
eventRegions = new (aBuilder) nsDisplayLayerEventRegions(aBuilder, this);
|
||||
eventRegions = MakeDisplayItem<nsDisplayLayerEventRegions>(aBuilder, this);
|
||||
eventRegions->AddFrame(aBuilder, this);
|
||||
aBuilder->SetLayerEventRegions(eventRegions);
|
||||
}
|
||||
|
@ -3072,7 +3072,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
if (eventRegions) {
|
||||
eventRegions->Destroy(aBuilder);
|
||||
eventRegions = new (aBuilder) nsDisplayLayerEventRegions(aBuilder, this);
|
||||
eventRegions = MakeDisplayItem<nsDisplayLayerEventRegions>(aBuilder, this);
|
||||
eventRegions->AddFrame(aBuilder, this);
|
||||
aBuilder->SetLayerEventRegions(eventRegions);
|
||||
}
|
||||
|
@ -3116,7 +3116,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
if (hasOverrideDirtyRect && gfxPrefs::LayoutDisplayListShowArea()) {
|
||||
nsDisplaySolidColor* color =
|
||||
new (aBuilder) nsDisplaySolidColor(aBuilder, this,
|
||||
MakeDisplayItem<nsDisplaySolidColor>(aBuilder, this,
|
||||
dirtyRect + aBuilder->GetCurrentFrameOffsetToReferenceFrame(),
|
||||
NS_RGBA(255, 0, 0, 64), false);
|
||||
color->SetOverrideZIndex(INT32_MAX);
|
||||
|
@ -3219,7 +3219,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
/* List now emptied, so add the new list to the top. */
|
||||
resultList.AppendToTop(
|
||||
new (aBuilder) nsDisplayFilter(aBuilder, this, &resultList,
|
||||
MakeDisplayItem<nsDisplayFilter>(aBuilder, this, &resultList,
|
||||
handleOpacity));
|
||||
}
|
||||
|
||||
|
@ -3239,7 +3239,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
|||
: containerItemASR;
|
||||
/* List now emptied, so add the new list to the top. */
|
||||
resultList.AppendToTop(
|
||||
new (aBuilder) nsDisplayMask(aBuilder, this, &resultList, !useOpacity,
|
||||
MakeDisplayItem<nsDisplayMask>(aBuilder, this, &resultList, !useOpacity,
|
||||
maskASR));
|
||||
}
|
||||
|
||||
|
@ -3261,7 +3261,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
|||
// all descendant content, but some should not be clipped.
|
||||
DisplayListClipState::AutoSaveRestore opacityClipState(aBuilder);
|
||||
resultList.AppendToTop(
|
||||
new (aBuilder) nsDisplayOpacity(aBuilder, this, &resultList,
|
||||
MakeDisplayItem<nsDisplayOpacity>(aBuilder, this, &resultList,
|
||||
containerItemASR,
|
||||
opacityItemForEventsAndPluginsOnly));
|
||||
if (aCreatedContainerItem) {
|
||||
|
@ -3327,7 +3327,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
|||
GetOffsetToCrossDoc(outerReferenceFrame));
|
||||
|
||||
nsDisplayTransform *transformItem =
|
||||
new (aBuilder) nsDisplayTransform(aBuilder, this,
|
||||
MakeDisplayItem<nsDisplayTransform>(aBuilder, this,
|
||||
&resultList, visibleRect, 0,
|
||||
allowAsyncAnimation);
|
||||
resultList.AppendToTop(transformItem);
|
||||
|
@ -3337,7 +3337,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
|||
clipState.Restore();
|
||||
}
|
||||
resultList.AppendToTop(
|
||||
new (aBuilder) nsDisplayPerspective(
|
||||
MakeDisplayItem<nsDisplayPerspective>(
|
||||
aBuilder, this,
|
||||
GetContainingBlock(0, disp)->GetContent()->GetPrimaryFrame(),
|
||||
&resultList));
|
||||
|
@ -3351,7 +3351,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
|||
if (clipCapturedBy == ContainerItemType::eOwnLayerForTransformWithRoundedClip) {
|
||||
clipState.Restore();
|
||||
resultList.AppendToTop(
|
||||
new (aBuilder) nsDisplayOwnLayer(aBuilder, this, &resultList,
|
||||
MakeDisplayItem<nsDisplayOwnLayer>(aBuilder, this, &resultList,
|
||||
aBuilder->CurrentActiveScrolledRoot(),
|
||||
nsDisplayOwnLayerFlags::eNone,
|
||||
mozilla::layers::FrameMetrics::NULL_SCROLL_ID,
|
||||
|
@ -3374,7 +3374,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
|||
const ActiveScrolledRoot* fixedASR =
|
||||
ActiveScrolledRoot::PickAncestor(containerItemASR, aBuilder->CurrentActiveScrolledRoot());
|
||||
resultList.AppendToTop(
|
||||
new (aBuilder) nsDisplayFixedPosition(aBuilder, this, &resultList, fixedASR));
|
||||
MakeDisplayItem<nsDisplayFixedPosition>(aBuilder, this, &resultList, fixedASR));
|
||||
if (aCreatedContainerItem) {
|
||||
*aCreatedContainerItem = true;
|
||||
}
|
||||
|
@ -3390,7 +3390,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
|||
const ActiveScrolledRoot* stickyASR =
|
||||
ActiveScrolledRoot::PickAncestor(containerItemASR, aBuilder->CurrentActiveScrolledRoot());
|
||||
resultList.AppendToTop(
|
||||
new (aBuilder) nsDisplayStickyPosition(aBuilder, this, &resultList, stickyASR));
|
||||
MakeDisplayItem<nsDisplayStickyPosition>(aBuilder, this, &resultList, stickyASR));
|
||||
if (aCreatedContainerItem) {
|
||||
*aCreatedContainerItem = true;
|
||||
}
|
||||
|
@ -3404,7 +3404,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
|||
if (useBlendMode) {
|
||||
DisplayListClipState::AutoSaveRestore blendModeClipState(aBuilder);
|
||||
resultList.AppendToTop(
|
||||
new (aBuilder) nsDisplayBlendMode(aBuilder, this, &resultList,
|
||||
MakeDisplayItem<nsDisplayBlendMode>(aBuilder, this, &resultList,
|
||||
effects->mMixBlendMode,
|
||||
containerItemASR));
|
||||
if (aCreatedContainerItem) {
|
||||
|
@ -3436,7 +3436,7 @@ WrapInWrapList(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
// Clear clip rect for the construction of the items below. Since we're
|
||||
// clipping all their contents, they themselves don't need to be clipped.
|
||||
return new (aBuilder) nsDisplayWrapList(aBuilder, aFrame, aList, aContainerASR, true);
|
||||
return MakeDisplayItem<nsDisplayWrapList>(aBuilder, aFrame, aList, aContainerASR, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3777,7 +3777,7 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
|
|||
// make sure we accumulate event regions for its layer.
|
||||
if (buildingForChild.IsAnimatedGeometryRoot() || isPositioned) {
|
||||
nsDisplayLayerEventRegions* eventRegions =
|
||||
new (aBuilder) nsDisplayLayerEventRegions(aBuilder, child);
|
||||
MakeDisplayItem<nsDisplayLayerEventRegions>(aBuilder, child);
|
||||
eventRegions->AddFrame(aBuilder, child);
|
||||
aBuilder->SetLayerEventRegions(eventRegions);
|
||||
|
||||
|
@ -10966,8 +10966,8 @@ nsIFrame::CreateOwnLayerIfNeeded(nsDisplayListBuilder* aBuilder,
|
|||
if (GetContent() &&
|
||||
GetContent()->IsXULElement() &&
|
||||
GetContent()->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::layer)) {
|
||||
aList->AppendToTop(new (aBuilder)
|
||||
nsDisplayOwnLayer(aBuilder, this, aList, aBuilder->CurrentActiveScrolledRoot()));
|
||||
aList->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayOwnLayer>(aBuilder, this, aList, aBuilder->CurrentActiveScrolledRoot()));
|
||||
if (aCreatedContainerItem) {
|
||||
*aCreatedContainerItem = true;
|
||||
}
|
||||
|
|
|
@ -680,7 +680,7 @@ nsHTMLFramesetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
if (mDragger && aBuilder->IsForEventDelivery()) {
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayEventReceiver(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayEventReceiver>(aBuilder, this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1425,7 +1425,7 @@ nsHTMLFramesetBorderFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
const nsDisplayListSet& aLists)
|
||||
{
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayFramesetBorder(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayFramesetBorder>(aBuilder, this));
|
||||
}
|
||||
|
||||
void nsHTMLFramesetBorderFrame::PaintBorder(DrawTarget* aDrawTarget,
|
||||
|
@ -1636,5 +1636,5 @@ nsHTMLFramesetBlankFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
const nsDisplayListSet& aLists)
|
||||
{
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayFramesetBlank(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayFramesetBlank>(aBuilder, this));
|
||||
}
|
||||
|
|
|
@ -3072,9 +3072,9 @@ AppendToTop(nsDisplayListBuilder* aBuilder, const nsDisplayListSet& aLists,
|
|||
flags |= nsDisplayOwnLayerFlags::eScrollbarContainer;
|
||||
}
|
||||
|
||||
newItem = new (aBuilder) nsDisplayOwnLayer(aBuilder, aSourceFrame, aSource, asr, flags, scrollTarget);
|
||||
newItem = MakeDisplayItem<nsDisplayOwnLayer>(aBuilder, aSourceFrame, aSource, asr, flags, scrollTarget);
|
||||
} else {
|
||||
newItem = new (aBuilder) nsDisplayWrapList(aBuilder, aSourceFrame, aSource, asr);
|
||||
newItem = MakeDisplayItem<nsDisplayWrapList>(aBuilder, aSourceFrame, aSource, asr);
|
||||
}
|
||||
|
||||
if (aFlags & APPEND_POSITIONED) {
|
||||
|
@ -3618,9 +3618,9 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
if (dirtyRectHasBeenOverriden && gfxPrefs::LayoutDisplayListShowArea()) {
|
||||
nsDisplaySolidColor* color =
|
||||
new (aBuilder) nsDisplaySolidColor(aBuilder, mOuter,
|
||||
dirtyRect + aBuilder->GetCurrentFrameOffsetToReferenceFrame(),
|
||||
NS_RGBA(0, 0, 255, 64), false);
|
||||
MakeDisplayItem<nsDisplaySolidColor>(aBuilder, mOuter,
|
||||
dirtyRect + aBuilder->GetCurrentFrameOffsetToReferenceFrame(),
|
||||
NS_RGBA(0, 0, 255, 64), false);
|
||||
color->SetOverrideZIndex(INT32_MAX);
|
||||
scrolledContent.PositionedDescendants()->AppendToTop(color);
|
||||
}
|
||||
|
@ -3684,13 +3684,13 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
CompositorHitTestInfo info = CompositorHitTestInfo::eVisibleToHitTest
|
||||
| CompositorHitTestInfo::eDispatchToContent;
|
||||
nsDisplayCompositorHitTestInfo* hitInfo =
|
||||
new (aBuilder) nsDisplayCompositorHitTestInfo(aBuilder, mScrolledFrame, info, 1,
|
||||
MakeDisplayItem<nsDisplayCompositorHitTestInfo>(aBuilder, mScrolledFrame, info, 1,
|
||||
Some(mScrollPort + aBuilder->ToReferenceFrame(mOuter)));
|
||||
AppendInternalItemToTop(scrolledContent, hitInfo, zIndex);
|
||||
}
|
||||
if (aBuilder->IsBuildingLayerEventRegions()) {
|
||||
nsDisplayLayerEventRegions* inactiveRegionItem =
|
||||
new (aBuilder) nsDisplayLayerEventRegions(aBuilder, mScrolledFrame, 1);
|
||||
MakeDisplayItem<nsDisplayLayerEventRegions>(aBuilder, mScrolledFrame, 1);
|
||||
inactiveRegionItem->AddInactiveScrollPort(mScrolledFrame, mScrollPort + aBuilder->ToReferenceFrame(mOuter));
|
||||
AppendInternalItemToTop(scrolledContent, inactiveRegionItem, zIndex);
|
||||
}
|
||||
|
@ -3698,7 +3698,7 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
if (aBuilder->ShouldBuildScrollInfoItemsForHoisting()) {
|
||||
aBuilder->AppendNewScrollInfoItemForHoisting(
|
||||
new (aBuilder) nsDisplayScrollInfoLayer(aBuilder, mScrolledFrame,
|
||||
MakeDisplayItem<nsDisplayScrollInfoLayer>(aBuilder, mScrolledFrame,
|
||||
mOuter));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -482,7 +482,7 @@ nsHTMLCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
clip(aBuilder, this, clipFlags);
|
||||
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayCanvas(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayCanvas>(aBuilder, this));
|
||||
|
||||
DisplaySelectionOverlay(aBuilder, aLists.Content(),
|
||||
nsISelectionDisplay::DISPLAY_IMAGES);
|
||||
|
|
|
@ -1849,8 +1849,8 @@ nsImageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
if (!imageOK || !mImage || !SizeIsAvailable(currentRequest)) {
|
||||
// No image yet, or image load failed. Draw the alt-text and an icon
|
||||
// indicating the status
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayAltFeedback(aBuilder, this));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayAltFeedback>(aBuilder, this));
|
||||
|
||||
// This image is visible (we are being asked to paint it) but it's not
|
||||
// decoded yet. And we are not going to ask the image to draw, so this
|
||||
|
@ -1867,8 +1867,8 @@ nsImageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
}
|
||||
}
|
||||
} else {
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayImage(aBuilder, this, mImage, mPrevImage));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayImage>(aBuilder, this, mImage, mPrevImage));
|
||||
|
||||
// If we were previously displaying an icon, we're not anymore
|
||||
if (mDisplayingIcon) {
|
||||
|
@ -1878,9 +1878,9 @@ nsImageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
#ifdef DEBUG
|
||||
if (GetShowFrameBorders() && GetImageMap()) {
|
||||
aLists.Outlines()->AppendToTop(new (aBuilder)
|
||||
nsDisplayGeneric(aBuilder, this, PaintDebugImageMap, "DebugImageMap",
|
||||
DisplayItemType::TYPE_DEBUG_IMAGE_MAP));
|
||||
aLists.Outlines()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayGeneric>(aBuilder, this, PaintDebugImageMap, "DebugImageMap",
|
||||
DisplayItemType::TYPE_DEBUG_IMAGE_MAP));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -586,14 +586,14 @@ nsPageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
*aBuilder, content, child, backgroundRect, NS_RGBA(0,0,0,0));
|
||||
}
|
||||
|
||||
content.AppendToTop(new (aBuilder) nsDisplayTransform(aBuilder, child,
|
||||
content.AppendToTop(MakeDisplayItem<nsDisplayTransform>(aBuilder, child,
|
||||
&content, content.GetVisibleRect(), ::ComputePageTransform));
|
||||
|
||||
set.Content()->AppendToTop(&content);
|
||||
|
||||
if (PresContext()->IsRootPaginatedDocument()) {
|
||||
set.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayHeaderFooter(aBuilder, this));
|
||||
set.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayHeaderFooter>(aBuilder, this));
|
||||
}
|
||||
|
||||
set.MoveTo(aLists);
|
||||
|
|
|
@ -273,9 +273,9 @@ nsPlaceholderFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
#ifdef DEBUG
|
||||
if (GetShowFrameBorders()) {
|
||||
aLists.Outlines()->AppendToTop(
|
||||
new (aBuilder) nsDisplayGeneric(aBuilder, this, PaintDebugPlaceholder,
|
||||
"DebugPlaceholder",
|
||||
DisplayItemType::TYPE_DEBUG_PLACEHOLDER));
|
||||
MakeDisplayItem<nsDisplayGeneric>(aBuilder, this, PaintDebugPlaceholder,
|
||||
"DebugPlaceholder",
|
||||
DisplayItemType::TYPE_DEBUG_PLACEHOLDER));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -1187,9 +1187,9 @@ nsPluginFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
// determine if we are printing
|
||||
if (type == nsPresContext::eContext_Print) {
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayGeneric(aBuilder, this, PaintPrintPlugin, "PrintPlugin",
|
||||
DisplayItemType::TYPE_PRINT_PLUGIN));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayGeneric>(aBuilder, this, PaintPrintPlugin, "PrintPlugin",
|
||||
DisplayItemType::TYPE_PRINT_PLUGIN));
|
||||
} else {
|
||||
LayerState state = GetLayerState(aBuilder, nullptr);
|
||||
if (state == LAYER_INACTIVE &&
|
||||
|
@ -1199,12 +1199,12 @@ nsPluginFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
if (aBuilder->IsPaintingToWindow() &&
|
||||
state == LAYER_ACTIVE &&
|
||||
IsTransparentMode()) {
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayPluginReadback(aBuilder, this));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayPluginReadback>(aBuilder, this));
|
||||
}
|
||||
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayPlugin(aBuilder, this));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayPlugin>(aBuilder, this));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -747,9 +747,9 @@ nsSimplePageSequenceFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
}
|
||||
}
|
||||
|
||||
content.AppendToTop(new (aBuilder)
|
||||
nsDisplayTransform(aBuilder, this, &content, content.GetVisibleRect(),
|
||||
::ComputePageSequenceTransform));
|
||||
content.AppendToTop(
|
||||
MakeDisplayItem<nsDisplayTransform>(aBuilder, this, &content, content.GetVisibleRect(),
|
||||
::ComputePageSequenceTransform));
|
||||
|
||||
aLists.Content()->AppendToTop(&content);
|
||||
}
|
||||
|
|
|
@ -318,7 +318,7 @@ WrapBackgroundColorInOwnLayer(nsDisplayListBuilder* aBuilder,
|
|||
if (item->GetType() == DisplayItemType::TYPE_BACKGROUND_COLOR) {
|
||||
nsDisplayList tmpList;
|
||||
tmpList.AppendToTop(item);
|
||||
item = new (aBuilder) nsDisplayOwnLayer(aBuilder, aFrame, &tmpList, aBuilder->CurrentActiveScrolledRoot());
|
||||
item = MakeDisplayItem<nsDisplayOwnLayer>(aBuilder, aFrame, &tmpList, aBuilder->CurrentActiveScrolledRoot());
|
||||
}
|
||||
tempItems.AppendToTop(item);
|
||||
}
|
||||
|
@ -558,7 +558,7 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
zoomFlags |= nsDisplayOwnLayerFlags::eGenerateScrollableLayer;
|
||||
}
|
||||
nsDisplayZoom* zoomItem =
|
||||
new (aBuilder) nsDisplayZoom(aBuilder, subdocRootFrame, &childItems,
|
||||
MakeDisplayItem<nsDisplayZoom>(aBuilder, subdocRootFrame, &childItems,
|
||||
subdocAPD, parentAPD, zoomFlags);
|
||||
childItems.AppendToTop(zoomItem);
|
||||
needsOwnLayer = false;
|
||||
|
@ -570,14 +570,14 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
}
|
||||
if (constructResolutionItem) {
|
||||
nsDisplayResolution* resolutionItem =
|
||||
new (aBuilder) nsDisplayResolution(aBuilder, subdocRootFrame, &childItems,
|
||||
flags);
|
||||
MakeDisplayItem<nsDisplayResolution>(aBuilder, subdocRootFrame, &childItems,
|
||||
flags);
|
||||
childItems.AppendToTop(resolutionItem);
|
||||
needsOwnLayer = false;
|
||||
}
|
||||
|
||||
// We always want top level content documents to be in their own layer.
|
||||
nsDisplaySubDocument* layerItem = new (aBuilder) nsDisplaySubDocument(
|
||||
nsDisplaySubDocument* layerItem = MakeDisplayItem<nsDisplaySubDocument>(
|
||||
aBuilder, subdocRootFrame ? subdocRootFrame : this, this,
|
||||
&childItems, flags);
|
||||
childItems.AppendToTop(layerItem);
|
||||
|
|
|
@ -5237,7 +5237,7 @@ nsTextFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
}
|
||||
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayText(aBuilder, this, isSelected));
|
||||
MakeDisplayItem<nsDisplayText>(aBuilder, this, isSelected));
|
||||
}
|
||||
|
||||
static nsIFrame*
|
||||
|
|
|
@ -570,7 +570,7 @@ nsVideoFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
if (HasVideoElement() && !shouldDisplayPoster) {
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayVideo(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayVideo>(aBuilder, this));
|
||||
}
|
||||
|
||||
// Add child frames to display list. We expect various children,
|
||||
|
|
|
@ -294,7 +294,7 @@ RenderFrameParent::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
clipState.ClipContentDescendants(bounds);
|
||||
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayRemote(aBuilder, aFrame, this));
|
||||
MakeDisplayItem<nsDisplayRemote>(aBuilder, aFrame, this));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1988,8 +1988,8 @@ nsMathMLChar::Display(nsDisplayListBuilder* aBuilder,
|
|||
// purposes. Normally, users will set the background on the container frame.
|
||||
// paint the selection background -- beware MathML frames overlap a lot
|
||||
if (aSelectedRect && !aSelectedRect->IsEmpty()) {
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayMathMLSelectionRect(aBuilder, aForFrame, *aSelectedRect));
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayMathMLSelectionRect>(aBuilder, aForFrame, *aSelectedRect));
|
||||
}
|
||||
else if (mRect.width && mRect.height) {
|
||||
if (styleContext != parentContext &&
|
||||
|
@ -2004,15 +2004,15 @@ nsMathMLChar::Display(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
#if defined(DEBUG) && defined(SHOW_BOUNDING_BOX)
|
||||
// for visual debug
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayMathMLCharDebug(aBuilder, aForFrame, mRect));
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayMathMLCharDebug>(aBuilder, aForFrame, mRect));
|
||||
#endif
|
||||
}
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayMathMLCharForeground(aBuilder, aForFrame, this,
|
||||
aIndex,
|
||||
aSelectedRect &&
|
||||
!aSelectedRect->IsEmpty()));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayMathMLCharForeground>(aBuilder, aForFrame, this,
|
||||
aIndex,
|
||||
aSelectedRect &&
|
||||
!aSelectedRect->IsEmpty()));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -625,7 +625,7 @@ nsMathMLContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
return;
|
||||
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayMathMLError(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayMathMLError>(aBuilder, this));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -318,8 +318,8 @@ nsMathMLFrame::DisplayBoundingMetrics(nsDisplayListBuilder* aBuilder,
|
|||
nscoord w = aMetrics.rightBearing - aMetrics.leftBearing;
|
||||
nscoord h = aMetrics.ascent + aMetrics.descent;
|
||||
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayMathMLBoundingMetrics(aBuilder, aFrame, nsRect(x,y,w,h)));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayMathMLBoundingMetrics>(aBuilder, aFrame, nsRect(x,y,w,h)));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -370,8 +370,8 @@ nsMathMLFrame::DisplayBar(nsDisplayListBuilder* aBuilder,
|
|||
if (!aFrame->StyleVisibility()->IsVisible() || aRect.IsEmpty())
|
||||
return;
|
||||
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayMathMLBar(aBuilder, aFrame, aRect, aIndex));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayMathMLBar>(aBuilder, aFrame, aRect, aIndex));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -873,6 +873,6 @@ nsMathMLmencloseFrame::DisplayNotation(nsDisplayListBuilder* aBuilder,
|
|||
aThickness <= 0)
|
||||
return;
|
||||
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayNotation(aBuilder, aFrame, aRect, aThickness, aType));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayNotation>(aBuilder, aFrame, aRect, aThickness, aType));
|
||||
}
|
||||
|
|
|
@ -656,7 +656,7 @@ nsMathMLmfracFrame::DisplaySlash(nsDisplayListBuilder* aBuilder,
|
|||
if (!aFrame->StyleVisibility()->IsVisible() || aRect.IsEmpty())
|
||||
return;
|
||||
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayMathMLSlash(aBuilder, aFrame, aRect, aThickness,
|
||||
StyleVisibility()->mDirection));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayMathMLSlash>(aBuilder, aFrame, aRect, aThickness,
|
||||
StyleVisibility()->mDirection));
|
||||
}
|
||||
|
|
|
@ -1232,8 +1232,7 @@ nsMathMLmtdFrame::ProcessBorders(nsTableFrame* aFrame,
|
|||
nsDisplayListBuilder* aBuilder,
|
||||
const nsDisplayListSet& aLists)
|
||||
{
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplaymtdBorder(aBuilder, this));
|
||||
aLists.BorderBackground()->AppendToTop(MakeDisplayItem<nsDisplaymtdBorder>(aBuilder, this));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -145,6 +145,7 @@ DisplayItemData::DisplayItemData(LayerManagerData* aParent, uint32_t aKey,
|
|||
, mUsed(true)
|
||||
, mIsInvalid(false)
|
||||
, mReusedItem(false)
|
||||
, mDisconnected(false)
|
||||
{
|
||||
MOZ_COUNT_CTOR(DisplayItemData);
|
||||
|
||||
|
@ -260,15 +261,7 @@ static const nsIFrame* sDestroyedFrame = nullptr;
|
|||
DisplayItemData::~DisplayItemData()
|
||||
{
|
||||
MOZ_COUNT_DTOR(DisplayItemData);
|
||||
MOZ_RELEASE_ASSERT(mLayer);
|
||||
for (uint32_t i = 0; i < mFrameList.Length(); i++) {
|
||||
nsIFrame* frame = mFrameList[i];
|
||||
if (frame == sDestroyedFrame) {
|
||||
continue;
|
||||
}
|
||||
SmallPointerArray<DisplayItemData>& array = frame->DisplayItemData();
|
||||
array.RemoveElement(this);
|
||||
}
|
||||
Disconnect();
|
||||
|
||||
MOZ_RELEASE_ASSERT(sAliveDisplayItemDatas);
|
||||
nsPtrHashKey<mozilla::DisplayItemData>* entry
|
||||
|
@ -283,6 +276,27 @@ DisplayItemData::~DisplayItemData()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
DisplayItemData::Disconnect()
|
||||
{
|
||||
if (mDisconnected) {
|
||||
return;
|
||||
}
|
||||
mDisconnected = true;
|
||||
|
||||
for (uint32_t i = 0; i < mFrameList.Length(); i++) {
|
||||
nsIFrame* frame = mFrameList[i];
|
||||
if (frame == sDestroyedFrame) {
|
||||
continue;
|
||||
}
|
||||
SmallPointerArray<DisplayItemData>& array = frame->DisplayItemData();
|
||||
array.RemoveElement(this);
|
||||
}
|
||||
|
||||
mLayer = nullptr;
|
||||
mOptLayer = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
DisplayItemData::ClearAnimationCompositorState()
|
||||
{
|
||||
|
@ -329,6 +343,10 @@ public:
|
|||
}
|
||||
~LayerManagerData() {
|
||||
MOZ_COUNT_DTOR(LayerManagerData);
|
||||
|
||||
for (auto iter = mDisplayItems.Iter(); !iter.Done(); iter.Next()) {
|
||||
iter.Get()->GetKey()->Disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_DISPLAY_ITEM_DATA
|
||||
|
@ -406,21 +424,6 @@ FrameLayerBuilder::DestroyDisplayItemDataFor(nsIFrame* aFrame)
|
|||
aFrame->DisplayItemData().Clear();
|
||||
}
|
||||
|
||||
struct AssignedDisplayItem
|
||||
{
|
||||
AssignedDisplayItem(nsDisplayItem* aItem,
|
||||
const DisplayItemClip& aClip,
|
||||
LayerState aLayerState)
|
||||
: mItem(aItem)
|
||||
, mClip(aClip)
|
||||
, mLayerState(aLayerState)
|
||||
{}
|
||||
|
||||
nsDisplayItem* mItem;
|
||||
DisplayItemClip mClip;
|
||||
LayerState mLayerState;
|
||||
};
|
||||
|
||||
/**
|
||||
* We keep a stack of these to represent the PaintedLayers that are
|
||||
* currently available to have display items added to.
|
||||
|
@ -1493,7 +1496,8 @@ public:
|
|||
mXScale(1.f), mYScale(1.f),
|
||||
mAppUnitsPerDevPixel(0),
|
||||
mTranslation(0, 0),
|
||||
mAnimatedGeometryRootPosition(0, 0) {}
|
||||
mAnimatedGeometryRootPosition(0, 0),
|
||||
mLastItemCount(0) {}
|
||||
|
||||
/**
|
||||
* Record the number of clips in the PaintedLayer's mask layer.
|
||||
|
@ -1556,6 +1560,9 @@ public:
|
|||
// DrawPaintedLayer, for example when progressive paint is enabled.
|
||||
nsIntRegion mVisibilityComputedRegion;
|
||||
|
||||
// The number of items assigned to this layer on the previous paint.
|
||||
size_t mLastItemCount;
|
||||
|
||||
/**
|
||||
* This is set when the painted layer has no component alpha.
|
||||
*/
|
||||
|
@ -1942,7 +1949,7 @@ FrameLayerBuilder::RemoveFrameFromLayerManager(const nsIFrame* aFrame,
|
|||
#endif
|
||||
|
||||
for (DisplayItemData* data : aArray) {
|
||||
PaintedLayer* t = data->mLayer->AsPaintedLayer();
|
||||
PaintedLayer* t = data->mLayer ? data->mLayer->AsPaintedLayer() : nullptr;
|
||||
if (t) {
|
||||
PaintedDisplayItemLayerUserData* paintedData =
|
||||
static_cast<PaintedDisplayItemLayerUserData*>(t->GetUserData(&gPaintedDisplayItemLayerUserData));
|
||||
|
@ -1955,6 +1962,7 @@ FrameLayerBuilder::RemoveFrameFromLayerManager(const nsIFrame* aFrame,
|
|||
}
|
||||
}
|
||||
|
||||
data->Disconnect();
|
||||
data->mParent->mDisplayItems.RemoveEntry(data);
|
||||
}
|
||||
|
||||
|
@ -2026,6 +2034,7 @@ FrameLayerBuilder::WillEndTransaction()
|
|||
}
|
||||
|
||||
data->ClearAnimationCompositorState();
|
||||
data->Disconnect();
|
||||
iter.Remove();
|
||||
} else {
|
||||
ComputeGeometryChangeForItem(data);
|
||||
|
@ -2072,14 +2081,18 @@ FrameLayerBuilder::HasRetainedDataFor(nsIFrame* aFrame, uint32_t aDisplayItemKey
|
|||
}
|
||||
|
||||
DisplayItemData*
|
||||
FrameLayerBuilder::GetOldLayerForFrame(nsIFrame* aFrame, uint32_t aDisplayItemKey)
|
||||
FrameLayerBuilder::GetOldLayerForFrame(nsIFrame* aFrame, uint32_t aDisplayItemKey, DisplayItemData* aOldData /* = nullptr */)
|
||||
{
|
||||
// If we need to build a new layer tree, then just refuse to recycle
|
||||
// anything.
|
||||
if (!mRetainingManager || mInvalidateAllLayers)
|
||||
return nullptr;
|
||||
|
||||
DisplayItemData *data = GetDisplayItemData(aFrame, aDisplayItemKey);
|
||||
DisplayItemData* data = aOldData;
|
||||
if (!data || data->mLayer->Manager() != mRetainingManager || data->Disconnected()) {
|
||||
data = GetDisplayItemData(aFrame, aDisplayItemKey);
|
||||
}
|
||||
MOZ_ASSERT(data == GetDisplayItemData(aFrame, aDisplayItemKey));
|
||||
|
||||
if (data && data->mLayer->Manager() == mRetainingManager) {
|
||||
return data;
|
||||
|
@ -3152,9 +3165,12 @@ void ContainerState::FinishPaintedLayerData(PaintedLayerData& aData, FindOpaqueB
|
|||
mLayerBuilder->AddPaintedDisplayItem(data, item.mItem, item.mClip,
|
||||
*this, item.mLayerState,
|
||||
data->mAnimatedGeometryRootOffset,
|
||||
oldData);
|
||||
oldData, item);
|
||||
}
|
||||
|
||||
PaintedDisplayItemLayerUserData* userData = GetPaintedDisplayItemLayerUserData(data->mLayer);
|
||||
userData->mLastItemCount = data->mAssignedDisplayItems.Length();
|
||||
|
||||
NewLayerEntry* newLayerEntry = &mNewChildLayers[data->mNewChildLayersIndex];
|
||||
|
||||
RefPtr<Layer> layer;
|
||||
|
@ -3228,6 +3244,10 @@ void ContainerState::FinishPaintedLayerData(PaintedLayerData& aData, FindOpaqueB
|
|||
}
|
||||
#endif
|
||||
|
||||
FrameLayerBuilder::PaintedLayerItemsEntry* entry = mLayerBuilder->
|
||||
AddPaintedLayerItemsEntry(static_cast<PaintedLayer*>(layer.get()));
|
||||
MOZ_ASSERT(entry);
|
||||
|
||||
nsIntRegion transparentRegion;
|
||||
transparentRegion.Sub(data->mVisibleRegion, data->mOpaqueRegion);
|
||||
bool isOpaque = transparentRegion.IsEmpty();
|
||||
|
@ -3270,8 +3290,6 @@ void ContainerState::FinishPaintedLayerData(PaintedLayerData& aData, FindOpaqueB
|
|||
commonClipCount = std::max(0, data->mCommonClipCount);
|
||||
SetupMaskLayer(layer, data->mItemClip, commonClipCount);
|
||||
// copy commonClipCount to the entry
|
||||
FrameLayerBuilder::PaintedLayerItemsEntry* entry = mLayerBuilder->
|
||||
GetPaintedLayerItemsEntry(static_cast<PaintedLayer*>(layer.get()));
|
||||
entry->mCommonClipCount = commonClipCount;
|
||||
} else {
|
||||
// mask layer for image and color layers
|
||||
|
@ -3295,6 +3313,9 @@ void ContainerState::FinishPaintedLayerData(PaintedLayerData& aData, FindOpaqueB
|
|||
}
|
||||
layer->SetContentFlags(flags);
|
||||
|
||||
entry->mItems = Move(data->mAssignedDisplayItems);
|
||||
entry->mContainerLayerFrame = GetContainerFrame();
|
||||
|
||||
PaintedLayerData* containingPaintedLayerData =
|
||||
mLayerBuilder->GetContainingPaintedLayerData();
|
||||
// If we're building layers for an inactive layer, the event regions are
|
||||
|
@ -4577,6 +4598,9 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList)
|
|||
if (layer) {
|
||||
paintedLayerData->mLayer = layer;
|
||||
|
||||
PaintedDisplayItemLayerUserData* userData = GetPaintedDisplayItemLayerUserData(layer);
|
||||
paintedLayerData->mAssignedDisplayItems.SetCapacity(userData->mLastItemCount);
|
||||
|
||||
NS_ASSERTION(FindIndexOfLayerIn(mNewChildLayers, layer) < 0,
|
||||
"Layer already in list???");
|
||||
mNewChildLayers[paintedLayerData->mNewChildLayersIndex].mLayer = layer.forget();
|
||||
|
@ -4733,7 +4757,8 @@ FrameLayerBuilder::AddPaintedDisplayItem(PaintedLayerData* aLayerData,
|
|||
ContainerState& aContainerState,
|
||||
LayerState aLayerState,
|
||||
const nsPoint& aTopLeft,
|
||||
DisplayItemData* aData)
|
||||
DisplayItemData* aData,
|
||||
AssignedDisplayItem& aAssignedDisplayItem)
|
||||
{
|
||||
PaintedLayer* layer = aLayerData->mLayer;
|
||||
PaintedDisplayItemLayerUserData* paintedData =
|
||||
|
@ -4768,105 +4793,100 @@ FrameLayerBuilder::AddPaintedDisplayItem(PaintedLayerData* aLayerData,
|
|||
|
||||
AddLayerDisplayItem(layer, aItem, aLayerState, tempManager, aData);
|
||||
|
||||
PaintedLayerItemsEntry* entry = mPaintedLayerItems.PutEntry(layer);
|
||||
if (entry) {
|
||||
entry->mContainerLayerFrame = aContainerState.GetContainerFrame();
|
||||
if (tempManager) {
|
||||
FLB_LOG_PAINTED_LAYER_DECISION(aLayerData, "Creating nested FLB for item %p\n", aItem);
|
||||
FrameLayerBuilder* layerBuilder = new FrameLayerBuilder();
|
||||
layerBuilder->Init(mDisplayListBuilder, tempManager, aLayerData, true,
|
||||
&aClip);
|
||||
if (tempManager) {
|
||||
FLB_LOG_PAINTED_LAYER_DECISION(aLayerData, "Creating nested FLB for item %p\n", aItem);
|
||||
FrameLayerBuilder* layerBuilder = new FrameLayerBuilder();
|
||||
layerBuilder->Init(mDisplayListBuilder, tempManager, aLayerData, true,
|
||||
&aClip);
|
||||
|
||||
tempManager->BeginTransaction();
|
||||
if (mRetainingManager) {
|
||||
layerBuilder->DidBeginRetainedLayerTransaction(tempManager);
|
||||
}
|
||||
|
||||
UniquePtr<LayerProperties> props(LayerProperties::CloneFrom(tempManager->GetRoot()));
|
||||
RefPtr<Layer> tmpLayer =
|
||||
aItem->BuildLayer(mDisplayListBuilder, tempManager, ContainerLayerParameters());
|
||||
// We have no easy way of detecting if this transaction will ever actually get finished.
|
||||
// For now, I've just silenced the warning with nested transactions in BasicLayers.cpp
|
||||
if (!tmpLayer) {
|
||||
tempManager->EndTransaction(nullptr, nullptr);
|
||||
tempManager->SetUserData(&gLayerManagerLayerBuilder, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
bool snap;
|
||||
nsRect visibleRect =
|
||||
aItem->GetVisibleRect().Intersect(aItem->GetBounds(mDisplayListBuilder, &snap));
|
||||
nsIntRegion rgn = visibleRect.ToOutsidePixels(paintedData->mAppUnitsPerDevPixel);
|
||||
|
||||
// Convert the visible rect to a region and give the item
|
||||
// a chance to try restrict it further.
|
||||
nsRegion tightBounds = aItem->GetTightBounds(mDisplayListBuilder, &snap);
|
||||
if (!tightBounds.IsEmpty()) {
|
||||
rgn.AndWith(tightBounds.ToOutsidePixels(paintedData->mAppUnitsPerDevPixel));
|
||||
}
|
||||
SetOuterVisibleRegion(tmpLayer, &rgn);
|
||||
|
||||
// If BuildLayer didn't call BuildContainerLayerFor, then our new layer won't have been
|
||||
// stored in layerBuilder. Manually add it now.
|
||||
if (mRetainingManager) {
|
||||
#ifdef DEBUG_DISPLAY_ITEM_DATA
|
||||
LayerManagerData* parentLmd = static_cast<LayerManagerData*>
|
||||
(layer->Manager()->GetUserData(&gLayerManagerUserData));
|
||||
LayerManagerData* lmd = static_cast<LayerManagerData*>
|
||||
(tempManager->GetUserData(&gLayerManagerUserData));
|
||||
lmd->mParent = parentLmd;
|
||||
#endif
|
||||
DisplayItemData* data = layerBuilder->GetDisplayItemDataForManager(aItem, tempManager);
|
||||
layerBuilder->StoreDataForFrame(aItem, tmpLayer, LAYER_ACTIVE, data);
|
||||
}
|
||||
|
||||
tempManager->SetRoot(tmpLayer);
|
||||
layerBuilder->WillEndTransaction();
|
||||
tempManager->AbortTransaction();
|
||||
|
||||
#ifdef MOZ_DUMP_PAINTING
|
||||
if (gfxUtils::DumpDisplayList() || gfxEnv::DumpPaint()) {
|
||||
fprintf_stderr(gfxUtils::sDumpPaintFile, "Basic layer tree for painting contents of display item %s(%p):\n", aItem->Name(), aItem->Frame());
|
||||
std::stringstream stream;
|
||||
tempManager->Dump(stream, "", gfxEnv::DumpPaintToFile());
|
||||
fprint_stderr(gfxUtils::sDumpPaintFile, stream); // not a typo, fprint_stderr declared in LayersLogging.h
|
||||
}
|
||||
#endif
|
||||
|
||||
nsIntPoint offset = GetLastPaintOffset(layer) - GetTranslationForPaintedLayer(layer);
|
||||
props->MoveBy(-offset);
|
||||
// Effective transforms are needed by ComputeDifferences().
|
||||
tmpLayer->ComputeEffectiveTransforms(Matrix4x4());
|
||||
nsIntRegion invalid;
|
||||
if (!props->ComputeDifferences(tmpLayer, invalid, nullptr)) {
|
||||
nsRect visible = aItem->Frame()->GetVisualOverflowRect();
|
||||
invalid = visible.ToOutsidePixels(paintedData->mAppUnitsPerDevPixel);
|
||||
}
|
||||
if (aLayerState == LAYER_SVG_EFFECTS) {
|
||||
invalid = nsSVGIntegrationUtils::AdjustInvalidAreaForSVGEffects(aItem->Frame(),
|
||||
aItem->ToReferenceFrame(),
|
||||
invalid);
|
||||
}
|
||||
if (!invalid.IsEmpty()) {
|
||||
#ifdef MOZ_DUMP_PAINTING
|
||||
if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) {
|
||||
printf_stderr("Inactive LayerManager(%p) for display item %s(%p) has an invalid region - invalidating layer %p\n", tempManager.get(), aItem->Name(), aItem->Frame(), layer);
|
||||
}
|
||||
#endif
|
||||
invalid.ScaleRoundOut(paintedData->mXScale, paintedData->mYScale);
|
||||
|
||||
if (hasClip) {
|
||||
invalid.And(invalid, intClip);
|
||||
}
|
||||
|
||||
InvalidatePostTransformRegion(layer, invalid,
|
||||
GetTranslationForPaintedLayer(layer));
|
||||
}
|
||||
tempManager->BeginTransaction();
|
||||
if (mRetainingManager) {
|
||||
layerBuilder->DidBeginRetainedLayerTransaction(tempManager);
|
||||
}
|
||||
|
||||
UniquePtr<LayerProperties> props(LayerProperties::CloneFrom(tempManager->GetRoot()));
|
||||
RefPtr<Layer> tmpLayer =
|
||||
aItem->BuildLayer(mDisplayListBuilder, tempManager, ContainerLayerParameters());
|
||||
// We have no easy way of detecting if this transaction will ever actually get finished.
|
||||
// For now, I've just silenced the warning with nested transactions in BasicLayers.cpp
|
||||
if (!tmpLayer) {
|
||||
tempManager->EndTransaction(nullptr, nullptr);
|
||||
tempManager->SetUserData(&gLayerManagerLayerBuilder, nullptr);
|
||||
aAssignedDisplayItem.mItem = nullptr;
|
||||
return;
|
||||
}
|
||||
|
||||
bool snap;
|
||||
nsRect visibleRect =
|
||||
aItem->GetVisibleRect().Intersect(aItem->GetBounds(mDisplayListBuilder, &snap));
|
||||
nsIntRegion rgn = visibleRect.ToOutsidePixels(paintedData->mAppUnitsPerDevPixel);
|
||||
|
||||
// Convert the visible rect to a region and give the item
|
||||
// a chance to try restrict it further.
|
||||
nsRegion tightBounds = aItem->GetTightBounds(mDisplayListBuilder, &snap);
|
||||
if (!tightBounds.IsEmpty()) {
|
||||
rgn.AndWith(tightBounds.ToOutsidePixels(paintedData->mAppUnitsPerDevPixel));
|
||||
}
|
||||
SetOuterVisibleRegion(tmpLayer, &rgn);
|
||||
|
||||
// If BuildLayer didn't call BuildContainerLayerFor, then our new layer won't have been
|
||||
// stored in layerBuilder. Manually add it now.
|
||||
if (mRetainingManager) {
|
||||
#ifdef DEBUG_DISPLAY_ITEM_DATA
|
||||
LayerManagerData* parentLmd = static_cast<LayerManagerData*>
|
||||
(layer->Manager()->GetUserData(&gLayerManagerUserData));
|
||||
LayerManagerData* lmd = static_cast<LayerManagerData*>
|
||||
(tempManager->GetUserData(&gLayerManagerUserData));
|
||||
lmd->mParent = parentLmd;
|
||||
#endif
|
||||
DisplayItemData* data = layerBuilder->GetDisplayItemDataForManager(aItem, tempManager);
|
||||
layerBuilder->StoreDataForFrame(aItem, tmpLayer, LAYER_ACTIVE, data);
|
||||
}
|
||||
|
||||
tempManager->SetRoot(tmpLayer);
|
||||
layerBuilder->WillEndTransaction();
|
||||
tempManager->AbortTransaction();
|
||||
|
||||
#ifdef MOZ_DUMP_PAINTING
|
||||
if (gfxUtils::DumpDisplayList() || gfxEnv::DumpPaint()) {
|
||||
fprintf_stderr(gfxUtils::sDumpPaintFile, "Basic layer tree for painting contents of display item %s(%p):\n", aItem->Name(), aItem->Frame());
|
||||
std::stringstream stream;
|
||||
tempManager->Dump(stream, "", gfxEnv::DumpPaintToFile());
|
||||
fprint_stderr(gfxUtils::sDumpPaintFile, stream); // not a typo, fprint_stderr declared in LayersLogging.h
|
||||
}
|
||||
#endif
|
||||
|
||||
nsIntPoint offset = GetLastPaintOffset(layer) - GetTranslationForPaintedLayer(layer);
|
||||
props->MoveBy(-offset);
|
||||
// Effective transforms are needed by ComputeDifferences().
|
||||
tmpLayer->ComputeEffectiveTransforms(Matrix4x4());
|
||||
nsIntRegion invalid;
|
||||
if (!props->ComputeDifferences(tmpLayer, invalid, nullptr)) {
|
||||
nsRect visible = aItem->Frame()->GetVisualOverflowRect();
|
||||
invalid = visible.ToOutsidePixels(paintedData->mAppUnitsPerDevPixel);
|
||||
}
|
||||
if (aLayerState == LAYER_SVG_EFFECTS) {
|
||||
invalid = nsSVGIntegrationUtils::AdjustInvalidAreaForSVGEffects(aItem->Frame(),
|
||||
aItem->ToReferenceFrame(),
|
||||
invalid);
|
||||
}
|
||||
if (!invalid.IsEmpty()) {
|
||||
#ifdef MOZ_DUMP_PAINTING
|
||||
if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) {
|
||||
printf_stderr("Inactive LayerManager(%p) for display item %s(%p) has an invalid region - invalidating layer %p\n", tempManager.get(), aItem->Name(), aItem->Frame(), layer);
|
||||
}
|
||||
#endif
|
||||
invalid.ScaleRoundOut(paintedData->mXScale, paintedData->mYScale);
|
||||
|
||||
if (hasClip) {
|
||||
invalid.And(invalid, intClip);
|
||||
}
|
||||
|
||||
InvalidatePostTransformRegion(layer, invalid,
|
||||
GetTranslationForPaintedLayer(layer));
|
||||
}
|
||||
ClippedDisplayItem* cdi =
|
||||
entry->mItems.AppendElement(ClippedDisplayItem(aItem));
|
||||
cdi->mInactiveLayerManager = tempManager;
|
||||
}
|
||||
aAssignedDisplayItem.mInactiveLayerManager = tempManager;
|
||||
}
|
||||
|
||||
DisplayItemData*
|
||||
|
@ -4886,6 +4906,8 @@ FrameLayerBuilder::StoreDataForFrame(nsDisplayItem* aItem, Layer* aLayer,
|
|||
RefPtr<DisplayItemData> data =
|
||||
new (aItem->Frame()->PresContext()) DisplayItemData(lmd, aItem->GetPerFrameKey(), aLayer);
|
||||
|
||||
aItem->SetDisplayItemData(data);
|
||||
|
||||
data->BeginUpdate(aLayer, aState, aItem);
|
||||
|
||||
lmd->mDisplayItems.PutEntry(data);
|
||||
|
@ -4915,12 +4937,7 @@ FrameLayerBuilder::StoreDataForFrame(nsIFrame* aFrame,
|
|||
lmd->mDisplayItems.PutEntry(data);
|
||||
}
|
||||
|
||||
FrameLayerBuilder::ClippedDisplayItem::ClippedDisplayItem(nsDisplayItem* aItem)
|
||||
: mItem(aItem)
|
||||
{
|
||||
}
|
||||
|
||||
FrameLayerBuilder::ClippedDisplayItem::~ClippedDisplayItem()
|
||||
AssignedDisplayItem::~AssignedDisplayItem()
|
||||
{
|
||||
if (mInactiveLayerManager) {
|
||||
mInactiveLayerManager->SetUserData(&gLayerManagerLayerBuilder, nullptr);
|
||||
|
@ -5888,7 +5905,7 @@ static void DebugPaintItem(DrawTarget& aDrawTarget,
|
|||
#endif
|
||||
|
||||
/* static */ void
|
||||
FrameLayerBuilder::RecomputeVisibilityForItems(nsTArray<ClippedDisplayItem>& aItems,
|
||||
FrameLayerBuilder::RecomputeVisibilityForItems(nsTArray<AssignedDisplayItem>& aItems,
|
||||
nsDisplayListBuilder *aBuilder,
|
||||
const nsIntRegion& aRegionToDraw,
|
||||
const nsIntPoint& aOffset,
|
||||
|
@ -5905,7 +5922,10 @@ FrameLayerBuilder::RecomputeVisibilityForItems(nsTArray<ClippedDisplayItem>& aIt
|
|||
visible.ScaleInverseRoundOut(aXScale, aYScale);
|
||||
|
||||
for (i = aItems.Length(); i > 0; --i) {
|
||||
ClippedDisplayItem* cdi = &aItems[i - 1];
|
||||
AssignedDisplayItem* cdi = &aItems[i - 1];
|
||||
if (!cdi->mItem) {
|
||||
continue;
|
||||
}
|
||||
const DisplayItemClip& clip = cdi->mItem->GetClip();
|
||||
|
||||
NS_ASSERTION(AppUnitsPerDevPixel(cdi->mItem) == aAppUnitsPerDevPixel,
|
||||
|
@ -5941,7 +5961,7 @@ FrameLayerBuilder::RecomputeVisibilityForItems(nsTArray<ClippedDisplayItem>& aIt
|
|||
}
|
||||
|
||||
void
|
||||
FrameLayerBuilder::PaintItems(nsTArray<ClippedDisplayItem>& aItems,
|
||||
FrameLayerBuilder::PaintItems(nsTArray<AssignedDisplayItem>& aItems,
|
||||
const nsIntRect& aRect,
|
||||
gfxContext *aContext,
|
||||
nsDisplayListBuilder* aBuilder,
|
||||
|
@ -5963,7 +5983,10 @@ FrameLayerBuilder::PaintItems(nsTArray<ClippedDisplayItem>& aItems,
|
|||
DisplayItemClip tmpClip;
|
||||
|
||||
for (uint32_t i = 0; i < aItems.Length(); ++i) {
|
||||
ClippedDisplayItem* cdi = &aItems[i];
|
||||
AssignedDisplayItem* cdi = &aItems[i];
|
||||
if (!cdi->mItem) {
|
||||
continue;
|
||||
}
|
||||
|
||||
nsRect paintRect = cdi->mItem->GetVisibleRect().Intersect(boundRect);
|
||||
if (paintRect.IsEmpty())
|
||||
|
|
|
@ -71,6 +71,8 @@ public:
|
|||
void Invalidate() { mIsInvalid = true; }
|
||||
void ClearAnimationCompositorState();
|
||||
|
||||
bool HasMergedFrames() const { return mFrameList.Length() > 1; }
|
||||
|
||||
static DisplayItemData* AssertDisplayItemData(DisplayItemData* aData);
|
||||
|
||||
void* operator new(size_t sz, nsPresContext* aPresContext)
|
||||
|
@ -104,6 +106,10 @@ public:
|
|||
return mRefCnt;
|
||||
}
|
||||
|
||||
void Disconnect();
|
||||
|
||||
bool Disconnected() { return mDisconnected; }
|
||||
|
||||
private:
|
||||
DisplayItemData(LayerManagerData* aParent,
|
||||
uint32_t aKey,
|
||||
|
@ -186,6 +192,7 @@ private:
|
|||
bool mUsed;
|
||||
bool mIsInvalid;
|
||||
bool mReusedItem;
|
||||
bool mDisconnected;
|
||||
};
|
||||
|
||||
class RefCountedRegion {
|
||||
|
@ -199,6 +206,31 @@ public:
|
|||
bool mIsInfinite;
|
||||
};
|
||||
|
||||
struct AssignedDisplayItem
|
||||
{
|
||||
AssignedDisplayItem(nsDisplayItem* aItem,
|
||||
const DisplayItemClip& aClip,
|
||||
LayerState aLayerState)
|
||||
: mItem(aItem)
|
||||
, mClip(aClip)
|
||||
, mLayerState(aLayerState)
|
||||
{}
|
||||
|
||||
~AssignedDisplayItem();
|
||||
|
||||
nsDisplayItem* mItem;
|
||||
DisplayItemClip mClip;
|
||||
LayerState mLayerState;
|
||||
|
||||
/**
|
||||
* If the display item is being rendered as an inactive
|
||||
* layer, then this stores the layer manager being
|
||||
* used for the inactive transaction.
|
||||
*/
|
||||
RefPtr<layers::LayerManager> mInactiveLayerManager;
|
||||
};
|
||||
|
||||
|
||||
struct ContainerLayerParameters {
|
||||
ContainerLayerParameters()
|
||||
: mXScale(1)
|
||||
|
@ -495,7 +527,8 @@ public:
|
|||
ContainerState& aContainerState,
|
||||
LayerState aLayerState,
|
||||
const nsPoint& aTopLeft,
|
||||
DisplayItemData* aData);
|
||||
DisplayItemData* aData,
|
||||
AssignedDisplayItem& aAssignedDisplayItem);
|
||||
|
||||
/**
|
||||
* Calls GetOldLayerForFrame on the underlying frame of the display item,
|
||||
|
@ -596,7 +629,7 @@ public:
|
|||
* This could be a dedicated layer for the display item, or a PaintedLayer
|
||||
* that renders many display items.
|
||||
*/
|
||||
DisplayItemData* GetOldLayerForFrame(nsIFrame* aFrame, uint32_t aDisplayItemKey);
|
||||
DisplayItemData* GetOldLayerForFrame(nsIFrame* aFrame, uint32_t aDisplayItemKey, DisplayItemData* aOldData = nullptr);
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -648,21 +681,8 @@ protected:
|
|||
* DrawPaintedLayer callback can figure out which items to draw for the
|
||||
* PaintedLayer.
|
||||
*/
|
||||
struct ClippedDisplayItem {
|
||||
explicit ClippedDisplayItem(nsDisplayItem* aItem);
|
||||
~ClippedDisplayItem();
|
||||
|
||||
nsDisplayItem* mItem;
|
||||
|
||||
/**
|
||||
* If the display item is being rendered as an inactive
|
||||
* layer, then this stores the layer manager being
|
||||
* used for the inactive transaction.
|
||||
*/
|
||||
RefPtr<LayerManager> mInactiveLayerManager;
|
||||
};
|
||||
|
||||
static void RecomputeVisibilityForItems(nsTArray<ClippedDisplayItem>& aItems,
|
||||
static void RecomputeVisibilityForItems(nsTArray<AssignedDisplayItem>& aItems,
|
||||
nsDisplayListBuilder* aBuilder,
|
||||
const nsIntRegion& aRegionToDraw,
|
||||
const nsIntPoint& aOffset,
|
||||
|
@ -670,7 +690,7 @@ protected:
|
|||
float aXScale,
|
||||
float aYScale);
|
||||
|
||||
void PaintItems(nsTArray<ClippedDisplayItem>& aItems,
|
||||
void PaintItems(nsTArray<AssignedDisplayItem>& aItems,
|
||||
const nsIntRect& aRect,
|
||||
gfxContext* aContext,
|
||||
nsDisplayListBuilder* aBuilder,
|
||||
|
@ -690,7 +710,7 @@ public:
|
|||
PaintedLayerItemsEntry(const PaintedLayerItemsEntry&);
|
||||
~PaintedLayerItemsEntry();
|
||||
|
||||
nsTArray<ClippedDisplayItem> mItems;
|
||||
nsTArray<AssignedDisplayItem> mItems;
|
||||
nsIFrame* mContainerLayerFrame;
|
||||
// The translation set on this PaintedLayer before we started updating the
|
||||
// layer tree.
|
||||
|
@ -711,9 +731,9 @@ public:
|
|||
* Get the PaintedLayerItemsEntry object associated with aLayer in this
|
||||
* FrameLayerBuilder
|
||||
*/
|
||||
PaintedLayerItemsEntry* GetPaintedLayerItemsEntry(PaintedLayer* aLayer)
|
||||
PaintedLayerItemsEntry* AddPaintedLayerItemsEntry(PaintedLayer* aLayer)
|
||||
{
|
||||
return mPaintedLayerItems.GetEntry(aLayer);
|
||||
return mPaintedLayerItems.PutEntry(aLayer);
|
||||
}
|
||||
|
||||
PaintedLayerData* GetContainingPaintedLayerData()
|
||||
|
|
|
@ -2257,7 +2257,7 @@ nsDisplayListBuilder::BuildCompositorHitTestInfoIfNeeded(nsIFrame* aFrame,
|
|||
}
|
||||
|
||||
nsDisplayCompositorHitTestInfo* item =
|
||||
new (this) nsDisplayCompositorHitTestInfo(this, aFrame, info);
|
||||
MakeDisplayItem<nsDisplayCompositorHitTestInfo>(this, aFrame, info);
|
||||
|
||||
SetCompositorHitTestInfo(item);
|
||||
aList->AppendToTop(item);
|
||||
|
@ -3531,9 +3531,10 @@ nsDisplayBackgroundImage::GetInitData(nsDisplayListBuilder* aBuilder,
|
|||
};
|
||||
}
|
||||
|
||||
nsDisplayBackgroundImage::nsDisplayBackgroundImage(const InitData& aInitData,
|
||||
nsDisplayBackgroundImage::nsDisplayBackgroundImage(nsDisplayListBuilder* aBuilder,
|
||||
const InitData& aInitData,
|
||||
nsIFrame* aFrameForBounds)
|
||||
: nsDisplayImageContainer(aInitData.builder, aInitData.frame)
|
||||
: nsDisplayImageContainer(aBuilder, aInitData.frame)
|
||||
, mBackgroundStyle(aInitData.backgroundStyle)
|
||||
, mImage(aInitData.image)
|
||||
, mDependentFrame(nullptr)
|
||||
|
@ -3643,7 +3644,7 @@ SpecialCutoutRegionCase(nsDisplayListBuilder* aBuilder,
|
|||
region.Sub(aBackgroundRect, *static_cast<nsRegion*>(cutoutRegion));
|
||||
region.MoveBy(aBuilder->ToReferenceFrame(aFrame));
|
||||
aList->AppendToTop(
|
||||
new (aBuilder) nsDisplaySolidColorRegion(aBuilder, aFrame, region, aColor));
|
||||
MakeDisplayItem<nsDisplaySolidColorRegion>(aBuilder, aFrame, region, aColor));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -3748,12 +3749,12 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
|
|||
nsDisplayBackgroundColor *bgItem;
|
||||
if (aSecondaryReferenceFrame) {
|
||||
bgItem =
|
||||
new (aBuilder) nsDisplayTableBackgroundColor(aBuilder, aSecondaryReferenceFrame, bgColorRect, bg,
|
||||
MakeDisplayItem<nsDisplayTableBackgroundColor>(aBuilder, aSecondaryReferenceFrame, bgColorRect, bg,
|
||||
drawBackgroundColor ? color : NS_RGBA(0, 0, 0, 0),
|
||||
aFrame);
|
||||
} else {
|
||||
bgItem =
|
||||
new (aBuilder) nsDisplayBackgroundColor(aBuilder, aFrame, bgColorRect, bg,
|
||||
MakeDisplayItem<nsDisplayBackgroundColor>(aBuilder, aFrame, bgColorRect, bg,
|
||||
drawBackgroundColor ? color : NS_RGBA(0, 0, 0, 0));
|
||||
}
|
||||
bgItem->SetDependentFrame(aBuilder, dependentFrame);
|
||||
|
@ -3765,11 +3766,11 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
|
|||
if (theme->NeedToClearBackgroundBehindWidget(aFrame, aFrame->StyleDisplay()->mAppearance) &&
|
||||
aBuilder->IsInChromeDocumentOrPopup() && !aBuilder->IsInTransform()) {
|
||||
bgItemList.AppendToTop(
|
||||
new (aBuilder) nsDisplayClearBackground(aBuilder, aFrame));
|
||||
MakeDisplayItem<nsDisplayClearBackground>(aBuilder, aFrame));
|
||||
}
|
||||
if (aSecondaryReferenceFrame) {
|
||||
nsDisplayTableThemedBackground* bgItem =
|
||||
new (aBuilder) nsDisplayTableThemedBackground(aBuilder,
|
||||
MakeDisplayItem<nsDisplayTableThemedBackground>(aBuilder,
|
||||
aSecondaryReferenceFrame,
|
||||
bgRect,
|
||||
aFrame);
|
||||
|
@ -3777,7 +3778,7 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
|
|||
bgItemList.AppendToTop(bgItem);
|
||||
} else {
|
||||
nsDisplayThemedBackground* bgItem =
|
||||
new (aBuilder) nsDisplayThemedBackground(aBuilder, aFrame, bgRect);
|
||||
MakeDisplayItem<nsDisplayThemedBackground>(aBuilder, aFrame, bgRect);
|
||||
bgItem->Init(aBuilder);
|
||||
bgItemList.AppendToTop(bgItem);
|
||||
}
|
||||
|
@ -3851,9 +3852,9 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
|
|||
nsDisplayBackgroundImage::InitData tableData = bgData;
|
||||
nsIFrame* styleFrame = tableData.frame;
|
||||
tableData.frame = aSecondaryReferenceFrame;
|
||||
bgItem = new (aBuilder) nsDisplayTableBackgroundImage(tableData, styleFrame);
|
||||
bgItem = MakeDisplayItem<nsDisplayTableBackgroundImage>(aBuilder, tableData, styleFrame);
|
||||
} else {
|
||||
bgItem = new (aBuilder) nsDisplayBackgroundImage(bgData);
|
||||
bgItem = MakeDisplayItem<nsDisplayBackgroundImage>(aBuilder, bgData);
|
||||
}
|
||||
}
|
||||
bgItem->SetDependentFrame(aBuilder, dependentFrame);
|
||||
|
@ -3876,9 +3877,9 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
|
|||
nsIFrame* styleFrame = tableData.frame;
|
||||
tableData.frame = aSecondaryReferenceFrame;
|
||||
|
||||
bgItem = new (aBuilder) nsDisplayTableBackgroundImage(tableData, styleFrame);
|
||||
bgItem = MakeDisplayItem<nsDisplayTableBackgroundImage>(aBuilder, tableData, styleFrame);
|
||||
} else {
|
||||
bgItem = new (aBuilder) nsDisplayBackgroundImage(bgData);
|
||||
bgItem = MakeDisplayItem<nsDisplayBackgroundImage>(aBuilder, bgData);
|
||||
}
|
||||
bgItem->SetDependentFrame(aBuilder, dependentFrame);
|
||||
thisItemList.AppendToTop(bgItem);
|
||||
|
@ -3891,12 +3892,12 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
|
|||
// item with respect to asr.
|
||||
if (aSecondaryReferenceFrame) {
|
||||
thisItemList.AppendToTop(
|
||||
new (aBuilder) nsDisplayTableBlendMode(aBuilder, aSecondaryReferenceFrame, &thisItemList,
|
||||
MakeDisplayItem<nsDisplayTableBlendMode>(aBuilder, aSecondaryReferenceFrame, &thisItemList,
|
||||
bg->mImage.mLayers[i].mBlendMode,
|
||||
asr, i + 1, aFrame));
|
||||
} else {
|
||||
thisItemList.AppendToTop(
|
||||
new (aBuilder) nsDisplayBlendMode(aBuilder, aFrame, &thisItemList,
|
||||
MakeDisplayItem<nsDisplayBlendMode>(aBuilder, aFrame, &thisItemList,
|
||||
bg->mImage.mLayers[i].mBlendMode,
|
||||
asr, i + 1));
|
||||
}
|
||||
|
@ -4399,9 +4400,10 @@ nsDisplayBackgroundImage::GetBoundsInternal(nsDisplayListBuilder* aBuilder,
|
|||
aBuilder->GetBackgroundPaintFlags());
|
||||
}
|
||||
|
||||
nsDisplayTableBackgroundImage::nsDisplayTableBackgroundImage(const InitData& aData,
|
||||
nsDisplayTableBackgroundImage::nsDisplayTableBackgroundImage(nsDisplayListBuilder* aBuilder,
|
||||
const InitData& aData,
|
||||
nsIFrame* aCellFrame)
|
||||
: nsDisplayBackgroundImage(aData, aCellFrame)
|
||||
: nsDisplayBackgroundImage(aBuilder, aData, aCellFrame)
|
||||
, mStyleFrame(aCellFrame)
|
||||
, mTableType(GetTableTypeFromFrame(mStyleFrame))
|
||||
{
|
||||
|
@ -6268,7 +6270,7 @@ nsDisplayWrapList::MergeDisplayListFromItem(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
// Create a new nsDisplayWrapList using a copy-constructor. This is done
|
||||
// to preserve the information about bounds.
|
||||
nsDisplayWrapList* wrapper = new (aBuilder) nsDisplayWrapList(aBuilder, *wrappedItem);
|
||||
nsDisplayWrapList* wrapper = MakeDisplayItem<nsDisplayWrapList>(aBuilder, *wrappedItem);
|
||||
|
||||
// Set the display list pointer of the new wrapper item to the display list
|
||||
// of the wrapped item.
|
||||
|
@ -6920,7 +6922,7 @@ nsDisplayBlendContainer::CreateForMixBlendMode(nsDisplayListBuilder* aBuilder,
|
|||
nsIFrame* aFrame, nsDisplayList* aList,
|
||||
const ActiveScrolledRoot* aActiveScrolledRoot)
|
||||
{
|
||||
return new (aBuilder) nsDisplayBlendContainer(aBuilder, aFrame, aList, aActiveScrolledRoot, false);
|
||||
return MakeDisplayItem<nsDisplayBlendContainer>(aBuilder, aFrame, aList, aActiveScrolledRoot, false);
|
||||
}
|
||||
|
||||
/* static */ nsDisplayBlendContainer*
|
||||
|
@ -6928,7 +6930,7 @@ nsDisplayBlendContainer::CreateForBackgroundBlendMode(nsDisplayListBuilder* aBui
|
|||
nsIFrame* aFrame, nsDisplayList* aList,
|
||||
const ActiveScrolledRoot* aActiveScrolledRoot)
|
||||
{
|
||||
return new (aBuilder) nsDisplayBlendContainer(aBuilder, aFrame, aList, aActiveScrolledRoot, true);
|
||||
return MakeDisplayItem<nsDisplayBlendContainer>(aBuilder, aFrame, aList, aActiveScrolledRoot, true);
|
||||
}
|
||||
|
||||
nsDisplayBlendContainer::nsDisplayBlendContainer(nsDisplayListBuilder* aBuilder,
|
||||
|
@ -6995,7 +6997,7 @@ nsDisplayTableBlendContainer::CreateForBackgroundBlendMode(nsDisplayListBuilder*
|
|||
const ActiveScrolledRoot* aActiveScrolledRoot,
|
||||
nsIFrame* aAncestorFrame)
|
||||
{
|
||||
return new (aBuilder) nsDisplayTableBlendContainer(aBuilder, aFrame, aList, aActiveScrolledRoot, true, aAncestorFrame);
|
||||
return MakeDisplayItem<nsDisplayTableBlendContainer>(aBuilder, aFrame, aList, aActiveScrolledRoot, true, aAncestorFrame);
|
||||
}
|
||||
|
||||
nsDisplayOwnLayer::nsDisplayOwnLayer(nsDisplayListBuilder* aBuilder,
|
||||
|
@ -7374,7 +7376,7 @@ nsDisplayFixedPosition::CreateForFixedBackground(nsDisplayListBuilder* aBuilder,
|
|||
nsDisplayList temp;
|
||||
temp.AppendToTop(aImage);
|
||||
|
||||
return new (aBuilder) nsDisplayFixedPosition(aBuilder, aFrame, &temp, aIndex + 1);
|
||||
return MakeDisplayItem<nsDisplayFixedPosition>(aBuilder, aFrame, &temp, aIndex + 1);
|
||||
}
|
||||
|
||||
|
||||
|
@ -7487,7 +7489,7 @@ nsDisplayTableFixedPosition::CreateForFixedBackground(nsDisplayListBuilder* aBui
|
|||
nsDisplayList temp;
|
||||
temp.AppendToTop(aImage);
|
||||
|
||||
return new (aBuilder) nsDisplayTableFixedPosition(aBuilder, aFrame, &temp, aIndex + 1, aAncestorFrame);
|
||||
return MakeDisplayItem<nsDisplayTableFixedPosition>(aBuilder, aFrame, &temp, aIndex + 1, aAncestorFrame);
|
||||
}
|
||||
|
||||
nsDisplayStickyPosition::nsDisplayStickyPosition(nsDisplayListBuilder* aBuilder,
|
||||
|
|
|
@ -130,10 +130,14 @@ typedef mozilla::EnumSet<mozilla::gfx::CompositionOp> BlendModeSet;
|
|||
#define NS_DISPLAY_DECL_NAME(n, e) \
|
||||
virtual const char* Name() const override { return n; } \
|
||||
virtual DisplayItemType GetType() const override { return DisplayItemType::e; } \
|
||||
private: \
|
||||
void* operator new(size_t aSize, \
|
||||
nsDisplayListBuilder* aBuilder) { \
|
||||
return aBuilder->Allocate(aSize, DisplayItemType::e); \
|
||||
}
|
||||
} \
|
||||
template<typename T, typename... Args> \
|
||||
friend T* ::MakeDisplayItem(nsDisplayListBuilder* aBuilder, Args&&... aArgs); \
|
||||
public:
|
||||
|
||||
|
||||
/**
|
||||
|
@ -2025,6 +2029,27 @@ protected:
|
|||
|
||||
class nsDisplayWrapList;
|
||||
|
||||
template<typename T, typename... Args>
|
||||
MOZ_ALWAYS_INLINE T*
|
||||
MakeDisplayItem(nsDisplayListBuilder* aBuilder, Args&&... aArgs)
|
||||
{
|
||||
T* item = new (aBuilder) T(aBuilder, mozilla::Forward<Args>(aArgs)...);
|
||||
|
||||
const mozilla::SmallPointerArray<mozilla::DisplayItemData>& array =
|
||||
item->Frame()->DisplayItemData();
|
||||
for (uint32_t i = 0; i < array.Length(); i++) {
|
||||
mozilla::DisplayItemData* did = array.ElementAt(i);
|
||||
if (did->GetDisplayItemKey() == item->GetPerFrameKey()) {
|
||||
if (did->HasMergedFrames()) {
|
||||
item->SetDisplayItemData(did);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the unit of rendering and event testing. Each instance of this
|
||||
* class represents an entity that can be drawn on the screen, e.g., a
|
||||
|
@ -2116,6 +2141,7 @@ public:
|
|||
if (mFrame && aFrame == mFrame) {
|
||||
MOZ_ASSERT(!mFrame->HasDisplayItem(this));
|
||||
mFrame = nullptr;
|
||||
mDisplayItemData = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2582,6 +2608,8 @@ public:
|
|||
*/
|
||||
virtual void GetMergedFrames(nsTArray<nsIFrame*>* aFrames) const {}
|
||||
|
||||
virtual bool HasMergedFrames() const { return false; }
|
||||
|
||||
/**
|
||||
* During the visibility computation and after TryMerge, display lists may
|
||||
* return true here to flatten themselves away, removing them. This
|
||||
|
@ -2807,6 +2835,12 @@ public:
|
|||
nsDisplayListBuilder* aBuilder,
|
||||
const ActiveScrolledRoot* aASR) const;
|
||||
|
||||
void SetDisplayItemData(mozilla::DisplayItemData* aDID) {
|
||||
mDisplayItemData = aDID;
|
||||
}
|
||||
|
||||
mozilla::DisplayItemData* GetDisplayItemData() { return mDisplayItemData; }
|
||||
|
||||
protected:
|
||||
nsDisplayItem() = delete;
|
||||
|
||||
|
@ -2823,6 +2857,7 @@ protected:
|
|||
RefPtr<struct AnimatedGeometryRoot> mAnimatedGeometryRoot;
|
||||
// Result of ToReferenceFrame(mFrame), if mFrame is non-null
|
||||
nsPoint mToReferenceFrame;
|
||||
RefPtr<mozilla::DisplayItemData> mDisplayItemData;
|
||||
// This is the rectangle that needs to be painted.
|
||||
// Display item construction sets this to the dirty rect.
|
||||
// nsDisplayList::ComputeVisibility sets this to the visible region
|
||||
|
@ -3386,10 +3421,6 @@ public:
|
|||
}
|
||||
virtual const char* Name() const override { return mName; }
|
||||
virtual DisplayItemType GetType() const override { return mType; }
|
||||
void* operator new(size_t aSize,
|
||||
nsDisplayListBuilder* aBuilder) {
|
||||
return aBuilder->Allocate(aSize, DisplayItemType::TYPE_GENERIC);
|
||||
}
|
||||
|
||||
// This override is needed because GetType() for nsDisplayGeneric subclasses
|
||||
// does not match TYPE_GENERIC that was used to allocate the object.
|
||||
|
@ -3400,6 +3431,13 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
void* operator new(size_t aSize,
|
||||
nsDisplayListBuilder* aBuilder) {
|
||||
return aBuilder->Allocate(aSize, DisplayItemType::TYPE_GENERIC);
|
||||
}
|
||||
template<typename T, typename... Args>
|
||||
friend T* MakeDisplayItem(nsDisplayListBuilder* aBuilder, Args&&... aArgs);
|
||||
|
||||
PaintCallback mPaint;
|
||||
OldPaintCallback mOldPaint; // XXX: should be removed eventually
|
||||
const char* mName;
|
||||
|
@ -3453,7 +3491,7 @@ protected:
|
|||
if (!aBuilder->IsBackgroundOnly() && !aBuilder->IsForEventDelivery() && \
|
||||
PresShell()->IsPaintingFrameCounts()) { \
|
||||
aLists.Outlines()->AppendToTop( \
|
||||
new (aBuilder) nsDisplayReflowCount(aBuilder, this, _name)); \
|
||||
MakeDisplayItem<nsDisplayReflowCount>(aBuilder, this, _name)); \
|
||||
} \
|
||||
PR_END_MACRO
|
||||
|
||||
|
@ -3462,7 +3500,7 @@ protected:
|
|||
if (!aBuilder->IsBackgroundOnly() && !aBuilder->IsForEventDelivery() && \
|
||||
PresShell()->IsPaintingFrameCounts()) { \
|
||||
aLists.Outlines()->AppendToTop( \
|
||||
new (aBuilder) nsDisplayReflowCount(aBuilder, this, _name, _color)); \
|
||||
MakeDisplayItem<nsDisplayReflowCount>(aBuilder, this, _name, _color)); \
|
||||
} \
|
||||
PR_END_MACRO
|
||||
|
||||
|
@ -3834,7 +3872,8 @@ public:
|
|||
const nsRect& aBackgroundRect,
|
||||
const nsStyleBackground* aBackgroundStyle);
|
||||
|
||||
explicit nsDisplayBackgroundImage(const InitData& aInitData,
|
||||
explicit nsDisplayBackgroundImage(nsDisplayListBuilder* aBuilder,
|
||||
const InitData& aInitData,
|
||||
nsIFrame* aFrameForBounds = nullptr);
|
||||
virtual ~nsDisplayBackgroundImage();
|
||||
|
||||
|
@ -4028,7 +4067,7 @@ TableType GetTableTypeFromFrame(nsIFrame* aFrame);
|
|||
*/
|
||||
class nsDisplayTableBackgroundImage : public nsDisplayBackgroundImage {
|
||||
public:
|
||||
nsDisplayTableBackgroundImage(const InitData& aInitData, nsIFrame* aCellFrame);
|
||||
nsDisplayTableBackgroundImage(nsDisplayListBuilder* aBuilder, const InitData& aInitData, nsIFrame* aCellFrame);
|
||||
|
||||
virtual uint32_t GetPerFrameKey() const override {
|
||||
return (mLayer << (TYPE_BITS + static_cast<uint8_t>(TableTypeBits::COUNT))) |
|
||||
|
@ -4952,6 +4991,11 @@ public:
|
|||
aFrames->AppendElements(mMergedFrames);
|
||||
}
|
||||
|
||||
virtual bool HasMergedFrames() const override
|
||||
{
|
||||
return !mMergedFrames.IsEmpty();
|
||||
}
|
||||
|
||||
virtual bool ShouldFlattenAway(nsDisplayListBuilder* aBuilder) override
|
||||
{
|
||||
return true;
|
||||
|
@ -5104,7 +5148,7 @@ public:
|
|||
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsDisplayOpacity);
|
||||
return new (aBuilder) nsDisplayOpacity(aBuilder, *this);
|
||||
return MakeDisplayItem<nsDisplayOpacity>(aBuilder, *this);
|
||||
}
|
||||
|
||||
virtual nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
|
||||
|
@ -5184,7 +5228,7 @@ public:
|
|||
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsDisplayBlendMode);
|
||||
return new (aBuilder) nsDisplayBlendMode(aBuilder, *this);
|
||||
return MakeDisplayItem<nsDisplayBlendMode>(aBuilder, *this);
|
||||
}
|
||||
|
||||
nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
|
||||
|
@ -5248,7 +5292,7 @@ public:
|
|||
|
||||
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
|
||||
{
|
||||
return new (aBuilder) nsDisplayTableBlendMode(aBuilder, *this);
|
||||
return MakeDisplayItem<nsDisplayTableBlendMode>(aBuilder, *this);
|
||||
}
|
||||
|
||||
virtual nsIFrame* FrameForInvalidation() const override { return mAncestorFrame; }
|
||||
|
@ -5285,7 +5329,7 @@ public:
|
|||
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsDisplayBlendContainer);
|
||||
return new (aBuilder) nsDisplayBlendContainer(aBuilder, *this);
|
||||
return MakeDisplayItem<nsDisplayBlendContainer>(aBuilder, *this);
|
||||
}
|
||||
|
||||
virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
|
||||
|
@ -5344,7 +5388,7 @@ public:
|
|||
|
||||
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
|
||||
{
|
||||
return new (aBuilder) nsDisplayTableBlendContainer(aBuilder, *this);
|
||||
return MakeDisplayItem<nsDisplayTableBlendContainer>(aBuilder, *this);
|
||||
}
|
||||
|
||||
virtual nsIFrame* FrameForInvalidation() const override { return mAncestorFrame; }
|
||||
|
@ -5582,7 +5626,7 @@ public:
|
|||
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsDisplayStickyPosition);
|
||||
return new (aBuilder) nsDisplayStickyPosition(aBuilder, *this);
|
||||
return MakeDisplayItem<nsDisplayStickyPosition>(aBuilder, *this);
|
||||
}
|
||||
|
||||
virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
|
||||
|
@ -5636,7 +5680,7 @@ public:
|
|||
|
||||
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
|
||||
{
|
||||
return new (aBuilder) nsDisplayFixedPosition(aBuilder, *this);
|
||||
return MakeDisplayItem<nsDisplayFixedPosition>(aBuilder, *this);
|
||||
}
|
||||
|
||||
virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
|
||||
|
@ -5694,7 +5738,7 @@ public:
|
|||
|
||||
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
|
||||
{
|
||||
return new (aBuilder) nsDisplayTableFixedPosition(aBuilder, *this);
|
||||
return MakeDisplayItem<nsDisplayTableFixedPosition>(aBuilder, *this);
|
||||
}
|
||||
|
||||
virtual nsIFrame* FrameForInvalidation() const override { return mAncestorFrame; }
|
||||
|
@ -5718,7 +5762,6 @@ protected:
|
|||
, mTableType(aOther.mTableType)
|
||||
{}
|
||||
|
||||
|
||||
nsIFrame* mAncestorFrame;
|
||||
TableType mTableType;
|
||||
};
|
||||
|
@ -5899,7 +5942,7 @@ public:
|
|||
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsDisplayMask);
|
||||
return new (aBuilder) nsDisplayMask(aBuilder, *this);
|
||||
return MakeDisplayItem<nsDisplayMask>(aBuilder, *this);
|
||||
}
|
||||
|
||||
NS_DISPLAY_DECL_NAME("Mask", TYPE_MASK)
|
||||
|
@ -5988,7 +6031,7 @@ public:
|
|||
virtual nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsDisplayFilter);
|
||||
return new (aBuilder) nsDisplayFilter(aBuilder, *this);
|
||||
return MakeDisplayItem<nsDisplayFilter>(aBuilder, *this);
|
||||
}
|
||||
|
||||
NS_DISPLAY_DECL_NAME("Filter", TYPE_FILTER)
|
||||
|
|
|
@ -260,7 +260,7 @@ SVGGeometryFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
}
|
||||
DisplayOutline(aBuilder, aLists);
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplaySVGGeometry(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplaySVGGeometry>(aBuilder, this));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -3204,7 +3204,7 @@ SVGTextFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
}
|
||||
DisplayOutline(aBuilder, aLists);
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplaySVGText(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplaySVGText>(aBuilder, this));
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -786,10 +786,10 @@ nsSVGOuterSVGFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
nsDisplayListSet set(&newList, &newList, &newList,
|
||||
&newList, &newList, &newList);
|
||||
BuildDisplayListForNonBlockChildren(aBuilder, set);
|
||||
aLists.Content()->AppendToTop(new (aBuilder) nsDisplaySVGWrapper(aBuilder, this, &newList));
|
||||
aLists.Content()->AppendToTop(MakeDisplayItem<nsDisplaySVGWrapper>(aBuilder, this, &newList));
|
||||
} else if (IsVisibleForPainting(aBuilder) || !aBuilder->IsForPainting()) {
|
||||
aLists.Content()->AppendToTop(
|
||||
new (aBuilder) nsDisplayOuterSVG(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayOuterSVG>(aBuilder, this));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -391,8 +391,7 @@ nsTableCellFrame::ProcessBorders(nsTableFrame* aFrame,
|
|||
|
||||
if (!GetContentEmpty() ||
|
||||
StyleTableBorder()->mEmptyCells == NS_STYLE_TABLE_EMPTY_CELLS_SHOW) {
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayBorder(aBuilder, this));
|
||||
aLists.BorderBackground()->AppendToTop(MakeDisplayItem<nsDisplayBorder>(aBuilder, this));
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -496,7 +495,7 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
bool hasBoxShadow = !!StyleEffects()->mBoxShadow;
|
||||
if (hasBoxShadow) {
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
new (aBuilder) nsDisplayBoxShadowOuter(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayBoxShadowOuter>(aBuilder, this));
|
||||
}
|
||||
|
||||
// display background if we need to.
|
||||
|
@ -512,7 +511,7 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
// display inset box-shadows if we need to.
|
||||
if (hasBoxShadow) {
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
new (aBuilder) nsDisplayBoxShadowInner(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayBoxShadowInner>(aBuilder, this));
|
||||
}
|
||||
|
||||
// display borders if we need to
|
||||
|
@ -520,8 +519,8 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
// and display the selection border if we need to
|
||||
if (IsSelected()) {
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayTableCellSelection(aBuilder, this));
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayTableCellSelection>(aBuilder, this));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1533,7 +1533,7 @@ nsTableFrame::DisplayGenericTablePart(nsDisplayListBuilder* aBuilder,
|
|||
// Paint the outset box-shadows for the table frames
|
||||
if (aFrame->StyleEffects()->mBoxShadow) {
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
new (aBuilder) nsDisplayBoxShadowOuter(aBuilder, aFrame));
|
||||
MakeDisplayItem<nsDisplayBoxShadowOuter>(aBuilder, aFrame));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1601,7 +1601,7 @@ nsTableFrame::DisplayGenericTablePart(nsDisplayListBuilder* aBuilder,
|
|||
// Paint the inset box-shadows for the table frames
|
||||
if (aFrame->StyleEffects()->mBoxShadow) {
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
new (aBuilder) nsDisplayBoxShadowInner(aBuilder, aFrame));
|
||||
MakeDisplayItem<nsDisplayBoxShadowInner>(aBuilder, aFrame));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1616,13 +1616,13 @@ nsTableFrame::DisplayGenericTablePart(nsDisplayListBuilder* aBuilder,
|
|||
if (table->IsBorderCollapse()) {
|
||||
if (table->HasBCBorders()) {
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
new (aBuilder) nsDisplayTableBorderCollapse(aBuilder, table));
|
||||
MakeDisplayItem<nsDisplayTableBorderCollapse>(aBuilder, table));
|
||||
}
|
||||
} else {
|
||||
const nsStyleBorder* borderStyle = aFrame->StyleBorder();
|
||||
if (borderStyle->HasBorder()) {
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
new (aBuilder) nsDisplayBorder(aBuilder, table));
|
||||
MakeDisplayItem<nsDisplayBorder>(aBuilder, table));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1348,11 +1348,11 @@ nsBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
if (mState & NS_STATE_CURRENTLY_IN_DEBUG) {
|
||||
destination.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayGeneric(aBuilder, this, PaintXULDebugBackground,
|
||||
destination.BorderBackground()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayGeneric>(aBuilder, this, PaintXULDebugBackground,
|
||||
"XULDebugBackground"));
|
||||
destination.Outlines()->AppendToTop(new (aBuilder)
|
||||
nsDisplayXULDebug(aBuilder, this));
|
||||
destination.Outlines()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayXULDebug>(aBuilder, this));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1384,11 +1384,11 @@ nsBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
DisplayListClipState::AutoSaveRestore ownLayerClipState(aBuilder);
|
||||
|
||||
// Wrap the list to make it its own layer
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayOwnLayer(aBuilder, this, &masterList, ownLayerASR,
|
||||
nsDisplayOwnLayerFlags::eNone,
|
||||
mozilla::layers::FrameMetrics::NULL_SCROLL_ID,
|
||||
mozilla::layers::ScrollThumbData{}, true, true));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayOwnLayer>(aBuilder, this, &masterList, ownLayerASR,
|
||||
nsDisplayOwnLayerFlags::eNone,
|
||||
mozilla::layers::FrameMetrics::NULL_SCROLL_ID,
|
||||
mozilla::layers::ScrollThumbData{}, true, true));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2086,14 +2086,13 @@ public:
|
|||
virtual nsDisplayItem* WrapList(nsDisplayListBuilder* aBuilder,
|
||||
nsIFrame* aFrame,
|
||||
nsDisplayList* aList) override {
|
||||
return new (aBuilder)
|
||||
nsDisplayXULEventRedirector(aBuilder, aFrame, aList, mTargetFrame);
|
||||
return MakeDisplayItem<nsDisplayXULEventRedirector>(aBuilder, aFrame, aList,
|
||||
mTargetFrame);
|
||||
}
|
||||
virtual nsDisplayItem* WrapItem(nsDisplayListBuilder* aBuilder,
|
||||
nsDisplayItem* aItem) override {
|
||||
return new (aBuilder)
|
||||
nsDisplayXULEventRedirector(aBuilder, aItem->Frame(), aItem,
|
||||
mTargetFrame);
|
||||
return MakeDisplayItem<nsDisplayXULEventRedirector>(aBuilder, aItem->Frame(), aItem,
|
||||
mTargetFrame);
|
||||
}
|
||||
private:
|
||||
nsIFrame* mTargetFrame;
|
||||
|
|
|
@ -153,8 +153,8 @@ nsGroupBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
|
||||
aBuilder, this, GetBackgroundRectRelativeToSelf(),
|
||||
aLists.BorderBackground());
|
||||
aLists.BorderBackground()->AppendToTop(new (aBuilder)
|
||||
nsDisplayXULGroupBorder(aBuilder, this));
|
||||
aLists.BorderBackground()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayXULGroupBorder>(aBuilder, this));
|
||||
|
||||
DisplayOutline(aBuilder, aLists);
|
||||
}
|
||||
|
|
|
@ -342,7 +342,7 @@ nsImageBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
nsDisplayList list;
|
||||
list.AppendToTop(
|
||||
new (aBuilder) nsDisplayXULImage(aBuilder, this));
|
||||
MakeDisplayItem<nsDisplayXULImage>(aBuilder, this));
|
||||
|
||||
CreateOwnLayerIfNeeded(aBuilder, &list);
|
||||
|
||||
|
|
|
@ -112,8 +112,8 @@ nsLeafBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
if (!aBuilder->IsForEventDelivery() || !IsVisibleForPainting(aBuilder))
|
||||
return;
|
||||
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayEventReceiver(aBuilder, this));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayEventReceiver>(aBuilder, this));
|
||||
}
|
||||
|
||||
/* virtual */ nscoord
|
||||
|
|
|
@ -326,8 +326,8 @@ nsSliderFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
if (aBuilder->IsForEventDelivery() && isDraggingThumb()) {
|
||||
// This is EVIL, we shouldn't be messing with event delivery just to get
|
||||
// thumb mouse drag events to arrive at the slider!
|
||||
aLists.Outlines()->AppendToTop(new (aBuilder)
|
||||
nsDisplayEventReceiver(aBuilder, this));
|
||||
aLists.Outlines()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayEventReceiver>(aBuilder, this));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -458,16 +458,16 @@ nsSliderFrame::BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
// Wrap the list to make it its own layer.
|
||||
const ActiveScrolledRoot* ownLayerASR = contASRTracker.GetContainerASR();
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayOwnLayer(aBuilder, this, &masterList, ownLayerASR,
|
||||
flags, scrollTargetId,
|
||||
ScrollThumbData{scrollDirection,
|
||||
GetThumbRatio(),
|
||||
thumbStart,
|
||||
thumbLength,
|
||||
isAsyncDraggable,
|
||||
sliderTrackStart,
|
||||
sliderTrackLength}));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayOwnLayer>(aBuilder, this, &masterList, ownLayerASR,
|
||||
flags, scrollTargetId,
|
||||
ScrollThumbData{scrollDirection,
|
||||
GetThumbRatio(),
|
||||
thumbStart,
|
||||
thumbLength,
|
||||
isAsyncDraggable,
|
||||
sliderTrackStart,
|
||||
sliderTrackLength}));
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -384,8 +384,8 @@ nsSplitterFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
if (mInner->mDragging && aBuilder->IsForEventDelivery())
|
||||
{
|
||||
// XXX It's probably better not to check visibility here, right?
|
||||
aLists.Outlines()->AppendToTop(new (aBuilder)
|
||||
nsDisplayEventReceiver(aBuilder, this));
|
||||
aLists.Outlines()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayEventReceiver>(aBuilder, this));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -373,8 +373,8 @@ nsTextBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
nsLeafBoxFrame::BuildDisplayList(aBuilder, aLists);
|
||||
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayXULTextBox(aBuilder, this));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayXULTextBox>(aBuilder, this));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -2845,7 +2845,7 @@ nsTreeBodyFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
if (!mView || !GetContent ()->GetComposedDoc()->GetWindow())
|
||||
return;
|
||||
|
||||
nsDisplayItem* item = new (aBuilder) nsDisplayTreeBody(aBuilder, this);
|
||||
nsDisplayItem* item = MakeDisplayItem<nsDisplayTreeBody>(aBuilder, this);
|
||||
aLists.Content()->AppendToTop(item);
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
|
|
|
@ -126,8 +126,8 @@ nsTreeColFrame::BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
WrapListsInRedirector(aBuilder, set, aLists);
|
||||
|
||||
aLists.Content()->AppendToTop(new (aBuilder)
|
||||
nsDisplayXULTreeColSplitterTarget(aBuilder, this));
|
||||
aLists.Content()->AppendToTop(
|
||||
MakeDisplayItem<nsDisplayXULTreeColSplitterTarget>(aBuilder, this));
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче