Guard 'autocomplete' with WebKitGTK+ 1.7.4

This commit is contained in:
Christian Dywan 2012-01-19 01:39:02 +01:00
parent 41a0ab4bc7
commit 26485b9be2

View file

@ -379,12 +379,15 @@ formhistory_DOMContentLoaded_cb (WebKitDOMElement* window,
for (i = 0; i < webkit_dom_node_list_get_length (inputs); i++) for (i = 0; i < webkit_dom_node_list_get_length (inputs); i++)
{ {
const gchar* autocomplete;
WebKitDOMNode* element = webkit_dom_node_list_item (inputs, i); WebKitDOMNode* element = webkit_dom_node_list_item (inputs, i);
g_object_get (element, "autocomplete", &autocomplete, NULL); #if WEBKIT_CHECK_VERSION (1, 7, 4)
/* Dont bind if input is not text or autocomplete is disabled */ gchar* autocomplete = webkit_dom_html_input_element_get_autocomplete (
if (!g_strcmp0 (autocomplete, "off")) WebKitDOMHTMLInputElement (element));
gboolean off = !g_strcmp0 (autocomplete, "off");
g_free (autocomplete);
if (off)
continue; continue;
#endif
g_object_set_data (G_OBJECT (element), "doc", doc); g_object_set_data (G_OBJECT (element), "doc", doc);
g_object_set_data (G_OBJECT (element), "webview", web_view); g_object_set_data (G_OBJECT (element), "webview", web_view);