Bug 43827 - [Qt] Unable to load pages on QtTestBrowser after canceling a page load.
Summary: [Qt] Unable to load pages on QtTestBrowser after canceling a page load.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: S60 Hardware S60 3rd edition
: P2 Normal
Assignee: Yi Shen
URL:
Keywords: Qt
Depends on:
Blocks:
 
Reported: 2010-08-10 19:28 PDT by Alexandra Santos
Modified: 2010-10-20 15:42 PDT (History)
6 users (show)

See Also:


Attachments
first try (1.07 KB, patch)
2010-10-18 07:55 PDT, Yi Shen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandra Santos 2010-08-10 19:28:39 PDT
The user is unable to continue loading pages after cancelling a page load. 

Steps to reproduce:

1.- Flash the device with symbian 4 platform.
2.- Install and launch QtTestBrowser
3.- Try to load a page and click the "cancel" button before the page finish loading.

Actual results:

Page loading is cancelled and the "load/reload" button does not get enabled; therefore, unable to continue loading pages.

Expected results:

After cancelling a page loading, the "load/reload" button would be enabled. Therefore; user would be able to continue loading pages.
Comment 1 Yi Shen 2010-10-18 07:55:16 PDT
Created attachment 71036 [details]
first try
Comment 2 Yi Shen 2010-10-18 08:01:07 PDT
After triggered stop action on qwebpage to cancel page loading, the Navigation Actions (back, forward, reload, stop ...) doesn't get updated in most cases. So the patch tries to update navigation actions explicitly after calling mainFrame()->d->frame->loader()->stopForUserCancel().
Comment 3 Antonio Gomes 2010-10-18 08:16:54 PDT
Only STOP breaks it?
Comment 4 Antonio Gomes 2010-10-18 08:19:19 PDT
Comment on attachment 71036 [details]
first try

It looks sane to me.
Comment 5 Antonio Gomes 2010-10-18 08:19:34 PDT
Any change to have a autotest for it?
Comment 6 Antonio Gomes 2010-10-18 08:20:04 PDT
QT = QuickTime :)
Comment 7 Yi Shen 2010-10-18 08:26:35 PDT
Thanks for super fast review, Antonio :) I don't have any any auto test for it now since there is no such test existing. Only did some tests on the QtTestBrowser.
Comment 8 WebKit Commit Bot 2010-10-18 08:41:32 PDT
Comment on attachment 71036 [details]
first try

Clearing flags on attachment: 71036

Committed r69961: <http://trac.webkit.org/changeset/69961>
Comment 9 WebKit Commit Bot 2010-10-18 08:41:37 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Suresh Voruganti 2010-10-20 11:32:25 PDT
Pls cherry pick the fix for Qtwebkit 2.1 as this is Qtwebkit2.1 Basic Acceptance test failure.
Comment 11 Antonio Gomes 2010-10-20 11:35:52 PDT
Kling raised a concern with the patch and suggested we addressing that in FrameLoaderClient side, which I found reasonable.

Yi, news on that?
Comment 12 Yi Shen 2010-10-20 12:12:05 PDT
(In reply to comment #11)
> Kling raised a concern with the patch and suggested we addressing that in FrameLoaderClient side, which I found reasonable.
> 
> Yi, news on that?

Hi Antonio, I checked the FrameLoaderClientQt and FrameLoader, and I think the only place we can updateNav in FrameLoaderClientQt is in frameLoadCompleted(). The down side is that frameLoadCompleted can be called multiple times.

void FrameLoaderClientQt::frameLoadCompleted()
{
    // Note: Can be called multiple times.
    if (!m_loadError.isNull() && m_loadError.isCancellation())
        m_webFrame->page()->d->updateNavigationActions();
}

Any thoughts?
Comment 13 Antonio Gomes 2010-10-20 12:15:50 PDT
(In reply to comment #12)
> (In reply to comment #11)
> > Kling raised a concern with the patch and suggested we addressing that in FrameLoaderClient side, which I found reasonable.
> > 
> > Yi, news on that?
> 
> Hi Antonio, I checked the FrameLoaderClientQt and FrameLoader, and I think the only place we can updateNav in FrameLoaderClientQt is in frameLoadCompleted(). The down side is that frameLoadCompleted can be called multiple times.
> 
> void FrameLoaderClientQt::frameLoadCompleted()
> {
>     // Note: Can be called multiple times.
>     if (!m_loadError.isNull() && m_loadError.isCancellation())
>         m_webFrame->page()->d->updateNavigationActions();
> }
> 
> Any thoughts?

It gets called multiple times in what situations? like one per frame?
Comment 14 Yi Shen 2010-10-20 12:39:25 PDT
(In reply to comment #13)
> (In reply to comment #12)
> It gets called multiple times in what situations? like one per frame?
No, seems one per sub resource loader. For most often, after user cancel loading, the state of frame is set to FrameStateComplete. Then all the sub resource loaders call FrameLoader::checkLoadCompleteForThisFrame when removing itself from the DocumentLoader. In checkLoadCompleteForThisFrame, it calls the FrameLoaderClientQt::frameLoadCompleted() since the state is FrameStateComplete.

e.g, when cancel loading cnn.com, I saw frameLoadCompleted gets called > 30 times.
Comment 15 Ademar Reis 2010-10-20 15:38:04 PDT
Revision r69961 cherry-picked into qtwebkit-2.1 with commit 230afa2 <http://gitorious.org/webkit/qtwebkit/commit/230afa2>