Closed Bug 1263674 Opened 4 years ago Closed 4 years ago

Awesomebar popup truncates text incorrectly in RTL

Categories

(Firefox :: Address Bar, defect)

defect
Not set

Tracking

()

VERIFIED FIXED
Firefox 48
Tracking Status
firefox48 --- verified

People

(Reporter: adw, Assigned: adw)

References

Details

Attachments

(1 file)

It's truncated so that it's way too short because the truncation calculation uses a DOMRect.left -- not RTL-aware.  Not sure how I did not notice this before when I tested RTL but I definitely did not.
Comment on attachment 8740064 [details]
MozReview Request: Bug 1263674 - Fix awesomebar popup truncation in RTL. r?mak

https://reviewboard.mozilla.org/r/45533/#review42333

::: toolkit/content/widgets/autocomplete.xml:2020
(Diff revision 1)
> -          // the listbox's padding on the left side.
> +          // visually balance out the listbox's padding on the left side.
> +          let dir =
> +            this.ownerDocument.defaultView.getComputedStyle(this).direction;
> +          let titleStart = dir == "rtl" ? itemRect.right - titleRect.right
> +                                        : titleRect.left - itemRect.left;
>            let extraPadding = 30;

I'd move up the definition of extraPadding just after the comment, just to help readability a little bit.
Attachment #8740064 - Flags: review?(mak77) → review+
https://hg.mozilla.org/mozilla-central/rev/882c541a3be3
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48
The text is correctly truncated across platform using the Arabic locale of Latest 48.0a2 DevEdition, buildID 20160503004116.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.