summaryrefslogtreecommitdiff
path: root/src/html/html_form_element.c
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2012-11-03 22:10:17 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2012-11-03 22:10:17 +0000
commitc27dd9093614b9df998f994ee2fe530782e1d890 (patch)
treefaa6ebabb6a11b53778a859d593110ab7ea00618 /src/html/html_form_element.c
parent45048d167c9f1e9ca31317ce19a3e9ca23968d07 (diff)
downloadlibdom-c27dd9093614b9df998f994ee2fe530782e1d890.tar.gz
libdom-c27dd9093614b9df998f994ee2fe530782e1d890.tar.bz2
Remove ability to dispatch a generic event as a ptr+len, and memoise all previous callsites
Diffstat (limited to 'src/html/html_form_element.c')
-rw-r--r--src/html/html_form_element.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/html/html_form_element.c b/src/html/html_form_element.c
index 55ec0e9..808383d 100644
--- a/src/html/html_form_element.c
+++ b/src/html/html_form_element.c
@@ -235,16 +235,18 @@ SIMPLE_GET_SET(target)
*/
dom_exception dom_html_form_element_submit(dom_html_form_element *ele)
{
- struct dom_document *doc = dom_node_get_owner(ele);
+ struct dom_html_document *doc =
+ (dom_html_document *) dom_node_get_owner(ele);
bool success = false;
assert(doc != NULL);
/* Dispatch an event and let the default action handler to deal with
* the submit action, and a 'submit' event is bubbling and cancelable
*/
- return _dom_dispatch_generic_event(doc, (dom_event_target *) ele,
- (const uint8_t *) "submit", SLEN("submit"), true,
- true, &success);
+ return _dom_dispatch_generic_event((dom_document *)doc,
+ (dom_event_target *) ele,
+ doc->memoised[hds_submit], true,
+ true, &success);
}
/**
@@ -255,16 +257,18 @@ dom_exception dom_html_form_element_submit(dom_html_form_element *ele)
*/
dom_exception dom_html_form_element_reset(dom_html_form_element *ele)
{
- struct dom_document *doc = dom_node_get_owner(ele);
+ struct dom_html_document *doc =
+ (dom_html_document *) dom_node_get_owner(ele);
bool success = false;
assert(doc != NULL);
/* Dispatch an event and let the default action handler to deal with
* the reset action, and a 'reset' event is bubbling and cancelable
*/
- return _dom_dispatch_generic_event(doc, (dom_event_target *) ele,
- (const uint8_t *) "reset", SLEN("reset"), true,
- true, &success);
+ return _dom_dispatch_generic_event((dom_document *) doc,
+ (dom_event_target *) ele,
+ doc->memoised[hds_reset], true,
+ true, &success);
}
/*-----------------------------------------------------------------------*/