The default bug view has changed. See this FAQ.

Painting artifacts with RTL trees

RESOLVED FIXED

Status

()

Core
XP Toolkit/Widgets: XUL
RESOLVED FIXED
6 years ago
6 years ago

People

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

Tracking

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
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.
(Assignee)

Comment 1

6 years ago
Created attachment 527681 [details] [diff] [review]
Proposed patch
Assignee: nobody → neil
Status: NEW → ASSIGNED
Attachment #527681 - Flags: review?(enndeakin)
(Assignee)

Comment 2

6 years ago
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?
Comment on attachment 527681 [details] [diff] [review]
Proposed patch

Review of attachment 527681 [details] [diff] [review]:
Attachment #527681 - Flags: review?(enndeakin) → review+
(Assignee)

Comment 5

6 years ago
Pushed changeset 3bee3fefdec8 to mozilla-central.
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Depends on: 654017
You need to log in before you can comment on or make changes to this bug.