about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMarco Peereboom <marco@conformal.com>2011-11-09 15:47:33 -0600
committerMarco Peereboom <marco@conformal.com>2011-11-09 15:47:33 -0600
commit11a06994df648bea20c2440c658ce887b74c81b5 (patch)
tree48ebb0c0679a2b8f6c5b281d40b011fb76f3c308
parentf9b12bd17c7f263670e16d8ebd60c06dee8dba73 (diff)
downloadxombrero-11a06994df648bea20c2440c658ce887b74c81b5.tar.gz
Add funky workaround for fancy rich edit boxes in RT
HTML5 defines a new property called "editable".  None of the old
textarea or input properties has that so I never keyed off it.  Turn out
that it is used so treat these as editable things as well.  This works
around an issue in the RT rich text editor which is special in it's own
way.
-rw-r--r--xxxterm.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/xxxterm.c b/xxxterm.c
index 7659877..fac842f 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -2626,6 +2626,23 @@ dom_is_input(struct tab *t, WebKitDOMElement **active)
 	for (;;) {
 		a = webkit_dom_html_document_get_active_element(
 		    (WebKitDOMHTMLDocument*)doc);
+		if (a == NULL)
+			return (0);
+
+		/*
+		 * I think this is a total hack because this property isn't
+		 * set for textareas or input however, it is set for jquery
+		 * textareas that do rich text.  Since this works around issues
+		 * in RT we'll simply keep it!
+		 *
+		 * This might break some other stuff but for now it helps.
+		 */
+		if (webkit_dom_html_element_get_is_content_editable(
+		    (WebKitDOMHTMLElement*)a)) {
+			*active = a;
+			return (1);
+		}
+
 		frame = (WebKitDOMHTMLFrameElement *)a;
 		if (WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(frame)) {
 			doc = webkit_dom_html_frame_element_get_content_document(