Closed Bug 64490 Opened 24 years ago Closed 24 years ago

ALIGN="left" is ignored when DIR="rtl"

Categories

(Core :: Layout, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla0.9.1

People

(Reporter: mar_garina, Assigned: mkaply)

References

()

Details

(Keywords: rtl)

Bug description: When mozilla encounters a html with <HTML DIR="rtl">, it indeed shows the html as a right-to-left page. It automatticly aligns any <TD> in a table to the right, and that's good. the problem is that if the user wants to align to the left, <TD ALIGN="left"> doesn't work as it should- the ALIGN="left" is ignored and it aligns it to the right. How it should be: Mozilla should not ignore the ALIGN parameter in the <TD> if the document is defined as DIR="rtl" , and if it encounters ALIGN="left", it should align to the left. How to reproduce: Just view the source of the URL I put here. Note: I'm not sure why, but I think that when mozilla loads the html from cache it works fine.. if you see this fine, try to reload the document.
Looks related to bug 24366 and bug 1802. Any thoughts?
Assigning to myself. I just started working on a fix for this and other related bugs. It shouldn't be that hard. I'm just trying to make all of our -moz-right hacks work for -moz-left too...
Assignee: karnaze → dbaron
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Priority: -- → P2
Hardware: PC → All
Target Milestone: --- → mozilla0.8
The cache effects may be due to some of the recent table regression bugs... I'm not sure what we'd see without those bugs.
Actually I think this may be harder than I thought. I think this and bug 24366 may be due to a problem in nsLineLayout... (search for DIRECTION in nsLineLayout.cpp to find some interesting comments and code...)
Dump frames shows: TableCell(td)(1)@0x41e781e0 {24,0,3552,588} [state=00000014] sc=0x41e797e0< Block(td)(1)@0x41e78240 {24,24,3504,540} [state=001c0014] sc=0x41e79bd0(i=1,b=0)< line 0x41e78334: count=1 state=inline,clean,NOT Impacted,[0x1000] mew=1764 {0,0,1764,540} ca={0,0,3504,540} < Frame(img)(0)@0x41e7828c {1740,0,1764,540} [state=000000b4] > > > the line box mBounds is {0,0,1764,540} but the img frame is at {1740,0,1764,540} This seems suspicious to me, although I'm not 100% sure what they should be. Perhaps this is related to nsLineLayout::UpdateFrames not being written for RTL?
I wonder if this is fixed by IBM's bidi changes in bug 62777 -- they have some changes to nsLineLayout.cpp that may fix this (like the ones in TrimTrailingWhiteSpaceIn). Assigning back to default layout owner.
Assignee: dbaron → clayton
Component: HTMLTables → Layout
Depends on: 62777
QA Contact: chrisd → petersen
Note, if this file is stored on a local drive it also works, right?
H-J: No, The html doesn't work well from local drive.
Yes, the IBM bidi code seems to fix this bug
dbaron: bidi changes seem to work only for an element with explicit specification of alignment (like example in the "Bug description"), but not in the case of inherited alignment (eg, if you have <html dir="rtl" align="left">, child elements inherit the direction, but not the alignment.)
align="left" has no meaning on the HTML element
does ALIGN have meaning on the TABLE element? (<table dir="rtl" align="left">: only the dir attribute affects cell alignment.)
On a TABLE it's equivalent to float so it shouldn't affect the alignment of the contents. Something like <div align=left> <p>Left-aligned RTL text.</p> </div> ought to work, though.
Yes, it works. So I'm sorry... It seems that bidi code fixed this bug.
Based on previous comment, assigning to mkaply since this will be fixed when bidi branch lands.
Assignee: clayton → mkaply
A very similar bug I found (just for making sure bidi patch will fix this one also): http://www.deot.net/alignbug2.html
What is supposed to happen here? Do you mean that a typed text must be always aligned to the left?
Not at all.. The box is aligned to left, and when I type something inside it 'jumps' to the right, as it was aligned to the right. Does it work well for you ??
Yes, it works fine; when typing the box remains left-aligned.
This is weird, it happens both in the version I built and in the binary. Anyway.. if it's just in my place so ignore it...
Sorry, I had to say that I was using a BIDI version of mozilla.. (since you wanted to make sure that bidi patch will fix this one also.)
Updating milestone - Bidi is being targeted for 0.9 I believe
Target Milestone: mozilla0.8 → mozilla0.9
This bug will be fixed when IBMBIDI is turned on
Status: NEW → ASSIGNED
Depends on: 75982
No longer depends on: 62777
Target Milestone: mozilla0.9 → mozilla0.9.1
Web site is not available, but per conversation and since Bidi is in, I am marking this fixed. Reporter, please reopen if you see this problem.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
HTML Element issue
QA Contact: petersen → bsharma
Verified on build: 2001-05-29-20-Trunk platform: Win NT Tested the http://www.deot.net/alignbug2.html test case and while typing the text is right aligned and the box is left aligned.
Status: RESOLVED → VERIFIED
Mass-assigning the new rtl keyword to RTL-related (see bug 349193).
Keywords: rtl
You need to log in before you can comment on or make changes to this bug.