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)
Core
Layout: Text and Fonts
Tracking
()
RESOLVED
FIXED
People
(Reporter: bernd_mozilla, Assigned: smontagu)
References
(Blocks 2 open bugs)
Details
Attachments
(2 files, 3 obsolete files)
631 bytes,
text/html
|
Details | |
11.77 KB,
patch
|
Details | Diff | Splinter Review |
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
Assignee | ||
Comment 2•23 years ago
|
||
Accepting. This looks like a similar problem to bug 108187.
Assignee: mkaply → smontagu
Comment 3•23 years ago
|
||
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.
Comment 4•23 years ago
|
||
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
Updated•23 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla0.9.9
Comment 5•23 years ago
|
||
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
Comment 6•23 years ago
|
||
The above patch may be a nudge in the right direction. Or it may not! ;-)
Comment 7•23 years ago
|
||
Attachment #66986 -
Attachment is obsolete: true
Comment 8•23 years ago
|
||
Sigh. Attached wrong patch above.
Attachment #66990 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.9 → mozilla1.1
Assignee | ||
Updated•23 years ago
|
Status: NEW → ASSIGNED
Comment 9•20 years ago
|
||
*** Bug 258928 has been marked as a duplicate of this bug. ***
Comment 10•20 years ago
|
||
See dupe bug 258928 for a testcase with span elements. This bug is also
manifested with padding rather than margins.
Assignee | ||
Comment 11•20 years ago
|
||
*** Bug 266194 has been marked as a duplicate of this bug. ***
Comment 12•19 years ago
|
||
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?
Reporter | ||
Comment 13•19 years ago
|
||
Comment 14•19 years ago
|
||
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
Comment 15•19 years ago
|
||
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.
Comment 16•19 years ago
|
||
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?
Comment 18•19 years ago
|
||
(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.
Comment 19•19 years ago
|
||
Just setting the flags correctly.
BTW, it's not such a long patch...
OS: Windows 98 → All
Target Milestone: mozilla1.1alpha → ---
Comment 20•19 years ago
|
||
(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.
Comment 21•19 years ago
|
||
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.
Comment 23•19 years ago
|
||
HI everybody,
Our documentation for the patch is available at:
http://www.metanetworking.com/Mozilla/121633/reordering.html
The previous link does not work.
Updated•19 years ago
|
Hardware: PC → All
Updated•18 years ago
|
Comment 24•18 years ago
|
||
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.
Description
•