Closed Bug 1321633 Opened 3 years ago Closed 3 years ago

[RTL] Long history item's titles & URLs are being faded out from the wrong side

Categories

(Firefox for Android :: Theme and Visual Design, defect, P5)

Unspecified
Android
defect

Tracking

()

VERIFIED FIXED
Firefox 53
Tracking Status
firefox53 --- verified

People

(Reporter: itiel_yn8, Assigned: maliu)

References

(Blocks 1 open bug)

Details

(Keywords: rtl)

Attachments

(4 files)

After testing the latest Nightly builds, long hisotry item's titles/URLs are being faded out from the wrong side (or not faded at all if the text is hebrew).
Scenarios to consider:
1. Long URLs should ALWAYS fade out from the right side. This should also be applied to LTR builds.
2. Long history item's title should be faded out according to it's text directionality:
   a. If text is RTL, fade out from the left (currently there's no fading at all)
   b. If text is LTR, fade out from the right
   * The same should possibly be applied to LTR builds as well

Screenshot demonstrating the issue is attached.
Blocks: 927667
Blocks: 924699
tracking-fennec: --- → ?
tracking-fennec: ? → ---
Assignee: nobody → max
(In reply to ItielMaN from comment #0)
> Created attachment 8816249 [details]
> Wrong fading out behaviour
> 2. Long history item's title should be faded out according to it's text
> directionality:
>    a. If text is RTL, fade out from the left (currently there's no fading at
> all)
> Screenshot demonstrating the issue is attached.

After dig into android framework, it seems LinearGradient doesn't work on RTL text direction. My current patch only fix the wrong faded edge. Solution is fade by text direction with first-strong-ltr strategy.
Attachment #8823250 - Flags: review?(s.kaspari) → review?(ahunt)
(In reply to Max Liu [:maliu] from comment #2)
> (In reply to ItielMaN from comment #0)
> > Created attachment 8816249 [details]
> > Wrong fading out behaviour
> > 2. Long history item's title should be faded out according to it's text
> > directionality:
> >    a. If text is RTL, fade out from the left (currently there's no fading at
> > all)
> > Screenshot demonstrating the issue is attached.
> 
> After dig into android framework, it seems LinearGradient doesn't work on
> RTL text direction. My current patch only fix the wrong faded edge. Solution
> is fade by text direction with first-strong-ltr strategy.

If helpful I wrote a prototype of the URL bar that could fade on both sides for bug 1271998. I still might have the code somewhere.
Comment on attachment 8823250 [details]
Bug 1321633 - Apply gradient based on text direction with first strong strategy,

https://reviewboard.mozilla.org/r/101816/#review103960
Attachment #8823250 - Flags: review?(ahunt) → review+
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/64767e9197df
Apply gradient based on text direction with first strong strategy, r=ahunt
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/64767e9197df
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 53
This patch probably created a regression where scrolling the history in a New Tab makes faded text (both page titles and URLs) randomly disappear.
Max, should I open a new bug for it or can it be solved in this bug?
Flags: needinfo?(max)
Attached image Before scrolling
Attached image After scrolling
(In reply to ItielMaN from comment #7)
> This patch probably created a regression where scrolling the history in a
> New Tab makes faded text (both page titles and URLs) randomly disappear.
> Max, should I open a new bug for it or can it be solved in this bug?

This bug is confirmed also by Tomer Cohen (CC'd on this bug), if the Android's language is RTL-based such as Hebrew.
Also, text on the history page that *isn't* being faded out looses its directionality and aligns itself to the right, if scrolling like I've said in comment 7.
(In reply to ItielMaN from comment #7)
> This patch probably created a regression where scrolling the history in a
> New Tab makes faded text (both page titles and URLs) randomly disappear.
> Max, should I open a new bug for it or can it be solved in this bug?

Yes, please file a new bug. Thank you.
Flags: needinfo?(max)
Original issues - fading on left side was fixed. 
Verified on Pixel with Nightly 53.0a1 (2017.01.18) with Hebrew on

@ ItielMaN I am not seeing the issue after panning.
Status: RESOLVED → VERIFIED
Blocks: 1332258
You need to log in before you can comment on or make changes to this bug.