Re: [w3ctag/design-reviews] Incubation: speculation rules `form_submission` field for prerendering (Issue #1192)

dandclark left a comment (w3ctag/design-reviews#1192)

Thanks for the clarification! @xiaochengh and I have continued looking at this and had a few more suggestions and questions.

- The fact that this is meant to be injected dynamically leads us to wonder whether speculation rules should have some kind of JavaScript object model. The dynamic way this will need to be used is pretty unergonomic, where a `<script>` element is created and set to JSON text (potentially from serialized JSON object) and then injected into the DOM. The inconsistency with how normal speculation rules are used may also be a source of confusion for developers. An API to make this more author-friendly is worth considering as future work.
- We didn't understand the mention of `form-action` CSP as a justification for why the feature is needed. We take the point that if a form submission navigation is going to be blocked by CSP, the `form_submission` speculation rule could prevent wasting the resources to prerender the page that isn't going to be navigated to. But isn't the form basically broken at that point regardless? A wasted prerender seems like it's of relatively low importance if the site isn't working.
 - We also had a hard time following the part of your [earlier reply](https://github.com/w3ctag/design-reviews/issues/1192#issuecomment-3996180497) around "Without this field, prerendering will always be prepared as non form submission and will actually break the current spec." Can you clarify further? What aspect of [populating a session history entry](https://html.spec.whatwg.org/multipage/browsing-the-web.html#populating-a-session-history-entry) will be broken here, other than the fact that we might end up with a wasted prerender since the CSP will cause it to fail to load?
- [`target_hint`](https://github.com/w3ctag/design-reviews/issues/931) is referred to as precedent for this, but for that feature the [explainer](https://github.com/WICG/nav-speculation/blob/main/triggers.md#window-name-targeting-hints) mentioned that `target_hint` could someday maybe be deprecated/removed if Chromium does some internal work such that it's no longer needed. There's a bug tracking that: https://issues.chromium.org/issues/361129302. Should the removal of the `form_submission` rule be tracked in the same way, in case Chrome ever does the engineering work so it's no longer needed?
- The triggering mechanisms mentioned in the explainer (hovering over a submit button) don't seem like they'd work well with mobile. Please consider adding a note on this and consider whether it should be used together with other mobile-friendly triggering mechanisms.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/1192#issuecomment-4340126639
You are receiving this because you are subscribed to this thread.

Message ID: <w3ctag/design-reviews/issues/1192/4340126639@github.com>

Received on Wednesday, 29 April 2026 00:52:35 UTC