Bug 97065 - Web Inspector: Source Mapping doesn't work when inspector is in remote-mode
Summary: Web Inspector: Source Mapping doesn't work when inspector is in remote-mode
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: http://dev.fontdragr.com
Keywords:
Depends on: 73959
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-18 20:31 PDT by Peter Wang
Modified: 2014-03-10 16:20 PDT (History)
15 users (show)

See Also:


Attachments
Patch (13.22 KB, patch)
2012-09-18 20:36 PDT, Peter Wang
no flags Details | Formatted Diff | Diff
Patch (12.96 KB, patch)
2012-09-19 01:40 PDT, Peter Wang
no flags Details | Formatted Diff | Diff
Patch (12.86 KB, patch)
2012-09-19 06:15 PDT, Peter Wang
pfeldman: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Wang 2012-09-18 20:31:34 PDT
This defect exists in both Chrome and other ports. 
The root reason is the function "InspectorFrontendHost.loadResourceSynchronously" (CompilerScriptMapping.js) is only a stub when Inspector is working in remote-mode.
Comment 1 Peter Wang 2012-09-18 20:36:01 PDT
Created attachment 164651 [details]
Patch
Comment 2 WebKit Review Bot 2012-09-18 21:24:43 PDT
Comment on attachment 164651 [details]
Patch

Attachment 164651 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13894394

New failing tests:
http/tests/inspector/compiler-script-mapping.html
Comment 3 Vsevolod Vlasov 2012-09-19 01:20:41 PDT
Comment on attachment 164651 [details]
Patch

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

> Source/WebCore/inspector/front-end/CompilerScriptMapping.js:95
> +            sourceMap = this.loadSourceMapForScript(script);

You should add return here for this patch to work.
This means the script won't have source mapping until source map is loaded, which means stopping on breakpoint at this point would break things.
Comment 4 Vsevolod Vlasov 2012-09-19 01:21:05 PDT
See https://bugs.webkit.org/show_bug.cgi?id=97032 also
Comment 5 Peter Wang 2012-09-19 01:40:18 PDT
Created attachment 164691 [details]
Patch
Comment 6 Vsevolod Vlasov 2012-09-19 01:57:47 PDT
Comment on attachment 164691 [details]
Patch

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

> Source/WebCore/inspector/front-end/DebuggerScriptMapping.js:57
> +        if (!mapping._asyncLoadSource)

I don't think this fixes the problem I mentioned.
We should always have a mapping set for script which will correctly transfrom any raw location to ui location at any moment.
Comment 7 Peter Wang 2012-09-19 02:00:52 PDT
(In reply to comment #5)
> Created an attachment (id=164691) [details]
> Patch

Sorry, I didn't notice comments#3 when I was uploading this patch. I'll update it according to your comments.
Comment 8 Pavel Feldman 2012-09-19 02:43:29 PDT
I don't think this is conceptually right to load source maps through the backend. You should treat the front-end as an IDE and the IDE should use its own capabilities to load resources from the web (not via the mobile device). I'd rather have an extension that does cross-origin requests.
Comment 9 Peter Wang 2012-09-19 06:15:30 PDT
Reopening to attach new patch.
Comment 10 Peter Wang 2012-09-19 06:15:39 PDT
Created attachment 164725 [details]
Patch
Comment 11 Peter Wang 2012-09-19 06:22:15 PDT
(In reply to comment #10)
> Created an attachment (id=164725) [details]
> Patch

This patch is updated for comments#3. I'll uploaded a new patch that also accommodate the comments#8.
Comment 12 Pavel Feldman 2012-09-19 06:31:11 PDT
Comment on attachment 164725 [details]
Patch

The way it should be addressed lays outside the WebCore/WebKit boundary. I would imagine it as an extension that exposes cross-origin XHRs or as CORS-enabled server serving the source maps.
But it definitely should not  be going via the backend / device.
Comment 13 Peter Wang 2012-09-19 07:45:37 PDT
(In reply to comment #12)
> (From update of attachment 164725 [details])
> The way it should be addressed lays outside the WebCore/WebKit boundary. I would imagine it as an extension that exposes cross-origin XHRs or as CORS-enabled server serving the source maps.
> But it definitely should not  be going via the backend / device.

Thx for the tips. I'll try it. My port really needs this feature to work.
Comment 14 Peter Wang 2012-10-16 01:26:56 PDT
The reason of this bug is obviously, but really hard to fix: if we can support CROSS-ORIGIN "InspectorFrontendHostStub.loadResourceSynchronously" in remote inspecting mode, we'll resolve it.

As https://bugs.webkit.org/show_bug.cgi?id=91528 resolved, we can use "InspectorFrontendHostStub.loadResourceSynchronously" in remote-mode, but cannot do a cross-origin request.

The patch for https://bugs.webkit.org/show_bug.cgi?id=73959 is trying to make that function cross-origin, but denied due to security concern. 

Maybe I should try to fix bug#73959 firstly.