Polyfill remote-dom FormData using the native Worker implementation#621
Open
developit wants to merge 3 commits into
Open
Polyfill remote-dom FormData using the native Worker implementation#621developit wants to merge 3 commits into
developit wants to merge 3 commits into
Conversation
Capture the environment native constructor and populate it from the common subset of successful Remote DOM controls. This keeps native storage, file handling, iteration, and multipart Request interoperability intact.
Avoid inferring checkable behavior from input type names so Remote DOM custom elements participate correctly. Cover custom checked properties and document the property-based behavior.
Use explicit early continues so omitted controls do not trigger unrelated property reads. Keep each omission rule independent and let downstream minification combine conditions when useful.
frehner
reviewed
Jul 16, 2026
| continue; | ||
| } | ||
|
|
||
| data.append(name, control.value ?? control.getAttribute('value') ?? ''); |
There was a problem hiding this comment.
checked elements submit "on" as a fallback if the value attribute isn't there
Otherwise, if the field element is an input element whose type attribute is in the Checkbox state or the Radio Button state:
If the field element has a value attribute specified, then let value be the value of that attribute; otherwise, let value be the string "on".
step 7.1 here https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#constructing-form-data-set
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bridge remote-dom forms to the native
FormDataimplementation available in Web Workers, instead of reimplementing the API. This keeps the polyfill small while preserving native behavior for storage, iteration, file handling, and multipart request interoperability.What changed
FormDataconstructor and use it to build form data from remote-dom controls.FormDatafrom the common subset of successful controls supported by remote-dom.Notes
FormDatasemantics.