https://bugs.webkit.org/show_bug.cgi?id=144063
These two items were the odd ones out since they are only available
when recording a timeline. We will need the toolbar space soon, so make
this lets us make the dashboard skinnier.
This also removes the exception catching in DashboardContainerView. It doesn't really
help us and it makes debugging an exception harder.
Reviewed by Joseph Pecoraro.
* UserInterface/Views/DashboardContainerView.css:
(.toolbar .dashboard-container):
* UserInterface/Views/DashboardContainerView.js:
(WebInspector.DashboardContainerView.prototype._dashboardViewForRepresentedObject):
* UserInterface/Views/DefaultDashboardView.css:
(body.web .toolbar.collapsed .dashboard.default > .item.resourcesCount):
(body.javascript .toolbar .dashboard.default > .item.resourcesCount):
* UserInterface/Views/DefaultDashboardView.js:
(WebInspector.DefaultDashboardView):
(WebInspector.DefaultDashboardView.prototype._updateDisplay):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183328
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
2015-04-22 Timothy Hatcher <timothy@apple.com>
+ Web Inspector: Remove time and weight from the dashboard
+ https://bugs.webkit.org/show_bug.cgi?id=144063
+
+ These two items were the odd ones out since they are only available
+ when recording a timeline. We will need the toolbar space soon, so make
+ this lets us make the dashboard skinnier.
+
+ This also removes the exception catching in DashboardContainerView. It doesn't really
+ help us and it makes debugging an exception harder.
+
+ Reviewed by Joseph Pecoraro.
+
+ * UserInterface/Views/DashboardContainerView.css:
+ (.toolbar .dashboard-container):
+ * UserInterface/Views/DashboardContainerView.js:
+ (WebInspector.DashboardContainerView.prototype._dashboardViewForRepresentedObject):
+ * UserInterface/Views/DefaultDashboardView.css:
+ (body.web .toolbar.collapsed .dashboard.default > .item.resourcesCount):
+ (body.javascript .toolbar .dashboard.default > .item.resourcesCount):
+ * UserInterface/Views/DefaultDashboardView.js:
+ (WebInspector.DefaultDashboardView):
+ (WebInspector.DefaultDashboardView.prototype._updateDisplay):
+
+2015-04-22 Timothy Hatcher <timothy@apple.com>
+
Web Inspector: Remove sidebar panel shortcut and image
https://bugs.webkit.org/show_bug.cgi?id=144061
this._waitingForFirstMainResourceToStartTrackingSize = true;
- // Necessary event required to track page load time and resource sizes.
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
- WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStopped, this._capturingStopped, this);
-
// Necessary events required to track load of resources.
WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ResourceWasAdded, this._resourceWasAdded, this);
WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.FrameWasAdded, this._frameWasAdded, this);
logManager.addEventListener(WebInspector.LogManager.Event.PreviousMessageRepeatCountUpdated, this._consoleMessageWasRepeated, this);
this._resourcesCount = 0;
- this._resourcesSize = 0;
- this._time = 0;
this._logs = 0;
this._errors = 0;
this._issues = 0;
this._dataDidChange();
}
- get resourcesSize()
- {
- return this._resourcesSize;
- }
-
- set resourcesSize(value)
- {
- this._resourcesSize = value;
- this._dataDidChange();
- }
-
- get time()
- {
- return this._time;
- }
-
- set time(value)
- {
- this._time = value;
- this._dataDidChange();
- }
-
get logs()
{
return this._logs;
this.dispatchEventToListeners(WebInspector.DefaultDashboard.Event.DataDidChange);
}
- _mainResourceDidChange(event)
- {
- console.assert(event.target instanceof WebInspector.Frame);
-
- if (!event.target.isMainFrame())
- return;
-
- this._resourcesCount = 1;
- this._resourcesSize = WebInspector.frameResourceManager.mainFrame.mainResource.size || 0;
-
- // Only update the time if we are recording the timeline.
- if (!WebInspector.timelineManager.isCapturing()) {
- this._time = 0;
- return;
- }
-
- // We should only track resource sizes on fresh loads.
- if (this._waitingForFirstMainResourceToStartTrackingSize) {
- delete this._waitingForFirstMainResourceToStartTrackingSize;
- WebInspector.Resource.addEventListener(WebInspector.Resource.Event.SizeDidChange, this._resourceSizeDidChange, this);
- }
-
- this._dataDidChange();
- this._startUpdatingTime();
- }
-
- _capturingStopped(event)
- {
- // If recording stops, we should stop the timer if it hasn't stopped already.
- this._stopUpdatingTime();
- }
-
_resourceWasAdded(event)
{
++this.resourcesCount;
this.resourcesSize += event.target.size - event.data.previousSize;
}
- _startUpdatingTime()
- {
- this._stopUpdatingTime();
-
- this.time = 0;
-
- this._timelineBaseTime = Date.now();
- this._timeIntervalDelay = 50;
- this._timeIntervalIdentifier = setInterval(this._updateTime.bind(this), this._timeIntervalDelay);
- }
-
- _stopUpdatingTime()
- {
- if (!this._timeIntervalIdentifier)
- return;
-
- clearInterval(this._timeIntervalIdentifier);
- delete this._timeIntervalIdentifier;
- }
-
- _updateTime()
- {
- var duration = Date.now() - this._timelineBaseTime;
-
- var timeIntervalDelay = this._timeIntervalDelay;
- if (duration >= 1000) // 1 second
- timeIntervalDelay = 100;
- else if (duration >= 60000) // 60 seconds
- timeIntervalDelay = 1000;
- else if (duration >= 3600000) // 1 minute
- timeIntervalDelay = 10000;
-
- if (timeIntervalDelay !== this._timeIntervalDelay) {
- this._timeIntervalDelay = timeIntervalDelay;
-
- clearInterval(this._timeIntervalIdentifier);
- this._timeIntervalIdentifier = setInterval(this._updateTime.bind(this), this._timeIntervalDelay);
- }
-
- var mainFrame = WebInspector.frameResourceManager.mainFrame;
- var mainFrameStartTime = mainFrame.mainResource.firstTimestamp;
- var mainFrameLoadEventTime = mainFrame.loadEventTimestamp;
-
- if (isNaN(mainFrameStartTime) || isNaN(mainFrameLoadEventTime)) {
- this.time = duration / 1000;
- return;
- }
-
- this.time = mainFrameLoadEventTime - mainFrameStartTime;
-
- this._stopUpdatingTime();
- }
-
_consoleMessageAdded(event)
{
var message = event.data.message;
/*
- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
.toolbar .dashboard-container {
position: relative;
- width: 375px;
+ width: 225px;
border-radius: 4px;
background-color: rgb(252, 252, 252);
if (onlyReturnExistingViews)
return null;
- try {
- // No existing content view found, make a new one.
- dashboardView = WebInspector.DashboardView.create(representedObject);
- } catch (e) {
- console.error(e, e.stack);
+ // No existing content view found, make a new one.
+ dashboardView = WebInspector.DashboardView.create(representedObject);
+
+ console.assert(dashboardView, "Unknown representedObject", representedObject);
+ if (!dashboardView)
return null;
- }
this._dashboardStack.push(dashboardView);
this._toolbarItem.element.appendChild(dashboardView.element);
/*
- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-body.web .toolbar.collapsed .dashboard.default > :matches(.time, .resourcesSize, .logs) {
+body.web .toolbar.collapsed .dashboard.default > .item.resourcesCount {
display: none;
}
-body.javascript .toolbar .dashboard.default > :matches(.time, .resourcesSize, .resourcesCount) {
+body.javascript .toolbar .dashboard.default > .item.resourcesCount {
display: none;
}
font-weight: bold;
}
-.toolbar .dashboard.default > .time,
-.toolbar .dashboard.default > .resourcesSize {
- min-width: 70px;
-}
-
.toolbar .dashboard.default > .item.enabled:hover {
border: 1px solid rgba(0, 0, 0, 0.1);
}
content: url(../Images/Resources.svg);
}
-.toolbar .dashboard.default > .time > img {
- content: url(../Images/Time.svg);
-}
-
.toolbar .dashboard.default > .logs > img {
content: url(../Images/Logs.svg);
}
-.toolbar .dashboard.default > .resourcesSize > img {
- content: url(../Images/Weight.svg);
-}
-
.toolbar .dashboard.default > .errors > img {
content: url(../Images/Errors.svg);
}
content: url(../Images/Legacy/Resources.svg);
}
-body.mac-platform.legacy .toolbar .dashboard.default > .time > img {
- content: url(../Images/Legacy/Time.svg);
-}
-
body.mac-platform.legacy .toolbar .dashboard.default > .logs > img {
content: url(../Images/Legacy/Logs.svg);
}
-body.mac-platform.legacy .toolbar .dashboard.default > .resourcesSize > img {
- content: url(../Images/Legacy/Weight.svg);
-}
-
body.mac-platform.legacy .toolbar .dashboard.default > .errors > img {
content: url(../Images/Legacy/Errors.svg);
}
tooltip: WebInspector.UIString("Total number of resources, click to show the Resources navigation sidebar"),
handler: this._resourcesWasClicked
},
- resourcesSize: {
- tooltip: WebInspector.UIString("Total size of all resources, click to show the Network Requests timeline"),
- handler: this._networkItemWasClicked
- },
- time: {
- tooltip: WebInspector.UIString("Time until the load event fired, click to show the Network Requests timeline"),
- handler: this._networkItemWasClicked
- },
logs: {
tooltip: WebInspector.UIString("Console logs, click to show the Console"),
handler: this._consoleItemWasClicked.bind(this, WebInspector.LogContentView.Scopes.Logs)
for (var category of ["logs", "issues", "errors"])
this._setConsoleItemValue(category, dashboard[category]);
- var timeItem = this._items.time;
- timeItem.text = dashboard.time ? Number.secondsToString(dashboard.time) : "\u2014";
- this._setItemEnabled(timeItem, dashboard.time > 0);
-
var countItem = this._items.resourcesCount;
countItem.text = this._formatPossibleLargeNumber(dashboard.resourcesCount);
this._setItemEnabled(countItem, dashboard.resourcesCount > 0);
-
- var sizeItem = this._items.resourcesSize;
- sizeItem.text = dashboard.resourcesSize ? Number.bytesToString(dashboard.resourcesSize, false) : "\u2014";
- this._setItemEnabled(sizeItem, dashboard.resourcesSize > 0);
}
_formatPossibleLargeNumber(number)