Gitweb links:
...log
http://git.netsurf-browser.org/netsurf-wiki.git/shortlog/b45ce6f2e22276ad1fda840e686a57e0d29628d8
...commit
http://git.netsurf-browser.org/netsurf-wiki.git/commit/b45ce6f2e22276ad1fda840e686a57e0d29628d8
...tree
http://git.netsurf-browser.org/netsurf-wiki.git/tree/b45ce6f2e22276ad1fda840e686a57e0d29628d8
The branch, master has been updated
via b45ce6f2e22276ad1fda840e686a57e0d29628d8 (commit)
from c823e38e5cc46c06abe669e0aa3d01e96cfbfab4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf-wiki.git/commit/?id=b45ce6f2e22276ad1fda840e686a57e0d29628d8
commit b45ce6f2e22276ad1fda840e686a57e0d29628d8
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Dev weekend: Update forms notes with current data structures section.
diff --git a/developer-weekend/may-2020.mdwn b/developer-weekend/may-2020.mdwn
index b97ca9d..589968c 100644
--- a/developer-weekend/may-2020.mdwn
+++ b/developer-weekend/may-2020.mdwn
@@ -74,15 +74,15 @@ Write ups
Current Forms Handling
----------------------
-### DOM / Gadget syncronisation
+### DOM / Gadget synchronization
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.
+JavaScript can modify the representation in the DOM. Users can
+modify the representation 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
+This synchronizes 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.
@@ -100,6 +100,30 @@ The `form_gadget_sync_with_dom()` is called from:
called during box tree construction of the special box elements in
**[html/box_special.c]**.
+### NetSurf data structures
+
+The `box` structure has a "gadget" member, which is a `struct form_control`
+pointer. These gadget pointers are set to the corresponding form_control
+when the form_control is created during box construction.
+
+The `html` content contains a forms linked list. These are of type
+`struct form`. The linked list is created by `html_forms_get_forms()` in
+**[html/forms.c]**, called from `html_begin_conversion()` in **[html/html.c]**.
+
+Since box tree construction hasn't happened yet, this collects a list of
+forms which are empty, containing no form controls.
+
+The form controls are added to the form structures as the forms are created
+during box construction. Box construction happens later in the `dom_to_box`
+call in `html_finish_conversion`.
+
+The fact that the form controls are referenced in both the form structures
+and from the box gadget member, and the fact that they aren't ref-counted
+means that we often dare not free them. So they leak everywhere.
+
+It seems that the struct form is only created for the purposes of form
+submission; to collect all the gadgets associated with the form.
+
Once more unto the breach dear friends…
---------------------------------------
-----------------------------------------------------------------------
Summary of changes:
developer-weekend/may-2020.mdwn | 32 ++++++++++++++++++++++++++++----
1 file changed, 28 insertions(+), 4 deletions(-)
diff --git a/developer-weekend/may-2020.mdwn b/developer-weekend/may-2020.mdwn
index b97ca9d..589968c 100644
--- a/developer-weekend/may-2020.mdwn
+++ b/developer-weekend/may-2020.mdwn
@@ -74,15 +74,15 @@ Write ups
Current Forms Handling
----------------------
-### DOM / Gadget syncronisation
+### DOM / Gadget synchronization
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.
+JavaScript can modify the representation in the DOM. Users can
+modify the representation 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
+This synchronizes 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.
@@ -100,6 +100,30 @@ The `form_gadget_sync_with_dom()` is called from:
called during box tree construction of the special box elements in
**[html/box_special.c]**.
+### NetSurf data structures
+
+The `box` structure has a "gadget" member, which is a `struct form_control`
+pointer. These gadget pointers are set to the corresponding form_control
+when the form_control is created during box construction.
+
+The `html` content contains a forms linked list. These are of type
+`struct form`. The linked list is created by `html_forms_get_forms()` in
+**[html/forms.c]**, called from `html_begin_conversion()` in **[html/html.c]**.
+
+Since box tree construction hasn't happened yet, this collects a list of
+forms which are empty, containing no form controls.
+
+The form controls are added to the form structures as the forms are created
+during box construction. Box construction happens later in the `dom_to_box`
+call in `html_finish_conversion`.
+
+The fact that the form controls are referenced in both the form structures
+and from the box gadget member, and the fact that they aren't ref-counted
+means that we often dare not free them. So they leak everywhere.
+
+It seems that the struct form is only created for the purposes of form
+submission; to collect all the gadgets associated with the form.
+
Once more unto the breach dear friends…
---------------------------------------
--
NetSurf Developer Wiki Backing Store
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]