Bug 154303

Summary: JSContext Inspector: Support for inline source maps
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, 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: 145150    
Attachments:
Description Flags
[PATCH] Proposed Fix
timothy: review+
[PATCH] For Landing none

Description Joseph Pecoraro 2016-02-16 11:42:07 PST
* SUMMARY
Support for inline source maps in JSContext inspection.

We should be able to handle a sourceMappingURL that is a dataURL with inline `sourcesContent`!

* TEST
//# sourceMappingURL=data:application/json;base64,ewogICAgInZlcnNpb24iOiAzLAogICAgImZpbGUiOiAiY29tYmluZWQubWluLmpzLnRtcCIsCiAgICAic291cmNlcyI6IFsic2NyaXB0LTEuanMiLCAic2NyaXB0LTIuanMiXSwKICAgICJzb3VyY2VzQ29udGVudCI6IFsiLy8gTm90aGluZyBzcGVjaWFsIHRvIHNlZSBoZXJlLlxuZnVuY3Rpb24gbm90aGluZ1NwZWNpYWxUb1NlZUhlcmUxKCkge1xuICAgIGNvbnNvbGUubG9nKFwibm90aGluZ1NwZWNpYWxUb1NlZUhlcmUxXCIpO1xufSIsICIvLyBOb3RoaW5nIHNwZWNpYWwgdG8gc2VlIGhlcmUuXG5mdW5jdGlvbiBub3RoaW5nU3BlY2lhbFRvU2VlSGVyZTIoKSB7XG4gICAgY29uc29sZS5sb2coXCJub3RoaW5nU3BlY2lhbFRvU2VlSGVyZTJcIik7XG59Il0sCiAgICAibmFtZXMiOiBbIm5vdGhpbmdTcGVjaWFsVG9TZWVIZXJlMSIsICJjb25zb2xlIiwgImxvZyIsICJub3RoaW5nU3BlY2lhbFRvU2VlSGVyZTIiXSwKICAgICJtYXBwaW5ncyI6ICJBQUNBLFFBQVNBLDRCQUNMQyxRQUFRQyxJQUFJLDRCQ0RoQixRQUFTQyw0QkFDTEYsUUFBUUMsSUFBSSIKfQo=

* DECODED
{
    "version": 3,
    "file": "combined.min.js.tmp",
    "sources": ["script-1.js", "script-2.js"],
    "sourcesContent": ["// Nothing special to see here.\nfunction nothingSpecialToSeeHere1() {\n    console.log(\"nothingSpecialToSeeHere1\");\n}", "// Nothing special to see here.\nfunction nothingSpecialToSeeHere2() {\n    console.log(\"nothingSpecialToSeeHere2\");\n}"],
    "names": ["nothingSpecialToSeeHere1", "console", "log", "nothingSpecialToSeeHere2"],
    "mappings": "AACA,QAASA,4BACLC,QAAQC,IAAI,4BCDhB,QAASC,4BACLF,QAAQC,IAAI"
}
Comment 1 Joseph Pecoraro 2016-02-16 11:42:19 PST
<rdar://problem/24670392>
Comment 2 Joseph Pecoraro 2016-02-16 11:51:24 PST
Created attachment 271462 [details]
[PATCH] Proposed Fix
Comment 3 Timothy Hatcher 2016-02-16 12:13:04 PST
Comment on attachment 271462 [details]
[PATCH] Proposed Fix

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

> Source/WebInspectorUI/UserInterface/Controllers/SourceMapManager.js:118
> +        // COMPATIBILITY (iOS 7): Network.loadResource did not exist.

Add a similar comment to the one in SourceMapResource.js about JavaScript Debuggables.
Comment 4 Joseph Pecoraro 2016-02-16 12:27:13 PST
Created attachment 271467 [details]
[PATCH] For Landing
Comment 5 WebKit Commit Bot 2016-02-16 13:17:30 PST
Comment on attachment 271467 [details]
[PATCH] For Landing

Clearing flags on attachment: 271467

Committed r196654: <http://trac.webkit.org/changeset/196654>