In WebKit1 there's code to prevent that load signals are emitted when loading internal custom error pages. We added webkit_web_view_replace_content() with the same idea, but it has ended up being problematic, because it allows to add any HTML content (in WebKit1 we assumed internal error pages never fails and always load) and it's impossible to know when the load has finished. It also required a lot of logic to handle replace_content as an especial case, in order to hide the fact that it loads content. So, let's rename it to webkit_web_view_load_alternate_html() and emit load events normally. Clients can easily ignore load signals when loading alternate content.
Created attachment 159403 [details]
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 on attachment 159403 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=159403&action=review
> + * error page, the the back-forward list is maintained appropriately.
Hrm. Would it make sense to just say outright something like, "When this method is called, a new entry is added to the back-forward list." ?
> + * For everything else this method works the same way than webkit_web_view_load_html().
Nit: same way than -> same way as
(In reply to comment #3)
> (From update of attachment 159403 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=159403&action=review
> > Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:1554
> > + * error page, the the back-forward list is maintained appropriately.
> Hrm. Would it make sense to just say outright something like, "When this method is called, a new entry is added to the back-forward list." ?
It's more complicated than that, when alternate string is called from a load error callback, going back/forward from a load error page convert the load into a reload to avoid a new time to be added to the back forward list. See this bug:
Because it's currently broken in wk2, and see the implementation here:
So, I copied the description from the wk1 mac docs:
I plan to add a unit test for that case, skipped until bug #94476 is fixed.
> > Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:1555
> > + * For everything else this method works the same way than webkit_web_view_load_html().
> Nit: same way than -> same way as
Committed r126030: <http://trac.webkit.org/changeset/126030>