summaryrefslogtreecommitdiff
path: root/src/dwb.c
diff options
context:
space:
mode:
authorportix <none@none>2012-12-05 23:44:22 +0100
committerportix <none@none>2012-12-05 23:44:22 +0100
commita3e9b9a954200e249ac8790dda7fbfa5c0bd41a3 (patch)
tree7ed80aaae550a231bdec606f6950993964569674 /src/dwb.c
parentdbeec3f7a8b6cdf6a080d24aa4297422fe3d70cb (diff)
downloaddwb-a3e9b9a954200e249ac8790dda7fbfa5c0bd41a3.zip
Use strcasecmp instead of g_strcmp0 when comparing tagnames, fixes editor issue on xml-documents
Diffstat (limited to 'src/dwb.c')
-rw-r--r--src/dwb.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/dwb.c b/src/dwb.c
index ab66c450..d57632a8 100644
--- a/src/dwb.c
+++ b/src/dwb.c
@@ -1071,9 +1071,9 @@ dwb_editor_watch(GPid pid, int status, EditorInfo *info)
if (length > 0 && content[length-1] == '\n')
content[length-1] = 0;
- if (!g_strcmp0(info->tagname, "INPUT"))
+ if (!strcasecmp(info->tagname, "INPUT"))
webkit_dom_html_input_element_set_value(WEBKIT_DOM_HTML_INPUT_ELEMENT(e), content);
- else if (!g_strcmp0(info->tagname, "TEXTAREA"))
+ else if (!strcasecmp(info->tagname, "TEXTAREA"))
webkit_dom_html_text_area_element_set_value(WEBKIT_DOM_HTML_TEXT_AREA_ELEMENT(e), content);
clean:
@@ -1144,13 +1144,15 @@ dwb_get_editable(WebKitDOMElement *element)
return false;
char *tagname = webkit_dom_node_get_node_name(WEBKIT_DOM_NODE(element));
- if (!g_strcmp0(tagname, "INPUT"))
+ if (tagname == NULL)
+ return false;
+ if (!strcasecmp(tagname, "INPUT"))
{
char *type = webkit_dom_element_get_attribute((void*)element, "type");
if (!g_strcmp0(type, "text") || !g_strcmp0(type, "search")|| !g_strcmp0(type, "password"))
return true;
}
- else if (!g_strcmp0(tagname, "TEXTAREA"))
+ else if (!strcasecmp(tagname, "TEXTAREA"))
return true;
return false;
@@ -1204,18 +1206,15 @@ dwb_open_in_editor(void)
if (active == NULL)
return STATUS_ERROR;
- if (!dwb_get_editable(active))
- return STATUS_ERROR;
-
tagname = webkit_dom_element_get_tag_name(active);
if (tagname == NULL)
{
ret = STATUS_ERROR;
goto clean;
}
- if (! g_strcmp0(tagname, "INPUT"))
+ if (! strcasecmp(tagname, "INPUT"))
value = webkit_dom_html_input_element_get_value(WEBKIT_DOM_HTML_INPUT_ELEMENT(active));
- else if (! g_strcmp0(tagname, "TEXTAREA"))
+ else if (! strcasecmp(tagname, "TEXTAREA"))
value = webkit_dom_html_text_area_element_get_value(WEBKIT_DOM_HTML_TEXT_AREA_ELEMENT(active));
if (value == NULL)