Title: [203920] trunk/Source/WebInspectorUI
- Revision
- 203920
- Author
- [email protected]
- Date
- 2016-07-29 13:43:42 -0700 (Fri, 29 Jul 2016)
Log Message
Web Inspector: Inactive/active network bar segments overlap when latency is zero
https://bugs.webkit.org/show_bug.cgi?id=160147
<rdar://problem/27516007>
Reviewed by Joseph Pecoraro.
TimelineRecordBar should hide the inactive segment when its duration
is less than the minimum displayable size. The active segment can
assume the whole width of the bar.
* UserInterface/Views/TimelineOverviewGraph.js:
(WebInspector.TimelineOverviewGraph.prototype.get secondsPerPixel):
Make secondsPerPixel available during TimelineRecordBars.refresh.
* UserInterface/Views/TimelineRecordBar.js:
(WebInspector.TimelineRecordBar.prototype.refresh):
Check inactive duration against the minimum display size,
and add/remove DOM nodes and bar styles as needed.
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (203919 => 203920)
--- trunk/Source/WebInspectorUI/ChangeLog 2016-07-29 20:29:20 UTC (rev 203919)
+++ trunk/Source/WebInspectorUI/ChangeLog 2016-07-29 20:43:42 UTC (rev 203920)
@@ -1,3 +1,24 @@
+2016-07-29 Matt Baker <[email protected]>
+
+ Web Inspector: Inactive/active network bar segments overlap when latency is zero
+ https://bugs.webkit.org/show_bug.cgi?id=160147
+ <rdar://problem/27516007>
+
+ Reviewed by Joseph Pecoraro.
+
+ TimelineRecordBar should hide the inactive segment when its duration
+ is less than the minimum displayable size. The active segment can
+ assume the whole width of the bar.
+
+ * UserInterface/Views/TimelineOverviewGraph.js:
+ (WebInspector.TimelineOverviewGraph.prototype.get secondsPerPixel):
+ Make secondsPerPixel available during TimelineRecordBars.refresh.
+
+ * UserInterface/Views/TimelineRecordBar.js:
+ (WebInspector.TimelineRecordBar.prototype.refresh):
+ Check inactive duration against the minimum display size,
+ and add/remove DOM nodes and bar styles as needed.
+
2016-07-29 Nikita Vasilyev <[email protected]>
REGRESSION (r195456): Web Inspector: Changing tabs in Styles sidebar shouldn't change sidebar's width
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js (203919 => 203920)
--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js 2016-07-29 20:29:20 UTC (rev 203919)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js 2016-07-29 20:43:42 UTC (rev 203920)
@@ -148,6 +148,8 @@
return this._timelineOverview;
}
+ get secondsPerPixel() { return this._timelineOverview.secondsPerPixel; }
+
get visible()
{
return this._visible;
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.js (203919 => 203920)
--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.js 2016-07-29 20:29:20 UTC (rev 203919)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.js 2016-07-29 20:43:42 UTC (rev 203920)
@@ -225,6 +225,12 @@
refresh(graphDataSource)
{
+ console.assert(graphDataSource.zeroTime);
+ console.assert(graphDataSource.startTime);
+ console.assert(graphDataSource.currentTime);
+ console.assert(graphDataSource.endTime);
+ console.assert(graphDataSource.secondsPerPixel);
+
if (!this._records || !this._records.length)
return false;
@@ -303,10 +309,21 @@
if (inactiveUnfinished)
barActiveStartTime = graphCurrentTime;
+ else if (this._renderMode === WebInspector.TimelineRecordBar.RenderMode.Normal) {
+ // Hide the inactive segment when its duration is less than the minimum displayable size.
+ let minimumSegmentDuration = graphDataSource.secondsPerPixel * WebInspector.TimelineRecordBar.MinimumWidthPixels;
+ if (barActiveStartTime - barStartTime < minimumSegmentDuration) {
+ barActiveStartTime = barStartTime;
+ if (this._inactiveBarElement)
+ this._inactiveBarElement.remove();
+ }
+ }
- var middlePercentage = (barActiveStartTime - barStartTime) / barDuration;
+ let showInactiveSegment = barActiveStartTime > barStartTime;
+ this._element.classList.toggle("has-inactive-segment", showInactiveSegment);
- if (this._renderMode !== WebInspector.TimelineRecordBar.RenderMode.ActiveOnly) {
+ let middlePercentage = (barActiveStartTime - barStartTime) / barDuration;
+ if (showInactiveSegment && this._renderMode !== WebInspector.TimelineRecordBar.RenderMode.ActiveOnly) {
if (!this._inactiveBarElement) {
this._inactiveBarElement = document.createElement("div");
this._inactiveBarElement.classList.add("segment");
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes