зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1393464 - Remove `Heritage` from devtools helper view-helpers.js; r=pbro
Calling "devtools/shared/extend" instead. MozReview-Commit-ID: HbonI7vq8Be --HG-- extra : rebase_source : 5c9f2ccd0f5cddfcdb1949354932fd492564cc93
This commit is contained in:
Родитель
7faefe8a6c
Коммит
450fb4980c
|
@ -9,7 +9,7 @@
|
|||
* Functions handling details about a single recorded animation frame snapshot
|
||||
* (the calls list, rendering preview, thumbnails filmstrip etc.).
|
||||
*/
|
||||
var CallsListView = Heritage.extend(WidgetMethods, {
|
||||
var CallsListView = extend(WidgetMethods, {
|
||||
/**
|
||||
* Initialization function, called when the tool is started.
|
||||
*/
|
||||
|
|
|
@ -14,10 +14,11 @@ const EventEmitter = require("devtools/shared/old-event-emitter");
|
|||
const { CallWatcherFront } = require("devtools/shared/fronts/call-watcher");
|
||||
const { CanvasFront } = require("devtools/shared/fronts/canvas");
|
||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
const { extend } = require("devtools/shared/extend");
|
||||
const flags = require("devtools/shared/flags");
|
||||
const { LocalizationHelper } = require("devtools/shared/l10n");
|
||||
const { PluralForm } = require("devtools/shared/plural-form");
|
||||
const { Heritage, WidgetMethods, setNamedTimeout, clearNamedTimeout,
|
||||
const { WidgetMethods, setNamedTimeout, clearNamedTimeout,
|
||||
setConditionalTimeout } = require("devtools/client/shared/widgets/view-helpers");
|
||||
|
||||
// Use privileged promise in panel documents to prevent having them to freeze
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
/**
|
||||
* Functions handling the recorded animation frame snapshots UI.
|
||||
*/
|
||||
var SnapshotsListView = Heritage.extend(WidgetMethods, {
|
||||
var SnapshotsListView = extend(WidgetMethods, {
|
||||
/**
|
||||
* Initialization function, called when the tool is started.
|
||||
*/
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
|
||||
const actions = require("../actions/event-listeners");
|
||||
const { bindActionCreators } = require("devtools/client/shared/vendor/redux");
|
||||
const { Heritage, WidgetMethods } = require("devtools/client/shared/widgets/view-helpers");
|
||||
const { extend } = require("devtools/shared/extend");
|
||||
const { WidgetMethods } = require("devtools/client/shared/widgets/view-helpers");
|
||||
const { SideMenuWidget } = require("resource://devtools/client/shared/widgets/SideMenuWidget.jsm");
|
||||
|
||||
/**
|
||||
|
@ -26,7 +27,7 @@ function EventListenersView(controller) {
|
|||
controller.onChange("event-listeners", this.renderListeners.bind(this));
|
||||
}
|
||||
|
||||
EventListenersView.prototype = Heritage.extend(WidgetMethods, {
|
||||
EventListenersView.prototype = extend(WidgetMethods, {
|
||||
/**
|
||||
* Initialization function, called when the debugger is started.
|
||||
*/
|
||||
|
|
|
@ -20,8 +20,8 @@ const actions = Object.assign(
|
|||
require("../actions/breakpoints")
|
||||
);
|
||||
const { bindActionCreators } = require("devtools/client/shared/vendor/redux");
|
||||
const { extend } = require("devtools/shared/extend");
|
||||
const {
|
||||
Heritage,
|
||||
WidgetMethods,
|
||||
setNamedTimeout
|
||||
} = require("devtools/client/shared/widgets/view-helpers");
|
||||
|
@ -80,7 +80,7 @@ function SourcesView(controller, DebuggerView) {
|
|||
this._onConditionalPopupHidden = this._onConditionalPopupHidden.bind(this);
|
||||
}
|
||||
|
||||
SourcesView.prototype = Heritage.extend(WidgetMethods, {
|
||||
SourcesView.prototype = extend(WidgetMethods, {
|
||||
/**
|
||||
* Initialization function, called when the debugger is started.
|
||||
*/
|
||||
|
@ -350,13 +350,13 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
|
|||
}
|
||||
|
||||
// Create the element node and menu popup for the breakpoint item.
|
||||
let breakpointArgs = Heritage.extend(breakpoint.asMutable(), options);
|
||||
let breakpointArgs = extend(breakpoint.asMutable(), options);
|
||||
let breakpointView = this._createBreakpointView.call(this, breakpointArgs);
|
||||
let contextMenu = this._createContextMenu.call(this, breakpointArgs);
|
||||
|
||||
// Append a breakpoint child item to the corresponding source item.
|
||||
sourceItem.append(breakpointView.container, {
|
||||
attachment: Heritage.extend(breakpointArgs, {
|
||||
attachment: extend(breakpointArgs, {
|
||||
actor: location.actor,
|
||||
line: location.line,
|
||||
view: breakpointView,
|
||||
|
|
|
@ -109,8 +109,9 @@ const { SideMenuWidget } = require("resource://devtools/client/shared/widgets/Si
|
|||
const { VariablesView } = require("resource://devtools/client/shared/widgets/VariablesView.jsm");
|
||||
const { VariablesViewController, StackFrameUtils } = require("resource://devtools/client/shared/widgets/VariablesViewController.jsm");
|
||||
const EventEmitter = require("devtools/shared/old-event-emitter");
|
||||
const { extend } = require("devtools/shared/extend");
|
||||
const { gDevTools } = require("devtools/client/framework/devtools");
|
||||
const { ViewHelpers, Heritage, WidgetMethods, setNamedTimeout,
|
||||
const { ViewHelpers, WidgetMethods, setNamedTimeout,
|
||||
clearNamedTimeout } = require("devtools/client/shared/widgets/view-helpers");
|
||||
|
||||
// Use privileged promise in panel documents to prevent having them to freeze
|
||||
|
|
|
@ -846,7 +846,7 @@ var DebuggerView = {
|
|||
function ResultsPanelContainer() {
|
||||
}
|
||||
|
||||
ResultsPanelContainer.prototype = Heritage.extend(WidgetMethods, {
|
||||
ResultsPanelContainer.prototype = extend(WidgetMethods, {
|
||||
/**
|
||||
* Sets the anchor node for this container panel.
|
||||
* @param nsIDOMNode aNode
|
||||
|
|
|
@ -551,7 +551,7 @@ function FilteredSourcesView(DebuggerView) {
|
|||
this._onSelect = this._onSelect.bind(this);
|
||||
}
|
||||
|
||||
FilteredSourcesView.prototype = Heritage.extend(ResultsPanelContainer.prototype, {
|
||||
FilteredSourcesView.prototype = extend(ResultsPanelContainer.prototype, {
|
||||
/**
|
||||
* Initialization function, called when the debugger is started.
|
||||
*/
|
||||
|
@ -714,7 +714,7 @@ function FilteredFunctionsView(SourceScripts, Parser, DebuggerView) {
|
|||
this._onSelect = this._onSelect.bind(this);
|
||||
}
|
||||
|
||||
FilteredFunctionsView.prototype = Heritage.extend(ResultsPanelContainer.prototype, {
|
||||
FilteredFunctionsView.prototype = extend(ResultsPanelContainer.prototype, {
|
||||
/**
|
||||
* Initialization function, called when the debugger is started.
|
||||
*/
|
||||
|
|
|
@ -23,7 +23,7 @@ function GlobalSearchView(DebuggerController, DebuggerView) {
|
|||
this._onMatchClick = this._onMatchClick.bind(this);
|
||||
}
|
||||
|
||||
GlobalSearchView.prototype = Heritage.extend(WidgetMethods, {
|
||||
GlobalSearchView.prototype = extend(WidgetMethods, {
|
||||
/**
|
||||
* Initialization function, called when the debugger is started.
|
||||
*/
|
||||
|
|
|
@ -20,7 +20,7 @@ function StackFramesClassicListView(DebuggerController, DebuggerView) {
|
|||
this._onSelect = this._onSelect.bind(this);
|
||||
}
|
||||
|
||||
StackFramesClassicListView.prototype = Heritage.extend(WidgetMethods, {
|
||||
StackFramesClassicListView.prototype = extend(WidgetMethods, {
|
||||
/**
|
||||
* Initialization function, called when the debugger is started.
|
||||
*/
|
||||
|
|
|
@ -25,7 +25,7 @@ function StackFramesView(DebuggerController, DebuggerView) {
|
|||
this._getStackAsString = this._getStackAsString.bind(this);
|
||||
}
|
||||
|
||||
StackFramesView.prototype = Heritage.extend(WidgetMethods, {
|
||||
StackFramesView.prototype = extend(WidgetMethods, {
|
||||
/**
|
||||
* Initialization function, called when the debugger is started.
|
||||
*/
|
||||
|
|
|
@ -29,7 +29,7 @@ function WatchExpressionsView(DebuggerController, DebuggerView) {
|
|||
this._onKeyPress = this._onKeyPress.bind(this);
|
||||
}
|
||||
|
||||
WatchExpressionsView.prototype = Heritage.extend(WidgetMethods, {
|
||||
WatchExpressionsView.prototype = extend(WidgetMethods, {
|
||||
/**
|
||||
* Initialization function, called when the debugger is started.
|
||||
*/
|
||||
|
|
|
@ -13,7 +13,7 @@ function WorkersView() {
|
|||
this._onWorkerSelect = this._onWorkerSelect.bind(this);
|
||||
}
|
||||
|
||||
WorkersView.prototype = Heritage.extend(WidgetMethods, {
|
||||
WorkersView.prototype = extend(WidgetMethods, {
|
||||
initialize: function () {
|
||||
if (!Prefs.workersEnabled) {
|
||||
return;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
const { Task } = require("devtools/shared/task");
|
||||
const { Heritage } = require("devtools/client/shared/widgets/view-helpers");
|
||||
const { extend } = require("devtools/shared/extend");
|
||||
const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
|
||||
const MountainGraphWidget = require("devtools/client/shared/widgets/MountainGraphWidget");
|
||||
const { CanvasGraphUtils } = require("devtools/client/shared/widgets/Graphs");
|
||||
|
@ -59,7 +59,7 @@ function PerformanceGraph(parent, metric) {
|
|||
this.setTheme();
|
||||
}
|
||||
|
||||
PerformanceGraph.prototype = Heritage.extend(LineGraphWidget.prototype, {
|
||||
PerformanceGraph.prototype = extend(LineGraphWidget.prototype, {
|
||||
strokeWidth: STROKE_WIDTH,
|
||||
dampenValuesFactor: DAMPEN_VALUES,
|
||||
fixedHeight: HEIGHT,
|
||||
|
@ -108,7 +108,7 @@ function FramerateGraph(parent) {
|
|||
PerformanceGraph.call(this, parent, ProfilerGlobal.L10N.getStr("graphs.fps"));
|
||||
}
|
||||
|
||||
FramerateGraph.prototype = Heritage.extend(PerformanceGraph.prototype, {
|
||||
FramerateGraph.prototype = extend(PerformanceGraph.prototype, {
|
||||
mainColor: FRAMERATE_GRAPH_COLOR_NAME,
|
||||
setPerformanceData: function ({ duration, ticks }, resolution) {
|
||||
this.dataDuration = duration;
|
||||
|
@ -126,7 +126,7 @@ function MemoryGraph(parent) {
|
|||
PerformanceGraph.call(this, parent, ProfilerGlobal.L10N.getStr("graphs.memory"));
|
||||
}
|
||||
|
||||
MemoryGraph.prototype = Heritage.extend(PerformanceGraph.prototype, {
|
||||
MemoryGraph.prototype = extend(PerformanceGraph.prototype, {
|
||||
mainColor: MEMORY_GRAPH_COLOR_NAME,
|
||||
setPerformanceData: function ({ duration, memory }) {
|
||||
this.dataDuration = duration;
|
||||
|
@ -138,7 +138,7 @@ function TimelineGraph(parent, filter) {
|
|||
MarkersOverview.call(this, parent, filter);
|
||||
}
|
||||
|
||||
TimelineGraph.prototype = Heritage.extend(MarkersOverview.prototype, {
|
||||
TimelineGraph.prototype = extend(MarkersOverview.prototype, {
|
||||
headerHeight: MARKERS_GRAPH_HEADER_HEIGHT,
|
||||
rowHeight: MARKERS_GRAPH_ROW_HEIGHT,
|
||||
groupPadding: MARKERS_GROUP_VERTICAL_PADDING,
|
||||
|
@ -439,7 +439,7 @@ function OptimizationsGraph(parent) {
|
|||
this.setTheme();
|
||||
}
|
||||
|
||||
OptimizationsGraph.prototype = Heritage.extend(MountainGraphWidget.prototype, {
|
||||
OptimizationsGraph.prototype = extend(MountainGraphWidget.prototype, {
|
||||
|
||||
render: Task.async(function* (threadNode, frameNode) {
|
||||
// Regardless if we draw or clear the graph, wait
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
* markers are visible in the "waterfall".
|
||||
*/
|
||||
|
||||
const { Heritage } = require("devtools/client/shared/widgets/view-helpers");
|
||||
const { extend } = require("devtools/shared/extend");
|
||||
const { AbstractCanvasGraph } = require("devtools/client/shared/widgets/Graphs");
|
||||
|
||||
const { colorUtils } = require("devtools/shared/css/color");
|
||||
|
@ -48,7 +48,7 @@ function MarkersOverview(parent, filter = [], ...args) {
|
|||
this.setFilter(filter);
|
||||
}
|
||||
|
||||
MarkersOverview.prototype = Heritage.extend(AbstractCanvasGraph.prototype, {
|
||||
MarkersOverview.prototype = extend(AbstractCanvasGraph.prototype, {
|
||||
clipheadLineColor: OVERVIEW_CLIPHEAD_LINE_COLOR,
|
||||
selectionLineColor: OVERVIEW_SELECTION_LINE_COLOR,
|
||||
headerHeight: OVERVIEW_HEADER_HEIGHT,
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*/
|
||||
|
||||
const { L10N } = require("devtools/client/performance/modules/global");
|
||||
const { Heritage } = require("devtools/client/shared/widgets/view-helpers");
|
||||
const { extend } = require("devtools/shared/extend");
|
||||
const { AbstractTreeItem } = require("resource://devtools/client/shared/widgets/AbstractTreeItem.jsm");
|
||||
|
||||
const URL_LABEL_TOOLTIP = L10N.getStr("table.url.tooltiptext");
|
||||
|
@ -174,7 +174,7 @@ function CallView({
|
|||
this._onUrlClick = this._onUrlClick.bind(this);
|
||||
}
|
||||
|
||||
CallView.prototype = Heritage.extend(AbstractTreeItem.prototype, {
|
||||
CallView.prototype = extend(AbstractTreeItem.prototype, {
|
||||
/**
|
||||
* Creates the view for this tree node.
|
||||
* @param nsIDOMNode document
|
||||
|
|
|
@ -14,10 +14,11 @@ var { loader, require } = BrowserLoaderModule.BrowserLoader({
|
|||
window
|
||||
});
|
||||
var { Task } = require("devtools/shared/task");
|
||||
/* exported Heritage, ViewHelpers, WidgetMethods, setNamedTimeout, clearNamedTimeout */
|
||||
var { Heritage, ViewHelpers, WidgetMethods, setNamedTimeout, clearNamedTimeout } = require("devtools/client/shared/widgets/view-helpers");
|
||||
/* exported ViewHelpers, WidgetMethods, setNamedTimeout, clearNamedTimeout */
|
||||
var { ViewHelpers, WidgetMethods, setNamedTimeout, clearNamedTimeout } = require("devtools/client/shared/widgets/view-helpers");
|
||||
var { PrefObserver } = require("devtools/client/shared/prefs");
|
||||
|
||||
/* exported extend */
|
||||
const { extend } = require("devtools/shared/extend");
|
||||
// Use privileged promise in panel documents to prevent having them to freeze
|
||||
// during toolbox destruction. See bug 1402779.
|
||||
var Promise = require("Promise");
|
||||
|
|
|
@ -55,14 +55,14 @@ exports.synthesizeProfile = () => {
|
|||
exports.synthesizeCustomTreeClass = () => {
|
||||
const { Cu } = require("chrome");
|
||||
const { AbstractTreeItem } = Cu.import("resource://devtools/client/shared/widgets/AbstractTreeItem.jsm", {});
|
||||
const { Heritage } = require("devtools/client/shared/widgets/view-helpers");
|
||||
const { extend } = require("devtools/shared/extend");
|
||||
|
||||
function MyCustomTreeItem(dataSrc, properties) {
|
||||
AbstractTreeItem.call(this, properties);
|
||||
this.itemDataSrc = dataSrc;
|
||||
}
|
||||
|
||||
MyCustomTreeItem.prototype = Heritage.extend(AbstractTreeItem.prototype, {
|
||||
MyCustomTreeItem.prototype = extend(AbstractTreeItem.prototype, {
|
||||
_displaySelf: function (document, arrowNode) {
|
||||
let node = document.createElement("hbox");
|
||||
node.style.marginInlineStart = (this.level * 10) + "px";
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
/**
|
||||
* CallTree view containing profiler call tree, controlled by DetailsView.
|
||||
*/
|
||||
var JsCallTreeView = Heritage.extend(DetailsSubview, {
|
||||
var JsCallTreeView = extend(DetailsSubview, {
|
||||
|
||||
rerenderPrefs: [
|
||||
"invert-call-tree",
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
* FlameGraph view containing a pyramid-like visualization of a profile,
|
||||
* controlled by DetailsView.
|
||||
*/
|
||||
var JsFlameGraphView = Heritage.extend(DetailsSubview, {
|
||||
var JsFlameGraphView = extend(DetailsSubview, {
|
||||
|
||||
shouldUpdateWhileMouseIsActive: true,
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
/**
|
||||
* CallTree view containing memory allocation sites, controlled by DetailsView.
|
||||
*/
|
||||
var MemoryCallTreeView = Heritage.extend(DetailsSubview, {
|
||||
var MemoryCallTreeView = extend(DetailsSubview, {
|
||||
|
||||
rerenderPrefs: [
|
||||
"invert-call-tree"
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
* FlameGraph view containing a pyramid-like visualization of memory allocation
|
||||
* sites, controlled by DetailsView.
|
||||
*/
|
||||
var MemoryFlameGraphView = Heritage.extend(DetailsSubview, {
|
||||
var MemoryFlameGraphView = extend(DetailsSubview, {
|
||||
|
||||
shouldUpdateWhileMouseIsActive: true,
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ const { TickUtils } = require("devtools/client/performance/modules/waterfall-tic
|
|||
/**
|
||||
* Waterfall view containing the timeline markers, controlled by DetailsView.
|
||||
*/
|
||||
var WaterfallView = Heritage.extend(DetailsSubview, {
|
||||
var WaterfallView = extend(DetailsSubview, {
|
||||
|
||||
// Smallest unit of time between two markers. Larger by 10x^3 than Number.EPSILON.
|
||||
MARKER_EPSILON: 0.000000000001,
|
||||
|
|
|
@ -55,7 +55,7 @@ const promise = require("promise");
|
|||
const defer = require("devtools/shared/defer");
|
||||
const Services = require("Services");
|
||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
const {Heritage} = require("devtools/client/shared/widgets/view-helpers");
|
||||
const { extend } = require("devtools/shared/extend");
|
||||
|
||||
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const {NetUtil} = require("resource://gre/modules/NetUtil.jsm");
|
||||
|
@ -2177,7 +2177,7 @@ function ScratchpadWindow() {}
|
|||
|
||||
ScratchpadWindow.consoleFor = ScratchpadTab.consoleFor;
|
||||
|
||||
ScratchpadWindow.prototype = Heritage.extend(ScratchpadTab.prototype, {
|
||||
ScratchpadWindow.prototype = extend(ScratchpadTab.prototype, {
|
||||
/**
|
||||
* Attach to this window.
|
||||
*
|
||||
|
@ -2207,7 +2207,7 @@ function ScratchpadTarget(aTarget)
|
|||
|
||||
ScratchpadTarget.consoleFor = ScratchpadTab.consoleFor;
|
||||
|
||||
ScratchpadTarget.prototype = Heritage.extend(ScratchpadTab.prototype, {
|
||||
ScratchpadTarget.prototype = extend(ScratchpadTab.prototype, {
|
||||
_attach: function ST__attach()
|
||||
{
|
||||
if (this._target.isRemote) {
|
||||
|
|
|
@ -15,7 +15,8 @@ const EventEmitter = require("devtools/shared/old-event-emitter");
|
|||
const Tooltip = require("devtools/client/shared/widgets/tooltip/Tooltip");
|
||||
const Editor = require("devtools/client/sourceeditor/editor");
|
||||
const {LocalizationHelper} = require("devtools/shared/l10n");
|
||||
const {Heritage, WidgetMethods, setNamedTimeout} =
|
||||
const {extend} = require("devtools/shared/extend");
|
||||
const {WidgetMethods, setNamedTimeout} =
|
||||
require("devtools/client/shared/widgets/view-helpers");
|
||||
const {Task} = require("devtools/shared/task");
|
||||
|
||||
|
@ -198,7 +199,7 @@ var EventsHandler = {
|
|||
/**
|
||||
* Functions handling the sources UI.
|
||||
*/
|
||||
var ShadersListView = Heritage.extend(WidgetMethods, {
|
||||
var ShadersListView = extend(WidgetMethods, {
|
||||
/**
|
||||
* Initialization function, called when the tool is started.
|
||||
*/
|
||||
|
|
|
@ -41,7 +41,7 @@ this.EXPORTED_SYMBOLS = ["AbstractTreeItem"];
|
|||
* this.itemDataSrc = dataSrc;
|
||||
* }
|
||||
*
|
||||
* MyCustomTreeItem.prototype = Heritage.extend(AbstractTreeItem.prototype, {
|
||||
* MyCustomTreeItem.prototype = extend(AbstractTreeItem.prototype, {
|
||||
* _displaySelf: function(document, arrowNode) {
|
||||
* let node = document.createElement("hbox");
|
||||
* ...
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
"use strict";
|
||||
|
||||
const { Heritage, setNamedTimeout, clearNamedTimeout } = require("devtools/client/shared/widgets/view-helpers");
|
||||
const { extend } = require("devtools/shared/extend");
|
||||
const { setNamedTimeout, clearNamedTimeout } = require("devtools/client/shared/widgets/view-helpers");
|
||||
const { AbstractCanvasGraph, CanvasGraphUtils } = require("devtools/client/shared/widgets/Graphs");
|
||||
|
||||
const HTML_NS = "http://www.w3.org/1999/xhtml";
|
||||
|
@ -77,7 +78,7 @@ this.BarGraphWidget = function (parent, ...args) {
|
|||
});
|
||||
};
|
||||
|
||||
BarGraphWidget.prototype = Heritage.extend(AbstractCanvasGraph.prototype, {
|
||||
BarGraphWidget.prototype = extend(AbstractCanvasGraph.prototype, {
|
||||
clipheadLineColor: GRAPH_CLIPHEAD_LINE_COLOR,
|
||||
selectionLineColor: GRAPH_SELECTION_LINE_COLOR,
|
||||
selectionBackgroundColor: GRAPH_SELECTION_BACKGROUND_COLOR,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
"use strict";
|
||||
|
||||
const { Task } = require("devtools/shared/task");
|
||||
const { Heritage } = require("devtools/client/shared/widgets/view-helpers");
|
||||
const { extend } = require("devtools/shared/extend");
|
||||
const { AbstractCanvasGraph, CanvasGraphUtils } = require("devtools/client/shared/widgets/Graphs");
|
||||
const { LocalizationHelper } = require("devtools/shared/l10n");
|
||||
|
||||
|
@ -89,7 +89,7 @@ this.LineGraphWidget = function (parent, options = {}, ...args) {
|
|||
});
|
||||
};
|
||||
|
||||
LineGraphWidget.prototype = Heritage.extend(AbstractCanvasGraph.prototype, {
|
||||
LineGraphWidget.prototype = extend(AbstractCanvasGraph.prototype, {
|
||||
backgroundColor: GRAPH_BACKGROUND_COLOR,
|
||||
backgroundGradientStart: GRAPH_BACKGROUND_GRADIENT_START,
|
||||
backgroundGradientEnd: GRAPH_BACKGROUND_GRADIENT_END,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
"use strict";
|
||||
|
||||
const { Heritage } = require("devtools/client/shared/widgets/view-helpers");
|
||||
const { extend } = require("devtools/shared/extend");
|
||||
const { AbstractCanvasGraph } = require("devtools/client/shared/widgets/Graphs");
|
||||
|
||||
// Bar graph constants.
|
||||
|
@ -57,7 +57,7 @@ this.MountainGraphWidget = function (parent, ...args) {
|
|||
AbstractCanvasGraph.apply(this, [parent, "mountain-graph", ...args]);
|
||||
};
|
||||
|
||||
MountainGraphWidget.prototype = Heritage.extend(AbstractCanvasGraph.prototype, {
|
||||
MountainGraphWidget.prototype = extend(AbstractCanvasGraph.prototype, {
|
||||
backgroundColor: GRAPH_BACKGROUND_COLOR,
|
||||
strokeColor: GRAPH_STROKE_COLOR,
|
||||
strokeWidth: GRAPH_STROKE_WIDTH,
|
||||
|
|
|
@ -24,7 +24,8 @@ const Services = require("Services");
|
|||
const { getSourceNames } = require("devtools/client/shared/source-utils");
|
||||
const promise = require("promise");
|
||||
const defer = require("devtools/shared/defer");
|
||||
const { Heritage, ViewHelpers, setNamedTimeout } =
|
||||
const { extend } = require("devtools/shared/extend");
|
||||
const { ViewHelpers, setNamedTimeout } =
|
||||
require("devtools/client/shared/widgets/view-helpers");
|
||||
const { Task } = require("devtools/shared/task");
|
||||
const nodeConstants = require("devtools/shared/dom-node-constants");
|
||||
|
@ -2179,7 +2180,7 @@ function Variable(aScope, aName, aDescriptor, aOptions) {
|
|||
this.setGrip(aDescriptor.value);
|
||||
}
|
||||
|
||||
Variable.prototype = Heritage.extend(Scope.prototype, {
|
||||
Variable.prototype = extend(Scope.prototype, {
|
||||
/**
|
||||
* Whether this Variable should be prefetched when it is remoted.
|
||||
*/
|
||||
|
@ -3072,7 +3073,7 @@ function Property(aVar, aName, aDescriptor, aOptions) {
|
|||
Variable.call(this, aVar, aName, aDescriptor, aOptions);
|
||||
}
|
||||
|
||||
Property.prototype = Heritage.extend(Variable.prototype, {
|
||||
Property.prototype = extend(Variable.prototype, {
|
||||
/**
|
||||
* The class name applied to this property's target element.
|
||||
*/
|
||||
|
@ -3160,7 +3161,7 @@ VariablesView.prototype.commitHierarchy = function () {
|
|||
|
||||
// Some variables are likely to contain a very large number of properties.
|
||||
// It would be a bad idea to re-expand them or perform expensive operations.
|
||||
VariablesView.prototype.commitHierarchyIgnoredItems = Heritage.extend(null, {
|
||||
VariablesView.prototype.commitHierarchyIgnoredItems = extend(null, {
|
||||
"window": true,
|
||||
"this": true
|
||||
});
|
||||
|
@ -4116,7 +4117,7 @@ function EditableName(aVariable, aOptions) {
|
|||
|
||||
EditableName.create = Editable.create;
|
||||
|
||||
EditableName.prototype = Heritage.extend(Editable.prototype, {
|
||||
EditableName.prototype = extend(Editable.prototype, {
|
||||
className: "element-name-input",
|
||||
|
||||
get label() {
|
||||
|
@ -4138,7 +4139,7 @@ function EditableValue(aVariable, aOptions) {
|
|||
|
||||
EditableValue.create = Editable.create;
|
||||
|
||||
EditableValue.prototype = Heritage.extend(Editable.prototype, {
|
||||
EditableValue.prototype = extend(Editable.prototype, {
|
||||
className: "element-value-input",
|
||||
|
||||
get label() {
|
||||
|
@ -4160,7 +4161,7 @@ function EditableNameAndValue(aVariable, aOptions) {
|
|||
|
||||
EditableNameAndValue.create = Editable.create;
|
||||
|
||||
EditableNameAndValue.prototype = Heritage.extend(EditableName.prototype, {
|
||||
EditableNameAndValue.prototype = extend(EditableName.prototype, {
|
||||
_reset: function (e) {
|
||||
// Hide the Variable or Property if the user presses escape.
|
||||
this._variable.remove();
|
||||
|
|
|
@ -13,29 +13,6 @@ const WIDGET_FOCUSABLE_NODES = new Set(["vbox", "hbox"]);
|
|||
|
||||
var namedTimeoutsStore = new Map();
|
||||
|
||||
/**
|
||||
* Inheritance helpers from the addon SDK's core/heritage.
|
||||
* Remove these when all devtools are loadered.
|
||||
*/
|
||||
exports.Heritage = {
|
||||
/**
|
||||
* @see extend in sdk/core/heritage.
|
||||
*/
|
||||
extend: function (prototype, properties = {}) {
|
||||
return Object.create(prototype, this.getOwnPropertyDescriptors(properties));
|
||||
},
|
||||
|
||||
/**
|
||||
* @see getOwnPropertyDescriptors in sdk/core/heritage.
|
||||
*/
|
||||
getOwnPropertyDescriptors: function (object) {
|
||||
return Object.getOwnPropertyNames(object).reduce((descriptor, name) => {
|
||||
descriptor[name] = Object.getOwnPropertyDescriptor(object, name);
|
||||
return descriptor;
|
||||
}, {});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper for draining a rapid succession of events and invoking a callback
|
||||
* once everything settles down.
|
||||
|
@ -490,7 +467,7 @@ Item.prototype = {
|
|||
* this.widget = new MyWidget(document.querySelector(".my-node"));
|
||||
* }
|
||||
*
|
||||
* MyView.prototype = Heritage.extend(WidgetMethods, {
|
||||
* MyView.prototype = extend(WidgetMethods, {
|
||||
* myMethod: function() {},
|
||||
* ...
|
||||
* });
|
||||
|
|
Загрузка…
Ссылка в новой задаче