diff options
author | Michael Drake <michael.drake@codethink.co.uk> | 2020-05-24 22:05:45 +0100 |
---|---|---|
committer | Michael Drake <michael.drake@codethink.co.uk> | 2020-05-24 22:06:18 +0100 |
commit | 0aeb2c61055dec3b0192c722b88fac425f2858af (patch) | |
tree | 41e0d68fac905fb0e303f175445cb62d5039abd2 | |
parent | 6aec7716abfd7974c289c9e876c6fe837731259c (diff) | |
download | netsurf-wiki-0aeb2c61055dec3b0192c722b88fac425f2858af.tar.gz netsurf-wiki-0aeb2c61055dec3b0192c722b88fac425f2858af.tar.bz2 |
Dev weekend: Current forms handling.
-rw-r--r-- | developer-weekend/may-2020.mdwn | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/developer-weekend/may-2020.mdwn b/developer-weekend/may-2020.mdwn index f8e7333..85113d0 100644 --- a/developer-weekend/may-2020.mdwn +++ b/developer-weekend/may-2020.mdwn @@ -68,6 +68,39 @@ Topics * Text layout (maybe). * Selection cleanups. +Write ups +========= + +Current Forms Handling +---------------------- + +### DOM / Gadget syncronisation + +Currently both the DOM and the NetSurf gadget for form input elements +store a representation of the current state of the form element. +JavaScript can modifiy the representation in the DOM. Users can +modifiy the repreentation in the form gadget. + +There is a `form_gadget_sync_with_dom()` in NetSurf's `form.c`. +This syncronises the data both ways. If the DOM has changed, then +the gadget representation is updated, and if the gadget has changed +then the DOM is updated. If both have changed, the gadget version +wins. + +The `form_gadget_sync_with_dom()` is called from: + +* **[html/dom_event.c]** The DOMSubtreeModified callback. +* **[html/form.c]** The `form_gadget_update_value()` function, which is called + from: + * **[html/box_textarea.c]** The desktop/textarea widget callback for + TEXTAREA_MSG_TEXT_MODIFIED. + * **[html/html.c] The file upload handling in + `html_set_file_gadget_filename()`. +* **[html/forms.c]** The `parse_input_element` function, which ends up getting + called during box tree construction of the special box elements in + **[html/box_special.c]**. + + Tasks ===== |