After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 682354 - Pages with no title are shown as Blank pages in WebKit2
Pages with no title are shown as Blank pages in WebKit2
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Backend
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Xan Lopez
Epiphany Maintainers
Depends on:
Blocks: 678610
 
 
Reported: 2012-08-21 13:27 UTC by Carlos Garcia Campos
Modified: 2012-08-25 17:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (1020 bytes, patch)
2012-08-21 13:27 UTC, Carlos Garcia Campos
reviewed Details | Review
Updated patch (2.26 KB, patch)
2012-08-21 15:16 UTC, Carlos Garcia Campos
reviewed Details | Review

Description Carlos Garcia Campos 2012-08-21 13:27:51 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.
Comment 1 Xan Lopez 2012-08-21 13:54:18 UTC
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.
Comment 2 Carlos Garcia Campos 2012-08-21 15:16:13 UTC
Created attachment 222030 [details] [review]
Updated patch
Comment 3 Xan Lopez 2012-08-22 06:23:53 UTC
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.
Comment 4 Carlos Garcia Campos 2012-08-22 09:27:03 UTC
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.
Comment 5 Xan Lopez 2012-08-25 17:02:09 UTC
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.