Bug 136526 - Committed URL is not reset when a new load starts
Summary: Committed URL is not reset when a new load starts
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-04 03:37 PDT by Carlos Garcia Campos
Modified: 2014-09-18 03:25 PDT (History)
3 users (show)

See Also:


Attachments
Patch (17.36 KB, patch)
2014-09-04 03:42 PDT, Carlos Garcia Campos
ap: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2014-09-04 03:37:02 PDT
The committed URL of PageLoadState and frame is not reset when a new load starts. One of the problems I've noticed is that if the page fails, the active URL after didFailProvisionalLoadWithErrorForFrame() is the one from previous load. In the PageLoadBasic unit test we check that the committed URL is null in didStartProvisionalLoadForFrame(), it works because it's the first load, if we start a new load the test fails.
Comment 1 Carlos Garcia Campos 2014-09-04 03:42:08 PDT
Created attachment 237616 [details]
Patch

I've rewritten the unit tests to use a test class and make easier to add more test cases.
Comment 2 Alexey Proskuryakov 2014-09-04 11:00:20 PDT
Comment on attachment 237616 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=237616&action=review

> Source/WebKit2/ChangeLog:8
> +        Reset the committed URL when a new load starts.

I don't see how this can be right. When a load hasn't been committed yet, the current page is unchanged - this is the very reason for having an uncommitted state. If the user starts a load and immediately hits Esc to cancel, the page should remain in the same state that it was before load.
Comment 3 Carlos Garcia Campos 2014-09-10 00:38:58 PDT
(In reply to comment #2)
> (From update of attachment 237616 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=237616&action=review
> 
> > Source/WebKit2/ChangeLog:8
> > +        Reset the committed URL when a new load starts.
> 
> I don't see how this can be right. When a load hasn't been committed yet, the current page is unchanged - this is the very reason for having an uncommitted state. If the user starts a load and immediately hits Esc to cancel, the page should remain in the same state that it was before load.

I see your point, and I agree that's the last committed URL in the page/frame, but I'm not so sure that's the active URL. I guess we need to define what the active URL is, though. This is what we have in the WebKitGTK+ API documentation:

http://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html#webkit-web-view-get-uri

It doesn't say anything about the active URL when the provisional load fails, what do you think it should be?
Comment 4 Carlos Garcia Campos 2014-09-18 03:25:01 PDT
I agree we should not reset the commited URL on new load, closing as invalid.