Skip to content

fix: describe the element that paints an off-screen native submit - #2785

Merged
chubes4 merged 2 commits into
trunkfrom
fix/form-hidden-submit-presenter
Oct 14, 2026
Merged

chubes4 merged 2 commits into
trunkfrom
fix/form-hidden-submit-presenter

Conversation

@chubes4

@chubes4 chubes4 commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Part of Automattic/static-site-importer#2071.

Problem

Hosted builders often keep a native submit for semantics but move it off-screen with inline styles (position:absolute; left:-9999px; width:1px; height:1px) and paint a captioned sibling in its place (an <a class="…button">Send</a> with no href). The form layout and presentation graphs described the native control, so providers reproduced a 1px off-screen input and the visible submit disappeared after materialization.

Change

  • FormControlClassifier::presentingElement() resolves the element that paints a native submit: an input/button submit moved off-screen by its inline style whose single adjacent non-control, non-navigating sibling carries the same caption. Ambiguous or captionless matches keep the native control.
  • presentedControlElements() maps the shared control enumeration through it index for index, so control-N ids stay aligned with the control manifest.
  • FormLayoutGraphBuilder and FormPresentationGraphBuilder describe presented elements. Control semantics (topology, classification, provider mapping) still read controlElements().
  • A presenter carries its caption typography like a <button> does.
  • CssValueInspector::isMovedOffscreenBox() uses the same 999px off-screen threshold hidesText() applies to text-indent.

Evidence

  • New tests/unit/form-offscreen-submit-presenter.php (16 assertions) fails on trunk and passes here. It covers visible, clip-only, mismatched caption, ambiguous, navigating link, and non-submit negatives.
  • Lab import of the hosted-builder contact page (2 pages, SSI main + this branch): the submit now renders with source paint (#f5a623, #fff, Montserrat 700) at 390/768/1440; on trunk it rendered no visible submit. Quality pass, 0 fallbacks.
  • The remaining feat(release): configure native component releases #2071 gaps (caption box padding/transform, float pair row, block-flow stacking) are separate follow-ups.

AI disclosure: implemented with Claude (Pi backend via Roadie); Claude diagnosed the producer entity, wrote the change and test, and ran the Lab verification.

@chubes4
chubes4 merged commit fc6676a into trunk Oct 14, 2026
11 checks passed
@chubes4
chubes4 deleted the fix/form-hidden-submit-presenter branch October 14, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant