Changeset 162564 in webkit


Ignore:
Timestamp:
Jan 22, 2014 3:27:06 PM (10 years ago)
Author:
timothy@apple.com
Message:

Improve collapsing of TimelineDataGridNode graphs up to ancestors.

https://bugs.webkit.org/show_bug.cgi?id=127440

Reviewed by Joseph Pecoraro.

  • UserInterface/TimelineDataGridNode.js:

(WebInspector.TimelineDataGridNode.prototype.collapse):
(WebInspector.TimelineDataGridNode.prototype.createCellContent):
(WebInspector.TimelineDataGridNode.prototype.refresh):
(WebInspector.TimelineDataGridNode.prototype.needsGraphRefresh):
Notify the next visible ancestor it needs to refresh. Use needsGraphRefresh so ancestors
are notified instead of directly calling refreshGraph in some places.

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r162561 r162564  
     12014-01-22  Timothy Hatcher  <timothy@apple.com>
     2
     3        Improve collapsing of TimelineDataGridNode graphs up to ancestors.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=127440
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        * UserInterface/TimelineDataGridNode.js:
     10        (WebInspector.TimelineDataGridNode.prototype.collapse):
     11        (WebInspector.TimelineDataGridNode.prototype.createCellContent):
     12        (WebInspector.TimelineDataGridNode.prototype.refresh):
     13        (WebInspector.TimelineDataGridNode.prototype.needsGraphRefresh):
     14        Notify the next visible ancestor it needs to refresh. Use needsGraphRefresh so ancestors
     15        are notified instead of directly calling refreshGraph in some places.
     16
    1172014-01-22  Timothy Hatcher  <timothy@apple.com>
    218
  • trunk/Source/WebInspectorUI/UserInterface/TimelineDataGridNode.js

    r162560 r162564  
    6969        WebInspector.DataGridNode.prototype.collapse.call(this);
    7070
     71        if (!this.revealed)
     72            return;
     73
    7174        // Refresh to show child bars in our graph now that we collapsed.
    7275        this.refreshGraph();
     
    9598    {
    9699        if (columnIdentifier === "graph" && this._graphDataSource) {
    97             this.refreshGraph();
     100            this.needsGraphRefresh();
    98101            return this._graphContainerElement;
    99102        }
     
    209212    {
    210213        if (this._graphDataSource && this._graphOnly) {
    211             this.refreshGraph();
     214            this.needsGraphRefresh();
    212215            return;
    213216        }
     
    226229        }
    227230
    228         if (!this.revealed) {
    229             // We are not visible, but an ancestor will be drawing our graph.
    230             // Notify the next visible ancestor to refresh their graph.
    231             var ancestor = this;
    232             while (ancestor && !ancestor.root) {
    233                 if (ancestor.revealed && ancestor instanceof WebInspector.TimelineDataGridNode) {
    234                     ancestor.refreshGraph();
    235                     return;
    236                 }
    237 
    238                 ancestor = ancestor.parent;
    239             }
    240 
    241             return;
    242         }
     231        // We are not visible, but an ancestor will draw our graph.
     232        // They need notified by using our needsGraphRefresh.
     233        console.assert(this.revealed);
     234        if (!this.revealed)
     235            return;
    243236
    244237        var startTime = this._graphDataSource.startTime;
     
    337330    needsGraphRefresh: function()
    338331    {
     332        if (!this.revealed) {
     333            // We are not visible, but an ancestor will be drawing our graph.
     334            // Notify the next visible ancestor that their graph needs to refresh.
     335            var ancestor = this;
     336            while (ancestor && !ancestor.root) {
     337                if (ancestor.revealed && ancestor instanceof WebInspector.TimelineDataGridNode) {
     338                    ancestor.needsGraphRefresh();
     339                    return;
     340                }
     341
     342                ancestor = ancestor.parent;
     343            }
     344
     345            return;
     346        }
     347
    339348        if (!this._graphDataSource || this._scheduledGraphRefreshIdentifier)
    340349            return;
Note: See TracChangeset for help on using the changeset viewer.