Closed Bug 652007 Opened 13 years ago Closed 13 years ago

Painting artifacts with RTL trees

Categories

(Core :: XUL, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: neil, Assigned: neil)

References

Details

Attachments

(1 file)

Bug 649840 uncovered a painting bug with RTL trees.
In researching this bug, I have discovered the following:
*GetCoordsForCellItem doesn't take column alignment into account at all
*If the text is overflowing, AdjustForCellText doesn't take column alignment into account, so for instance if all the cells in RTL or right-aligned column overflow then they will have a ragged right margin
*GetItemWithinCellAt and PaintText force the text to be right-aligned without any margin or padding when RTL is in effect (possibly to work around the above bug) although the border and background paints in the expected position allowing for column alignment.
*PaintText also miscalculates the width of the text when it has borders or padding so PaintRow makes PaintSeparator paints over the border or padding.
*PaintRow also gets the left separator wrong; it tries to use the indentation instead of the twisty rect to make a top-level separator span the tree.
Attached patch Proposed patchSplinter Review
Assignee: nobody → neil
Status: NEW → ASSIGNED
Attachment #527681 - Flags: review?(enndeakin)
Comment on attachment 527681 [details] [diff] [review]
Proposed patch

>@@ -1275,25 +1275,17 @@ nsTreeBodyFrame::GetCoordsForCellItem
*GetCoordsForCellItem doesn't take column alignment into account at all

>@@ -1464,32 +1456,32 @@ nsTreeBodyFrame::AdjustForCellText
*AdjustForCellText doesn't take column alignment into account

>@@ -1623,18 +1615,16 @@ nsTreeBodyFrame::GetItemWithinCellAt
*GetItemWithinCellAt forces the text to be right-aligned when RTL is in effect

>@@ -3578,30 +3568,26 @@ nsTreeBodyFrame::PaintText
*PaintText also miscalculates the width of the text (untested in RTL)
*PaintText forces the text to be right-aligned when RTL is in effect
Thanks Neil for your patch!

The other Neil will be on vacation for quite some time.  Is there anybody else who can review this?  roc maybe?
Pushed changeset 3bee3fefdec8 to mozilla-central.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Depends on: 654017
Moving to Core:XUL per https://bugzilla.mozilla.org/show_bug.cgi?id=1455336
Component: XP Toolkit/Widgets: XUL → XUL
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: