Commit 0f949982 authored by graouts@apple.com's avatar graouts@apple.com

Console buttons don’t show after page reload

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

Reviewed by Darin Adler.

The correct display of navigation items in the ContentBrowser is contingent on
the ContentViewContainer's _backForwardList being up-to-date when the navigation
items are retrieved from it. However, when the main resource changes (in this case
the user refreshes the browser), calls are made to ContentViewContainer's
closeAllContentViewsOfPrototype() which may modify the _backForwardList but doesn't
necessarily notify of a change to the currentContentView since we may be still showing
the same view in case it wasn't directly related to the main resource, for instance
the console log.

We now check if the _backForwardList is changed as a result of calling
closeAllContentViewsOfPrototype() and in that case also dispatch the
CurrentContentViewDidChange event which will restore the correct state
for the back/forward buttons and navigation items of the navigation bar.

* UserInterface/ContentViewContainer.js:
(WebInspector.ContentViewContainer.prototype.closeAllContentViewsOfPrototype):
Track changes to the _backForwardList and dispatch the CurrentContentViewDidChange
event in case such changes happened.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156727 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1c81affb
2013-10-01 Antoine Quint <graouts@apple.com>
Console buttons don’t show after page reload
https://bugs.webkit.org/show_bug.cgi?id=116515
Reviewed by Darin Adler.
The correct display of navigation items in the ContentBrowser is contingent on
the ContentViewContainer's _backForwardList being up-to-date when the navigation
items are retrieved from it. However, when the main resource changes (in this case
the user refreshes the browser), calls are made to ContentViewContainer's
closeAllContentViewsOfPrototype() which may modify the _backForwardList but doesn't
necessarily notify of a change to the currentContentView since we may be still showing
the same view in case it wasn't directly related to the main resource, for instance
the console log.
We now check if the _backForwardList is changed as a result of calling
closeAllContentViewsOfPrototype() and in that case also dispatch the
CurrentContentViewDidChange event which will restore the correct state
for the back/forward buttons and navigation items of the navigation bar.
* UserInterface/ContentViewContainer.js:
(WebInspector.ContentViewContainer.prototype.closeAllContentViewsOfPrototype):
Track changes to the _backForwardList and dispatch the CurrentContentViewDidChange
event in case such changes happened.
2013-09-30 Antoine Quint <graouts@apple.com> 2013-09-30 Antoine Quint <graouts@apple.com>
Web Inspector: rows in the Layer sidebar panel may have the incorrect background color Web Inspector: rows in the Layer sidebar panel may have the incorrect background color
......
...@@ -257,6 +257,7 @@ WebInspector.ContentViewContainer.prototype = { ...@@ -257,6 +257,7 @@ WebInspector.ContentViewContainer.prototype = {
var oldCurrentContentView = this.currentContentView; var oldCurrentContentView = this.currentContentView;
var backForwardListDidChange = false;
// Hide and disassociate with all the content views that are instances of the constructor. // Hide and disassociate with all the content views that are instances of the constructor.
for (var i = this._backForwardList.length - 1; i >= 0; --i) { for (var i = this._backForwardList.length - 1; i >= 0; --i) {
var contentView = this._backForwardList[i]; var contentView = this._backForwardList[i];
...@@ -276,12 +277,13 @@ WebInspector.ContentViewContainer.prototype = { ...@@ -276,12 +277,13 @@ WebInspector.ContentViewContainer.prototype = {
// Remove the item from the back/forward list. // Remove the item from the back/forward list.
this._backForwardList.splice(i, 1); this._backForwardList.splice(i, 1);
backForwardListDidChange = true;
} }
var currentContentView = this.currentContentView; var currentContentView = this.currentContentView;
console.assert(currentContentView || (!currentContentView && this._currentIndex === -1)); console.assert(currentContentView || (!currentContentView && this._currentIndex === -1));
if (currentContentView && currentContentView !== oldCurrentContentView) { if (currentContentView && (currentContentView !== oldCurrentContentView || backForwardListDidChange)) {
this._showContentView(currentContentView); this._showContentView(currentContentView);
this.dispatchEventToListeners(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange); this.dispatchEventToListeners(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment