Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/6d39b569c700ddfa405c5c9a7a49320be2945997
...commit
http://git.netsurf-browser.org/netsurf.git/commit/6d39b569c700ddfa405c5c9a7a49320be2945997
...tree
http://git.netsurf-browser.org/netsurf.git/tree/6d39b569c700ddfa405c5c9a7a49320be2945997
The branch, master has been updated
via 6d39b569c700ddfa405c5c9a7a49320be2945997 (commit)
from be00425776514fccddd79d69caa8ed01dc172779 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commitdiff/6d39b569c700ddfa405c5c9a7a49320be2945997
commit 6d39b569c700ddfa405c5c9a7a49320be2945997
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Pass content containing form's nsurl to form_submit, instead of its
hlcache_handle. Avoid dereferencing bw in html content handlers.
diff --git a/render/form.c b/render/form.c
index 40e95ea..09579dc 100644
--- a/render/form.c
+++ b/render/form.c
@@ -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;
}
diff --git a/render/form.h b/render/form.h
index e2f9f63..dab6a62 100644
--- a/render/form.h
+++ b/render/form.h
@@ -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);
diff --git a/render/html_interaction.c b/render/html_interaction.c
index 1365d77..4d21b22 100644
--- a/render/html_interaction.c
+++ b/render/html_interaction.c
@@ -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;
diff --git a/render/textinput.c b/render/textinput.c
index 3c3eb73..6c580a8 100644
--- a/render/textinput.c
+++ b/render/textinput.c
@@ -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:
-----------------------------------------------------------------------
Summary of changes:
render/form.c | 13 +++++--------
render/form.h | 2 +-
render/html_interaction.c | 2 +-
render/textinput.c | 2 +-
4 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/render/form.c b/render/form.c
index 40e95ea..09579dc 100644
--- a/render/form.c
+++ b/render/form.c
@@ -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;
}
diff --git a/render/form.h b/render/form.h
index e2f9f63..dab6a62 100644
--- a/render/form.h
+++ b/render/form.h
@@ -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);
diff --git a/render/html_interaction.c b/render/html_interaction.c
index 1365d77..4d21b22 100644
--- a/render/html_interaction.c
+++ b/render/html_interaction.c
@@ -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;
diff --git a/render/textinput.c b/render/textinput.c
index 3c3eb73..6c580a8 100644
--- a/render/textinput.c
+++ b/render/textinput.c
@@ -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:
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org