GNOME Bugzilla – Bug 682354
Pages with no title are shown as Blank pages in WebKit2
Last modified: 2012-08-25 17:02:09 UTC
Created attachment 221994 [details] [review] Patch The problem is that in WebKit2, notify::title is not emitted for a NULL title, so when the page finishes loading the title is still Blank page, the default one.
Review of attachment 221994 [details] [review]: ::: embed/ephy-web-view.c @@ +2186,3 @@ g_object_notify (object, "embed-title"); + else if (!webkit_web_view_get_title (web_view)) + ephy_web_view_set_title (view, NULL); What I'd do: Call set_title with NULL if the page is blank or has no title. set_title already takes care of both cases, the only improvement we can make is to make it not re-set title and notify:: if we are setting the same title again (which is a sane change anyway). I think this is cleaner.
Created attachment 222030 [details] [review] Updated patch
Review of attachment 222030 [details] [review]: ::: embed/ephy-web-view.c @@ +1141,3 @@ + g_free (priv->title); + priv->title = ephy_string_shorten (title, MAX_TITLE_LENGTH); + } I don't really get what we are achieving with this change. You are avoiding setting priv->title in some more cases now, but you are still notifying the property anyway? I'd really just add a if (!g_str_equal (title, priv->title)) around the last assignment to priv->title and the notify and be done with this tbh.
Current code always emits notify for blank pages, for whatever reason, so I tried to keep that behaviour. We would need to shorten the given title before comparing it, I guess.
I've committed the calls to set_title (view, NULL) from the patch, which should be straightforward. If we want we can open another bug for the extra notify calls.