Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submitting element directionality for various input element types #9206

Closed
vinhill opened this issue Apr 24, 2023 · 8 comments
Closed

Submitting element directionality for various input element types #9206

vinhill opened this issue Apr 24, 2023 · 8 comments
Labels
i18n-afrlreq Notifies African languages experts of relevant issues i18n-alreq Notifies Arabic script experts of relevant issues i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. topic: forms

Comments

@vinhill
Copy link
Contributor

vinhill commented Apr 24, 2023

With regard to input elements, the dirname attribute only applies for the elements in the text and search state. But the algorithm for constructing an entry list does not enforce this. A possibility would be to extend step 11 with: If the element is an input element whose type attribute is not the Text or Search state, continue. This makes it easier for browsers to behave consistent and it becomes obvious for which types the submission of dirname would succeed.

Currently, a user could deviate from the standard and specify dirname on other types of input elements. While the standard states that dirname does not apply and must not be specified for non-text, non-search input types, it is not specified how to enforce this. Though, given multiple continue instructions within the construction of an entry list, it becomes obscure under which situations such a deviation might succeed.

I am currently implementing this attribute in Firefox and compared a first implementation to Chrome. I tested the attribute on an input element with empty value. Both browsers might submit the directionality if the type attribute corresponds to tel, url, email, password and number while only Firefox would also submit for hidden, date, month, week, datetime-local, range and color.

@zcorpan

@r12a r12a added i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. i18n-alreq Notifies Arabic script experts of relevant issues i18n-afrlreq Notifies African languages experts of relevant issues labels Apr 24, 2023
@annevk
Copy link
Member

annevk commented Apr 24, 2023

Yeah, you are correct. That note is very misleading currently.

I think extending step 11 is the way to go, though I would augment the existing conditional instead of adding a new step. Also, don't forget about textarea. Are you willing to submit a PR?

@zcorpan
Copy link
Member

zcorpan commented Apr 24, 2023

We could check for whether dirname applies when the element is an input element, instead of checking type directly.

@annevk
Copy link
Member

annevk commented Apr 24, 2023

We could, though I think checking the state is better because:

  1. Most of form submission does so already.
  2. Applies only works for input, not textarea.
  3. Applies is quite indirect and hard to translate into actionable requirements.

@vinhill
Copy link
Contributor Author

vinhill commented Apr 24, 2023

Sure, I can submit a pull request.

I came up with three formulations for the condition. By referencing concept-input-apply, it stays somewhat actionable. I believe, for two and three, the note is not necessary anymore. If we remove the note, I would favor the latter two options.

  1. If the element has a dirname attribute, and that attribute's value is not the empty string, and, if the element is an input element, the dirname attribute applies, then:
    ...
    Note: An element can only have a dirname attribute if it is a textarea element or an input element. The dirname attribute only applies to an input element whose type attribute is in either the Text state or the Search state.

  2. If the element has a dirname attribute, and that attribute's value is not the empty string, and, if the element is an input element, the type attribute is in the Text or Search state, then:
    ...
    Note: An element can only have a dirname attribute if it is a textarea element or an input element.

  3. If the element has a dirname attribute whose value is not the empty string, and, for input elements, the type attribute is in the Text or Search state, then:

@annevk
Copy link
Member

annevk commented Apr 24, 2023

Dropping the note seems good, how about something like:

If the element has a dirname attribute, that attribute's value is not the empty string, and the element is either a textarea element or an input element whose type attribute is in the Text or Search state, then:

@r12a

This comment was marked as off-topic.

@annevk

This comment was marked as off-topic.

@r12a

This comment was marked as off-topic.

@annevk annevk closed this as completed in 1605570 May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n-afrlreq Notifies African languages experts of relevant issues i18n-alreq Notifies Arabic script experts of relevant issues i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. topic: forms
Development

No branches or pull requests

4 participants