Skip to content

<form method="dialog"> should probably not check for noopener #8499

Closed

Description

@nt1m

According to the spec, we should be checking for the noopener, and then skip to the dialog steps.

https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#form-submission-algorithm:get-an-element's-noopener

I think it probably makes sense to skip to the dialog steps earlier, before we even do any navigation checks, given form[method=dialog] does not involve any navigation.

cc @domenic @annevk

Activity

  1. added
    agenda+
    on Nov 14, 2022
  2. nt1m commented on Nov 14, 2022

    @nt1m
    MemberAuthor

    cc @whatwg/forms too

  3. added
    topic: forms
    on Nov 14, 2022
  4. annevk commented on Nov 14, 2022

    @annevk
    Member

    So currently <form method=dialog rel=noopener> fails to submit (due to an early return) and with this change it would succeed (or at least continue beyond that point). Seems reasonable to me for the reason you state.

    Edit: this analysis was incorrect. The problem is that we end up creating a top-level navigable we don't need.

  5. domenic commented on Nov 16, 2022

    @domenic
    Member

    Seems good to me. So this would consist of moving what is currently steps 16 and 23 up to after step 9, I think? That is, we still want to:

    • Check "cannot navigate" (multiple times)
    • Check sandboxing
    • Fire submit events
    • Construct the entry list and thus fire formdata events

    But we do not want to:

    • Bail early if the action="" value is not parseable as a URL
    • Call "the rules for choosing a navigable" including potentially creating a new window, consulting target/formtarget, etc.

    Would you be up for writing a spec PR and tests PR covering these?

  6. annevk commented on Nov 16, 2022

    @annevk
    Member

    Presumably we just have to move

    If the value of method is dialog then jump to the submit dialog steps.

    up? Makes sense to ignore action parsing as well. (Ideally we'd not have "jump", but that's a bit more effort.)

  7. domenic commented on Nov 16, 2022

    @domenic
    Member

    Right, that's step 23; step 16 is establishing the value of method.

  8. smaug---- commented on Nov 16, 2022

    @smaug----
  9. added
    topic: dialog
    on Nov 17, 2022
  10. josepharhar commented on Dec 8, 2022

    @josepharhar
    Contributor

    Sounds good to me. Based on what I'm reading in chromium it seems like this is what we are already doing.
    The check for method=dialog comes before what I believe is the check for the target navigable.

  11. removed
    agenda+
    on Dec 13, 2022
  12. smaug---- commented on Jan 30, 2023

    @smaug----

    Looks reasonable. @avandolder

  13. avandolder commented on Jan 30, 2023

    @avandolder

    Yeah, this should also line up with how Gecko already handles submissions - we check for dialog before handling rel values.

  14. added a commit that references this issue on Feb 24, 2023
    dcaf4dd
  15. annevk commented on Mar 5, 2023

    @annevk
    Member

    FYI, I ended up finding a "bug" in Gecko. It takes the form's action into account. Bug linked from the PR.

  16. added a commit that references this issue on Mar 6, 2023
    e150a14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: dialogtopic: forms

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions