Changeset 176136 in webkit


Ignore:
Timestamp:
Nov 14, 2014 1:28:53 PM (9 years ago)
Author:
mitz@apple.com
Message:

<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.

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:
Location:
trunk/Source
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r176135 r176136  
     12014-11-14  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/18978497> Wrong (off-by-1) navigation snapshots shown after a mix of gesture and button back/forward navigation
     4        https://bugs.webkit.org/show_bug.cgi?id=138753
     5
     6        Reviewed by Tim Horton.
     7
     8        Removed a FrameLoaderClient function that no one overrides anymore.
     9
     10        * loader/FrameLoaderClient.h:
     11        (WebCore::FrameLoaderClient::willChangeCurrentHistoryItem): Deleted.
     12        * loader/HistoryController.cpp:
     13        (WebCore::HistoryController::setCurrentItem): Removed call to willChangeCurrentHistoryItem.
     14        (WebCore::HistoryController::replaceCurrentItem): Ditto.
     15
    1162014-11-14  Jeremy Jones  <jeremyj@apple.com>
    217
  • trunk/Source/WebCore/loader/FrameLoaderClient.h

    r175055 r176136  
    209209        virtual void updateGlobalHistoryItemForPage() { }
    210210
    211         virtual void willChangeCurrentHistoryItem() { }
    212 
    213211        // This frame has set its opener to null, disowning it for the lifetime of the frame.
    214212        // See http://html.spec.whatwg.org/#dom-opener.
  • trunk/Source/WebCore/loader/HistoryController.cpp

    r174380 r176136  
    575575void HistoryController::setCurrentItem(HistoryItem* item)
    576576{
    577     m_frame.loader().client().willChangeCurrentHistoryItem();
    578 
    579577    m_frameLoadComplete = false;
    580578    m_previousItem = m_currentItem;
     
    890888    if (m_provisionalItem)
    891889        m_provisionalItem = item;
    892     else {
    893         m_frame.loader().client().willChangeCurrentHistoryItem();
     890    else
    894891        m_currentItem = item;
    895     }
    896892}
    897893
  • trunk/Source/WebKit2/ChangeLog

    r176133 r176136  
     12014-11-14  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/18978497> Wrong (off-by-1) navigation snapshots shown after a mix of gesture and button back/forward navigation
     4        https://bugs.webkit.org/show_bug.cgi?id=138753
     5
     6        Reviewed by Tim Horton.
     7
     8        Rather than having the UI process record a snapshot jut before the Web Content process’s
     9        notion of its current back/forward list item changes, have the UI process record a snapshot
     10        right before its own current back/forward list item changes. This ensures that the right
     11        snapshot gets attached to the right item in the UI process.
     12
     13        * UIProcess/WebBackForwardList.cpp:
     14        (WebKit::WebBackForwardList::addItem): If there is a current item, record a navigation
     15        snapshot of it before making the new item current.
     16        (WebKit::WebBackForwardList::goToItem): If there is a current item, record a navigation
     17        snapshot of it before making another item current.
     18
     19        * UIProcess/WebPageProxy.cpp:
     20        (WebKit::WebPageProxy::willChangeCurrentHistoryItemForMainFrame): Deleted.
     21        * UIProcess/WebPageProxy.h:
     22
     23        * UIProcess/WebPageProxy.messages.in: Removed willChangeCurrentHistoryItemForMainFrame
     24        message.
     25
     26        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     27        (WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem): Deleted.
     28        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Removed declaration of
     29        willChangeCurrentHistoryItem override.
     30
     31        * WebProcess/WebPage/WebPage.cpp:
     32        (WebKit::WebPage::willChangeCurrentHistoryItemForMainFrame): Deleted.
     33        * WebProcess/WebPage/WebPage.h:
     34
    1352014-11-14  Dan Bernstein  <mitz@apple.com>
    236
  • trunk/Source/WebKit2/UIProcess/WebBackForwardList.cpp

    r175360 r176136  
    9393   
    9494    if (m_hasCurrentIndex) {
     95        m_page->recordNavigationSnapshot();
     96
    9597        // Toss everything in the forward list.
    9698        unsigned targetSize = m_currentIndex + 1;
     
    178180    WebBackForwardListItem* currentItem = m_entries[m_currentIndex].get();
    179181    bool shouldKeepCurrentItem = true;
    180     if (currentItem != item)
     182    if (currentItem != item) {
     183        m_page->recordNavigationSnapshot();
    181184        shouldKeepCurrentItem = m_page->shouldKeepCurrentBackForwardListItemInList(m_entries[m_currentIndex].get());
     185    }
    182186
    183187    // If the client said to remove the current item, remove it and then update the target index.
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r176097 r176136  
    52995299}
    53005300
    5301 void WebPageProxy::willChangeCurrentHistoryItemForMainFrame()
    5302 {
    5303     recordNavigationSnapshot();
    5304 }
    5305 
    53065301void WebPageProxy::isPlayingAudioDidChange(bool newIsPlayingAudio)
    53075302{
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r176097 r176136  
    10781078#endif // ENABLE(NETSCAPE_PLUGIN_API)
    10791079    void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; }
    1080     void willChangeCurrentHistoryItemForMainFrame();
    10811080
    10821081    void reattachToWebProcess();
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in

    r176011 r176136  
    409409#endif
    410410
    411     WillChangeCurrentHistoryItemForMainFrame()
    412 
    413411#if ENABLE(CONTENT_FILTERING)
    414412    ContentFilterDidBlockLoadForFrame(WebCore::ContentFilter contentFilter, uint64_t frameID)
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r175549 r176136  
    16311631}
    16321632
    1633 void WebFrameLoaderClient::willChangeCurrentHistoryItem()
    1634 {
    1635     WebPage* webPage = m_frame->page();
    1636     if (!webPage)
    1637         return;
    1638     if (!m_frame->isMainFrame())
    1639         return;
    1640 
    1641     webPage->willChangeCurrentHistoryItemForMainFrame();
    1642 }
    1643 
    16441633#if ENABLE(CONTENT_FILTERING)
    16451634void WebFrameLoaderClient::contentFilterDidBlockLoad(std::unique_ptr<WebCore::ContentFilter> contentFilter)
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h

    r175055 r176136  
    131131   
    132132    virtual bool shouldGoToHistoryItem(WebCore::HistoryItem*) const override;
    133     virtual void willChangeCurrentHistoryItem() override;
    134133
    135134    virtual void didDisplayInsecureContent() override;
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r176086 r176136  
    48124812}
    48134813
    4814 void WebPage::willChangeCurrentHistoryItemForMainFrame()
    4815 {
    4816     send(Messages::WebPageProxy::WillChangeCurrentHistoryItemForMainFrame());
    4817 }
    4818 
    48194814} // namespace WebKit
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r176086 r176136  
    845845    void didChangeScrollOffsetForFrame(WebCore::Frame*);
    846846
    847     void willChangeCurrentHistoryItemForMainFrame();
    848 
    849847private:
    850848    WebPage(uint64_t pageID, const WebPageCreationParameters&);
Note: See TracChangeset for help on using the changeset viewer.