Bug 160147

Summary: Web Inspector: Inactive/active network bar segments overlap when latency is zero
Product: WebKit Reporter: Matt Baker <mattbaker>
Component: Web InspectorAssignee: Matt Baker <mattbaker>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P4 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[Image] Overlapping segments
none
[Patch] Proposed Fix
none
[Patch] For Landing none

Description Matt Baker 2016-07-24 12:10:54 PDT
Created attachment 284451 [details]
[Image] Overlapping segments

The `has-inactive-segment` class should be removed from network bars with zero latency.
Comment 1 Radar WebKit Bug Importer 2016-07-24 12:11:08 PDT
<rdar://problem/27516007>
Comment 2 Matt Baker 2016-07-27 16:15:11 PDT
Created attachment 284742 [details]
[Patch] Proposed Fix
Comment 3 Joseph Pecoraro 2016-07-28 11:21:54 PDT
Comment on attachment 284742 [details]
[Patch] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=284742&action=review

r=me

> Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.js:307
> +            let minimumSegmentDuration = graphDataSource.secondsPerPixel * WebInspector.TimelineRecordBar.MinimumWidthPixels;

Nit: This block could use a comment like the ChangeLog.

Maybe we should assert all the graphDataSource methods somewhere in here. I worry there may be some data source that is missing secondsPerPixel. A brief look around and all data sources now seem fine, but a new data source in the future might forget it.

> Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.js:308
> +            if (barDuration < minimumSegmentDuration || barActiveStartTime - barStartTime < minimumSegmentDuration) {

Is the second expression a stricter check then the first? Can we just do that check or is there some way the first is still needed?
Comment 4 Matt Baker 2016-07-28 13:16:23 PDT
Comment on attachment 284742 [details]
[Patch] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=284742&action=review

>> Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.js:307
>> +            let minimumSegmentDuration = graphDataSource.secondsPerPixel * WebInspector.TimelineRecordBar.MinimumWidthPixels;
> 
> Nit: This block could use a comment like the ChangeLog.
> 
> Maybe we should assert all the graphDataSource methods somewhere in here. I worry there may be some data source that is missing secondsPerPixel. A brief look around and all data sources now seem fine, but a new data source in the future might forget it.

Agreed, it could be overlooked in the future.

>> Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.js:308
>> +            if (barDuration < minimumSegmentDuration || barActiveStartTime - barStartTime < minimumSegmentDuration) {
> 
> Is the second expression a stricter check then the first? Can we just do that check or is there some way the first is still needed?

The second check catches cases where the bar has a small (or zero) latency that would artificially inflate the bar width by 1-3px.
Comment 5 Matt Baker 2016-07-29 13:02:40 PDT
Comment on attachment 284742 [details]
[Patch] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=284742&action=review

>>> Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.js:308
>>> +            if (barDuration < minimumSegmentDuration || barActiveStartTime - barStartTime < minimumSegmentDuration) {
>> 
>> Is the second expression a stricter check then the first? Can we just do that check or is there some way the first is still needed?
> 
> The second check catches cases where the bar has a small (or zero) latency that would artificially inflate the bar width by 1-3px.

Correction, the first check is not needed. Will remove.
Comment 6 Matt Baker 2016-07-29 13:15:06 PDT
Created attachment 284893 [details]
[Patch] For Landing
Comment 7 WebKit Commit Bot 2016-07-29 13:44:57 PDT
Comment on attachment 284893 [details]
[Patch] For Landing

Clearing flags on attachment: 284893

Committed r203920: <http://trac.webkit.org/changeset/203920>
Comment 8 WebKit Commit Bot 2016-07-29 13:45:00 PDT
All reviewed patches have been landed.  Closing bug.