Bug 160147 - Web Inspector: Inactive/active network bar segments overlap when latency is zero
Summary: Web Inspector: Inactive/active network bar segments overlap when latency is zero
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P4 Normal
Assignee: Matt Baker
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-07-24 12:10 PDT by Matt Baker
Modified: 2016-07-29 13:45 PDT (History)
7 users (show)

See Also:


Attachments
[Image] Overlapping segments (114.33 KB, image/png)
2016-07-24 12:10 PDT, Matt Baker
no flags Details
[Patch] Proposed Fix (3.82 KB, patch)
2016-07-27 16:15 PDT, Matt Baker
no flags Details | Formatted Diff | Diff
[Patch] For Landing (4.26 KB, patch)
2016-07-29 13:15 PDT, Matt Baker
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.