https://bugs.webkit.org/show_bug.cgi?id=138753
Reviewed by Tim Horton.
Source/WebCore:
Removed a FrameLoaderClient function that no one overrides anymore.
* loader/FrameLoaderClient.h:
(WebCore::FrameLoaderClient::willChangeCurrentHistoryItem): Deleted.
* loader/HistoryController.cpp:
(WebCore::HistoryController::setCurrentItem): Removed call to willChangeCurrentHistoryItem.
(WebCore::HistoryController::replaceCurrentItem): Ditto.
Source/WebKit2:
Rather than having the UI process record a snapshot jut before the Web Content process’s
notion of its current back/forward list item changes, have the UI process record a snapshot
right before its own current back/forward list item changes. This ensures that the right
snapshot gets attached to the right item in the UI process.
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::addItem): If there is a current item, record a navigation
snapshot of it before making the new item current.
(WebKit::WebBackForwardList::goToItem): If there is a current item, record a navigation
snapshot of it before making another item current.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::willChangeCurrentHistoryItemForMainFrame): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in: Removed willChangeCurrentHistoryItemForMainFrame
message.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem): Deleted.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Removed declaration of
willChangeCurrentHistoryItem override.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::willChangeCurrentHistoryItemForMainFrame): Deleted.
* WebProcess/WebPage/WebPage.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176136
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-11-14 Dan Bernstein <mitz@apple.com>
+
+ <rdar://problem/18978497> Wrong (off-by-1) navigation snapshots shown after a mix of gesture and button back/forward navigation
+ https://bugs.webkit.org/show_bug.cgi?id=138753
+
+ Reviewed by Tim Horton.
+
+ Removed a FrameLoaderClient function that no one overrides anymore.
+
+ * loader/FrameLoaderClient.h:
+ (WebCore::FrameLoaderClient::willChangeCurrentHistoryItem): Deleted.
+ * loader/HistoryController.cpp:
+ (WebCore::HistoryController::setCurrentItem): Removed call to willChangeCurrentHistoryItem.
+ (WebCore::HistoryController::replaceCurrentItem): Ditto.
+
2014-11-14 Jeremy Jones <jeremyj@apple.com>
Do proper teardown for optimized fullscreen
virtual bool shouldGoToHistoryItem(HistoryItem*) const = 0;
virtual void updateGlobalHistoryItemForPage() { }
- virtual void willChangeCurrentHistoryItem() { }
-
// This frame has set its opener to null, disowning it for the lifetime of the frame.
// See http://html.spec.whatwg.org/#dom-opener.
// FIXME: JSC should allow disowning opener. - <https://bugs.webkit.org/show_bug.cgi?id=103913>.
void HistoryController::setCurrentItem(HistoryItem* item)
{
- m_frame.loader().client().willChangeCurrentHistoryItem();
-
m_frameLoadComplete = false;
m_previousItem = m_currentItem;
m_currentItem = item;
m_previousItem = nullptr;
if (m_provisionalItem)
m_provisionalItem = item;
- else {
- m_frame.loader().client().willChangeCurrentHistoryItem();
+ else
m_currentItem = item;
- }
}
} // namespace WebCore
2014-11-14 Dan Bernstein <mitz@apple.com>
+ <rdar://problem/18978497> Wrong (off-by-1) navigation snapshots shown after a mix of gesture and button back/forward navigation
+ https://bugs.webkit.org/show_bug.cgi?id=138753
+
+ Reviewed by Tim Horton.
+
+ Rather than having the UI process record a snapshot jut before the Web Content process’s
+ notion of its current back/forward list item changes, have the UI process record a snapshot
+ right before its own current back/forward list item changes. This ensures that the right
+ snapshot gets attached to the right item in the UI process.
+
+ * UIProcess/WebBackForwardList.cpp:
+ (WebKit::WebBackForwardList::addItem): If there is a current item, record a navigation
+ snapshot of it before making the new item current.
+ (WebKit::WebBackForwardList::goToItem): If there is a current item, record a navigation
+ snapshot of it before making another item current.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::willChangeCurrentHistoryItemForMainFrame): Deleted.
+ * UIProcess/WebPageProxy.h:
+
+ * UIProcess/WebPageProxy.messages.in: Removed willChangeCurrentHistoryItemForMainFrame
+ message.
+
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem): Deleted.
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Removed declaration of
+ willChangeCurrentHistoryItem override.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::willChangeCurrentHistoryItemForMainFrame): Deleted.
+ * WebProcess/WebPage/WebPage.h:
+
+2014-11-14 Dan Bernstein <mitz@apple.com>
+
Add some tracing to help investigating <rdar://problem/18905383> [iOS] Crash due to null m_webPageProxyForBackForwardListForCurrentSwipe in ViewGestureController::endSwipeGesture
https://bugs.webkit.org/show_bug.cgi?id=138750
Vector<RefPtr<WebBackForwardListItem>> removedItems;
if (m_hasCurrentIndex) {
+ m_page->recordNavigationSnapshot();
+
// Toss everything in the forward list.
unsigned targetSize = m_currentIndex + 1;
removedItems.reserveCapacity(m_entries.size() - targetSize);
// item should remain in the list.
WebBackForwardListItem* currentItem = m_entries[m_currentIndex].get();
bool shouldKeepCurrentItem = true;
- if (currentItem != item)
+ if (currentItem != item) {
+ m_page->recordNavigationSnapshot();
shouldKeepCurrentItem = m_page->shouldKeepCurrentBackForwardListItemInList(m_entries[m_currentIndex].get());
+ }
// If the client said to remove the current item, remove it and then update the target index.
Vector<RefPtr<WebBackForwardListItem>> removedItems;
m_isShowingNavigationGestureSnapshot = false;
}
-void WebPageProxy::willChangeCurrentHistoryItemForMainFrame()
-{
- recordNavigationSnapshot();
-}
-
void WebPageProxy::isPlayingAudioDidChange(bool newIsPlayingAudio)
{
if (m_isPlayingAudio == newIsPlayingAudio)
void didBlockInsecurePluginVersion(const String& mimeType, const String& pluginURLString, const String& frameURLString, const String& pageURLString, bool replacementObscured);
#endif // ENABLE(NETSCAPE_PLUGIN_API)
void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; }
- void willChangeCurrentHistoryItemForMainFrame();
void reattachToWebProcess();
uint64_t reattachToWebProcessWithItem(WebBackForwardListItem*);
DidFinishLoadForQuickLookDocumentInMainFrame(WebKit::QuickLookDocumentData data)
#endif
- WillChangeCurrentHistoryItemForMainFrame()
-
#if ENABLE(CONTENT_FILTERING)
ContentFilterDidBlockLoadForFrame(WebCore::ContentFilter contentFilter, uint64_t frameID)
#endif
return context.release();
}
-void WebFrameLoaderClient::willChangeCurrentHistoryItem()
-{
- WebPage* webPage = m_frame->page();
- if (!webPage)
- return;
- if (!m_frame->isMainFrame())
- return;
-
- webPage->willChangeCurrentHistoryItemForMainFrame();
-}
-
#if ENABLE(CONTENT_FILTERING)
void WebFrameLoaderClient::contentFilterDidBlockLoad(std::unique_ptr<WebCore::ContentFilter> contentFilter)
{
virtual void updateGlobalHistoryRedirectLinks() override;
virtual bool shouldGoToHistoryItem(WebCore::HistoryItem*) const override;
- virtual void willChangeCurrentHistoryItem() override;
virtual void didDisplayInsecureContent() override;
virtual void didRunInsecureContent(WebCore::SecurityOrigin*, const WebCore::URL&) override;
updateMainFrameScrollOffsetPinning();
}
-void WebPage::willChangeCurrentHistoryItemForMainFrame()
-{
- send(Messages::WebPageProxy::WillChangeCurrentHistoryItemForMainFrame());
-}
-
} // namespace WebKit
void didChangeScrollOffsetForFrame(WebCore::Frame*);
- void willChangeCurrentHistoryItemForMainFrame();
-
private:
WebPage(uint64_t pageID, const WebPageCreationParameters&);