Changeset 53188 in webkit


Ignore:
Timestamp:
Jan 13, 2010 8:31:49 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-01-13 Ilya Tikhonovsky <loislo@chromium.org>

Reviewed by Pavel Feldman.

WebInspector: Timeline panel scrolling speed can be increased.
https://bugs.webkit.org/show_bug.cgi?id=33579

Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r53187 r53188  
     12010-01-13  Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        WebInspector: Timeline panel scrolling speed can be increased.
     6        https://bugs.webkit.org/show_bug.cgi?id=33579
     7
     8        * inspector/front-end/TimelinePanel.js:
     9        (WebInspector.TimelinePanel):
     10        (WebInspector.TimelinePanel.prototype._scheduleRefresh):
     11        (WebInspector.TimelinePanel.prototype._refresh):
     12        (WebInspector.TimelinePanel.prototype._refreshRecords):
     13
    1142010-01-13  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
    215
  • trunk/WebCore/inspector/front-end/TimelinePanel.js

    r51528 r53188  
    3535
    3636    this._overviewPane = new WebInspector.TimelineOverviewPane(this.categories);
    37     this._overviewPane.addEventListener("window changed", this._scheduleRefresh, this);
     37    this._overviewPane.addEventListener("window changed", this._windowChanged, this);
    3838    this._overviewPane.addEventListener("filter changed", this._refresh, this);
    3939    this.element.appendChild(this._overviewPane.element);
     
    8181    this._sendRequestRecords = {};
    8282    this._calculator = new WebInspector.TimelineCalculator();
     83    this._boundariesAreValid = true;
    8384}
    8485
     
    292293    },
    293294
    294     _scheduleRefresh: function(immediate)
    295     {
     295    _windowChanged: function()
     296    {
     297        this._scheduleRefresh();
     298    },
     299 
     300    _scheduleRefresh: function(preserveBoundaries)
     301    {
     302        this._boundariesAreValid &= preserveBoundaries;
    296303        if (this._needsRefresh)
    297304            return;
     
    299306
    300307        if (this.visible && !("_refreshTimeout" in this))
    301             this._refreshTimeout = setTimeout(this._refresh.bind(this), immediate ? 0 : 100);
     308            this._refreshTimeout = setTimeout(this._refresh.bind(this), preserveBoundaries ? 0 : 100);
    302309    },
    303310
     
    309316            delete this._refreshTimeout;
    310317        }
    311         this._overviewPane.update(this._records);
    312         this._refreshRecords();
    313     },
    314 
    315     _refreshRecords: function()
    316     {
    317         this._calculator.windowLeft = this._overviewPane.windowLeft;
    318         this._calculator.windowRight = this._overviewPane.windowRight;
    319         this._calculator.reset();
    320 
    321         for (var i = 0; i < this._records.length; ++i)
    322             this._calculator.updateBoundaries(this._records[i]);
     318     
     319        if (!this._boundariesAreValid)
     320            this._overviewPane.update(this._records);
     321        this._refreshRecords(!this._boundariesAreValid);
     322        this._boundariesAreValid = true;
     323    },
     324
     325    _refreshRecords: function(updateBoundaries)
     326    {
     327        if (updateBoundaries) {
     328            this._calculator.windowLeft = this._overviewPane.windowLeft;
     329            this._calculator.windowRight = this._overviewPane.windowRight;
     330            this._calculator.reset();
     331
     332            for (var i = 0; i < this._records.length; ++i)
     333                this._calculator.updateBoundaries(this._records[i]);
     334        }
    323335
    324336        var recordsInWindow = [];
     
    392404        // Reserve some room for expand / collapse controls to the left for records that start at 0ms.
    393405        var timelinePaddingLeft = this._calculator.windowLeft === 0 ? expandOffset : 0;
    394         this._timelineGrid.updateDividers(true, this._calculator, timelinePaddingLeft);
     406        if (updateBoundaries)
     407            this._timelineGrid.updateDividers(true, this._calculator, timelinePaddingLeft);
    395408        this._adjustScrollPosition((recordsInWindow.length + 1) * rowHeight);
    396409    },
Note: See TracChangeset for help on using the changeset viewer.