Repository navigation
Add the form filler - #31
Merged
Merged
Conversation
Form filler 1: matching and My details
Form filler 2: page script, injector and controller
Form filler 3: review in the popup and reworded claims
A throwing popup subscriber no longer leaves busy set, and a throwing now() or relCanonical() after the apply no longer loses the counts or the fill result.
After a failed or unconfirmed apply the page may have renumbered its fields, so the controller drops the plan's writes and the old scan. The Will fill list now starts open, so every value is shown before the click.
Text-like fields (not radio, checkbox or file) are now treated as hidden when opacity is 0 on the field or an ancestor, when clip or clip-path collapses them, when the computed width or height is 1px or less, or when a laid-out box is 1px or smaller or entirely above or left of the page. Box checks only apply when the rect is not all zero, so happy-dom (no layout) is unaffected. A radio group with a checked member that is not a candidate (disabled, readonly, hidden) is left out of the scan entirely. checked indexes into options, and options only hold candidates, so the checked member cannot be represented without exposing a non-fillable element as a write target; omitting the group guarantees nothing is written and checking another radio can never clear it. Peers are matched by name within the same form owner, or among form-less radios. Checkbox groups are built the same way but checking one box does not clear others, so they are unchanged.
Before any write, apply.ts now re-runs the scan's own isCandidate and controlOf (exported from scan.ts, no copy) and, for radio groups, hasCheckedPeer live. A field hidden, switched to password, given a cc-* or similar autocomplete, or changed to another control kind after the scan is not written. Outcome on a failed recheck is 'gone': the scanned fillable field no longer exists as such. It is already a not-written outcome in WriteOutcome, so no new union member. The existing disabled/readonly checks still run first and keep reporting 'failed'. A read-back mismatch now sets text, date and textarea fields back to empty through the prototype setter, and restores the previous selectedIndex or unchecks the member, before returning 'failed'. No events fire on these paths.
Ancestors that are transparent, clipped, or collapsed to 1px or less while clipping overflow now hide a text field. Where checkVisibility exists, a text field it rejects, or one with no client rects, is hidden; radios and checkboxes use it without the opacity property so opacity:0 custom controls stay fillable. inset() clip-path is parsed in its 1 to 4 value form, the left-of-page check is skipped on right-to-left pages, and radio groups and peers are keyed by form owner (form attribute first, then nearest form) and name.
1. The ancestor walk skips documentElement, body and inline/contents boxes, and uses a rect intersection (at most 1px) when both boxes have layout. 2. Drop contentVisibilityAuto from checkVisibility; content-visibility:hidden is always honoured and closed details has no client rects. 3. RTL horizontal off-page check is box.left + scrollX >= clientWidth. 4. Share groupKey between countSlots and scanForm.
Drops the intersection test: a laid-out field in a 0x0 wrapper at the page origin read as no layout and was filled, and fields scrolled out of view in a scrolling box, or positioned outside their wrapper, were skipped. A parent now hides a field only when it clips overflow and is 1px or less across that axis, measured from its box when the field has layout.
The injector test may not import ../controller, a template key such as ctrl[`fill`] counts as reading fill(), and guard/scan.ts may not name the fill script. ARCHITECTURE now says the rules catch ordinary code, not code written to evade them.
Brings back the box test for overflow hidden and clip only, so a field moved outside a normal-sized wrapper is not filled, while fields in a scrolling box stay fillable. Both parent tests now apply only to parents that contain the field: an absolute field escapes up to its nearest positioned ancestor and a fixed one escapes all. ARCHITECTURE no longer calls the built-output scan a backstop for lint evasion.
A transform, filter, perspective, will-change or contain on an ancestor makes it the containing block for absolute and fixed fields, so its overflow clip now counts. contain:paint clips like overflow:clip. Document the visibility check as best-effort, with the review list as the guard.
This was referenced Nov 21, 2026
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.
Adds the form filler. You click Fill in the popup, check what will be filled, and confirm. Nothing reads or touches the page until you click, and nothing is ever submitted.
This brings the work merged in #27, #28 and #29 into
main, plus the fixes from the whole-branch review.What is in it
core/src/fill/: label matching, control fit and the fill plan. No DOM.shell/fill/page/: the page script. It scans the form, skips hidden fields, writes values, rechecks each field before writing and undoes a write that did not take.shell/fill/inject.ts: injects the page script into the top frame only, on click.shell/fill/controller.ts: holds the fill state for the popup.shell/ui/FillSection.tsx: the review in the popup. "Will fill" now starts open.docs/ARCHITECTURE.mdexplains them.Gate
The warning count did not change. No allowlist entries were added.
Hand checks (Task 26)
Screenshots
Day and night popup shots to follow, because "Will fill" now starts open.
Open risks (design section 11)
The hidden-field check is best-effort. The review list is the guard: every field that will be filled is shown before you click Fill.
clip: rect(0 0 0 0)without commas is not tested, because happy-dom does not compute it.display: contentsancestor with a transform or contain is treated as a containing block. A visible fixed or absolute field inside it can be skipped. It is then left unfilled.contain: paintonhtmlorbodyis ignored.will-change: translate,rotate,scaleorcontain, andcontainer-type: sizeorinline-size, are not treated as containing blocks. In both cases the field is still shown...//injector a name built from pieces. Code review is the backstop.remove,beforeoraftercalls in the page script.