Closed Bug 121633 Opened 23 years ago Closed 18 years ago

[bidi]reflowinlineframes accumulates margins on the right side.

Categories

(Core :: Layout: Text and Fonts, defect, P3)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: bernd_mozilla, Assigned: smontagu)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files, 3 obsolete files)

see attached testcase, under rtl conditions the images are not separated. The picture should be symmetric. Use IE to see the correct rendering. 2002-01-18-03
Attached file testcase
Accepting. This looks like a similar problem to bug 108187.
Assignee: mkaply → smontagu
Interesting. The patch in bug 46918 does not fix the problem, unfortunately. It looks like we're not accounting for _any_ left margin; i.e., removing `margin-right' altogether shows no space between the two images.
The problem here is that we're not including the margins in nsLineLayout::HorizontalAlignFrames. I'll include this change in the patch for bug 46918.
Assignee: smontagu → waterson
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla0.9.9
Well, I was wrong! I think that we do need to make some changes to nsLineLayout::HorizontalAlignFrames, which I'll attach, but the problem is deeper than that. Specifically, I think the code in nsBidiPresUtils::RepositionInlineFrames is going to need some serious re-thinking, as it needs to account for margins during re-ordering: margins may be arbitrarily nested through spans containing the text frames. It may make the most sense to try to incorporate this logic with the reflow instead of trying to do it out-of-line.
Assignee: waterson → smontagu
Status: ASSIGNED → NEW
Attached patch partial fix (obsolete) — Splinter Review
The above patch may be a nudge in the right direction. Or it may not! ;-)
Depends on: 46918
Attached patch oops, last patch missed a chunk (obsolete) — Splinter Review
Attachment #66986 - Attachment is obsolete: true
Attached patch argh! (obsolete) — Splinter Review
Sigh. Attached wrong patch above.
Attachment #66990 - Attachment is obsolete: true
Target Milestone: mozilla0.9.9 → mozilla1.1
Status: NEW → ASSIGNED
Blocks: 137995
*** Bug 258928 has been marked as a duplicate of this bug. ***
See dupe bug 258928 for a testcase with span elements. This bug is also manifested with padding rather than margins.
Blocks: 258928
*** Bug 266194 has been marked as a duplicate of this bug. ***
An ignorant's question regarding the patch: Is it just me or is the file no longer in the same place and no longer with the same content?
Comment on attachment 66991 [details] [diff] [review] argh! nsLineLayout.cpp has moved to layout/generic/ and its contents has changed.
Attachment #66991 - Attachment is obsolete: true
Blocks: 290160
i debugged the source code, it seems that margin-left isn't applied to RTL inline-frames at all. (width of frame is equal to width of content + margin-right) i commented out nsBidiPresUtils::RepositionInlineFrames() to ensure it's not reordered, but the output does not have left margins still. in nsLineLayout::ApplyStartMargin() we have: if (ltr) pfd->mBounds.x += pfd->mMargin.left; with no else for LTR.
No longer blocks: 258928
Attached patch a LONG! patchSplinter Review
Hi, please take a look at the patch. We beleive that the problem is in the algorithm since it could not be done top down. We need to have a bottom-up method instead. We will submit a document describing the problem and our solution soon. Thanks to Haamed to his hardwork
So, for what it's worth, I'm a bit scared of pages that mess with inline frames for Bidi reasons right now -- at least until bug 299065 lands. Bug 299065 is needed so that a unique directionality can be associated with each inline frame. Even once that happens, I'm not entirely sure what 'margin-left' and 'margin-right' should mean on inlines that have complex directionality, although I suspect the answer is that it should depend on 'direction': that is, for 'direction:ltr' ['direction:rtl'] frames, the 'margin-left' ['margin-right'] should be on the left [right] edge of the first logical part of the frame and 'margin-right' ['margin-left'] on the right [left] edge of the last logical part of the frame. What did this patch implement?
(In reply to comment #17) > Even once that happens, I'm not entirely sure what 'margin-left' and > 'margin-right' should mean on inlines that have complex directionality, > although I suspect the answer is that it should depend on 'direction': that > is, for 'direction:ltr' ['direction:rtl'] frames, the 'margin-left' > ['margin-right'] should be on the left [right] edge of the first logical part > of the frame and 'margin-right' ['margin-left'] on the right [left] edge of the > last logical part of the frame. I think http://www.w3.org/TR/CSS21/box.html#q11 (section 8.6) disagrees with you here. It says the "left-most" (or "right-most") part is the one getting the margins, paddings, and borders, not the first/last logical parts. I think that actually makes sense (although perhaps more difficult to implement). Thanks to smontagu for providing me with that reference.
Just setting the flags correctly. BTW, it's not such a long patch...
OS: Windows 98 → All
Target Milestone: mozilla1.1alpha → ---
(In reply to comment #17) > So, for what it's worth, I'm a bit scared of pages that mess with inline frames > for Bidi reasons right now -- at least until bug 299065 lands. Bug 299065 is > needed so that a unique directionality can be associated with each inline > frame. Forgot to say this: I'm actually re-writing this very code (nsBidiPresUtils::ReorderFrames()) as part of my patch for bug 299065 (see bug 299065 comment 25). While my patch doesn't fix margins (i.e., this bug), it does fix borders and paddings (bug 237370 and bug 258928), modulo bug 299063 and the issues mentioned in comment 17 and 18 here. So I'm joining dbaron's recommendation to wait with this until after bug 299065 is fixed. Mohsen and Haamed, it seems like bad luck that you guys worked on this at the very same time I started working on bug 299065. I will look at your patch to see if it gives me ideas for fixing the margin issues after 299065 is fixed.
here is a document about bug: http://ccsv.lsbu.ac.uk/~mnaderi/mozilla/121633/reordering.html As Uri said, w3.org has cleared what should be done about margins and paddings.
That part of the spec is relatively new; if we think it's wrong, it's definitely open to change, especially if current implementations don't interoperably agree with it.
HI everybody, Our documentation for the patch is available at: http://www.metanetworking.com/Mozilla/121633/reordering.html The previous link does not work.
Hardware: PC → All
Blocks: 328168
Blocks: 299250
Blocks: Persian
No longer blocks: 328168
Depends on: 328168
Fixed by Haamed's patch for bug 328168.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Component: Layout: BiDi Hebrew & Arabic → Layout: Text
QA Contact: zach → layout.fonts-and-text
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: