Bug 123281

Summary: Web Inspector: Adjust the precision of byte strings
Product: WebKit Reporter: Timothy Hatcher <timothy>
Component: Web InspectorAssignee: Timothy Hatcher <timothy>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, eoconnor, graouts, joepeck, mat, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
joepeck: review+, timothy: commit-queue-
Patch
joepeck: review+
Patch none

Description Timothy Hatcher 2013-10-24 11:36:55 PDT
It should show more precision for MB and less precision for < 1024 KB.
Comment 1 Radar WebKit Bug Importer 2013-10-24 11:37:30 PDT
<rdar://problem/15311366>
Comment 2 Mat Marquis 2013-10-24 11:39:53 PDT
> less precision for < 1024 KB.

I’m not sure why you’d want it to be less precise at any point?
Comment 3 Timothy Hatcher 2013-10-24 11:40:02 PDT
Created attachment 215085 [details]
Patch
Comment 4 Timothy Hatcher 2013-10-24 11:43:25 PDT
Created attachment 215086 [details]
Patch
Comment 5 Joseph Pecoraro 2013-10-24 11:44:05 PDT
Comment on attachment 215086 [details]
Patch

r=me
Comment 6 Joseph Pecoraro 2013-10-24 11:47:20 PDT
Comment on attachment 215086 [details]
Patch

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

> Source/WebInspectorUI/UserInterface/Utilities.js:945
> +        if (higherResolution || megabytes < 10)

We could even do the same for kilobytes. if KB < 10 show %.2f
Comment 7 Mat Marquis 2013-10-24 11:47:54 PDT
*** Bug 123280 has been marked as a duplicate of this bug. ***
Comment 8 Timothy Hatcher 2013-10-24 11:50:05 PDT
Created attachment 215087 [details]
Patch
Comment 9 Mat Marquis 2013-10-24 11:50:21 PDT
Wait, so this only shows the first decimal place up to 10MB? 

I’m not sure why there needs to be an upper threshold. I’d really rather have the most accurate possible read of bandwidth usage at any point.
Comment 10 Joseph Pecoraro 2013-10-24 11:52:08 PDT
Comment on attachment 215087 [details]
Patch

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

> Source/WebInspectorUI/UserInterface/Utilities.js:942
> +        else if (higherResolution && kilobytes < 1024)
> +            return WebInspector.UIString("%.1f KB").format(kilobytes);

This should be just "kilobytes < 1024", if higherResolution  were true, the top if would have been taken.
Comment 11 Timothy Hatcher 2013-10-24 12:04:52 PDT
Created attachment 215088 [details]
Patch
Comment 12 Joseph Pecoraro 2013-10-24 12:05:54 PDT
Comment on attachment 215088 [details]
Patch

r=me!!
Comment 13 WebKit Commit Bot 2013-10-24 12:38:07 PDT
Comment on attachment 215088 [details]
Patch

Clearing flags on attachment: 215088

Committed r157947: <http://trac.webkit.org/changeset/157947>
Comment 14 WebKit Commit Bot 2013-10-24 12:38:09 PDT
All reviewed patches have been landed.  Closing bug.