Bug 209879

Summary: Web Inspector: Use ECMAScript Numeric Separators for numbers with 5 or more digits
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Nikita Vasilyev <nvasilyev>
Status: RESOLVED FIXED    
Severity: Normal CC: inspector-bugzilla-changes, joepeck, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch none

Description Nikita Vasilyev 2020-04-01 14:05:19 PDT
Instead of `1000000` write `1_000_000` so it's easier to read.
Comment 1 Nikita Vasilyev 2020-04-01 14:08:15 PDT
Created attachment 395201 [details]
Patch
Comment 2 Joseph Pecoraro 2020-04-01 14:58:53 PDT
Comment on attachment 395201 [details]
Patch

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

Nice! Some comments

> Source/WebInspectorUI/UserInterface/Models/Geometry.js:569
> -        epsilon = epsilon || 0.0001;
> +        epsilon = epsilon || 0.000_1;

I don't like this one. But maybe that is just me?

> Source/WebInspectorUI/UserInterface/Models/ProfileNode.js:161
> +                if (this._selfTime < 0.000_1)

Ditto

> Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js:539
> +WI.TimelineRecording.TimestampThresholdForLegacyAssumedMilliseconds = 1_420_099_200_000; // Date.parse("Jan 1, 2015"). Milliseconds since epoch.

This is a very specific thing, not sure we even want to fake it being readable.

> Source/WebInspectorUI/UserInterface/Views/MemoryTimelineView.js:392
> +        totalElement.textContent = Number.percentageString(percent === 1 ? percent : (percent - 0.000_5));

Ditto.
Comment 3 Nikita Vasilyev 2020-04-01 15:03:54 PDT
Comment on attachment 395201 [details]
Patch

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

>> Source/WebInspectorUI/UserInterface/Models/Geometry.js:569
>> +        epsilon = epsilon || 0.000_1;
> 
> I don't like this one. But maybe that is just me?

Yeah, I wasn't sure about this myself. I can revert.

>> Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js:539
>> +WI.TimelineRecording.TimestampThresholdForLegacyAssumedMilliseconds = 1_420_099_200_000; // Date.parse("Jan 1, 2015"). Milliseconds since epoch.
> 
> This is a very specific thing, not sure we even want to fake it being readable.

I agree. I simply found numbers with 5 or more digits. I'll revert this chunk if you think the rest is r+ worthy.
Comment 4 Joseph Pecoraro 2020-04-01 15:07:43 PDT
> I agree. I simply found numbers with 5 or more digits. I'll revert this
> chunk if you think the rest is r+ worthy.

Yep
Comment 5 Nikita Vasilyev 2020-04-01 15:13:37 PDT
Created attachment 395209 [details]
Patch
Comment 6 Joseph Pecoraro 2020-04-01 15:25:16 PDT
Comment on attachment 395209 [details]
Patch

r=me
Comment 7 EWS 2020-04-01 15:50:22 PDT
Committed r259368: <https://trac.webkit.org/changeset/259368>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 395209 [details].
Comment 8 Radar WebKit Bug Importer 2020-04-01 15:51:19 PDT
<rdar://problem/61179192>