Changeset 117966 in webkit


Ignore:
Timestamp:
May 22, 2012 6:55:10 AM (12 years ago)
Author:
pfeldman@chromium.org
Message:

Web Inspector: [regression] dynamically created script tab is bound to the document resource.
https://bugs.webkit.org/show_bug.cgi?id=87119

Reviewed by Vsevolod Vlasov.

Source/WebCore:

Test: inspector/debugger/dynamic-script-tag.html

  • inspector/front-end/BreakpointManager.js:

(WebInspector.BreakpointManager.Breakpoint.prototype._setInDebugger.didSetBreakpoint):
(WebInspector.BreakpointManager.Breakpoint.prototype._setInDebugger):

  • inspector/front-end/DebuggerModel.js:

(WebInspector.DebuggerModel.prototype.rawLocationToUILocation):

  • inspector/front-end/ResourceScriptMapping.js:

(WebInspector.ResourceScriptMapping.prototype.addScript):
(WebInspector.ResourceScriptMapping.prototype._shouldBindScriptToContentProvider):

  • inspector/front-end/Script.js:

(WebInspector.Script.prototype.rawLocationToUILocation):
(WebInspector.Script.Location.prototype.update):

LayoutTests:

  • inspector/debugger/dynamic-script-tag-expected.txt: Added.
  • inspector/debugger/dynamic-script-tag.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r117963 r117966  
     12012-05-22  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Web Inspector: [regression] dynamically created script tab is bound to the document resource.
     4        https://bugs.webkit.org/show_bug.cgi?id=87119
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        * inspector/debugger/dynamic-script-tag-expected.txt: Added.
     9        * inspector/debugger/dynamic-script-tag.html: Added.
     10
    1112012-05-22  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r117965 r117966  
     12012-05-22  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Web Inspector: [regression] dynamically created script tab is bound to the document resource.
     4        https://bugs.webkit.org/show_bug.cgi?id=87119
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        Test: inspector/debugger/dynamic-script-tag.html
     9
     10        * inspector/front-end/BreakpointManager.js:
     11        (WebInspector.BreakpointManager.Breakpoint.prototype._setInDebugger.didSetBreakpoint):
     12        (WebInspector.BreakpointManager.Breakpoint.prototype._setInDebugger):
     13        * inspector/front-end/DebuggerModel.js:
     14        (WebInspector.DebuggerModel.prototype.rawLocationToUILocation):
     15        * inspector/front-end/ResourceScriptMapping.js:
     16        (WebInspector.ResourceScriptMapping.prototype.addScript):
     17        (WebInspector.ResourceScriptMapping.prototype._shouldBindScriptToContentProvider):
     18        * inspector/front-end/Script.js:
     19        (WebInspector.Script.prototype.rawLocationToUILocation):
     20        (WebInspector.Script.Location.prototype.update):
     21
    1222012-05-22  Vsevolod Vlasov  <vsevik@chromium.org>
    223
  • trunk/Source/WebCore/inspector/front-end/BreakpointManager.js

    r116846 r117966  
    382382            for (var i = 0; i < locations.length; ++i) {
    383383                var script = this._breakpointManager._debuggerModel.scriptForId(locations[i].scriptId);
    384                 var uiLocation = script.rawLocationToUILocation(locations[i]);
     384                var uiLocation = script.rawLocationToUILocation(locations[i].lineNumber, locations[i].columnNumber);
    385385                if (this._breakpointManager.findBreakpoint(uiLocation.uiSourceCode, uiLocation.lineNumber)) {
    386386                    // location clash
  • trunk/Source/WebCore/inspector/front-end/DebuggerModel.js

    r117277 r117966  
    536536        if (!script)
    537537            return null;
    538         return script.rawLocationToUILocation(rawLocation);
     538        return script.rawLocationToUILocation(rawLocation.lineNumber, rawLocation.columnNumber);
    539539    }
    540540}
  • trunk/Source/WebCore/inspector/front-end/ResourceScriptMapping.js

    r117600 r117966  
    9494            if (resource && resource.request && !resource.request.finished)
    9595                resource = null;
     96            // Only bind inline and standalone scripts.
     97            if (resource && !this._shouldBindScriptToContentProvider(script, resource))
     98                resource = null;
    9699            if (!resource) {
    97100                // When there is no resource, lookup in-flight requests.
    98101                request = WebInspector.networkManager.inflightRequestForURL(script.sourceURL);
     102                // Only bind inline and standalone scripts.
     103                if (request && !this._shouldBindScriptToContentProvider(script, request))
     104                  request = null;
    99105            }
    100106        }
     
    124130
    125131    /**
     132     * @param {WebInspector.Script} script
     133     * @param {WebInspector.ContentProvider} contentProvider
     134     * @return {boolean}
     135     */
     136    _shouldBindScriptToContentProvider: function(script, contentProvider)
     137    {
     138        if (script.isInlineScript())
     139            return contentProvider.contentType() === WebInspector.resourceTypes.Document;
     140        return contentProvider.contentType() === WebInspector.resourceTypes.Script;
     141    },
     142
     143    /**
    126144     * @param {WebInspector.Event} event
    127145     */
  • trunk/Source/WebCore/inspector/front-end/Script.js

    r117600 r117966  
    168168
    169169    /**
    170      * @param {DebuggerAgent.Location} rawLocation
     170     * @param {number} lineNumber
     171     * @param {number=} columnNumber
    171172     * @return {WebInspector.UILocation}
    172173     */
    173     rawLocationToUILocation: function(rawLocation)
    174     {
    175         console.assert(rawLocation.scriptId === this.scriptId);
    176         var uiLocation = this._sourceMapping.rawLocationToUILocation(rawLocation);
     174    rawLocationToUILocation: function(lineNumber, columnNumber)
     175    {
     176        var uiLocation = this._sourceMapping.rawLocationToUILocation(new WebInspector.DebuggerModel.Location(this, lineNumber, columnNumber || 0));
    177177        return uiLocation.uiSourceCode.overrideLocation(uiLocation);
    178178    },
     
    220220    update: function()
    221221    {
    222         var uiLocation = this._script.rawLocationToUILocation(this._rawLocation);
     222        var uiLocation = this._script.rawLocationToUILocation(this._rawLocation.lineNumber, this._rawLocation.columnNumber);
    223223        if (uiLocation) {
    224224            var uiSourceCode = uiLocation.uiSourceCode;
Note: See TracChangeset for help on using the changeset viewer.