Gitweb links:
...log
http://git.netsurf-browser.org/netsurf-wiki.git/shortlog/916ac380e9931dc85627c7a5b34b6af1c8e8aa86
...commit
http://git.netsurf-browser.org/netsurf-wiki.git/commit/916ac380e9931dc85627c7a5b34b6af1c8e8aa86
...tree
http://git.netsurf-browser.org/netsurf-wiki.git/tree/916ac380e9931dc85627c7a5b34b6af1c8e8aa86
The branch, master has been updated
via 916ac380e9931dc85627c7a5b34b6af1c8e8aa86 (commit)
from b45ce6f2e22276ad1fda840e686a57e0d29628d8 (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=916ac380e9931dc85627c7a5b34b6af1c8e8aa86
commit 916ac380e9931dc85627c7a5b34b6af1c8e8aa86
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
devday: Nodelist plan
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/developer-weekend/may-2020.mdwn b/developer-weekend/may-2020.mdwn
index 589968c..5f40f1a 100644
--- a/developer-weekend/may-2020.mdwn
+++ b/developer-weekend/may-2020.mdwn
@@ -207,6 +207,40 @@ All of the requisite bindings will need to be written to
support the form
behaviours since driving this through the DOM may necessitate JS interactions
with the forms (e.g. validation).
+## Unifying behaviour of `NodeList` and `HTMLCollection`
+
+In order to support Forms properly, a `RadioNodeList` which inherits from
+`NodeList` has to act as though it were a subview of an
`HTMLFormControlsCollection`
+which inherits from `HTMLCollection`. Given that `NodeList` and
`HTMLCollection`
+are independent heirarchies (they are both top level types) there is nominally
+no way for this to occur.
+
+Plan:
+
+1. Inside libdom, add the concept of a `_dom_live_node_view`
+2. That type's API has ref/unref, implements the tree walker which takes a
visitor
+ function pointer. The treewalker always returns the number of nodes it
visited
+ afterwards, to make counting easier.
+3. The node visitor API is: `visitor(context, node, index) -> decision`
+ where decision is one of `stop`, `traverse_siblings`, or `traverse_all`.
+4. Rework `NodeList` in terms of this new API, the `NodeList` visitor method
+ will be the current matching matching behaviour, plus the decision of
whether
+ to iterate deeply or not. This will allow us to shake out the behaviours
+ of the tree walker etc.
+5. Rework `HTMLCollection` in terms of the new API. The visitor method
+ will, this time, need to match elements. For named item lookup, the
+ visitor will be able to stop iteration at that point since there's no point
+ continuing.
+6. a) Implement `HTMLFormControlsCollection` with its own `namedItem`
+ method which, for the purposes of libdom, can return either an element or
+ a radioitemlist - the client will have to deal with this.
+
+ b) Implement `RadioItemList` so that it can be returned by (a).
+
+ Note: These two will essentially have to share some logic in order to work
+ compatibly. Since (a) is sharing logic with `HTMLCollection` that ought
+ to be moderately easy/safe to do.
+
Tasks
=====
-----------------------------------------------------------------------
Summary of changes:
developer-weekend/may-2020.mdwn | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/developer-weekend/may-2020.mdwn b/developer-weekend/may-2020.mdwn
index 589968c..5f40f1a 100644
--- a/developer-weekend/may-2020.mdwn
+++ b/developer-weekend/may-2020.mdwn
@@ -207,6 +207,40 @@ All of the requisite bindings will need to be written to
support the form
behaviours since driving this through the DOM may necessitate JS interactions
with the forms (e.g. validation).
+## Unifying behaviour of `NodeList` and `HTMLCollection`
+
+In order to support Forms properly, a `RadioNodeList` which inherits from
+`NodeList` has to act as though it were a subview of an
`HTMLFormControlsCollection`
+which inherits from `HTMLCollection`. Given that `NodeList` and
`HTMLCollection`
+are independent heirarchies (they are both top level types) there is nominally
+no way for this to occur.
+
+Plan:
+
+1. Inside libdom, add the concept of a `_dom_live_node_view`
+2. That type's API has ref/unref, implements the tree walker which takes a
visitor
+ function pointer. The treewalker always returns the number of nodes it
visited
+ afterwards, to make counting easier.
+3. The node visitor API is: `visitor(context, node, index) -> decision`
+ where decision is one of `stop`, `traverse_siblings`, or `traverse_all`.
+4. Rework `NodeList` in terms of this new API, the `NodeList` visitor method
+ will be the current matching matching behaviour, plus the decision of
whether
+ to iterate deeply or not. This will allow us to shake out the behaviours
+ of the tree walker etc.
+5. Rework `HTMLCollection` in terms of the new API. The visitor method
+ will, this time, need to match elements. For named item lookup, the
+ visitor will be able to stop iteration at that point since there's no point
+ continuing.
+6. a) Implement `HTMLFormControlsCollection` with its own `namedItem`
+ method which, for the purposes of libdom, can return either an element or
+ a radioitemlist - the client will have to deal with this.
+
+ b) Implement `RadioItemList` so that it can be returned by (a).
+
+ Note: These two will essentially have to share some logic in order to work
+ compatibly. Since (a) is sharing logic with `HTMLCollection` that ought
+ to be moderately easy/safe to do.
+
Tasks
=====
--
NetSurf Developer Wiki Backing Store
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]