Bug 194108 - Web Inspector: Timeline time range selection sometimes shows 0.000, should be just 0
Summary: Web Inspector: Timeline time range selection sometimes shows 0.000, should be...
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-01-31 13:34 PST by Joseph Pecoraro
Modified: 2019-01-31 15:26 PST (History)
5 users (show)

See Also:


Attachments
[IMAGE] Issue (482.32 KB, image/png)
2019-01-31 13:38 PST, Joseph Pecoraro
no flags Details
[PATCH] Proposed Fix (5.54 KB, patch)
2019-01-31 14:08 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-01-31 13:34:23 PST
Timeline time range selection sometimes shows 0.000, should be just 0

See attached photo.

Steps to Reproduce:
1. Inspect this page
2. Reload with a timeline
3. Make a timeline range selection
4. Drag the selection range (by the handle at the top) left and right a bunch
  => Ends up on the left with 0.000

Notes:
• Value is super small (0.000000000007) due to floating point precision
Comment 1 Radar WebKit Bug Importer 2019-01-31 13:37:17 PST
<rdar://problem/47714273>
Comment 2 Joseph Pecoraro 2019-01-31 13:38:30 PST
Created attachment 360766 [details]
[IMAGE] Issue
Comment 3 Joseph Pecoraro 2019-01-31 14:08:04 PST
Created attachment 360775 [details]
[PATCH] Proposed Fix
Comment 4 Devin Rousso 2019-01-31 14:12:03 PST
Comment on attachment 360775 [details]
[PATCH] Proposed Fix

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

rs=me

> Source/WebInspectorUI/UserInterface/Base/Utilities.js:1159
>          const epsilon = 0.0001;

I get that we're using `0.0001` because it's a decimal point away from 1/1000, but should we try using `Number.EPSILON` instead?
Comment 5 Joseph Pecoraro 2019-01-31 14:59:52 PST
(In reply to Devin Rousso from comment #4)
> Comment on attachment 360775 [details]
> [PATCH] Proposed Fix
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=360775&action=review
> 
> rs=me
> 
> > Source/WebInspectorUI/UserInterface/Base/Utilities.js:1159
> >          const epsilon = 0.0001;
> 
> I get that we're using `0.0001` because it's a decimal point away from
> 1/1000, but should we try using `Number.EPSILON` instead?

Yeah, that would probably be good. Lets switch to that separately!
Comment 6 WebKit Commit Bot 2019-01-31 15:26:34 PST
Comment on attachment 360775 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 360775

Committed r240824: <https://trac.webkit.org/changeset/240824>
Comment 7 WebKit Commit Bot 2019-01-31 15:26:35 PST
All reviewed patches have been landed.  Closing bug.