Bug 136526

Summary: Committed URL is not reset when a new load starts
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: andersca, ap, thorton
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch ap: review-

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.