Open Bug 1436066 Opened 6 years ago Updated 6 months ago

Incorrect appearance for RTL content inside Simplify Page

Categories

(Core :: Printing: Output, defect)

defect

Tracking

()

Tracking Status
firefox58 --- wontfix
firefox59 --- fix-optional
firefox60 --- affected

People

(Reporter: bmaris, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

[Affected versions]:
- 60.0a1

[Affected platforms]:
- Windows 10 x64
- Ubuntu 16.04 x64

[Steps to reproduce]:
1. Open Firefox with a RTL language build (eg. arabic)
2. Go to https://goo.gl/JvPWSq
3. Enter the Reader view mode (click on the book icon inside the address bar)
4. Observe the content alignment
5. Exit the Reader view mode (click again on the book icon inside the address bar)
6. Enter the print preview (menu - print icon)
7. Enter in Simplify Page (click on the  button with the checkbox)
8. Observe the content alignment

[Expected result]:
- In both, Reader view and Simplify Page the content is aligned to the right.

[Actual result]:
- The content inside the Reader view is  aligned to the right, while in Simplify Page is aligned to the left.

[Regression range]:
- I don’t think this is a regression, older builds have the same behaviour way back to 54.0a1 (2017-02-01). I couldn't verify this issue on older builds. On 54.0a1 (2017-01-31) when clicking on Simplify Page button a white empty page is displayed and on 53.0a1 (2016-12-14) I encountered a tab crash once I click on the Print icon.

[Additional notes]:
- Note that when the content is displayed in a LTR language (although in a RTL language build),  the alignment is to the left in both Reader View and Simplify Page.
Blocks: 1440631
Hey mlongaray, do you have cycles / interest in looking at this bug?
Flags: needinfo?(mlongaray)
Priority: -- → P3
Hey Mike, sorry the delay, I've been swamped in the past few weeks. I'm not sure if I'll have the cycles in the next two weeks, maybe after that. I'll keep you posted.
Flags: needinfo?(mlongaray)
Mike, do you have any pointers on what might be causing this? I've never been involved with how different language builds work. That'd be a lot of help. I might get someone to start ramping on the Simplify work so we can have greater bandwidth.
Flags: needinfo?(mconley)
(In reply to Matheus Longaray (:mlongaray) from comment #3)
> Mike, do you have any pointers on what might be causing this? I've never
> been involved with how different language builds work. That'd be a lot of
> help. I might get someone to start ramping on the Simplify work so we can
> have greater bandwidth.

If I had to guess, look for instances of `rtl` or `dir` in aboutreader files (css/js), and where that's out of sync with what we do with simplify page (given comment #0 says reader mode does work correctly in this case).

To test without an RTL build, you can use about:config and set `intl.uidirection` to the value 1 (default is -1, which uses the direction of the locale that's in use). Checking briefly, I can reproduce like that, and I see that a number of readability container elements have a `dir=rtl` attribute in reader mode, but not in simplify page... Does that help?
Flags: needinfo?(mconley) → needinfo?(mlongaray)

This looks more related to reader mode rather than printing.

Component: Printing → Reader Mode

Redirect a needinfo that is pending on an inactive user to the triage owner.
:Gijs, could you please find another way to get the information or close the bug as INCOMPLETE if it is not actionable?

For more information, please visit auto_nag documentation.

Flags: needinfo?(mlongaray) → needinfo?(gijskruitbosch+bugs)

(In reply to Hanna Jones from comment #5)

This looks more related to reader mode rather than printing.

I'm going to gently push back on this.

bug 1666247 implemented "simplified" view in print mode.

It reuses a bunch of reader mode stuff, but it also copies/duplicates/reimplements some of it. See in particular this code: https://searchfox.org/mozilla-central/rev/2005e8d87ee045f19dac58e5bff32eff7d01bc9b/toolkit/actors/PrintingChild.jsm#193-228

This HTML looks a bit like this:

<body><div id="container"><div id="reader-header" class="header" style="display: block;"><h1 id="reader-title">الصفحة الرئيسية</h1><div id="reader-credits" class="credits">المساهمون في مشاريع ويكيميديا</div></div><div class="content"><div id="moz-reader-content" style="display: block;"><div id="readability-page-1" class="page"><div id="bodyContent">
		<p>من ويكيبيديا، الموسوعة الحرة</p>

... snip ... 

	  </div>
	 </div>
		
	</div></div></div></div></div></body>

whereas in reader mode both the html node and the content container node get dir=rtl (from https://searchfox.org/mozilla-central/rev/2005e8d87ee045f19dac58e5bff32eff7d01bc9b/toolkit/components/reader/ReaderMode.jsm#473 ).

Therefore I think the bug is in how the print code is using readability, which does tell the print code what direction the text it's trying to print has.

This should be reasonably straightforward to fix. :-)

Severity: normal → --
Component: Reader Mode → Printing: Output
Flags: needinfo?(gijskruitbosch+bugs)
Priority: P3 → --
Product: Toolkit → Core
Severity: -- → S3
Depends on: 1666247
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: