Skip to content

Commit

Permalink
squash 'resources/unpacked/devtools' changes from 60101cd..ba10beb
Browse files Browse the repository at this point in the history
ba10beb DevTools: [SSP] render selectors effectively
e1f4c5a DevTools: preserve computed properties expansion on Computed Style re-rendering
b7f33c1 DevTools: fix compilation for the VBoxes with toolbar items.
b924c0b Timeline: rearrange trace completion logic for better extensibility
cad9b9b [DevTools] Replace SetScriptSourceError with ExceptionDetails in protocol
203ff82 DevTools: kill WI.SourcesView._showFile method
77dce3d [DevTools] Fix line and column in CallstackSidebarPane for async frames
e9563c8 DevTools: rename SourceFrame.onTextEditorContentLoaded into onTextEditorContentSet
e25e6a4 [DevTools] Make most fields of ExceptionDetails non-optional.
e3e89c0 [DevTools] Move Timestamp to Runtime, measure it in milliseconds.
fa23987 DevTools: WI.SourceCodeDiff should not depend on UISourceCode
7043980 [DevTools] Report console API calls through Runtime.
d3fea98 [DevTools] Add callFrame to CPUProfileNode & SamplingHeapProfileNode
68abc16 [DevTools] Fix compilation after r405625.
ced91b6 The WebInspector.sendOverProtocol method provides an easy mechanism to test and debug protocol commands. It's intended for developer debugging only.
c90d667 [DevTools] Support for the inspector target type
06690b1 [DevTools] Remove CallUID from CPUProfileNode
38cacec DevTools: reuse computedstylesmodel in the elements sidebar base class.
913b1f4 [DevTools] Remove Console.messagesCleared event.
d56fea1 [Devtools] Fixed minor regression with network log view padding
4668ad4 Revert of [Devtools] Improved URL parser for console (patchset #6 id:100001 of https://codereview.chromium.org/2125143002/ )
fd30c84 DevTools: Add color swatches to the Sources panel when editing style sheets.
d1ae919 [DevTools] Fix native function console output
c0efb9e [DevTools] Fix window object init on chrome://* pages
b3f8d1d [DevTools] Replace the target type with capabilities
63326d4 DevTools: remove the ComputedStyles -> Styles pane dependency.
4061e0f Timeline: re-expose the total size of layout tree in details
780e500 DevTools: Move Spectrum from elements/ to components/ so that it can be used in both Sources and Elements.
b1d7a4c DevTools: Added styling to checkboxes so that a focus state is displayed when tabbing through the checkboxes (for keyboard accessibility).
4e4c0be DevTools: remove panel-based clipboard events dispatching.
23db92f Fix uneven padding of network filters in the dev tools. Also makes the filter bar thinner.
0c99e59 DevTools: [LiveSASS] property enabling/disabling should not add spaces
8015295 DevTools: move functionality away from ElementsPanel for better DOM tree control reuse.
f71174a [DevTools] Always send a copy of worker message through the page.
887cc95 [DevTools] Set skip_in_browser=true for synthethic keyboard events.
24e6291 DevTools: Sort execution contexts in nested frames
52cf2dc [DevTools] Remove functionDetails from protocol.json
5968266 [DevTools] make Runtime.CallFrame 0-based
21cc3d9 DevTools: remove ElementsTreeElement.updateSelection.
e02009f DevTools: automatically populate 'More tools' submenu with the drawer views.
83d68a9 Revert of DevTools: automatically populate 'More tools' submenu with the drawer views. (patchset #4 id:60001 of https://codereview.chromium.org/2137763002/ )
12fa1da Revert of DevTools: automatically populate 'More tools' submenu with the drawer views. (patchset #4 id:60001 of https://codereview.chromium.org/2137763002/ )
6654cde DevTools: remove BaseToolbarPaneWidget.
19847b0 DevTools: automatically populate 'More tools' submenu with the drawer views.
d280a56 [DevTools] Better heuristic for detecting object literals.
996eda5 Use output_all_resource_defines=false in most grd files.
300d534 [Devtools] Improved URL parser for console
c466e98 [DevTools] Remove [V8] from InspectorInstrumentation.

git-subtree-dir: resources/unpacked/devtools
git-subtree-split: ba10beb
  • Loading branch information
darwin committed Jul 16, 2016
1 parent 5129396 commit e153125
Show file tree
Hide file tree
Showing 123 changed files with 1,392 additions and 1,533 deletions.
7 changes: 3 additions & 4 deletions devtools.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
'front_end/components/networkConditionsSettingsTab.css',
'front_end/components/objectPropertiesSection.css',
'front_end/components/objectValue.css',
'front_end/components/spectrum.css',
'front_end/components/CustomPreviewSection.js',
'front_end/components/DataSaverInfobar.js',
'front_end/components/DockController.js',
Expand All @@ -113,6 +114,7 @@
'front_end/components/RemoteObjectPreviewFormatter.js',
'front_end/components/RequestAppBannerActionDelegate.js',
'front_end/components/ShortcutsScreen.js',
'front_end/components/Spectrum.js',
'front_end/components/EventListenersUtils.js',
'front_end/components/EventListenersView.js',
'front_end/components/Reload.js',
Expand Down Expand Up @@ -432,7 +434,6 @@
],
'devtools_devices_js_files': [
'front_end/devices/devicesView.css',
'front_end/devices/DevicesDialog.js',
'front_end/devices/DevicesView.js',
],
'devtools_diff_js_files': [
Expand All @@ -446,10 +447,10 @@
'front_end/elements/elementsPanel.css',
'front_end/elements/elementsTreeOutline.css',
'front_end/elements/platformFontsWidget.css',
'front_end/elements/spectrum.css',
'front_end/elements/BezierEditor.js',
'front_end/elements/BezierUI.js',
'front_end/elements/ClassesPaneWidget.js',
'front_end/elements/ComputedStyleModel.js',
'front_end/elements/ElementsBreadcrumbs.js',
'front_end/elements/ElementsPanel.js',
'front_end/elements/ElementsSidebarPane.js',
Expand All @@ -458,14 +459,12 @@
'front_end/elements/ElementsTreeElementHighlighter.js',
'front_end/elements/ElementsTreeOutline.js',
'front_end/elements/ElementStatePaneWidget.js',
'front_end/elements/SharedSidebarModel.js',
'front_end/elements/EventListenersWidget.js',
'front_end/elements/InspectElementModeController.js',
'front_end/elements/MetricsSidebarPane.js',
'front_end/elements/PlatformFontsWidget.js',
'front_end/elements/PropertiesWidget.js',
'front_end/elements/PropertyChangeHighlighter.js',
'front_end/elements/Spectrum.js',
'front_end/elements/StylesPopoverHelper.js',
'front_end/elements/StylesSidebarPane.js',
'front_end/elements/ComputedStyleWidget.js',
Expand Down
32 changes: 27 additions & 5 deletions front_end/Runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,16 @@ Runtime._assert = function(value, message)
Runtime._originalAssert.call(Runtime._console, value, message + " " + new Error().stack);
}

Runtime._platform = "";

/**
* @param {string} platform
*/
Runtime.setPlatform = function(platform)
{
Runtime._platform = platform;
}

Runtime.prototype = {
useTestBase: function()
{
Expand Down Expand Up @@ -563,11 +573,12 @@ Runtime.prototype = {
/**
* @param {*} type
* @param {?Object=} context
* @param {boolean=} sortByTitle
* @return {!Array.<!Runtime.Extension>}
*/
extensions: function(type, context)
extensions: function(type, context, sortByTitle)
{
return this._extensions.filter(filter).sort(orderComparator);
return this._extensions.filter(filter).sort(sortByTitle ? titleComparator : orderComparator);

/**
* @param {!Runtime.Extension} extension
Expand All @@ -593,6 +604,18 @@ Runtime.prototype = {
var order2 = extension2.descriptor()["order"] || 0;
return order1 - order2;
}

/**
* @param {!Runtime.Extension} extension1
* @param {!Runtime.Extension} extension2
* @return {number}
*/
function titleComparator(extension1, extension2)
{
var title1 = extension1.title() || "";
var title2 = extension2.title() || "";
return title1.localeCompare(title2);
}
},

/**
Expand Down Expand Up @@ -978,13 +1001,12 @@ Runtime.Extension.prototype = {
},

/**
* @param {string} platform
* @return {string}
*/
title: function(platform)
title: function()
{
// FIXME: should be WebInspector.UIString() but runtime is not l10n aware yet.
return this._descriptor["title-" + platform] || this._descriptor["title"];
return this._descriptor["title-" + Runtime._platform] || this._descriptor["title"];
}
}

Expand Down
27 changes: 25 additions & 2 deletions front_end/Tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ TestSuite.prototype.testPauseInSharedWorkerInitialization1 = function()

function callback()
{
var target = WebInspector.targetManager.targetsWithJSContext()[0];
var target = WebInspector.targetManager.targets(WebInspector.Target.Capability.JS)[0];
target._connection.deprecatedRunAfterPendingDispatches(this.releaseControl.bind(this));
}
};
Expand All @@ -620,7 +620,7 @@ TestSuite.prototype.testPauseInSharedWorkerInitialization2 = function()

function callback()
{
var target = WebInspector.targetManager.targetsWithJSContext()[0];
var target = WebInspector.targetManager.targets(WebInspector.Target.Capability.JS)[0];
var debuggerModel = WebInspector.DebuggerModel.fromTarget(target);
if (debuggerModel.isPaused()) {
this.releaseControl();
Expand Down Expand Up @@ -717,6 +717,20 @@ TestSuite.prototype.testDeviceMetricsOverrides = function()
step1();
};

TestSuite.prototype.testDispatchKeyEventDoesNotCrash = function()
{
WebInspector.targetManager.mainTarget().inputAgent().invoke_dispatchKeyEvent({
type: "rawKeyDown",
windowsVirtualKeyCode: 0x23,
key: "End"
});
WebInspector.targetManager.mainTarget().inputAgent().invoke_dispatchKeyEvent({
type: "keyUp",
windowsVirtualKeyCode: 0x23,
key: "End"
});
};

TestSuite.prototype.testEmulateNetworkConditions = function()
{
var test = this;
Expand Down Expand Up @@ -899,6 +913,15 @@ TestSuite.prototype.testSettings = function()
}
}

TestSuite.prototype.testWindowInitializedOnNavigateBack = function()
{
var messages = WebInspector.multitargetConsoleModel.messages();
this.assertEquals(1, messages.length);
var text = messages[0].messageText;
if (text.indexOf("Uncaught") !== -1)
this.fail(text);
};

TestSuite.prototype.waitForTestResultsInConsole = function()
{
var messages = WebInspector.multitargetConsoleModel.messages();
Expand Down
4 changes: 3 additions & 1 deletion front_end/animation/AnimationModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,12 @@ WebInspector.AnimationModel._symbol = Symbol("AnimationModel");

/**
* @param {!WebInspector.Target} target
* @return {!WebInspector.AnimationModel}
* @return {?WebInspector.AnimationModel}
*/
WebInspector.AnimationModel.fromTarget = function(target)
{
if (!target.hasBrowserCapability())
return null;
if (!target[WebInspector.AnimationModel._symbol])
target[WebInspector.AnimationModel._symbol] = new WebInspector.AnimationModel(target);

Expand Down
32 changes: 3 additions & 29 deletions front_end/animation/AnimationTimeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ WebInspector.AnimationTimeline = function()
/** @type {!Map.<string, !WebInspector.AnimationModel.Animation>} */
this._animationsMap = new Map();
WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebInspector.DOMModel.Events.NodeRemoved, this._nodeRemoved, this);
WebInspector.targetManager.observeTargets(this, WebInspector.Target.Type.Page);
WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capability.Browser);
WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._nodeChanged, this);
}

Expand All @@ -51,13 +51,13 @@ WebInspector.AnimationTimeline._ControlState = {
WebInspector.AnimationTimeline.prototype = {
wasShown: function()
{
for (var target of WebInspector.targetManager.targets(WebInspector.Target.Type.Page))
for (var target of WebInspector.targetManager.targets(WebInspector.Target.Capability.Browser))
this._addEventListeners(target);
},

willHide: function()
{
for (var target of WebInspector.targetManager.targets(WebInspector.Target.Type.Page))
for (var target of WebInspector.targetManager.targets(WebInspector.Target.Capability.Browser))
this._removeEventListeners(target);
this._popoverHelper.hidePopover();
},
Expand Down Expand Up @@ -758,29 +758,3 @@ WebInspector.AnimationTimeline.StepTimingFunction.parse = function(text) {
return new WebInspector.AnimationTimeline.StepTimingFunction(parseInt(match[1], 10), match[2]);
return null;
}

/**
* @constructor
* @implements {WebInspector.ToolbarItem.Provider}
*/
WebInspector.AnimationTimeline.ButtonProvider = function()
{
this._button = new WebInspector.ToolbarButton(WebInspector.UIString("Animations"), "animation-toolbar-item");
this._button.addEventListener("click", this._clicked, this);
}

WebInspector.AnimationTimeline.ButtonProvider.prototype = {
_clicked: function()
{
WebInspector.inspectorView.showViewInDrawer("animations");
},

/**
* @override
* @return {!WebInspector.ToolbarItem}
*/
item: function()
{
return this._button;
}
}
6 changes: 0 additions & 6 deletions front_end/animation/module.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{
"extensions": [
{
"type": "@WebInspector.ToolbarItem.Provider",
"className": "WebInspector.AnimationTimeline.ButtonProvider",
"order": 2,
"location": "styles-sidebarpane-toolbar"
},
{
"type": "drawer-view",
"name": "animations",
Expand Down
6 changes: 3 additions & 3 deletions front_end/bindings/PresentationConsoleMessageHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ WebInspector.PresentationConsoleMessageHelper.prototype = {
return null;
var callFrame = message.stackTrace && message.stackTrace.callFrames ? message.stackTrace.callFrames[0] : null;
// FIXME(62725): stack trace line/column numbers are one-based.
var lineNumber = callFrame ? callFrame.lineNumber - 1 : message.line - 1;
var lineNumber = callFrame ? callFrame.lineNumber : message.line - 1;
var columnNumber = message.column ? message.column - 1 : 0;
if (callFrame && callFrame.columnNumber)
columnNumber = callFrame.columnNumber - 1;
if (callFrame)
columnNumber = callFrame.columnNumber;
if (message.scriptId)
return debuggerModel.createRawLocationByScriptId(message.scriptId, lineNumber, columnNumber);
return debuggerModel.createRawLocationByURL(message.url || "", lineNumber, columnNumber);
Expand Down
21 changes: 8 additions & 13 deletions front_end/bindings/ResourceScriptMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,28 +358,23 @@ WebInspector.ResourceScriptFile.prototype = {

/**
* @param {?string} error
* @param {!DebuggerAgent.SetScriptSourceError=} errorData
* @param {!RuntimeAgent.ExceptionDetails=} exceptionDetails
* @this {WebInspector.ResourceScriptFile}
*/
function scriptSourceWasSet(error, errorData)
function scriptSourceWasSet(error, exceptionDetails)
{
if (!error && !errorData)
if (!error && !exceptionDetails)
this._scriptSource = source;
this._update();

if (!error && !errorData)
if (!error && !exceptionDetails)
return;
var warningLevel = WebInspector.Console.MessageLevel.Warning;
if (!errorData) {
WebInspector.console.addMessage(WebInspector.UIString("LiveEdit failed: %s", error), warningLevel);
if (!exceptionDetails) {
WebInspector.console.addMessage(WebInspector.UIString("LiveEdit failed: %s", error), WebInspector.Console.MessageLevel.Warning);
return;
}
if (errorData) {
var messageText = WebInspector.UIString("LiveEdit compile failed: %s", errorData.message);
this._uiSourceCode.addLineMessage(WebInspector.UISourceCode.Message.Level.Error, messageText, errorData.lineNumber - 1, errorData.columnNumber + 1);
} else {
WebInspector.console.addMessage(WebInspector.UIString("Unknown LiveEdit error: %s; %s", JSON.stringify(errorData), error), warningLevel);
}
var messageText = WebInspector.UIString("LiveEdit compile failed: %s", exceptionDetails.text);
this._uiSourceCode.addLineMessage(WebInspector.UISourceCode.Message.Level.Error, messageText, exceptionDetails.lineNumber, exceptionDetails.columnNumber);
}
},

Expand Down
2 changes: 1 addition & 1 deletion front_end/components/DOMPresentationUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ WebInspector.DOMPresentationUtils.MarkerDecorator.prototype = {
*/
WebInspector.DOMPresentationUtils.GenericDecorator = function(extension)
{
this._title = WebInspector.UIString(extension.title(WebInspector.platform()));
this._title = WebInspector.UIString(extension.title());
this._color = extension.descriptor()["color"];
}

Expand Down
4 changes: 2 additions & 2 deletions front_end/components/EventListenersUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ WebInspector.EventListenerObjectInInspectedPage;
*/
WebInspector.EventListener.frameworkEventListeners = function(object)
{
if (!object.target().isPage()) {
if (!object.target().hasBrowserCapability()) {
// TODO(kozyatinskiy): figure out how this should work for |window|.
return Promise.resolve(/** @type {!WebInspector.FrameworkEventListenersObject} */ ({eventListeners: [], internalHandlers: null}));
}
Expand Down Expand Up @@ -137,7 +137,7 @@ WebInspector.EventListener.frameworkEventListeners = function(object)
function storeFunctionWithDetails(functionObject)
{
handler = functionObject;
return /** @type {!Promise<undefined>} */(functionObject.functionDetailsPromise().then(storeFunctionDetails));
return /** @type {!Promise<undefined>} */(functionObject.debuggerModel().functionDetailsPromise(functionObject).then(storeFunctionDetails));
}

/**
Expand Down
12 changes: 3 additions & 9 deletions front_end/components/ExecutionContextSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
WebInspector.ExecutionContextSelector = function(targetManager, context)
{
targetManager.observeTargets(this);
targetManager.observeTargets(this, WebInspector.Target.Capability.JS);
context.addFlavorChangeListener(WebInspector.ExecutionContext, this._executionContextChanged, this);
context.addFlavorChangeListener(WebInspector.Target, this._targetChanged, this);

Expand All @@ -28,8 +28,6 @@ WebInspector.ExecutionContextSelector.prototype = {
*/
targetAdded: function(target)
{
if (!target.hasJSContext())
return;
// Defer selecting default target since we need all clients to get their
// targetAdded notifications first.
setImmediate(deferred.bind(this));
Expand All @@ -51,13 +49,11 @@ WebInspector.ExecutionContextSelector.prototype = {
*/
targetRemoved: function(target)
{
if (!target.hasJSContext())
return;
var currentExecutionContext = this._context.flavor(WebInspector.ExecutionContext);
if (currentExecutionContext && currentExecutionContext.target() === target)
this._currentExecutionContextGone();

var targets = this._targetManager.targetsWithJSContext();
var targets = this._targetManager.targets(WebInspector.Target.Capability.JS);
if (this._context.flavor(WebInspector.Target) === target && targets.length)
this._context.setFlavor(WebInspector.Target, targets[0]);
},
Expand Down Expand Up @@ -165,11 +161,9 @@ WebInspector.ExecutionContextSelector.prototype = {

_currentExecutionContextGone: function()
{
var targets = this._targetManager.targetsWithJSContext();
var targets = this._targetManager.targets(WebInspector.Target.Capability.JS);
var newContext = null;
for (var i = 0; i < targets.length && !newContext; ++i) {
if (targets[i].isServiceWorker())
continue;
var executionContexts = targets[i].runtimeModel.executionContexts();
for (var executionContext of executionContexts) {
if (this._isMainFrameContext(executionContext)) {
Expand Down
Loading

0 comments on commit e153125

Please sign in to comment.