Commit Graph

14 Commits

Author SHA1 Message Date
Michael Drake fa64d91d12 Switch to new libcss API for unit conversion. 2021-05-30 11:52:33 +01:00
Vincent Sanders 402ad02ff5 remove unecessary use of gui_internal in content 2020-06-25 14:37:57 +01:00
Vincent Sanders 82559d2ff4 remove the forward references in html form internal handling 2020-05-03 21:56:51 +01:00
Vincent Sanders a706c69bf4 improve html content handler private headers 2020-05-02 20:47:53 +01:00
Vincent Sanders e8d0ba15ad split html box processing code
reduce the module size of the html box handling code by
 splitting into smaller sections.

No functional code change.
2020-04-29 20:37:42 +01:00
Vincent Sanders 570f2dc036 remove user warning and fix up error handling in form select menus 2019-11-07 18:52:49 +00:00
Daniel Silverstone b15b204f49 form: Fix situation where a gadget initialises with NULL value
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-04 22:12:10 +01:00
Daniel Silverstone 05c6ee02d9 html: Mirror gadget values in and out of the DOM
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>
2019-08-04 22:07:42 +01:00
Vincent Sanders 61891ada50 validate the form button element type attribute as per spec
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.
2019-02-22 21:11:34 +00:00
Vincent Sanders 7a61c95724 rewrite form_successful_controls_dom as form_dom_to_data
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.
2018-09-29 16:59:34 +01:00
Vincent Sanders 5c96acd6f1 fix url encoding to be compatible with nsurl API changes.
As part of this fix the form submission error handling and
 reporting has been improved.
2018-09-26 17:21:48 +01:00
Vincent Sanders eee67a65e8 remove warning by replacing sprintf snprintf 2018-08-24 11:49:56 +01:00
Michael Drake a58d97a41a Plotters: Add plot_style_fixed type, and use for font size. 2018-05-23 11:48:35 +01:00
Vincent Sanders 2a03ea3049 move html and text content handlers where they belong 2018-05-10 13:37:02 +01:00
Renamed from render/form.c (Browse further)