Closed Bug 126620 Opened 23 years ago Closed 20 years ago

[FIX]dir="reverse" confuses wrapped text

Categories

(Core :: XUL, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.8beta1

People

(Reporter: neil, Assigned: bzbarsky)

References

Details

Attachments

(2 files)

Direct children of a <vbox dir="reverse"> will display in the wrong position if
they contain wrapped text either automatically or manually via e.g.
<label style="white-space: -moz-pre-wrap;">wrapped
text
goes
here</label>
The position is offset exactly by the amount of extra height required for the
wrapping. The computed height is correct, and adjacent elements will compute
their position correctly if they do not contain wrapped text.
Attached file Test Case
To see the effect, click on the vbox, the handler reverses the direction.
*** Bug 235898 has been marked as a duplicate of this bug. ***
Assignee: hyatt → nobody
QA Contact: jrgmorrison
Blocks: 272420
Attached patch Proposed patchSplinter Review
The basic problem is that the wrapping changes the size of the box in the
layout loop.  So we go through the "if the child was a block or inline (e.g.,
HTML) it may have changed its rect *during* layout" branch of Layout().  In
this branch, the child's new rect is simply passed to SetBounds() when all is
said and done.	For normal-direction layout this is fine, since the child's
rect will have changed size but not changed position.  But for reverse layout,
we need to keep the rect at the same "far" (XMost or YMost) end, so a change in
size means we need to adjust the origin accordingly.

That's all this patch does.
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #170892 - Flags: superreview?(dbaron)
Attachment #170892 - Flags: review?(dbaron)
OS: Windows 95 → All
Priority: -- → P1
Hardware: PC → All
Summary: dir="reverse" confuses wrapped text → [FIX]dir="reverse" confuses wrapped text
Target Milestone: --- → mozilla1.8beta
Have you tested the patch in left-to-right and right-to-left contexts? The
interaction of dir="reverse" with right-to-left layout can be tricky.
I've done some testing, yes.  I can't actually get the original bug to appear in
a horizontal context (because of the way XUL layout works), which is where this
could possibly be relevant.  So the testing was necessarily somewhat limited --
I just verified that the layout is correct both with and without the patch.
Comment on attachment 170892 [details] [diff] [review]
Proposed patch

r+sr=dbaron, but does anyone do things like reposition views for this movement?
Attachment #170892 - Flags: superreview?(dbaron)
Attachment #170892 - Flags: superreview+
Attachment #170892 - Flags: review?(dbaron)
Attachment #170892 - Flags: review+
Yes, the SetBounds() call handles that.  Checked in for 1.8b.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: