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 767184 - Support name=og:site_name in addition to property=og:site_name
Support name=og:site_name in addition to property=og:site_name
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Web Applications
git master
Other Linux
: Normal minor
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-06-03 03:06 UTC by Daniel Aleksandersen
Modified: 2016-06-03 23:47 UTC
See Also:
GNOME target: ---
GNOME version: 3.19/3.20


Attachments
One-line patch for compatibility (1.24 KB, patch)
2016-06-03 03:06 UTC, Daniel Aleksandersen
none Details | Review
Patch, take two (2.01 KB, patch)
2016-06-03 14:42 UTC, Daniel Aleksandersen
none Details | Review
Patch, take three (1.96 KB, patch)
2016-06-03 21:58 UTC, Daniel Aleksandersen
committed Details | Review

Description Daniel Aleksandersen 2016-06-03 03:06:55 UTC
Created attachment 329015 [details] [review]
One-line patch for compatibility

Not standards compliant, but it’s a very common mistake to set OpenGraph data in the `name` attribute rather than the `property` attribute.
Comment 1 Michael Catanzaro 2016-06-03 13:59:01 UTC
Review of attachment 329015 [details] [review]:

OK, thanks. I would just add a comment to explain why we're doing something nonstandard here, else somebody else is bound to remove it in the future.
Comment 2 Daniel Aleksandersen 2016-06-03 14:42:11 UTC
Created attachment 329047 [details] [review]
Patch, take two

Also transforms all strings to lowercase for compatibility with creative web authors. Sure, the standard says all attributes should be lowercase, but out on the web – the situation is of course very different.
Comment 3 Michael Catanzaro 2016-06-03 15:26:49 UTC
Review of attachment 329047 [details] [review]:

Thanks. Two steps forward here, but...

::: embed/web-extension/ephy-web-dom-utils.c
@@ +125,3 @@
+     * commonly seen on the web in the name attribute. Both are supported. */
+    name = g_ascii_strdown (webkit_dom_html_meta_element_get_name (WEBKIT_DOM_HTML_META_ELEMENT (node)));
+    property = g_ascii_strdown (webkit_dom_element_get_attribute (WEBKIT_DOM_ELEMENT (node), "property"));

Unfortunately we once again have to deal with C memory management here. :( When a function returns a non-const char *, the return value is "transfer full" and you have to free the result with g_free. That's the case for both of these WebKit functions and also g_ascii_strdown, so it's not possible to pass the result of the WebKit functions straight to g_ascii_strdown -- then you can't free the result. You'll again need to use temporary variables to store the results here so that you can free them later.
Comment 4 Daniel Aleksandersen 2016-06-03 21:58:34 UTC
Created attachment 329098 [details] [review]
Patch, take three

Sorry about that. I’ve been writing too much Python lately. Third time’s the charm!

Thank you for excellent pointers and patience, Michael Catanzaro.
Comment 5 Michael Catanzaro 2016-06-03 23:44:56 UTC
Review of attachment 329098 [details] [review]:

::: embed/web-extension/ephy-web-dom-utils.c
@@ +119,3 @@
   for (i = 0; i < length && title == NULL; i++) {
+    gchar *name;
+    gchar *property;

I'm going to push this without the change to char*; we arbitrarily don't use gchar/gint/gdouble in Epiphany. Take a look at the toplevel HACKING file for a couple more rules like this.
Comment 6 Michael Catanzaro 2016-06-03 23:47:00 UTC
Also, g_ascii_strcasecmp was a good find; I didn't know about that. ;)