From 1f7af7b8c36fb6a693bda259e19f217f68dbb2cb Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sun, 24 May 2020 22:17:38 +0100 Subject: devday: Initial thoughts on forms Signed-off-by: Daniel Silverstone --- developer-weekend/may-2020.mdwn | 83 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/developer-weekend/may-2020.mdwn b/developer-weekend/may-2020.mdwn index 85113d0..b97ca9d 100644 --- a/developer-weekend/may-2020.mdwn +++ b/developer-weekend/may-2020.mdwn @@ -100,6 +100,89 @@ The `form_gadget_sync_with_dom()` is called from: called during box tree construction of the special box elements in **[html/box_special.c]**. +Once more unto the breach dear friends… +--------------------------------------- + +### …or "how I learned to love HTML forms" + +The goal is to fully replace the current HTML form handling with proper DOM +based forms. To do this we need to resolve a number of operations. + +1. Every kind of input element and so on needs its DOM behaviour writing + if it is missing, or checking if it is present already +2. The form element needs to gain requisite methods for resetting and submitting + which perform the flow including firing events as needed (or reacting to them) +3. The main HTML content needs to stop having a form construct entirely, instead + deferring to the DOM in all matters form-related +4. Gadgets should be owned by the boxes and should entirely operate by means + of the DOM nodes associated with their boxes. +5. The DOM becomes the canonical source of data. If the DOM changes, then the + gadgets react. If the gadgets wish to change the DOM then they push their + changed data into the DOM and cope if the DOM doesn't do entirely as they + expected. + +The final part is perhaps the hardest. It will require gadget implementations +to register as event listeners on the dom nodes in question and cope with them +changing. Done properly this will allow JS to change the options in a select +gadget at runtime etc. An early part of dynamic content. + +The various elements' specifications are here: + +* [Categories of elements](https://www.w3.org/TR/2017/REC-html52-20171214/sec-forms.html#form-categories) + such as form-associated, reassociatable, submittable, labelable, etc. +* [`
`](https://www.w3.org/TR/2017/REC-html52-20171214/sec-forms.html#the-form-element) +* [`