Changeset 84492 in webkit


Ignore:
Timestamp:
Apr 21, 2011 6:46:56 AM (13 years ago)
Author:
pfeldman@chromium.org
Message:

2011-04-21 Pavel Feldman <pfeldman@google.com>

Reviewed by Yury Semikhatsky.

Web Inspector: implement Go To Line for network panel.
https://bugs.webkit.org/show_bug.cgi?id=59090

  • inspector/front-end/GoToLineDialog.js: (WebInspector.GoToLineDialog.prototype._highlightSelectedLine):
  • inspector/front-end/NetworkItemView.js: (WebInspector.NetworkItemView.prototype._tabSelected): (WebInspector.NetworkItemView.prototype._installHighlightSupport):
  • inspector/front-end/NetworkPanel.js: (WebInspector.NetworkPanel):
  • inspector/front-end/TabbedPane.js: (WebInspector.TabbedPane.prototype.appendTab): (WebInspector.TabbedPane.prototype.selectTab):
  • inspector/front-end/TextViewer.js: (WebInspector.TextViewer.prototype.highlightLine):
Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r84490 r84492  
     12011-04-21  Pavel Feldman  <pfeldman@google.com>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        Web Inspector: implement Go To Line for network panel.
     6        https://bugs.webkit.org/show_bug.cgi?id=59090
     7
     8        * inspector/front-end/GoToLineDialog.js:
     9        (WebInspector.GoToLineDialog.prototype._highlightSelectedLine):
     10        * inspector/front-end/NetworkItemView.js:
     11        (WebInspector.NetworkItemView.prototype._tabSelected):
     12        (WebInspector.NetworkItemView.prototype._installHighlightSupport):
     13        * inspector/front-end/NetworkPanel.js:
     14        (WebInspector.NetworkPanel):
     15        * inspector/front-end/TabbedPane.js:
     16        (WebInspector.TabbedPane.prototype.appendTab):
     17        (WebInspector.TabbedPane.prototype.selectTab):
     18        * inspector/front-end/TextViewer.js:
     19        (WebInspector.TextViewer.prototype.highlightLine):
     20
    1212011-04-21  Nikolas Zimmermann  <nzimmermann@rim.com>
    222
  • trunk/Source/WebCore/inspector/front-end/GoToLineDialog.js

    r84484 r84492  
    4646    this._input.setAttribute("type", "text");
    4747    this._input.setAttribute("size", 6);
    48     var linesCount = view.textModel.linesCount;
    49     if (linesCount)
    50         this._input.setAttribute("title", WebInspector.UIString("1 - %d", linesCount));
    5148    var blurHandler = this._onBlur.bind(this);
    5249    this._input.addEventListener("blur", blurHandler, false);
     
    132129        var value = this._input.value;
    133130        var lineNumber = parseInt(value, 10) - 1;
    134         if (!isNaN(lineNumber) && lineNumber >= 0) {
    135             lineNumber = Math.min(lineNumber, this._view.textModel.linesCount - 1);
     131        if (!isNaN(lineNumber) && lineNumber >= 0)
    136132            this._view.highlightLine(lineNumber);
    137         }
    138133    }
    139134};
  • trunk/Source/WebCore/inspector/front-end/NetworkItemView.js

    r81878 r84492  
    9090    _tabSelected: function(event)
    9191    {
    92         WebInspector.settings.resourceViewTab = event.data.tabId;
     92        if (event.data.isUserGesture)
     93            WebInspector.settings.resourceViewTab = event.data.tabId;
     94        this._installHighlightSupport(event.data.view);
     95    },
     96
     97    _installHighlightSupport: function(view)
     98    {
     99        if (typeof view.highlightLine === "function")
     100            this.highlightLine = view.highlightLine.bind(view);
     101        else
     102            delete this.highlightLine;
    93103    },
    94104
  • trunk/Source/WebCore/inspector/front-end/NetworkPanel.js

    r84484 r84492  
    8585    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, this._onResourceUpdated, this);
    8686    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.FrameCommittedLoad, this._onFrameCommitLoad, this);
     87
     88    this.registerShortcuts();
    8789}
    8890
  • trunk/Source/WebCore/inspector/front-end/TabbedPane.js

    r72655 r84492  
    4848        this._contentElement.appendChild(view.element);
    4949
    50         this._tabs[id] = { tabElement: tabElement, view: view }
     50        this._tabs[id] = { tabElement: tabElement, view: view };
    5151    },
    5252
     
    6464        this._showTab(tab);
    6565        this._currentTab = tab;
    66         if (userGesture) {
    67             var event = {tabId: id};
    68             this.dispatchEventToListeners("tab-selected", event);
    69         }
     66        var event = {tabId: id, view: tab.view, isUserGesture: userGesture};
     67        this.dispatchEventToListeners("tab-selected", event);
    7068        return true;
    7169    },
  • trunk/Source/WebCore/inspector/front-end/TextViewer.js

    r84136 r84492  
    109109    highlightLine: function(lineNumber)
    110110    {
     111        lineNumber = Math.min(lineNumber, this._textModel.linesCount - 1);
    111112        this._mainPanel.highlightLine(lineNumber);
    112113    },
Note: See TracChangeset for help on using the changeset viewer.