Skip to content

Commit

Permalink
Merge r186287 - [WK2] WebBackForwardListItems' pageState is not kept …
Browse files Browse the repository at this point in the history
…up-to-date

https://bugs.webkit.org/show_bug.cgi?id=146614
<rdar://problem/21585268>

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):
  • Loading branch information
cdumez authored and carlosgcampos committed Jul 7, 2015
1 parent e92b828 commit 724ced4
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,27 @@
2015-07-05 Chris Dumez <cdumez@apple.com>

[WK2] WebBackForwardListItems' pageState is not kept up-to-date
https://bugs.webkit.org/show_bug.cgi?id=146614
<rdar://problem/21585268>

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 <cdumez@apple.com>

REGRESSION (r178097): HTMLSelectElement.add(option, undefined) prepends option to the list of options; should append to the end of the list of options
Expand Down
5 changes: 5 additions & 0 deletions Source/WebCore/history/HistoryItem.cpp
Expand Up @@ -571,6 +571,11 @@ void HistoryItem::setRedirectURLs(std::unique_ptr<Vector<String>> redirectURLs)
m_redirectURLs = WTF::move(redirectURLs);
}

void HistoryItem::notifyChanged()
{
notifyHistoryItemChanged(this);
}

#ifndef NDEBUG

int HistoryItem::showTree() const
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/history/HistoryItem.h
Expand Up @@ -206,6 +206,8 @@ class HistoryItem : public RefCounted<HistoryItem> {
void setSharedLinkUniqueIdentifier(const String& sharedLinkUniqueidentifier) { m_sharedLinkUniqueIdentifier = sharedLinkUniqueidentifier; }
#endif

void notifyChanged();

private:
WEBCORE_EXPORT HistoryItem();
WEBCORE_EXPORT HistoryItem(const String& urlString, const String& title);
Expand Down
3 changes: 3 additions & 0 deletions Source/WebCore/loader/HistoryController.cpp
Expand Up @@ -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()
Expand Down

0 comments on commit 724ced4

Please sign in to comment.