GNOME Bugzilla – Bug 767184
Support name=og:site_name in addition to property=og:site_name
Last modified: 2016-06-03 23:47:27 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.
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.
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.
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.
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.
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.
Also, g_ascii_strcasecmp was a good find; I didn't know about that. ;)