summaryrefslogtreecommitdiff
path: root/content/handlers/html/form.c
Commit message (Collapse)AuthorAgeFilesLines
* form: Fix situation where a gadget initialises with NULL valueDaniel Silverstone2019-08-041-2/+6
| | | | Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
* html: Mirror gadget values in and out of the DOMDaniel Silverstone2019-08-041-0/+111
| | | | | | | | | Currently only supporting text input, password input, and hidden input, along with text areas, this mirrors the text values in and out of the DOM, allowing JS to adjust the gadget values and for the gadget values to be interrogated from JS. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
* validate the form button element type attribute as per specVincent Sanders2019-02-221-4/+16
| | | | | | | https://html.spec.whatwg.org/multipage/form-elements.html#attr-button-type says if the type attribute is anything but "reset" or "button" it is of "submit" type. The previous logic was incorrect and only used the button if its type was explicitly submit and noting else.
* rewrite form_successful_controls_dom as form_dom_to_dataVincent Sanders2018-09-291-556/+883
| | | | | | | | | | | | | | | | | | | | | | | | Trying to reason about error propagation and resource leakage within the form submission code was impossible because of the form_successful_controls_dom function. This function was over six hundred lines long, had twenty six top level local variables and six levels of indent in places. This commit splits it out into thirteen shorter and more obvious functions. The resulting operation is identical except errors are properly propagated (all failures were reported as out of memory) and resource management can be reasoned about. The compiler appears to inline the entirety of the code from form_submit() down excepting a handful of leaf functions. This results in similar code output size as previous implementation. The new implementation has a greater number of variables passed to sub functions than desirable because multiple character sets are required to encode names and values in the multipart data list. However as noted the compiler effectively inlines all these functions so this does not actually become a major problem.
* fix url encoding to be compatible with nsurl API changes.Vincent Sanders2018-09-261-112/+112
| | | | | As part of this fix the form submission error handling and reporting has been improved.
* remove warning by replacing sprintf snprintfVincent Sanders2018-08-241-1/+5
|
* Plotters: Add plot_style_fixed type, and use for font size.Michael Drake2018-05-231-1/+1
|
* move html and text content handlers where they belongVincent Sanders2018-05-101-0/+1895