Changeset 79873 in webkit


Ignore:
Timestamp:
Feb 28, 2011 9:29:51 AM (13 years ago)
Author:
podivilov@chromium.org
Message:

2011-02-28 Pavel Podivilov <podivilov@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: [REGRESSION] source frame is recreated for each inlined script in document.
https://bugs.webkit.org/show_bug.cgi?id=55377

  • inspector/debugger/scripts-panel-expected.txt:
  • inspector/debugger/scripts-panel.html:

2011-02-28 Pavel Podivilov <podivilov@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: [REGRESSION] source frame is recreated for each inlined script in document.
https://bugs.webkit.org/show_bug.cgi?id=55377

  • inspector/front-end/ScriptsPanel.js: (WebInspector.ScriptsPanel.prototype._resourceLoadingFinished): (WebInspector.ScriptsPanel.prototype._sourceFrameForSourceName): (WebInspector.ScriptsPanel.prototype._createSourceFrame): (WebInspector.ScriptsPanel.prototype._recreateSourceFrame):
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r79872 r79873  
     12011-02-28  Pavel Podivilov  <podivilov@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: [REGRESSION] source frame is recreated for each inlined script in document.
     6        https://bugs.webkit.org/show_bug.cgi?id=55377
     7
     8        * inspector/debugger/scripts-panel-expected.txt:
     9        * inspector/debugger/scripts-panel.html:
     10
    1112011-02-28  Csaba Osztrogonác  <ossy@webkit.org>
    212
  • trunk/LayoutTests/inspector/debugger/scripts-panel-expected.txt

    r79560 r79873  
    66
    77Running: testHistory
     8
     9Running: testSourceFramesCount
     10Page reloaded.
    811Debugger was disabled.
    912
  • trunk/LayoutTests/inspector/debugger/scripts-panel.html

    r79555 r79873  
    9898
    9999            next();
     100        },
     101
     102        function testSourceFramesCount(next)
     103        {
     104            var sourceFrameCount = 0;
     105
     106            InspectorTest.showScriptSource("scripts-panel.html", didShowScriptSource);
     107
     108            function didShowScriptSource()
     109            {
     110                function didCreateSourceFrame()
     111                {
     112                    sourceFrameCount += 1;
     113                }
     114                InspectorTest.addSniffer(panel, "_createSourceFrame", didCreateSourceFrame, true);
     115                InspectorTest.reloadPage(didReload);
     116            }
     117
     118            function didReload()
     119            {
     120                InspectorTest.assertEquals("scripts-panel.html", select[select.selectedIndex].text);
     121                // There should be maximum 2 source frames: first one is the first shown, second one is the last viewed ("scripts-panel.html").
     122                InspectorTest.assertEquals(true, sourceFrameCount <= 2, "too many source frames created after page reload");
     123                next();
     124            }
    100125        }
    101126    ]);
    102127};
    103128
     129</script>
     130
     131<script>
     132function secondInlinedScriptInPage()
     133{
     134    return 0;
     135}
     136</script>
     137
     138<script>
     139function thirdInlinedScriptInPage()
     140{
     141    return 0;
     142}
     143</script>
     144
     145<script>
     146function fourthInlinedScriptInPage()
     147{
     148    return 0;
     149}
    104150</script>
    105151
  • trunk/Source/WebCore/ChangeLog

    r79871 r79873  
     12011-02-28  Pavel Podivilov  <podivilov@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: [REGRESSION] source frame is recreated for each inlined script in document.
     6        https://bugs.webkit.org/show_bug.cgi?id=55377
     7
     8        * inspector/front-end/ScriptsPanel.js:
     9        (WebInspector.ScriptsPanel.prototype._resourceLoadingFinished):
     10        (WebInspector.ScriptsPanel.prototype._sourceFrameForSourceName):
     11        (WebInspector.ScriptsPanel.prototype._createSourceFrame):
     12        (WebInspector.ScriptsPanel.prototype._recreateSourceFrame):
     13
    1142011-02-28  Patrick Gansterer  <paroga@webkit.org>
    215
  • trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js

    r79555 r79873  
    285285            if (resource.finished) {
    286286                // Resource is finished, bind the script right away.
    287                 resource._scriptsPendingResourceLoad = [script];
    288                 this._resourceLoadingFinished({ target: resource });
     287                script.resource = resource;
     288
     289                // Add resource url to files select if not already added while debugging inlined scripts.
     290                if (!(resource.url in this._sourceNameToFilesSelectOption))
     291                    this._addOptionToFilesSelectAndShowSourceFrameIfNeeded(resource.url);
    289292            } else {
    290293                // Resource is not finished, bind the script later.
     
    584587    {
    585588        var sourceFrame = this._sourceNameToSourceFrame[sourceName];
    586         if (sourceFrame)
    587             return sourceFrame;
    588 
     589        return sourceFrame || this._createSourceFrame(sourceName);
     590    },
     591
     592    _createSourceFrame: function(sourceName)
     593    {
    589594        var script = this._scriptForSourceName(sourceName);
    590595        var contentProvider;
     
    615620            return;
    616621
    617         var newSourceFrame = this._sourceFrameForSourceName(sourceName)
     622        var newSourceFrame = this._createSourceFrame(sourceName)
    618623        newSourceFrame.scrollTop = oldSourceFrame.scrollTop;
    619624        this.visibleView = newSourceFrame;
Note: See TracChangeset for help on using the changeset viewer.