Closed
Bug 348233
Opened 18 years ago
Closed 16 years ago
FTP and Gopher index pages are LTR always
Categories
(Core :: Networking, defect)
Core
Networking
Tracking
()
RESOLVED
FIXED
mozilla1.9.2a1
People
(Reporter: zwnj, Assigned: ehsan.akhgari)
References
(Depends on 1 open bug, Blocks 1 open bug, )
Details
(Keywords: fixed1.9.1, l12y, rtl)
Attachments
(5 files, 5 obsolete files)
55.53 KB,
image/png
|
Details | |
49.47 KB,
image/png
|
Details | |
22.53 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
beltzner
:
approval1.9.1+
|
Details | Diff | Splinter Review |
71.42 KB,
image/png
|
Details | |
50.57 KB,
image/png
|
Details |
FTP and Gopher index pages are LTR always. Screenshots in Persian (RTL) locale will be attached.
Reporter | ||
Comment 1•18 years ago
|
||
Reporter | ||
Comment 2•18 years ago
|
||
Assignee | ||
Comment 3•17 years ago
|
||
Mass-assigning the new rtl keyword to RTL-related (see bug 349193).
Keywords: rtl
Comment 4•16 years ago
|
||
I can reproduce in Firefox 3.1 beta 2 with Hebrew UI. It seems that this page is being rendered in nsIndexedToHTML.cpp. I think it won't be too complicated to fix it.
Target Milestone: Firefox 3 → ---
Assignee | ||
Comment 5•16 years ago
|
||
I'm going to give this a shot.
Assignee: nobody → ehsan.akhgari
Status: NEW → ASSIGNED
Component: General → Networking
Product: Firefox → Core
QA Contact: general → networking
Assignee | ||
Comment 6•16 years ago
|
||
Does anyone know of a working gopher server which can be used to test the patch here? Does Mozilla still support the gopher protocol at all?
Reporter | ||
Comment 7•16 years ago
|
||
This one works yet: gopher://quux.org/
Reporter | ||
Comment 8•16 years ago
|
||
And this is a gopher-based gopher search site, which you can find a lot of working servers: gopher://gopher.floodgap.com/7/v2/vs?firefox
Assignee | ||
Comment 9•16 years ago
|
||
We need to import chrome://global/content/global.dtd for the locale.dir entity here. Since this doesn't seem to be possible for HTML documents (or I don't know how), I tired to change the document to XHTML. With this patch, any attempt to view a file:// or gopher URL results in a blank page. DOM Inspector only shows a HEAD element under HTML, and nothing gets logged to the error console. Can someone point out what's wrong here?
Assignee | ||
Comment 10•16 years ago
|
||
The meat of this patch is based on that of bug 437844. I will comment on some parts of the patch shortly to make the review process easier. I extended the test suite for bug 437844 to test for this bug as well.
Attachment #354000 -
Attachment is obsolete: true
Attachment #359599 -
Flags: superreview?(bzbarsky)
Attachment #359599 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 11•16 years ago
|
||
Comment on attachment 359599 [details] [diff] [review] Patch (v1) Promised comments: >@@ -296,27 +297,35 @@ nsIndexedToHTML::OnStartRequest(nsIReque >+ // Bug 475986 makes this necessary, otherwise >+ // "text-align: start" would be fine >+ "body[chromedir=\"rtl\"] th {\n" >+ " text-align: right;\n" >+ "}\n" Bug 475986 (which I found when developing this patch) caused text-align:start not to work for <th> elements, so we have to use chromedir here. >+ "}\n" >+ "body[chromedir=\"rtl\"] table[order] > thead > tr > th::after {\n" >+ " text-align: left;\n" We don't have text-align:end... >@@ -343,31 +352,37 @@ nsIndexedToHTML::OnStartRequest(nsIReque >+ " }\n" >+ " table {\n" >+ " direction: ltr;\n" It doesn't make sense to reverse the direction of gopher listings, because they're not usually in RTL language. Doing so would look like reversing the direction of LTR documents if the locale direction is RTL. This simple rule makes sure that the direction of the gopher listing remains LTR, while the rest of the page (header) is correctly converted to RTL. >diff --git a/toolkit/themes/pinstripe/global/dirListing/dirListing.css b/toolkit/themes/pinstripe/global/dirListing/dirListing.css > /* last modified */ > th:last-child { >- text-align: center; >+ text-align: center !important; > } Without this, the Last Modified column header in RTL pages would be aligned to right. >diff --git a/toolkit/themes/winstripe/global/dirListing/dirListing.css b/toolkit/themes/winstripe/global/dirListing/dirListing.css > /* last modified */ > th:last-child { >- text-align: center; >+ text-align: center !important; > } Same here.
Comment 12•16 years ago
|
||
Probably good to get Dao to review this, since he wrote most of this code...
Comment 13•16 years ago
|
||
I'd rather we fix bug 475986 or at least sort out what the desired behavior is there, btw, before we hack around it here.
Assignee | ||
Updated•16 years ago
|
Attachment #359599 -
Flags: review?(dao)
Assignee | ||
Comment 14•16 years ago
|
||
Comment on attachment 359599 [details] [diff] [review] Patch (v1) Dao: can you please take a look as well? Thanks!
Comment 15•16 years ago
|
||
The WIP patch is a lot nicer. Can we continue there?
Assignee | ||
Comment 16•16 years ago
|
||
(In reply to comment #15) > The WIP patch is a lot nicer. Can we continue there? Converting this to XHTML did not work. I suspect it was because of the differences between the two (for example an item in this list <http://wiki.whatwg.org/wiki/HTML_vs._XHTML>)) but the major problem was that nothing was reported to the error console and DOM Inspector was useless as well. Do you know of any way to dump the resulting converted string somewhere to make it possible for me to debug the problem?
Comment 17•16 years ago
|
||
The xml namespace is missing from the html element. But it doesn't like any data is being processed, so there must be more wrong...
Assignee | ||
Comment 18•16 years ago
|
||
So, what's happening is that nsDirectoryViewerFactory is creating an HTML document for directory listings <http://mxr.mozilla.org/mozilla-central/source/xpfe/components/directory/nsDirectoryViewer.cpp#1493>, whereas the content of the document tells the parser it's HTML. So, the parser ends up using expat on an HTML content sink, which fails on this line: <http://mxr.mozilla.org/mozilla-central/source/parser/htmlparser/src/nsExpatDriver.cpp#1222>. I'm not sure if blindly switching to XHTML mimetype in nsDirectoryViewerFactory::CreateInstance is the way to go here, or if it affects other pieces of the puzzle that I may not be aware of...
Assignee | ||
Comment 19•16 years ago
|
||
I tried switching to the XHTML doctype, and based on testing it seems to work correctly. I also ported the test and the CSS fixes from the other patch into this patch, which is hopefully cleaner.
Attachment #359599 -
Attachment is obsolete: true
Attachment #359914 -
Flags: superreview?(bzbarsky)
Attachment #359914 -
Flags: review?(dao)
Attachment #359914 -
Flags: review?(bzbarsky)
Attachment #359599 -
Flags: superreview?(bzbarsky)
Attachment #359599 -
Flags: review?(dao)
Attachment #359599 -
Flags: review?(bzbarsky)
Comment 20•16 years ago
|
||
Comment on attachment 359914 [details] [diff] [review] Patch (XHTML) >+ "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n" >+ " \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\" [" I think "<!DOCTYPE html [" would be sufficient. > "table[order] > thead > tr > th::after {\n" [...] > " text-align: right;\n" >+ "}\n" >+ "body[dir=\"rtl\"] table[order] > thead > tr > th::after {\n" >+ " text-align: left;\n" This could use a reference to bug 299837. > th:last-child { >- text-align: center; >+ text-align: center !important; > } When bug 475986 gets fixed, this should also be reverted.
Attachment #359914 -
Flags: review?(dao) → review+
Assignee | ||
Comment 21•16 years ago
|
||
(In reply to comment #20) > > th:last-child { > >- text-align: center; > >+ text-align: center !important; > > } > > When bug 475986 gets fixed, this should also be reverted. Sure. I'll do this upon landing (in case bug 475986 doesn't get fixed in time, I'll file a followup bug so that this won't get forgotten).
Assignee | ||
Comment 22•16 years ago
|
||
Addressed Dao's review comments.
Attachment #359914 -
Attachment is obsolete: true
Attachment #359989 -
Flags: superreview?(bzbarsky)
Attachment #359989 -
Flags: review?(bzbarsky)
Attachment #359914 -
Flags: superreview?(bzbarsky)
Attachment #359914 -
Flags: review?(bzbarsky)
Comment 23•16 years ago
|
||
So is there a good reason to not just fix bug 475986 and bug 299837? Also, there are some places in this patch that are using left+right when they should just use start on <td>, no?
Comment 24•16 years ago
|
||
Ehsan, want to update the patch now that the text-align bugs are fixed?
Assignee | ||
Comment 25•16 years ago
|
||
Attachment #359989 -
Attachment is obsolete: true
Attachment #360924 -
Flags: superreview?(bzbarsky)
Attachment #360924 -
Flags: review?(bzbarsky)
Attachment #359989 -
Flags: superreview?(bzbarsky)
Attachment #359989 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 26•16 years ago
|
||
(In reply to comment #23) > Also, there are some places in this patch that are using left+right when they > should just use start on <td>, no? I'm not sure which changes you were referring to here.
Updated•16 years ago
|
Attachment #360924 -
Flags: superreview?(bzbarsky)
Attachment #360924 -
Flags: superreview+
Attachment #360924 -
Flags: review?(bzbarsky)
Attachment #360924 -
Flags: review+
Comment 27•16 years ago
|
||
Comment on attachment 360924 [details] [diff] [review] Updated patch Looks OK except for the test. Tests must not require network access to run.
Assignee | ||
Comment 28•16 years ago
|
||
(In reply to comment #27) > (From update of attachment 360924 [details] [diff] [review]) > Looks OK except for the test. Tests must not require network access to run. Hmm, do we have support for testing FTP and gopher servers any other way? Would it be OK if I handle the no-network situation inside the test so that it doesn't fail?
Assignee | ||
Comment 29•16 years ago
|
||
This is the same as the previous patch, except that I limited the test to file:// URIs because the FTP and gopher listings are made by the same code, and it should be enough to test the file:// URIs here.
Attachment #360924 -
Attachment is obsolete: true
Attachment #361135 -
Flags: superreview?(bzbarsky)
Attachment #361135 -
Flags: review?(bzbarsky)
Comment 30•16 years ago
|
||
> Hmm, do we have support for testing FTP and gopher servers any other way?
Probably not yet. Sorry I missed that comment; wasnt cced on the bug.
For what it's worth, if I say "r+sr with this one change" there's generally no need to ask me to look again (esp. if the change was as simple as just removing a hunk of code I asked you to remove, as here). I trust you to do that right on your own and all. ;)
Updated•16 years ago
|
Attachment #361135 -
Flags: superreview?(bzbarsky)
Attachment #361135 -
Flags: superreview+
Attachment #361135 -
Flags: review?(bzbarsky)
Attachment #361135 -
Flags: review+
Assignee | ||
Comment 31•16 years ago
|
||
(In reply to comment #30) > > Hmm, do we have support for testing FTP and gopher servers any other way? > > Probably not yet. Sorry I missed that comment; wasnt cced on the bug. > > For what it's worth, if I say "r+sr with this one change" there's generally no > need to ask me to look again (esp. if the change was as simple as just removing > a hunk of code I asked you to remove, as here). I trust you to do that right > on your own and all. ;) Yeah, I was just not sure whether you're OK with removing the tests, or you're suggesting to do the tests another way (hence the question about whether we have support for testing FTP and gopher servers any other way). :-) BTW, am I good to go to request approval on this patch for 1.9.1, and land it without the CSS fixes in the two dependencies?
Comment 32•16 years ago
|
||
It won't work there without those fixes, will it? And in fact will trigger CSS warnings for the unimplemented "end" value....
Assignee | ||
Comment 33•16 years ago
|
||
(In reply to comment #32) > It won't work there without those fixes, will it? And in fact will trigger CSS > warnings for the unimplemented "end" value.... I meant to use the CSS styles in attachment 359989 [details] [diff] [review], which work without those two fixes (and in fact work around those bugs). It won't be an ideal solution but it works, and I think it's enough for 1.9.1.
Comment 34•16 years ago
|
||
Ah, yeah. That would be fine; I assumed by "this patch" you meant the one going into m-c.
Assignee | ||
Comment 35•16 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/35d3b66853a8
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
Assignee | ||
Comment 36•16 years ago
|
||
Comment on attachment 361135 [details] [diff] [review] Final patch This patch fixes the directionality of the directory listing pages in RTL locales. It includes a test. Requesting approval to land on 1.9.1.
Attachment #361135 -
Flags: approval1.9.1?
Updated•16 years ago
|
Attachment #361135 -
Flags: approval1.9.1? → approval1.9.1+
Comment 37•16 years ago
|
||
Comment on attachment 361135 [details] [diff] [review] Final patch a191=beltzner
Assignee | ||
Comment 38•16 years ago
|
||
Landed on 1.9.1 with the required changes to handle the fact that bugs 299837 and 475986 will not be fixed on that branch. http://hg.mozilla.org/releases/mozilla-1.9.1/rev/452aef18ffa2
Keywords: fixed1.9.1
Comment 39•15 years ago
|
||
Ehsan, I am afraid I am seeing a regression in your fix. Please look on the screenshot above, the string "file:" is overlapping the file name!
Comment 40•15 years ago
|
||
Also reproducible for ar and fa.
You need to log in
before you can comment on or make changes to this bug.
Description
•