Allow the presence of form inputs to be obtained without knowledge of html content internals.
This commit is contained in:
parent
74a9ec6de4
commit
b134279644
|
@ -549,6 +549,7 @@ void browser_window_get_contextual_content(struct browser_window *bw,
|
|||
data->link_url = NULL;
|
||||
data->object = NULL;
|
||||
data->main = NULL;
|
||||
data->form_features = CTX_FORM_NONE;
|
||||
|
||||
browser_window__get_contextual_content(bw, x, y, data);
|
||||
}
|
||||
|
|
|
@ -162,7 +162,8 @@ nsgtk_scaffolding *scaf_list = NULL;
|
|||
|
||||
/** holds the context data for what's under the pointer, when the contextual
|
||||
* menu is opened. */
|
||||
static struct contextual_content current_menu_ctx = { NULL, NULL, NULL };
|
||||
static struct contextual_content current_menu_ctx = {
|
||||
NULL, NULL, NULL, CTX_FORM_NONE };
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -2670,6 +2670,23 @@ html_get_contextual_content(struct content *c,
|
|||
box->usemap, box_x, box_y, x, y,
|
||||
&target));
|
||||
}
|
||||
if (box->gadget) {
|
||||
switch (box->gadget->type) {
|
||||
case GADGET_TEXTBOX:
|
||||
case GADGET_TEXTAREA:
|
||||
case GADGET_PASSWORD:
|
||||
data->form_features = CTX_FORM_TEXT;
|
||||
break;
|
||||
|
||||
case GADGET_FILE:
|
||||
data->form_features = CTX_FORM_FILE;
|
||||
break;
|
||||
|
||||
default:
|
||||
data->form_features = CTX_FORM_NONE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -52,6 +52,11 @@ struct contextual_content {
|
|||
const char *link_url;
|
||||
struct hlcache_handle *object;
|
||||
struct hlcache_handle *main;
|
||||
enum {
|
||||
CTX_FORM_NONE,
|
||||
CTX_FORM_TEXT,
|
||||
CTX_FORM_FILE
|
||||
} form_features;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue