Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (183327 => 183328)
--- trunk/Source/WebInspectorUI/ChangeLog 2015-04-26 01:18:35 UTC (rev 183327)
+++ trunk/Source/WebInspectorUI/ChangeLog 2015-04-26 01:19:08 UTC (rev 183328)
@@ -1,5 +1,30 @@
2015-04-22 Timothy Hatcher <[email protected]>
+ 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 <[email protected]>
+
Web Inspector: Remove sidebar panel shortcut and image
https://bugs.webkit.org/show_bug.cgi?id=144061
Modified: trunk/Source/WebInspectorUI/UserInterface/Models/DefaultDashboard.js (183327 => 183328)
--- trunk/Source/WebInspectorUI/UserInterface/Models/DefaultDashboard.js 2015-04-26 01:18:35 UTC (rev 183327)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DefaultDashboard.js 2015-04-26 01:19:08 UTC (rev 183328)
@@ -31,10 +31,6 @@
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);
@@ -47,8 +43,6 @@
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;
@@ -67,28 +61,6 @@
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;
@@ -129,38 +101,6 @@
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;
@@ -176,59 +116,6 @@
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;
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DashboardContainerView.css (183327 => 183328)
--- trunk/Source/WebInspectorUI/UserInterface/Views/DashboardContainerView.css 2015-04-26 01:18:35 UTC (rev 183327)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DashboardContainerView.css 2015-04-26 01:19:08 UTC (rev 183328)
@@ -1,5 +1,5 @@
/*
- * 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
@@ -26,7 +26,7 @@
.toolbar .dashboard-container {
position: relative;
- width: 375px;
+ width: 225px;
border-radius: 4px;
background-color: rgb(252, 252, 252);
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DashboardContainerView.js (183327 => 183328)
--- trunk/Source/WebInspectorUI/UserInterface/Views/DashboardContainerView.js 2015-04-26 01:18:35 UTC (rev 183327)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DashboardContainerView.js 2015-04-26 01:19:08 UTC (rev 183328)
@@ -136,13 +136,12 @@
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);
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DefaultDashboardView.css (183327 => 183328)
--- trunk/Source/WebInspectorUI/UserInterface/Views/DefaultDashboardView.css 2015-04-26 01:18:35 UTC (rev 183327)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DefaultDashboardView.css 2015-04-26 01:19:08 UTC (rev 183328)
@@ -1,5 +1,5 @@
/*
- * 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
@@ -23,11 +23,11 @@
* 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;
}
@@ -58,11 +58,6 @@
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);
}
@@ -111,18 +106,10 @@
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);
}
@@ -136,18 +123,10 @@
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);
}
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DefaultDashboardView.js (183327 => 183328)
--- trunk/Source/WebInspectorUI/UserInterface/Views/DefaultDashboardView.js 2015-04-26 01:18:35 UTC (rev 183327)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DefaultDashboardView.js 2015-04-26 01:19:08 UTC (rev 183328)
@@ -36,14 +36,6 @@
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)
@@ -71,17 +63,9 @@
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)