Skip to content

Need support for dirname attribute – FIXED ! #216

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

Open
r12a opened this issue Feb 2, 2020 · 2 comments
Open

Need support for dirname attribute – FIXED ! #216

r12a opened this issue Feb 2, 2020 · 2 comments
Labels
doc:arab_ks doc:arab_ug doc:arfa gap The first comment in this issue is read by the gap-analysis document. i:bidi_text Bidirectional text l:arb Arabic l:ks Kashmiri l:pes Persian l:ug Uighur l:ur Urdu p:ok s:arab Arabic script (Used for arb + pes) s:aran Arabic nastaliq script style x:adlm x:alreq x:arab-ks x:arab-ug x:hebr x:nkoo

Comments

@r12a
Copy link
Contributor

r12a commented Feb 2, 2020

This issue is common to all RTL scripts.

When strings are passed around, some applications don't receive or use information about the appropriate base direction to use for those strings when they are rendered as part of a page.

This can lead to text being incorrectly aligned, and to text within a sentence or paragraph being incorrectly ordered. Some of this can be addressed by using heuristics to detect the direction first-strongly directional character in the string, but some strings can fail such heuristics.

For example, imagine a service which retrieves book names on an English page. If the page retrieves from the database an Arabic book name that begins with LTR letters, it should look like this:

Screenshot 2021-01-21 at 18 12 42

However, if just first-strong heuristics are used to decide the base direction for the inserted book name, it will incorrectly produce:

Screenshot 2021-01-21 at 18 14 00

For these cases the databases or JSON files, etc., from which such strings are pulled need to contain metadata about the base direction which needs to be applied to correct the display. The appropriate direction can be communicated to the backend storage from a form input by using the dirname attribute. This indicates the base direction in force for a form control, whether it is derived from the surrounding text or set manually by the user while typing.

More:

The GAP

The direction of the field is passed with the form data by Chrome and WebKit, but not by Gecko. Note that Gecko also doesn't change the computed direction of the form field when the user manually sets the direction.

Priority

Basic, because of its usefulness in ensuring correct directional display of RTL text that starts with a LTR character.

Tests & results

i18n test suite HTML5, dirname

Action taken

Gecko bug (already raised)

Outcomes

All 3 major browser engines, Gecko, Blink, & WebKit, now support relaying the field direction to the server using dirname. It also supports changing the computed direction of a form field when the user manually sets the direction.

See Can I Use?

@r12a r12a added gap The first comment in this issue is read by the gap-analysis document. doc:arfa i:bidi_text Bidirectional text p:basic The gap-analysis priority is Basic. labels Feb 2, 2020
@r12a
Copy link
Contributor Author

r12a commented Feb 2, 2020

The first comment in this issue contains text that will automatically appear in one or more gap-analysis documents as a subsection with the same title as this issue. Any edits made to that comment will be immediately available in the Editor's draft of the document. Proposals for changes or discussion of the content can be made by adding comments below this point.

Relevant gap analysis documents include:
AdlamArabicHebrewN'Ko

@xfq
Copy link
Member

xfq commented Feb 18, 2022

There are many related specs, like Web APIs (and maybe Web IDL and/or ECMAScript), data formats (like JSON-LD), manifests, and maybe markup languages. There will likely be new standards in the future that have this problem. How do we judge this problem has been solved?

@r12a r12a changed the title Base direction needed for string data Need support for dirname attribute Jun 13, 2023
@r12a r12a added p:ok and removed p:basic The gap-analysis priority is Basic. labels Aug 7, 2023
@r12a r12a added l:arb Arabic l:pes Persian l:ug Uighur l:ur Urdu l:ks Kashmiri labels Jun 5, 2024
@r12a r12a moved this to Fixed in Gap-analysis pipeline Jun 20, 2024
@r12a r12a added the s:arab Arabic script (Used for arb + pes) label Jun 29, 2024
@r12a r12a added the s:aran Arabic nastaliq script style label Jul 5, 2024
@r12a r12a changed the title Need support for dirname attribute Need support for dirname attribute – FIXED ! Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc:arab_ks doc:arab_ug doc:arfa gap The first comment in this issue is read by the gap-analysis document. i:bidi_text Bidirectional text l:arb Arabic l:ks Kashmiri l:pes Persian l:ug Uighur l:ur Urdu p:ok s:arab Arabic script (Used for arb + pes) s:aran Arabic nastaliq script style x:adlm x:alreq x:arab-ks x:arab-ug x:hebr x:nkoo
Projects
Development

No branches or pull requests

2 participants