Title: [172038] trunk/Source/WebInspectorUI
Revision
172038
Author
commit-qu...@webkit.org
Date
2014-08-05 11:29:42 -0700 (Tue, 05 Aug 2014)

Log 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 <sbar...@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):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (172037 => 172038)


--- trunk/Source/WebInspectorUI/ChangeLog	2014-08-05 18:27:40 UTC (rev 172037)
+++ trunk/Source/WebInspectorUI/ChangeLog	2014-08-05 18:29:42 UTC (rev 172038)
@@ -1,3 +1,26 @@
+2014-08-05  Saam Barati  <sbar...@apple.com>
+
+        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
+
+        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):
+
 2014-08-01  Jonathan Wells  <jonowe...@apple.com>
 
         Web Inspector: Timeline header height doesn't match style updates.

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/BackForwardEntry.js (172037 => 172038)


--- trunk/Source/WebInspectorUI/UserInterface/Models/BackForwardEntry.js	2014-08-05 18:27:40 UTC (rev 172037)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/BackForwardEntry.js	2014-08-05 18:29:42 UTC (rev 172038)
@@ -52,12 +52,13 @@
         return Object.shallowCopy(this._cookie);
     },
 
-    prepareToShow: function()
+    prepareToShow: function(shouldCallShown)
     {
         this._restoreFromCookie();
 
         this.contentView.visible = true;
-        this.contentView.shown();
+        if (shouldCallShown)
+            this.contentView.shown();
         this.contentView.updateLayout();
     },
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js (172037 => 172038)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js	2014-08-05 18:27:40 UTC (rev 172037)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js	2014-08-05 18:29:42 UTC (rev 172038)
@@ -190,16 +190,19 @@
         if (this._currentIndex === index)
             return;
 
-        // Hide the currently visible content view.
         var previousEntry = this.currentBackForwardEntry;
-        if (previousEntry)
-            this._hideEntry(previousEntry);
-
         this._currentIndex = index;
         var currentEntry = this.currentBackForwardEntry;
         console.assert(currentEntry);
 
-        this._showEntry(currentEntry);
+        var isNewContentView = !previousEntry || !currentEntry.contentView.visible;
+        if (isNewContentView) {
+            // Hide the currently visible content view.
+            if (previousEntry)
+                this._hideEntry(previousEntry);
+            this._showEntry(currentEntry, true);
+        } else
+            this._showEntry(currentEntry, false);
 
         this.dispatchEventToListeners(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange);
     },
@@ -240,7 +243,7 @@
 
         // Re-show the current entry, because its content view instance was replaced.
         if (currentlyShowing) {
-            this._showEntry(this.currentBackForwardEntry);
+            this._showEntry(this.currentBackForwardEntry, true);
             this.dispatchEventToListeners(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange);
         }
     },
@@ -296,7 +299,7 @@
         console.assert(currentEntry || (!currentEntry && this._currentIndex === -1));
 
         if (currentEntry && currentEntry.contentView !== oldCurrentContentView || backForwardListDidChange) {
-            this._showEntry(currentEntry);
+            this._showEntry(currentEntry, true);
             this.dispatchEventToListeners(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange);
         }
     },
@@ -352,7 +355,7 @@
         if (!currentEntry)
             return;
 
-        this._showEntry(currentEntry);
+        this._showEntry(currentEntry, true);
     },
 
     hidden: function()
@@ -393,12 +396,12 @@
         contentView.closed();
     },
 
-    _showEntry: function(entry)
+    _showEntry: function(entry, shouldCallShown)
     {
         console.assert(entry instanceof WebInspector.BackForwardEntry);
 
         this._addContentViewElement(entry.contentView);
-        entry.prepareToShow();
+        entry.prepareToShow(shouldCallShown);
     },
 
     _hideEntry: function(entry)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to