Bug 91478

Summary: [GTK] No main resource in WebView when page has been loaded from history cache
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: gustavo, mrobinson, philn, webkit.review.bot, xan.lopez
Priority: P2 Keywords: Gtk
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Bug Depends on: 91495    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Updated patch gustavo: review+

Description Carlos Garcia Campos 2012-07-17 02:16:14 PDT
We are assuming that a resource loaded for the main frame that is provisionally loaded is the main resource of the web view. However that's not true for pages loaded from history cache, so when you go back/forward webkit_web_view_get_main_resource() always returns NULL.
Comment 1 Carlos Garcia Campos 2012-07-17 02:30:39 PDT
Created attachment 152722 [details]
Patch
Comment 2 WebKit Review Bot 2012-07-17 02:32:51 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Xan Lopez 2012-07-17 03:13:24 PDT
Comment on attachment 152722 [details]
Patch

OK, I'm going to make the obvious naive question. Why is WK lying to us when the page is loaded from the history cache? It does not make sense to try to fix that?

(Also, mixing typo fixes with the bug fix, noooo)
Comment 4 Carlos Garcia Campos 2012-07-17 03:19:20 PDT
(In reply to comment #3)
> (From update of attachment 152722 [details])
> OK, I'm going to make the obvious naive question. Why is WK lying to us when the page is loaded from the history cache? It does not make sense to try to fix that?

I don't think WK is lying, it's just that pages loaded from the history cache are not provisionally loaded, but go directly to the committed state. I'm not loader expert, though.

> (Also, mixing typo fixes with the bug fix, noooo)

Oooooook, I'll split the patch :-)
Comment 5 Carlos Garcia Campos 2012-07-17 05:18:55 PDT
Created attachment 152741 [details]
Updated patch

Split the patch as suggested by Xan.
Comment 6 Carlos Garcia Campos 2012-07-17 07:47:13 PDT
Build issue is because it depends on bug #91495
Comment 7 Carlos Garcia Campos 2012-07-18 06:27:30 PDT
Committed r122960: <http://trac.webkit.org/changeset/122960>