diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 4e1159cd3a9e..94d52a683cf9 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,27 @@ +2015-07-05 Chris Dumez + + [WK2] WebBackForwardListItems' pageState is not kept up-to-date + https://bugs.webkit.org/show_bug.cgi?id=146614 + + + Reviewed by Gavin Barraclough. + + WebBackForwardListItems' pageState on UIProcess-side were not kept + up-to-date when it was updated on WebContent process side. This meant + that we were losing the scroll position (among other things) when + transferring the session state over from one view to another. + + We now call notifyHistoryItemChanged(item) after saving the scroll + position and the view state on the HistoryItem. As a result, the + WebBackForwardListProxy will send the updated pageState to the + UIProcess. + + * history/HistoryItem.cpp: + (WebCore::HistoryItem::notifyChanged): + * history/HistoryItem.h: + * loader/HistoryController.cpp: + (WebCore::HistoryController::saveScrollPositionAndViewStateToItem): + 2015-07-03 Chris Dumez REGRESSION (r178097): HTMLSelectElement.add(option, undefined) prepends option to the list of options; should append to the end of the list of options diff --git a/Source/WebCore/history/HistoryItem.cpp b/Source/WebCore/history/HistoryItem.cpp index 229bab8e7a23..3fa631f7dba6 100644 --- a/Source/WebCore/history/HistoryItem.cpp +++ b/Source/WebCore/history/HistoryItem.cpp @@ -571,6 +571,11 @@ void HistoryItem::setRedirectURLs(std::unique_ptr> redirectURLs) m_redirectURLs = WTF::move(redirectURLs); } +void HistoryItem::notifyChanged() +{ + notifyHistoryItemChanged(this); +} + #ifndef NDEBUG int HistoryItem::showTree() const diff --git a/Source/WebCore/history/HistoryItem.h b/Source/WebCore/history/HistoryItem.h index 4d843c48f2f5..b3f6ba5e6b31 100644 --- a/Source/WebCore/history/HistoryItem.h +++ b/Source/WebCore/history/HistoryItem.h @@ -206,6 +206,8 @@ class HistoryItem : public RefCounted { void setSharedLinkUniqueIdentifier(const String& sharedLinkUniqueidentifier) { m_sharedLinkUniqueIdentifier = sharedLinkUniqueidentifier; } #endif + void notifyChanged(); + private: WEBCORE_EXPORT HistoryItem(); WEBCORE_EXPORT HistoryItem(const String& urlString, const String& title); diff --git a/Source/WebCore/loader/HistoryController.cpp b/Source/WebCore/loader/HistoryController.cpp index d4610cae9274..fcdfc24f6678 100644 --- a/Source/WebCore/loader/HistoryController.cpp +++ b/Source/WebCore/loader/HistoryController.cpp @@ -90,6 +90,9 @@ void HistoryController::saveScrollPositionAndViewStateToItem(HistoryItem* item) // FIXME: It would be great to work out a way to put this code in WebCore instead of calling through to the client. m_frame.loader().client().saveViewStateToItem(item); + + // Notify clients that the HistoryItem has changed. + item->notifyChanged(); } void HistoryController::clearScrollPositionAndViewState()