Bug 154613

Summary: Web Inspector: Setting serializes Infinity as null
Product: WebKit Reporter: Matt Baker <mattbaker>
Component: Web InspectorAssignee: Matt Baker <mattbaker>
Status: RESOLVED WONTFIX    
Severity: Normal CC: bburg, graouts, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 154561    

Matt Baker
Reported 2016-02-23 15:41:59 PST
* SUMMARY Setting serializes Infinity as null. According to the ECMA-262 spec (page 473 Note 4): "Finite numbers are stringified as if by calling ToString(number). NaN and Infinity regardless of sign are represented as the String null." There isn't a need for serializing NaN at the moment. TimelineRuler however, needs to serialize Infinity in order to persist the "nothing is selected" ruler selection state, which is represented by a selection interval of [0, Infinity). *NOTES This can be added by augmenting JSON.stringify in Utilities.js, or by adding a special case in WebInspector.Setting.
Attachments
Radar WebKit Bug Importer
Comment 1 2016-02-23 15:42:22 PST
Timothy Hatcher
Comment 2 2016-02-23 15:47:55 PST
We could also store that "entire range selected" state as a bool and restore [0, Infinity] on load from settings.
Matt Baker
Comment 3 2016-02-23 15:50:23 PST
(In reply to comment #2) > We could also store that "entire range selected" state as a bool and restore > [0, Infinity] on load from settings. That is a possible solution. I'll try this, as well as MAX_VALUE as an alternative to Infinity in TimelineRuler code go with the cleaner solution.
Matt Baker
Comment 4 2016-02-24 17:41:21 PST
Using Number.MAX_VALUE instead of Infinity solved the issue.
Note You need to log in before you can comment on or make changes to this bug.