Bug 194549 - Web Inspector: Timeline.prototype.recordsInTimeRange uses a property most records do not have
Summary: Web Inspector: Timeline.prototype.recordsInTimeRange uses a property most rec...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-02-12 11:56 PST by Joseph Pecoraro
Modified: 2019-02-12 13:23 PST (History)
5 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (1.61 KB, patch)
2019-02-12 11:57 PST, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2019-02-12 11:56:53 PST
Timeline.prototype.recordsInTimeRange uses a property most records do not have

Change `record.timestamp` to `record.startTime`.

  • Not all records have a timestamp. They do have a startTime/endTime
  • Those that do, set the startTime/endTime to the timestamp value
Comment 1 Joseph Pecoraro 2019-02-12 11:57:18 PST
Created attachment 361818 [details]
[PATCH] Proposed Fix
Comment 2 Devin Rousso 2019-02-12 12:04:04 PST
Comment on attachment 361818 [details]
[PATCH] Proposed Fix

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

rs=me

> Source/WebInspectorUI/UserInterface/Models/Timeline.js:99
> +        let upperIndex = this._records.upperBound(endTime, (time, record) => time - record.startTime);

Should this be `endTime`?  If it's `startTime`, that means we'd include records that began in the range, but finished outside of the range.  If it's `endTime`, then we'd exclude those records.
Comment 3 Joseph Pecoraro 2019-02-12 12:55:41 PST
Comment on attachment 361818 [details]
[PATCH] Proposed Fix

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

>> Source/WebInspectorUI/UserInterface/Models/Timeline.js:99
>> +        let upperIndex = this._records.upperBound(endTime, (time, record) => time - record.startTime);
> 
> Should this be `endTime`?  If it's `startTime`, that means we'd include records that began in the range, but finished outside of the range.  If it's `endTime`, then we'd exclude those records.

I'd expect records that are even partially in the range. The lowerIndex could use `record.endTime`, but there is `includeRecordBeforeStart`.
Comment 4 WebKit Commit Bot 2019-02-12 13:22:02 PST
Comment on attachment 361818 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 361818

Committed r241315: <https://trac.webkit.org/changeset/241315>
Comment 5 WebKit Commit Bot 2019-02-12 13:22:03 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2019-02-12 13:23:32 PST
<rdar://problem/48012450>