Changeset 61801 in webkit


Ignore:
Timestamp:
Jun 24, 2010 4:58:36 PM (14 years ago)
Author:
ap@apple.com
Message:

Reviewed by Brady Eidson.

https://bugs.webkit.org/show_bug.cgi?id=41178
Timed refresh in subframes isn't stopped when going into b/f cache

Test: fast/history/timed-refresh-in-cached-frame.html

  • history/CachedFrame.cpp: (WebCore::CachedFrame::CachedFrame): Top frame's stopLoading() won't help cached subframes; stop loading from here.
  • loader/FrameLoader.cpp: (WebCore::FrameLoader::stopLoading): Don't stop loading in child frames. This didn't work for cached frames due to frame tree having been already desonstructed, and it's not necessary in non-cached case because stopLoading() will be called for subframes via FrameLoader::detachFromParent() and closeURL(). (WebCore::FrameLoader::pageHidden): This was a second code path that dispatched pagehide event - it's no longer needed, because everything goes through FrameLoader::stopLoading(). (WebCore::FrameLoader::commitProvisionalLoad): Don't call pageHidden(), the code for adding frame to b/f cache will do everything.
  • loader/FrameLoader.h: Removed pageHidden().
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r61800 r61801  
     12010-06-24  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Reviewed by Brady Eidson.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=41178
     6        Timed refresh in subframes isn't stopped when going into b/f cache
     7
     8        This is a slow test, because a fast redirect results in replacing the current item in b/f
     9        list, so back/forward cache doesn't get involved. But this code path must be tested.
     10
     11        * fast/history/timed-refresh-in-cached-frame-expected.txt: Added.
     12        * fast/history/timed-refresh-in-cached-frame.html: Added.
     13
    1142010-06-24  Peter Kasting  <pkasting@google.com>
    215
  • trunk/WebCore/ChangeLog

    r61799 r61801  
     12010-06-24  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Reviewed by Brady Eidson.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=41178
     6        Timed refresh in subframes isn't stopped when going into b/f cache
     7
     8        Test: fast/history/timed-refresh-in-cached-frame.html
     9
     10        * history/CachedFrame.cpp: (WebCore::CachedFrame::CachedFrame): Top frame's stopLoading()
     11        won't help cached subframes; stop loading from here.
     12
     13        * loader/FrameLoader.cpp:
     14        (WebCore::FrameLoader::stopLoading): Don't stop loading in child frames. This didn't work
     15        for cached frames due to frame tree having been already desonstructed, and it's not necessary
     16        in non-cached case because stopLoading() will be called for subframes via
     17        FrameLoader::detachFromParent() and closeURL().
     18        (WebCore::FrameLoader::pageHidden): This was a second code path that dispatched pagehide
     19        event - it's no longer needed, because everything goes through FrameLoader::stopLoading().
     20        (WebCore::FrameLoader::commitProvisionalLoad): Don't call pageHidden(), the code for adding
     21        frame to b/f cache will do everything.
     22
     23        * loader/FrameLoader.h: Removed pageHidden().
     24
    1252010-06-24  Eric Seidel  <eric@webkit.org>
    226
  • trunk/WebCore/history/CachedFrame.cpp

    r56825 r61801  
    130130    m_view->detachCustomScrollbars();
    131131
    132     m_document->documentWillBecomeInactive(); 
     132    m_document->documentWillBecomeInactive();
    133133    frame->clearTimers();
    134134    m_document->setInPageCache(true);
     135    frame->loader()->stopLoading(UnloadEventPolicyUnloadAndPageHide);
    135136   
    136137    frame->loader()->client()->savePlatformDataToCachedFrame(this);
  • trunk/WebCore/loader/FrameLoader.cpp

    r61584 r61801  
    492492    }
    493493
    494     // tell all subframes to stop as well
    495     for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling())
    496         child->loader()->stopLoading(unloadEventPolicy);
    497 
     494    // FIXME: This will cancel redirection timer, which really needs to be restarted when restoring the frame from b/f cache.
    498495    m_frame->redirectScheduler()->cancel();
    499496}
     
    18901887    // We are doing this here because we know for sure that a new page is about to be loaded.
    18911888    HistoryItem* item = history()->currentItem();
    1892     if (!m_frame->tree()->parent() && PageCache::canCache(m_frame->page()) && !item->isInPageCache()) {
    1893         pageHidden();
     1889    if (!m_frame->tree()->parent() && PageCache::canCache(m_frame->page()) && !item->isInPageCache())
    18941890        pageCache()->add(item, m_frame->page());
    1895     }
    18961891   
    18971892    if (m_loadType != FrameLoadTypeReplace)
     
    31273122    provisionalLoader->setCommitted(true);
    31283123    commitProvisionalLoad();
    3129 }
    3130 
    3131 void FrameLoader::pageHidden()
    3132 {
    3133     m_pageDismissalEventBeingDispatched = true;
    3134     if (m_frame->domWindow())
    3135         m_frame->domWindow()->dispatchEvent(PageTransitionEvent::create(eventNames().pagehideEvent, true), m_frame->document());
    3136     m_pageDismissalEventBeingDispatched = false;
    3137 
    3138     // Send pagehide event for subframes as well
    3139     for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling())
    3140         child->loader()->pageHidden();
    31413124}
    31423125
  • trunk/WebCore/loader/FrameLoader.h

    r61584 r61801  
    346346   
    347347    void loadProvisionalItemFromCachedPage();
    348     void pageHidden();
    349348
    350349    void receivedFirstData();
Note: See TracChangeset for help on using the changeset viewer.