Changeset 83577 in webkit


Ignore:
Timestamp:
Apr 12, 2011 4:38:11 AM (13 years ago)
Author:
podivilov@chromium.org
Message:

2011-04-12 Pavel Podivilov <podivilov@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: REGRESSION: Most resources in the Network panel show a blank panel when clicked.
https://bugs.webkit.org/show_bug.cgi?id=58273

  • inspector/debugger/source-frame-expected.txt:
  • inspector/debugger/source-frame.html:

2011-04-12 Pavel Podivilov <podivilov@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: REGRESSION: Most resources in the Network panel show a blank panel when clicked.
https://bugs.webkit.org/show_bug.cgi?id=58273

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r83575 r83577  
     12011-04-12  Pavel Podivilov  <podivilov@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: REGRESSION: Most resources in the Network panel show a blank panel when clicked.
     6        https://bugs.webkit.org/show_bug.cgi?id=58273
     7
     8        * inspector/debugger/source-frame-expected.txt:
     9        * inspector/debugger/source-frame.html:
     10
    1112011-04-12  Pavel Feldman  <pfeldman@google.com>
    212
  • trunk/LayoutTests/inspector/debugger/source-frame-expected.txt

    r79553 r83577  
    1010Running: testConsoleMessage
    1111Message text: source-frame.html:10test error message
     12
     13Running: testShowResource
    1214Debugger was disabled.
    1315
  • trunk/LayoutTests/inspector/debugger/source-frame.html

    r80356 r83577  
    4242                  next();
    4343              }
     44        },
     45
     46        function testShowResource(next)
     47        {
     48            WebInspector.showPanel("network");
     49
     50            InspectorTest.addSniffer(WebInspector.SourceFrame.prototype, "show", didShowSourceFrame);
     51            var resources = WebInspector.resourceTreeModel._resourcesByURL;
     52            for (var url in resources) {
     53                if (url.indexOf("debugger-test.js") !== -1) {
     54                    WebInspector.panels.network._showResource(resources[url], 1);
     55                    break;
     56                }
     57            }
     58
     59            function didShowSourceFrame()
     60            {
     61                next();
     62            }
    4463        }
    4564    ]);
  • trunk/Source/WebCore/ChangeLog

    r83576 r83577  
     12011-04-12  Pavel Podivilov  <podivilov@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: REGRESSION: Most resources in the Network panel show a blank panel when clicked.
     6        https://bugs.webkit.org/show_bug.cgi?id=58273
     7
     8        * inspector/front-end/SourceFrame.js:
     9        (WebInspector.SourceFrame):
     10        (WebInspector.SourceFrame.prototype.get visible):
     11        (WebInspector.SourceFrame.prototype.set visible):
     12        (WebInspector.SourceFrame.prototype.show):
     13        (WebInspector.SourceFrame.prototype.hide):
     14        (WebInspector.SourceFrame.prototype.detach):
     15        (WebInspector.SourceFrame.prototype._ensureContentLoaded):
     16        (WebInspector.SourceFrame.prototype.markDiff):
     17        (WebInspector.SourceFrame.prototype.addMessage):
     18        (WebInspector.SourceFrame.prototype.clearMessages):
     19        (WebInspector.SourceFrame.prototype.get scrollTop):
     20        (WebInspector.SourceFrame.prototype.set scrollTop):
     21        (WebInspector.SourceFrame.prototype.highlightLine):
     22        (WebInspector.SourceFrame.prototype._clearLineHighlight):
     23        (WebInspector.SourceFrame.prototype._initializeTextViewer):
     24        (WebInspector.SourceFrame.prototype.performSearch):
     25        (WebInspector.SourceFrame.prototype.searchCanceled):
     26        (WebInspector.SourceFrame.prototype._jumpToSearchResult):
     27        (WebInspector.SourceFrame.prototype.setExecutionLine):
     28        (WebInspector.SourceFrame.prototype.clearExecutionLine):
     29        (WebInspector.SourceFrame.prototype.resize):
     30
    1312011-04-12  Pavel Feldman  <pfeldman@google.com>
    232
  • trunk/Source/WebCore/inspector/front-end/SourceFrame.js

    r83438 r83577  
    3939    this._textModel.replaceTabsWithSpaces = true;
    4040
     41    this._textViewer = new WebInspector.TextViewer(this._textModel, WebInspector.platform, this._url, this);
     42    this._visible = false;
     43
    4144    this._currentSearchResultIndex = -1;
    4245    this._searchResults = [];
     
    5659
    5760WebInspector.SourceFrame.prototype = {
     61    get visible()
     62    {
     63        return this._textViewer.visible;
     64    },
     65
     66    set visible(x)
     67    {
     68        this._textViewer.visible = x;
     69    },
    5870
    5971    show: function(parentElement)
    6072    {
    61         this._parentElement = parentElement;
    62 
    6373        this._ensureContentLoaded();
    6474
    65         if (this._textViewer) {
     75        this._textViewer.show(parentElement);
     76        this._textViewer.resize();
     77
     78        if (this.loaded) {
    6679            if (this._scrollTop)
    6780                this._textViewer.scrollTop = this._scrollTop;
    6881            if (this._scrollLeft)
    6982                this._textViewer.scrollLeft = this._scrollLeft;
    70             this._textViewer.show(parentElement);
    71             this._textViewer.resize();
    7283        }
    7384    },
     
    7586    hide: function()
    7687    {
    77         delete this._parentElement;
    78 
    79         if (this._textViewer) {
     88        if (this.loaded) {
    8089            this._scrollTop = this._textViewer.scrollTop;
    8190            this._scrollLeft = this._textViewer.scrollLeft;
    8291            this._textViewer.freeCachedElements();
    83             this._textViewer.hide();
    84         }
    85 
     92        }
     93
     94        this._textViewer.hide();
    8695        this._hidePopup();
    8796        this._clearLineHighlight();
     
    9099    detach: function()
    91100    {
    92         delete this._parentElement;
    93 
    94         if (this._textViewer)
    95             this._textViewer.detach();
     101        this._textViewer.detach();
    96102    },
    97103
     
    115121        if (!this._contentRequested) {
    116122            this._contentRequested = true;
    117             this._requestContent(this._createTextViewer.bind(this));
     123            this._requestContent(this._initializeTextViewer.bind(this));
    118124        }
    119125    },
     
    126132    markDiff: function(diffData)
    127133    {
    128         if (this._diffLines && this._textViewer)
     134        if (this._diffLines && this.loaded)
    129135            this._removeDiffDecorations();
    130136
    131137        this._diffLines = diffData;
    132         if (this._textViewer)
     138        if (this.loaded)
    133139            this._updateDiffDecorations();
    134140    },
     
    137143    {
    138144        this._messages.push(msg);
    139         if (this._textViewer)
     145        if (this.loaded)
    140146            this.addMessageToSource(msg.line - 1, msg);
    141147    },
     
    151157        this._rowMessages = {};
    152158        this._messageBubbles = {};
    153         if (this._textViewer)
    154             this._textViewer.resize();
     159
     160        this._textViewer.resize();
    155161    },
    156162
     
    162168    get scrollTop()
    163169    {
    164         return this._textViewer ? this._textViewer.scrollTop : this._scrollTop;
     170        return this.loaded ? this._textViewer.scrollTop : this._scrollTop;
    165171    },
    166172
     
    168174    {
    169175        this._scrollTop = scrollTop;
    170         if (this._textViewer)
     176        if (this.loaded)
    171177            this._textViewer.scrollTop = scrollTop;
    172178    },
     
    174180    highlightLine: function(line)
    175181    {
    176         if (this._textViewer)
     182        if (this.loaded)
    177183            this._textViewer.highlightLine(line);
    178184        else
     
    182188    _clearLineHighlight: function()
    183189    {
    184         if (this._textViewer)
     190        if (this.loaded)
    185191            this._textViewer.clearLineHighlight();
    186192        else
     
    284290    },
    285291
    286     _createTextViewer: function(mimeType, content)
    287     {
     292    _initializeTextViewer: function(mimeType, content)
     293    {
     294        this._textViewer.mimeType = mimeType;
     295
    288296        this._content = content;
    289297        this._textModel.setText(null, content);
    290 
    291         this._textViewer = new WebInspector.TextViewer(this._textModel, WebInspector.platform, this._url, this);
    292298
    293299        var element = this._textViewer.element;
     
    303309        this._textViewer.beginUpdates();
    304310
    305         this._textViewer.mimeType = mimeType;
    306311        this._setTextViewerDecorations();
    307312
     
    367372        }
    368373
    369         if (this._textViewer)
     374        if (this.loaded)
    370375            doFindSearchMatches.call(this, query);
    371376        else
     
    378383    {
    379384        delete this._delayedFindSearchMatches;
    380         if (!this._textViewer)
     385        if (!this.loaded)
    381386            return;
    382387
     
    418423    _jumpToSearchResult: function(index)
    419424    {
    420         if (!this._textViewer || !this._searchResults.length)
     425        if (!this.loaded || !this._searchResults.length)
    421426            return;
    422427        this._currentSearchResultIndex = (index + this._searchResults.length) % this._searchResults.length;
     
    459464    {
    460465        this._executionLineNumber = lineNumber;
    461         if (this._textViewer) {
     466        if (this.loaded) {
    462467            this._textViewer.addDecoration(lineNumber, "webkit-execution-line");
    463468            if (!skipRevealLine)
     
    468473    clearExecutionLine: function()
    469474    {
    470         if (this._textViewer)
     475        if (this.loaded)
    471476            this._textViewer.removeDecoration(this._executionLineNumber, "webkit-execution-line");
    472477        delete this._executionLineNumber;
     
    864869    resize: function()
    865870    {
    866         if (this._textViewer)
    867             this._textViewer.resize();
     871        this._textViewer.resize();
    868872    },
    869873
Note: See TracChangeset for help on using the changeset viewer.