Skip to content

Commit c20052f

Browse files
committed
Add comment explaining why we're walking the form the way we are
1 parent eadb5b6 commit c20052f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/browser/xhr/form_data.zig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ const EntryIterable = iterator.Iterable(kv.EntryIterator, "FormDataEntryIterator
115115
// TODO: handle disabled fieldsets
116116
fn collectForm(form: *parser.Form, submitter_: ?*parser.ElementHTML, page: *Page) !kv.List {
117117
const arena = page.arena;
118+
119+
// Don't use libdom's formGetCollection (aka dom_html_form_element_get_elements)
120+
// It doesn't work with dynamically added elements, because their form
121+
// property doesn't get set. We should fix that.
122+
// However, even once fixed, there are other form-collection features we
123+
// probably want to implement (like disabled fieldsets), so we might want
124+
// to stick with our own walker even if fix libdom to properly support
125+
// dynamically added elements.
118126
const node_list = try @import("../dom/css.zig").querySelectorAll(arena, @alignCast(@ptrCast(form)), "input,select,button,textarea");
119127
const nodes = node_list.nodes.items;
120128

0 commit comments

Comments
 (0)