Bug 156371 - Web Inspector: ProfileView source links are off by 1 line, worse in pretty printed code
Summary: Web Inspector: ProfileView source links are off by 1 line, worse in pretty pr...
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: 2016-04-07 15:21 PDT by Joseph Pecoraro
Modified: 2016-04-07 16:28 PDT (History)
12 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (4.07 KB, patch)
2016-04-07 15:22 PDT, 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 2016-04-07 15:21:28 PDT
* SUMMARY
ProfileView source links are off by 1 line, worse in pretty printed code.

* TEST
<script>
function runFor(ms) {
    var until = Date.now() + ms;
    while (Date.now() < until);
}

function doWork() {
    runFor(200);
}

setTimeout(() => { doWork() }, 0);
</script>

* STEPS TO REPRODUCE
1. Inspect test page
2. Timeline record it doing work
3. Show Profile View
4. Jump to "runFor"
  => off by 1, it highlights the line with `until` and not `runFor`

* NOTES
- Protocol produces 1-based line numbers, but SourceCodeLocation expects 0-based.
Comment 1 Radar WebKit Bug Importer 2016-04-07 15:22:19 PDT
<rdar://problem/25612513>
Comment 2 Joseph Pecoraro 2016-04-07 15:22:40 PDT
Created attachment 275946 [details]
[PATCH] Proposed Fix
Comment 3 WebKit Commit Bot 2016-04-07 16:28:09 PDT
Comment on attachment 275946 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 275946

Committed r199201: <http://trac.webkit.org/changeset/199201>
Comment 4 WebKit Commit Bot 2016-04-07 16:28:13 PDT
All reviewed patches have been landed.  Closing bug.