Bug 71114 - Web Inspector: do not map scripts generated with document.write to the document resources.
Summary: Web Inspector: do not map scripts generated with document.write to the docume...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Pavel Feldman
URL:
Keywords:
Depends on: 71268
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-28 06:34 PDT by Pavel Feldman
Modified: 2011-11-04 09:50 PDT (History)
12 users (show)

See Also:


Attachments
Patch (13.53 KB, patch)
2011-10-28 08:55 PDT, Pavel Feldman
no flags Details | Formatted Diff | Diff
Patch (23.78 KB, patch)
2011-10-31 03:21 PDT, Pavel Feldman
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Feldman 2011-10-28 06:34:54 PDT
Patch to follow.
Comment 1 Pavel Feldman 2011-10-28 08:55:15 PDT
Created attachment 112871 [details]
Patch
Comment 2 Yury Semikhatsky 2011-10-31 02:05:21 PDT
Comment on attachment 112871 [details]
Patch

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

> Source/WebCore/inspector/front-end/DebuggerPresentationModel.js:116
> +        if (script.sourceURL && script.lineOffset !== 0 && script.columnOffset !== 0) {

Can we extract "script.lineOffset !== 0 && script.columnOffset !== 0" into script.isInlineScript() or something? It is used quite often in that sense.

> Source/WebCore/inspector/front-end/DebuggerPresentationModel.js:146
> +        this._rawSourceCode[script.scriptId] = rawSourceCode;

_rawSourceCode -> _rawSourceCodeForScriptId?

> Source/WebCore/inspector/front-end/Script.js:35
> +  */

Revert this.

> Source/WebCore/inspector/front-end/Script.js:47
> +WebInspector.Script._lastScriptId = 0;

Remove this?

> LayoutTests/inspector/debugger/bind-script-to-resource.html:55
> +Tests that only inline scripts are bound to the resource, while the ones generated with document.write are not. Bug 71099</a>

It is not clear at first glance what the correct result is which means that this test can be erroneously rebaselined should it start failing. Can you add an explicit check for the error condition and print FAIL in that case or describe here which result should be considered correct.
Comment 3 Pavel Feldman 2011-10-31 03:21:43 PDT
Created attachment 113030 [details]
Patch
Comment 4 Pavel Feldman 2011-10-31 04:56:18 PDT
Committed r98847: <http://trac.webkit.org/changeset/98847>
Comment 5 Csaba Osztrogonác 2011-10-31 18:24:01 PDT
(In reply to comment #4)
> Committed r98847: <http://trac.webkit.org/changeset/98847>

It broke 3 inspector tests on Snow Leopard and on Qt bot:
inspector/debugger/bind-script-to-resource.html
inspector/debugger/linkifier.html
inspector/debugger/source-frame-count.html

Could you fix it please?
Comment 6 Csaba Osztrogonác 2011-11-02 04:39:58 PDT
(In reply to comment #4)
> Committed r98847: <http://trac.webkit.org/changeset/98847>

It was rolled out by http://trac.webkit.org/changeset/98940
Comment 7 Pavel Feldman 2011-11-03 09:28:46 PDT
Committed r99203: <http://trac.webkit.org/changeset/99203>
Comment 8 Ryosuke Niwa 2011-11-04 09:50:41 PDT
It appears that this patch broke inspector/debugger/script-formatter.html

http://build.webkit.org/builders/SnowLeopard%20Intel%20Release%20(Tests)/builds/34424