[FIX]dir="reverse" confuses wrapped text

RESOLVED FIXED in mozilla1.8beta1

Status

()

Core
XUL
P1
normal
RESOLVED FIXED
16 years ago
9 years ago

People

(Reporter: neil@parkwaycc.co.uk, Assigned: bz)

Tracking

Trunk
mozilla1.8beta1
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

16 years ago
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.
(Reporter)

Comment 1

16 years ago
Created attachment 70494 [details]
Test Case

To see the effect, click on the vbox, the handler reverses the direction.
(Reporter)

Comment 2

14 years ago
*** Bug 235898 has been marked as a duplicate of this bug. ***

Updated

13 years ago
Assignee: hyatt → nobody
QA Contact: jrgmorrison
(Reporter)

Updated

13 years ago
Blocks: 272420
Created attachment 170892 [details] [diff] [review]
Proposed patch

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)
(Assignee)

Updated

13 years ago
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
Last Resolved: 13 years ago
Resolution: --- → FIXED

Updated

9 years ago
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.