Closed Bug 762270 Opened 12 years ago Closed 11 years ago

the file path text alignment for <input type = "file"> in arabic or other RTL locale should be right aligned

Categories

(Core :: Internationalization, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: shivangshah15, Assigned: mounir)

References

Details

(Keywords: rtl)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.4) Gecko/20100101 Firefox/10.0.4
Build ID: 20120420145309

Steps to reproduce:

using the <input type = "file"> tag on a page in arabic locale


Actual results:

As in arabic locale, the orientation of text is from right to left, when a user selects a file, the file-path text that is shown should be right-aligned. Instead it is left-aligned. We cannot use the CSS property "style = text-align: right;" because that will mess up the alignment in English locale (which should be left)


Expected results:

As in arabic locale, the orientation of text is from right to left, when a user selects a file, the file-path text that is shown should be right-aligned. Instead it is left-aligned. We cannot use the CSS property "style = text-align: right;" because that will mess up the alignment in English locale (which should be left)
Priority: -- → P3
Tricky... I suspect if we change this there will immediately be a bug filed to change it back, like bug 641238 for the URL field.

Does the same thing happen with an Arabic version of the browser? AFAICT (from the "Browse..." button), the screen shot is from an Arabic page viewed in an English browser.
I am sorry I have not tried the Arabic version of the browser. 

My scenario is:

The web application has localized resource strings. Depending on the browser locale, we show the respective localized strings. What you saw in the screenshot was basically firefox installed in English (native english language) but the browser language was changed to arabic. The web application detects arabic locale of the browser and changes all the localized resource strings (and the relative orientation of the full application) in arabic locale. I hope that makes sense?

It seems like the <input type = "file"> doesn't let the user input manually input a file path. It basically gets the path text when the user selects a file by clicking browse and populates the text field with that path text. If we look at any <input type = "text"> the alignment is to the right. So hope to see the same consistency with this input type. 

Please let me know if you need more information on this. my suggestion would be that the alignment for <input type="file"> should be the same as the <input type="text"> and both should be right aligned because of the arabic locale. Graphically Speaking for arabic locales:

    -------------------------------------
    | C:\Shivang Shah                    |   :Browse (incorrect alignment)
    -------------------------------------

    -------------------------------------
    |                    C:\Shivang Shah |   :Browse (correct alignment)
    -------------------------------------

Let me know if you need more info on this.

As far as the related bug 641238 is concerned, that is specifically for URL field and even though I totally agree with what people are discussing there, this is a specific requirement from the customers. So I believe the users do want it after-all :-) 

I am new to bugzilla and this is my very first bug filing :). I am not sure how these bugs are validated and/or how the decisions are made if they are actual bugs/regressions/enhancements. 

If you guys have a documented reasoning as to why it is done the way it is done (other then the related bug that you just provided), we could probably provide it to the customers. But from our application point of view, we are trying to be consistent throughout all browsers and it seems that chrome and IE handles them gracefully (although, I would not comment on if its the right/wrong way to do it. That's quite ambiguous :) )

Thanks !
cc-ing some Arabic and Hebrew experts.

To the best of my recollection, and judging by http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/style/forms.css&rev=3.151&mark=580-583#574, this is not the intended behaviour in file inputs. 

That looks as if it was intended for all file input text fields to have ltr directionality, but align right or left depending on the direction of the containing element. I need to check whether it ever actually worked that way.
Status: UNCONFIRMED → NEW
Ever confirmed: true
I am quite indifferent to it. AFAIU it shouldn't be edited anyway.
So I am looking at the CSS and it seems like the directionality is ok, but the "text-align" is set to "inherit" .. now I believe that for arabic locale, it should be inherited and mirrored ? meaning .. if the inherit is "right" for english, it should be aligning left and vice versa ?
Forgot to mention. 
Maybe, we should look at the value that is inherited for "text-align" in arabic locale as well. It is supposed to be inheriting the mirrored values, just like it does for other html tags (or maybe I am misunderstanding how the whole mirroring of alignment is handled, then it could be a totally different approach to handle this)
dbaron pointed out on IRC that what we need here is probably "text-align: match-parent" from CSS3 Text. http://www.w3.org/TR/css3-text/#match-parent
Depends on: 645642
I see bug 645642 is open for quite sometime. Are we expecting resolution on it? Or is this something we can tweak on the application side?
I'm planning to make a fix for bug 645642 in the near future. In the mean time, you may be able to work around by adding explicit "text-align: right" to the style for input[type="file"] in RTL locale.
Ok .. that would basically mean detecting both the browser (IE and chrome seem to working fine already) and browser locale and depending on both these parameters we should be doing the alignment ? I can look into that and evaluate the effort. If it's more than expected then we can just wait for the fix. 

No pressure, but any estimates on the time-frame?
Blocks: 838675
Keywords: rtl
Summary: the file path text alignment for <input type = "file"> in arabic locale should be right aligned → the file path text alignment for <input type = "file"> in arabic or other RTL locale should be right aligned
Depends on: 838694, 345195
No longer depends on: 645642
Attached patch PatchSplinter Review
Assignee: nobody → mounir
Status: NEW → ASSIGNED
Attachment #711287 - Flags: review?(smontagu)
OS: Windows 7 → All
Priority: P3 → --
Hardware: x86_64 → All
Version: 10 Branch → Trunk
Comment on attachment 711287 [details] [diff] [review]
Patch

Review of attachment 711287 [details] [diff] [review]:
-----------------------------------------------------------------

r=me (but please add a TODO about considering switching to match-parent, as you said on IRC)
Attachment #711287 - Flags: review?(smontagu) → review+
Target Milestone: --- → mozilla22
https://hg.mozilla.org/mozilla-central/rev/f022adef69ff
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: