Pass content containing form's nsurl to form_submit, instead of its hlcache_handle. Avoid dereferencing bw in html content handlers.
This commit is contained in:
parent
be00425776
commit
6d39b569c7
|
@ -1460,7 +1460,7 @@ void form_radio_set(hlcache_handle *content,
|
|||
* Collect controls and submit a form.
|
||||
*/
|
||||
|
||||
void form_submit(hlcache_handle *h, struct browser_window *target,
|
||||
void form_submit(nsurl *page_url, struct browser_window *target,
|
||||
struct form *form, struct form_control *submit_button)
|
||||
{
|
||||
char *data = NULL, *url = NULL;
|
||||
|
@ -1507,8 +1507,7 @@ void form_submit(hlcache_handle *h, struct browser_window *target,
|
|||
|
||||
url_destroy_components(&components);
|
||||
|
||||
browser_window_go(target, url, nsurl_access(hlcache_handle_get_url(h)),
|
||||
true);
|
||||
browser_window_go(target, url, nsurl_access(page_url), true);
|
||||
break;
|
||||
|
||||
case method_POST_URLENC:
|
||||
|
@ -1520,14 +1519,12 @@ void form_submit(hlcache_handle *h, struct browser_window *target,
|
|||
}
|
||||
|
||||
browser_window_go_post(target, form->action, data, 0,
|
||||
true, nsurl_access(hlcache_handle_get_url(h)),
|
||||
false, true, 0);
|
||||
true, nsurl_access(page_url), false, true, 0);
|
||||
break;
|
||||
|
||||
case method_POST_MULTIPART:
|
||||
browser_window_go_post(target, form->action, 0,
|
||||
success, true, nsurl_access(hlcache_handle_get_url(h)),
|
||||
false, true, 0);
|
||||
browser_window_go_post(target, form->action, 0, success,
|
||||
true, nsurl_access(page_url), false, true, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ void form_select_get_dimensions(struct form_control *control,
|
|||
int *width, int *height);
|
||||
void form_select_process_selection(hlcache_handle *h,
|
||||
struct form_control *control, int item);
|
||||
void form_submit(struct hlcache_handle *h, struct browser_window *target,
|
||||
void form_submit(nsurl *page_url, struct browser_window *target,
|
||||
struct form *form, struct form_control *submit_button);
|
||||
void form_radio_set(struct hlcache_handle *content, struct form_control *radio);
|
||||
|
||||
|
|
|
@ -839,7 +839,7 @@ void html_mouse_action(struct content *c, struct browser_window *bw,
|
|||
*/
|
||||
switch (action) {
|
||||
case ACTION_SUBMIT:
|
||||
form_submit(bw->current_content,
|
||||
form_submit(content_get_url(c),
|
||||
browser_window_find_target(bw, target, mouse),
|
||||
gadget->form, gadget);
|
||||
break;
|
||||
|
|
|
@ -1911,7 +1911,7 @@ bool textinput_input_callback(struct browser_window *bw, uint32_t key,
|
|||
selection_clear(&html->sel, true);
|
||||
|
||||
if (form)
|
||||
form_submit(bw->current_content, bw, form, 0);
|
||||
form_submit(content_get_url(c), bw, form, 0);
|
||||
return true;
|
||||
|
||||
case KEY_SHIFT_TAB:
|
||||
|
|
Loading…
Reference in New Issue