Changeset 67878 in webkit


Ignore:
Timestamp:
Sep 20, 2010 1:20:25 PM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-09-20 Jacob Dinu <dinu.jacob@nokia.com>

Reviewed by Adam Barth.

When loading a cached page, dispatchDidCommitLoad is called after FrameLoader::open so
that all initialzations are done before calling client dispatchDidCommitLoad to avoid
client from accessing incorrect data.
https://bugs.webkit.org/show_bug.cgi?id=41155

  • loader/FrameLoader.cpp: (WebCore::FrameLoader::commitProvisionalLoad): (WebCore::FrameLoader::transitionToCommitted):

2010-09-20 Jacob Dinu <dinu.jacob@nokia.com>

Reviewed by Adam Barth.

Added a new qwebpage test for loading a cached page
https://bugs.webkit.org/show_bug.cgi?id=41155

  • tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::loadCachedPage):
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r67877 r67878  
     12010-09-20  Jacob Dinu  <dinu.jacob@nokia.com>
     2
     3        Reviewed by Adam Barth.
     4
     5        When loading a cached page, dispatchDidCommitLoad is called after FrameLoader::open so
     6        that all initialzations are done before calling client dispatchDidCommitLoad to avoid
     7        client from accessing incorrect data.
     8        https://bugs.webkit.org/show_bug.cgi?id=41155
     9
     10        * loader/FrameLoader.cpp:
     11        (WebCore::FrameLoader::commitProvisionalLoad):
     12        (WebCore::FrameLoader::transitionToCommitted):
     13
    1142010-09-20  Simon Fraser  <simon.fraser@apple.com>
    215
  • trunk/WebCore/loader/FrameLoader.cpp

    r67709 r67878  
    18491849        prepareForCachedPageRestore();
    18501850        cachedPage->restore(m_frame->page());
     1851
     1852        dispatchDidCommitLoad();
     1853
     1854        // If we have a title let the WebView know about it.
     1855        String title = m_documentLoader->title();
     1856        if (!title.isNull())
     1857            m_client->dispatchDidReceiveTitle(title);         
     1858
    18511859        checkCompleted();
    18521860    } else {       
     
    19291937    // Handle adding the URL to the back/forward list.
    19301938    DocumentLoader* dl = m_documentLoader.get();
    1931     String ptitle = dl->title();
    19321939
    19331940    switch (m_loadType) {
     
    20062013    if (!m_client->hasHTMLView())
    20072014        receivedFirstData();
    2008     else if (cachedPage) {
    2009         // For non-cached HTML pages, these methods are called in receivedFirstData().
    2010         dispatchDidCommitLoad();
    2011 
    2012         // If we have a title let the WebView know about it.
    2013         if (!ptitle.isNull())
    2014             m_client->dispatchDidReceiveTitle(ptitle);         
    2015     }
    20162015}
    20172016
  • trunk/WebKit/qt/ChangeLog

    r67846 r67878  
     12010-09-20  Jacob Dinu  <dinu.jacob@nokia.com>
     2
     3        Reviewed by Adam Barth.
     4
     5        Added a new qwebpage test for loading a cached page
     6        https://bugs.webkit.org/show_bug.cgi?id=41155
     7
     8        * tests/qwebpage/tst_qwebpage.cpp:
     9        (tst_QWebPage::loadCachedPage):
     10
    1112010-09-08  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
    212
  • trunk/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp

    r67289 r67878  
    9898    void frameAt();
    9999    void requestCache();
     100    void loadCachedPage();
    100101    void protectBindingsRuntimeObjectsFromCollector();
    101102    void localURLSchemes();
     
    12891290}
    12901291
     1292void tst_QWebPage::loadCachedPage()
     1293{
     1294    TestPage page;
     1295    QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
     1296    page.settings()->setMaximumPagesInCache(3);
     1297
     1298    page.mainFrame()->load(QUrl("data:text/html,This is first page"));
     1299
     1300    QTRY_COMPARE(loadSpy.count(), 1);
     1301    QTRY_COMPARE(page.navigations.count(), 1);
     1302
     1303    QUrl firstPageUrl = page.mainFrame()->url();
     1304    page.mainFrame()->load(QUrl("data:text/html,This is second page"));
     1305
     1306    QTRY_COMPARE(loadSpy.count(), 2);
     1307    QTRY_COMPARE(page.navigations.count(), 2);
     1308
     1309    page.triggerAction(QWebPage::Stop);
     1310    QVERIFY(page.history()->canGoBack());
     1311
     1312    QSignalSpy urlSpy(page.mainFrame(), SIGNAL(urlChanged(QUrl)));
     1313    QVERIFY(urlSpy.isValid());
     1314
     1315    page.triggerAction(QWebPage::Back);
     1316    ::waitForSignal(page.mainFrame(), SIGNAL(urlChanged(QUrl)));
     1317    QCOMPARE(urlSpy.size(), 1);
     1318
     1319    QList<QVariant> arguments1 = urlSpy.takeFirst();
     1320    QCOMPARE(arguments1.at(0).toUrl(), firstPageUrl);
     1321
     1322}
    12911323void tst_QWebPage::backActionUpdate()
    12921324{
Note: See TracChangeset for help on using the changeset viewer.