Changeset 172038 in webkit


Ignore:
Timestamp:
Aug 5, 2014 11:29:42 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: shown() called on a content view when stepping over an instruction in the debugger
https://bugs.webkit.org/show_bug.cgi?id=135311

Patch by Saam Barati <sbarati@apple.com> on 2014-08-05
Reviewed by Timothy Hatcher.

ContentViewContainer should not repeatedly call ContentView.prototype.shown
on ContentViews that are already visible. ContentViewContainer now passes
a flag to BackForwardEntry.prototype.prepareToShow indicating whether it should
call the shown function on the ContentView it is about to display.
ContentViewContainer.prototype.showBackForwardEntryForIndex passes in this
flag based on its ContentView being visible.

  • UserInterface/Models/BackForwardEntry.js:

(WebInspector.BackForwardEntry.prototype.prepareToShow):

  • UserInterface/Views/ContentViewContainer.js:

(WebInspector.ContentViewContainer.prototype.showBackForwardEntryForIndex):
(WebInspector.ContentViewContainer.prototype.replaceContentView):
(WebInspector.ContentViewContainer.prototype.closeAllContentViewsOfPrototype):
(WebInspector.ContentViewContainer.prototype.shown):
(WebInspector.ContentViewContainer.prototype._showEntry):

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r171940 r172038  
     12014-08-05  Saam Barati  <sbarati@apple.com>
     2
     3        Web Inspector: shown() called on a content view when stepping over an instruction in the debugger
     4        https://bugs.webkit.org/show_bug.cgi?id=135311
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        ContentViewContainer should not repeatedly call ContentView.prototype.shown
     9        on ContentViews that are already visible. ContentViewContainer now passes
     10        a flag to BackForwardEntry.prototype.prepareToShow indicating whether it should
     11        call the shown function on the ContentView it is about to display.
     12        ContentViewContainer.prototype.showBackForwardEntryForIndex passes in this
     13        flag based on its ContentView being visible.
     14
     15        * UserInterface/Models/BackForwardEntry.js:
     16        (WebInspector.BackForwardEntry.prototype.prepareToShow):
     17        * UserInterface/Views/ContentViewContainer.js:
     18        (WebInspector.ContentViewContainer.prototype.showBackForwardEntryForIndex):
     19        (WebInspector.ContentViewContainer.prototype.replaceContentView):
     20        (WebInspector.ContentViewContainer.prototype.closeAllContentViewsOfPrototype):
     21        (WebInspector.ContentViewContainer.prototype.shown):
     22        (WebInspector.ContentViewContainer.prototype._showEntry):
     23
    1242014-08-01  Jonathan Wells  <jonowells@apple.com>
    225
  • trunk/Source/WebInspectorUI/UserInterface/Models/BackForwardEntry.js

    r164543 r172038  
    5353    },
    5454
    55     prepareToShow: function()
     55    prepareToShow: function(shouldCallShown)
    5656    {
    5757        this._restoreFromCookie();
    5858
    5959        this.contentView.visible = true;
    60         this.contentView.shown();
     60        if (shouldCallShown)
     61            this.contentView.shown();
    6162        this.contentView.updateLayout();
    6263    },
  • trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js

    r164543 r172038  
    191191            return;
    192192
    193         // Hide the currently visible content view.
    194193        var previousEntry = this.currentBackForwardEntry;
    195         if (previousEntry)
    196             this._hideEntry(previousEntry);
    197 
    198194        this._currentIndex = index;
    199195        var currentEntry = this.currentBackForwardEntry;
    200196        console.assert(currentEntry);
    201197
    202         this._showEntry(currentEntry);
     198        var isNewContentView = !previousEntry || !currentEntry.contentView.visible;
     199        if (isNewContentView) {
     200            // Hide the currently visible content view.
     201            if (previousEntry)
     202                this._hideEntry(previousEntry);
     203            this._showEntry(currentEntry, true);
     204        } else
     205            this._showEntry(currentEntry, false);
    203206
    204207        this.dispatchEventToListeners(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange);
     
    241244        // Re-show the current entry, because its content view instance was replaced.
    242245        if (currentlyShowing) {
    243             this._showEntry(this.currentBackForwardEntry);
     246            this._showEntry(this.currentBackForwardEntry, true);
    244247            this.dispatchEventToListeners(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange);
    245248        }
     
    297300
    298301        if (currentEntry && currentEntry.contentView !== oldCurrentContentView || backForwardListDidChange) {
    299             this._showEntry(currentEntry);
     302            this._showEntry(currentEntry, true);
    300303            this.dispatchEventToListeners(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange);
    301304        }
     
    353356            return;
    354357
    355         this._showEntry(currentEntry);
     358        this._showEntry(currentEntry, true);
    356359    },
    357360
     
    394397    },
    395398
    396     _showEntry: function(entry)
     399    _showEntry: function(entry, shouldCallShown)
    397400    {
    398401        console.assert(entry instanceof WebInspector.BackForwardEntry);
    399402
    400403        this._addContentViewElement(entry.contentView);
    401         entry.prepareToShow();
     404        entry.prepareToShow(shouldCallShown);
    402405    },
    403406
Note: See TracChangeset for help on using the changeset viewer.