Closed
Bug 416013
Opened 17 years ago
Closed 16 years ago
[rtl] bidi UI switching should not affect the display of the emptyText
Categories
(Toolkit :: UI Widgets, defect)
Toolkit
UI Widgets
Tracking
()
VERIFIED
FIXED
mozilla1.9.2a1
People
(Reporter: dao, Assigned: dao)
References
()
Details
(Keywords: intl, rtl, verified1.9.1)
Attachments
(1 file, 4 obsolete files)
1.83 KB,
patch
|
ehsan.akhgari
:
review+
Gavin
:
review+
beltzner
:
approval1.9.1+
|
Details | Diff | Splinter Review |
basically bug 342007, but for toolkit.
Assignee | ||
Updated•17 years ago
|
Flags: blocking1.9?
Target Milestone: --- → mozilla1.9beta4
Assignee | ||
Updated•17 years ago
|
Summary: emptyText should be displayed in the chrome direction → emptyText should always be displayed in the chrome direction
Assignee | ||
Comment 1•17 years ago
|
||
Mano, is this only about the alignment of the text?
Comment 2•17 years ago
|
||
No, it's about both direction and alignment.
Comment 3•17 years ago
|
||
That said, except for something like "חפש ב-amazon" (Search In Amazon), direction & alignment are identical testing-wise.
Assignee | ||
Comment 4•17 years ago
|
||
Ok, messing with the style property is ugly... Anyway, I'd like to know: Does this even work for you?
Comment 5•17 years ago
|
||
er, what happend to style.direction?
Comment 6•17 years ago
|
||
This ought to be done using a class IMO.
Assignee | ||
Comment 7•17 years ago
|
||
(In reply to comment #5)
> er, what happend to style.direction?
I'm using the unicode characters to force the direction... that's the idea at least.
(In reply to comment #6)
> This ought to be done using a class IMO.
Currently we don't have the direction information in the stylesheet, so we would still have to use getComputedStyle and set a "rtl" / "ltr" class, right?
Comment 8•17 years ago
|
||
cannot you set chromedir on the inputfield?
Comment 9•17 years ago
|
||
As in, there's not much point in all this getComputedStyle mess, you should use the chromedir attribute.
Assignee | ||
Comment 10•17 years ago
|
||
Adding chromedir to the bindings <content> means that every binding that extends textbox with its own <content> needs to be updated.
Comment 11•17 years ago
|
||
I'm fine with that.
Assignee | ||
Comment 12•17 years ago
|
||
We don't control all bindings that extend textbox. Since this bug is only discoverable with bidi UI support turned on, third-party widgets that got emptyText for free will remain broken here. That's hardly better than the getComputedStyle mess. It should be possible to combine both approaches.
Comment 13•17 years ago
|
||
Bindings which don't care about this (as in, don't ship localized RTL emptyText) won't update this, I'm fine with too. ;)
Assignee | ||
Comment 14•17 years ago
|
||
You can ship localized RTL emptyText without knowing about this issue.
Comment 15•17 years ago
|
||
Fine, document that on MDC: if you're setting empty text for a customized text field and ship he/ar localization in your extension, you should add the chromedir attribute.
Assignee | ||
Comment 16•17 years ago
|
||
no need to document it if we can make it work out of the box.
Assignee | ||
Comment 17•17 years ago
|
||
This should work. I didn't get it to work with the direction CSS property instead of the left-to-right / right-to-left override.
Attachment #301790 -
Attachment is obsolete: true
Comment 18•17 years ago
|
||
as i told you, this isn't about alignment, so you need to set here both direction and alignment.
Assignee | ||
Comment 19•17 years ago
|
||
That's why the left-to-right / right-to-left overrides are there. Testing with "חפש ב-amazon", this gives me a consistent result. Otherwise I get "amazon-..." after switching the textbox direction (shift+ctrl+x).
Comment 20•17 years ago
|
||
Why do you use getComputedStyle, there's this global.dtd entry....
Comment 21•17 years ago
|
||
and i don't want to make it work it out of the box if we can document this very special case, getComputedStyle is expensive.
Comment 22•17 years ago
|
||
Comment on attachment 301801 [details] [diff] [review]
patch
So, thinking about this more, i prefer the first patch then if we cannot get this to work without js :(
Comment 23•17 years ago
|
||
Comment on attachment 301790 [details] [diff] [review]
first try
I guess this will do for now.
Attachment #301790 -
Attachment is obsolete: false
Attachment #301790 -
Flags: review+
Assignee | ||
Comment 24•17 years ago
|
||
Hrm, the first one was really just a proof-of-concept. Don't you think the chrome direction should be cached at least? As you say, getComputedStyle is expensive.
Assignee | ||
Comment 25•17 years ago
|
||
this also handles |textbox { text-align: center }| gracefully.
Attachment #301801 -
Attachment is obsolete: true
Attachment #301900 -
Flags: review?(mano)
Assignee | ||
Comment 26•17 years ago
|
||
Btw, we don't support text-align:end yet. It's just in there for future compatibility.
Comment 27•17 years ago
|
||
There's more harm in caching this IMO.
Comment 28•17 years ago
|
||
I would care about the expensiveness of getComputedStyle if we did this for every textbox within the chrome (or if we did this every other minute), but this is just for focus/blur events of textboxes with the emptyText property set.
Assignee | ||
Comment 29•17 years ago
|
||
What about textboxes that have an explicit text-align set? (left/right/center)
Assignee | ||
Updated•17 years ago
|
Summary: emptyText should always be displayed in the chrome direction → bidi UI switching should not affect the display of the emptyText
Assignee | ||
Updated•17 years ago
|
Assignee | ||
Comment 30•17 years ago
|
||
updated test
Attachment #301900 -
Attachment is obsolete: true
Attachment #302919 -
Flags: review?(mano)
Attachment #301900 -
Flags: review?(mano)
Updated•17 years ago
|
Flags: blocking1.9? → blocking1.9+
Updated•17 years ago
|
Target Milestone: mozilla1.9beta4 → mozilla1.9
Updated•17 years ago
|
Flags: tracking1.9+ → wanted-next+
Assignee | ||
Updated•16 years ago
|
Attachment #302919 -
Flags: review?(mano)
Assignee | ||
Updated•16 years ago
|
Assignee: dao → nobody
Target Milestone: mozilla1.9 → ---
Comment 31•16 years ago
|
||
This is wanted-next+. Any chance of this making 1.9.1?
Assignee | ||
Comment 32•16 years ago
|
||
Assignee: nobody → dao
Attachment #301790 -
Attachment is obsolete: true
Attachment #302919 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #351009 -
Flags: review?(enndeakin)
Comment 33•16 years ago
|
||
It looks OK, but wouldn't mano be a better reviewer here?
Comment 34•16 years ago
|
||
With this patch, will the textbox's with explicit direction styles be set correctly?
For example, what happens when an RTL app (with locale.dir=="rtl") sets a <textbox> to LTR via CSS?
Assignee | ||
Comment 35•16 years ago
|
||
Depends on the CSS. As for bug 467251: the patch should work for the location bar.
Assignee | ||
Comment 36•16 years ago
|
||
Enn: ping?
(As said on irc, I think mano is busy with other things.)
Comment 37•16 years ago
|
||
I already implied that I don't think I'm a suitable reviewer for this.
Assignee | ||
Updated•16 years ago
|
Attachment #351009 -
Flags: review?(enndeakin) → review?(gavin.sharp)
Assignee | ||
Comment 38•16 years ago
|
||
Comment on attachment 351009 [details] [diff] [review]
patch v3
Mano, can you get to this before the next beta code freeze?
Attachment #351009 -
Flags: review?(gavin.sharp) → review?(mano)
Assignee | ||
Updated•16 years ago
|
Attachment #351009 -
Flags: review?(mano)
Attachment #351009 -
Flags: review?(gavin.sharp)
Attachment #351009 -
Flags: review?(ehsan.akhgari)
Comment 39•16 years ago
|
||
Comment on attachment 351009 [details] [diff] [review]
patch v3
I haven't tested the patch myself, but the code looks fine.
I have one question though. What happens if you don't specify the alignments? I think the direction rule should take care of that as well, right?
Attachment #351009 -
Flags: review?(ehsan.akhgari) → review+
Assignee | ||
Comment 40•16 years ago
|
||
(In reply to comment #39)
> I have one question though. What happens if you don't specify the alignments?
> I think the direction rule should take care of that as well, right?
It doesn't... tested in the search bar and the location bar.
Assignee | ||
Updated•16 years ago
|
Comment 41•16 years ago
|
||
I guess I don't really understand this bug or bug 342007. Why do we need to treat the emptyText differently than normal textbox values?
Assignee | ||
Comment 42•16 years ago
|
||
There shouldn't be a difference by default. But you can switch the direction of a textbox with accel+shift+x in order to write LTR in an RTL setting or vice versa.
Comment 43•16 years ago
|
||
Comment on attachment 351009 [details] [diff] [review]
patch v3
Ah, ok, so we need this to ensure that the emptyText is always in the chrome direction, even if the textbox is switched.
I guess the idea is that these styles take precedence over the styling triggered by the "dir" attribute set in nsEditor::SwitchTextDirection?
Attachment #351009 -
Flags: review?(gavin.sharp) → review+
Assignee | ||
Comment 44•16 years ago
|
||
(In reply to comment #43)
> I guess the idea is that these styles take precedence over the styling
> triggered by the "dir" attribute set in nsEditor::SwitchTextDirection?
Yes, that's an assumption we make.
Assignee | ||
Updated•16 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 45•16 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
Assignee | ||
Updated•16 years ago
|
Attachment #351009 -
Flags: approval1.9.1?
Comment 46•16 years ago
|
||
Verified fixed with:
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090215 Minefield/3.2a1pre ID:20090215020424
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2a1pre) Gecko/20090215 Minefield/3.2a1pre ID:20090215124130
Status: RESOLVED → VERIFIED
Flags: in-litmus?
Summary: bidi UI switching should not affect the display of the emptyText → [rtl] bidi UI switching should not affect the display of the emptyText
Updated•16 years ago
|
Attachment #351009 -
Flags: approval1.9.1? → approval1.9.1+
Comment 47•16 years ago
|
||
Comment on attachment 351009 [details] [diff] [review]
patch v3
a191=beltzner
Assignee | ||
Updated•16 years ago
|
Keywords: checkin-needed
Comment 48•16 years ago
|
||
Keywords: checkin-needed → fixed1.9.1
Comment 49•16 years ago
|
||
Verified on 1.9.1 with builds on OS X and Windows:
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20090221 Shiretoko/3.1b3pre ID:20090221020541
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1b3pre) Gecko/20090221 Shiretoko/3.1b3pre ID:20090221033633
Tracy, would you mind adding a new testgroup/subgroup for RTL tests? We have a couple of tests which could be added.
Keywords: fixed1.9.1 → verified1.9.1
Updated•12 years ago
|
Flags: in-litmus?
You need to log in
before you can comment on or make changes to this bug.
Description
•