Closed Bug 675943 Opened 13 years ago Closed 1 year ago

Need support for dirname attribute

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
116 Branch
Tracking Status
relnote-firefox --- 116+
firefox116 --- fixed

People

(Reporter: aharon, Assigned: vhilla)

References

(Blocks 2 open bugs, )

Details

(Keywords: dev-doc-complete, html5)

Attachments

(4 files)

Attached file dirname.html
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30




Expected results:

HTML5 added a new attribute for <input> and <textarea>, dirname (http://dev.w3.org/html5/spec/Overview.html#the-dirname-attribute):

"A form control dirname attribute on a form control element enables the submission of the directionality of the element, and gives the name of the field that contains this value during form submission. If such an attribute is specified, its value must not be the empty string."

Please note that the directionality is always either "ltr" or "rtl". It is never "auto" or "" or null.

Example:

<form action="addcomment.cgi" method=post>
 <p><label>Comment: <input type=text name="comment" dirname="comment.dir" required></label></p>
 <p><button name="mode" type=submit value="add">Post Comment</button></p>
</form>
When the user submits the form, the user agent includes three fields, one called "comment", one called "comment.dir", and one called "mode"; so if the user types "Hello", the submission body might be something like:

comment=Hello&comment.dir=ltr&mode=add
If the user manually switches to a right-to-left writing direction and enters "مرحبًا", the submission body might be something like:

comment=%D9%85%D8%B1%D8%AD%D8%A8%D9%8B%D8%A7&comment.dir=rtl&mode=add
Blocks: html5bidi
Status: UNCONFIRMED → NEW
Component: General → HTML: Form Submission
Ever confirmed: true
OS: Windows 7 → All
QA Contact: general → form-submission
Hardware: x86_64 → All
Depends on: DirAuto
The URL of the specification changed and is now available here:

http://www.w3.org/TR/html5/forms.html#submitting-element-directionality:-the-dirname-attribute (latest HTML 5 Working Draft)
http://www.w3.org/html/wg/drafts/html/master/forms.html#submitting-element-directionality:-the-dirname-attribute (latest HTML 5.1 Nightly)

One of these URLs should be added to the 'URL' field. (I don't have the rights to do that.)

Sebastian
WHATWG specs are generally preferred IIUC.
Fine for me.

So now this just needs someone to implement.

Sebastian
Component: HTML: Form Submission → DOM: Core & HTML
Severity: normal → S3
Type: defect → enhancement

These .dirName wpt tests fail due to the lack of the support.

Assignee: nobody → vhilla
Attachment #9328810 - Attachment description: Bug 675943 - Implement dirname attr for input elements within forms. r=edgar → Bug 675943 - Part 1: Implement dirname attr for input elements within forms. r=edgar
Depends on: 1108425

Clarification around dirname on input elements just merged to whatwg, see issue 9206

Attachment #9328810 - Attachment description: Bug 675943 - Part 1: Implement dirname attr for input elements within forms. r=edgar → WIP: Bug 675943 - Part 1: Implement dirname attr for input elements within forms. r=edgar
Attachment #9333881 - Attachment description: Bug 675943 - Part 2: Implement dirname attr for textarea elements within forms. r=edgar → WIP: Bug 675943 - Part 2: Implement dirname attr for textarea elements within forms. r=edgar
Attachment #9334502 - Attachment description: WIP: Bug 675943 - Part 3: Clean up after implementing dirname. → WIP: Bug 675943 - Part 3: Clean up after implementing dirname. r=edgar
Attachment #9333881 - Attachment description: WIP: Bug 675943 - Part 2: Implement dirname attr for textarea elements within forms. r=edgar → Bug 675943 - Part 2: Implement dirname attr for textarea elements within forms. r=edgar
Attachment #9328810 - Attachment description: WIP: Bug 675943 - Part 1: Implement dirname attr for input elements within forms. r=edgar → Bug 675943 - Part 1: Implement dirname attr for input elements within forms. r=edgar
Attachment #9334502 - Attachment description: WIP: Bug 675943 - Part 3: Clean up after implementing dirname. r=edgar → Bug 675943 - Part 3: Clean up after implementing dirname. r=edgar
Pushed by vhilla@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/33fabcece85d
Part 1: Implement dirname attr for input elements within forms. r=edgar
https://hg.mozilla.org/integration/autoland/rev/8f514549a81c
Part 2: Implement dirname attr for textarea elements within forms. r=edgar
https://hg.mozilla.org/integration/autoland/rev/56d084bfc8b8
Part 3: Clean up after implementing dirname. r=edgar

Hey Vincent, once this lands and be stuck in m-c, can you nominate this for release note? Simply change the Status of the tracking flag relnote-firefox from --- to ?, then fill in the fields on the comment.

relnote-firefox: --- → ?
Flags: needinfo?(vhilla)
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/40190 for changes under testing/web-platform/tests
Upstream PR was closed without merging
Attachment #9328810 - Attachment description: Bug 675943 - Part 1: Implement dirname attr for input elements within forms. r=edgar → WIP: Bug 675943 - Part 1: Implement dirname attr for input elements within forms. r=edgar
Attachment #9333881 - Attachment description: Bug 675943 - Part 2: Implement dirname attr for textarea elements within forms. r=edgar → WIP: Bug 675943 - Part 2: Implement dirname attr for textarea elements within forms. r=edgar
Attachment #9333881 - Attachment description: WIP: Bug 675943 - Part 2: Implement dirname attr for textarea elements within forms. r=edgar → Bug 675943 - Part 2: Implement dirname attr for textarea elements within forms. r=edgar
Attachment #9328810 - Attachment description: WIP: Bug 675943 - Part 1: Implement dirname attr for input elements within forms. r=edgar → Bug 675943 - Part 1: Implement dirname attr for input elements within forms. r=edgar

Missed some unexpected passes, did further testing and hopefully catched all.

Flags: needinfo?(vhilla)
Pushed by vhilla@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2e52989251ae
Part 1: Implement dirname attr for input elements within forms. r=edgar
https://hg.mozilla.org/integration/autoland/rev/9eba8dccc395
Part 2: Implement dirname attr for textarea elements within forms. r=edgar
https://hg.mozilla.org/integration/autoland/rev/84a06f46030f
Part 3: Clean up after implementing dirname. r=edgar

Release Note Request (optional, but appreciated)
[Why is this notable]: Text directionality can change through multiple ways. If a server wants to reliably display the submitted text correctly, it has to know about the text directionality as it was in the users editor.
[Affects Firefox for Android]: Yes
[Suggested wording]: Added support for the dirname attribute to pass text directionality information about input and textarea elements to the server.
[Links (documentation, blog post, etc)]:
https://www.w3.org/International/questions/qa-html-dir#reportingdirection
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#dirname

relnote-firefox: --- → ?
Upstream PR merged by moz-wptsync-bot

Updated browser-compat-data: 20109

MDN documentation changes for this can be tracked on the following GitHub issue: https://github.com/mdn/content/issues/27760

(Thank you for the BCD additions)

Basic info with release note added to MDN, setting as dev-doc-complete for now. Follow-up improvements incoming as described in the linked GitHub issue.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: