Closed Bug 391740 Opened 13 years ago Closed 13 years ago

listheader in richlistbox appears to right/at bottom of richlistitems

Categories

(Toolkit :: XUL Widgets, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.9beta1

People

(Reporter: myk, Assigned: philip.chee)

References

Details

Attachments

(5 files, 1 obsolete file)

In bug 376815, mano added support for using listheader in richlistboxes.  But when I try it, listheader appears to the right of the richlistitems in the richlistbox, not on top, as I would expect.

And orienting the richlistbox vertically also doesn't fix the problem.  It causes the listheader to appear at the bottom, not at the top.

Here's a testcase that demonstrates the problem.  Might this be fixed by bug 367843?
Blocks: 377784
No longer blocks: 377784
Flags: blocking1.9?
Duplicate of this bug: 395180
Attached patch Patch (obsolete) — Splinter Review
Found the cause.
Assignee: nobody → ventnor.bugzilla
Status: NEW → ASSIGNED
Attachment #280161 - Flags: review?(mano)
(In reply to comment #2)
> Created an attachment (id=280161) [details]
> Patch
> 
> Found the cause.
 
I tried this patch.
It looks good.
Comment on attachment 280161 [details] [diff] [review]
Patch

Let's try for M8 approval. My reasoning is that this will at least prevent the inevitable bug reports from M8 users about this issue, and the fix is one line long.
Attachment #280161 - Flags: approval1.9?
Target Milestone: --- → mozilla1.9 M8
I found there were two more problems.
1. Scroll with column header. 
   Column header should stay the position.
2. The height of the last row is too narrow.

Should I open new bug?
Attached image screenshot
with below tip in userChrome.css

#handlersView {
-moz-box-direction: reverse;
}

no problem with scroll, header stays at the top.
but last line is cut off.
Attached image screenshot
another tip,

#handlersView > listheader {
-moz-box-ordinal-group: 1;
}
Comment on attachment 280161 [details] [diff] [review]
Patch

a=bzbarsky
Attachment #280161 - Flags: approval1.9? → approval1.9+
Keywords: checkin-needed
Thanks for the patch!  I have checked it in.

Checking in toolkit/content/widgets/richlistbox.xml;
/cvsroot/mozilla/toolkit/content/widgets/richlistbox.xml,v  <--  richlistbox.xml
new revision: 1.44; previous revision: 1.43
done


(In reply to comment #6)
> I found there were two more problems.
> 1. Scroll with column header. 
>    Column header should stay the position.
> 2. The height of the last row is too narrow.
> 
> Should I open new bug?

Yes, please do open new bugs for these issues.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Keywords: checkin-needed
OS: Linux → All
Hardware: PC → All
Resolution: --- → FIXED
Attached image screen shot
> 2. The height of the last row is too narrow.

no problem with Win XP default theme.
(In reply to comment #11)
> Created an attachment (id=281272) [details]
> screen shot
> 
> > 2. The height of the last row is too narrow.
> 
> no problem with Win XP default theme.
 
Worksforme too with today's build.
Sorry I don't know why.

Anyway I opened bug 396545 for first problem.
Note: Some people are reporting that the headers are still appearing at the bottom of the list. Littlemutt has discovered that this happens if you have Console² extension installed. Just a headsup.
I plan to update Console² in the next few days.
I don't think this patch really fixed this problem. Adding xul:listheader to the includes statement just makes it NOT match the listheaders (I don't think xbl bindings are that smart about namespaces... or anything really except nodeNames), so they're pushed into the box and Bug 396545 happens.

The reason they're being put at the bottom of the box is because the single listheader element being used here contains some treecols, which get displayed strangely because of the way the tree box model fits things.

An easier fix than that is to just make the richlistbox take a listhead element instead of a listheader element, and then put two listheaders inside of it. Doing so here seemed to make everything work and look fine (minus some theme problems), but I don't have the means to write a diff, and I'm not sure if the listheader/treecol decisions were made for some better reason.
Sounds like this needs a better fix.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attachment #280161 - Attachment is obsolete: true
In fact, the fix should be backed out.
http://lxr.mozilla.org/seamonkey/source/toolkit/content/xul.css#445
listheader {
  -moz-binding: url("chrome://global/content/bindings/listbox.xml#listheader");
  -moz-box-ordinal-group: 2147483646;
}
This was introduced in Bug 178604 which is why the listheader appear at the bottom.
Attached patch Proposed patchSplinter Review
This patch fixes the test case in this bug and it doesn't cause the listheader in a richlistbox to scroll, but it might affect consumers of <richlistbox> that assume that the default orientation is horizontal.
Comment on attachment 281843 [details] [diff] [review]
Proposed patch

> but it might affect consumers of <richlistbox> that
> assume that the default orientation is horizontal.

Actually prior to the listheader support, all children ended up in a vertical scrollbox anyway so I don't think that there are any usages that depend on a richlistbox being horizontally inclined.
Attachment #281843 - Flags: review?(mano)
Um I forgot to mention that the first patch has to be backed out first.
Assignee: ventnor.bugzilla → philip.chee
Status: REOPENED → NEW
Blocks: 396545
Blocks: 377784
Flags: blocking1.9? → blocking1.9+
Comment on attachment 281843 [details] [diff] [review]
Proposed patch

r=mano, many thanks.
Attachment #281843 - Flags: review?(mano) → review+
Keywords: checkin-needed
Whiteboard: old patch needs to be backed out
Target Milestone: mozilla1.9 M8 → mozilla1.9 M9
Version: unspecified → Trunk
Comment on attachment 281843 [details] [diff] [review]
Proposed patch

Requesting approval to revert the previous patch and check in this one.  This patch is the correct fix for the problem.  It's a polish fix for the Applications prefpane, and it shouldn't cause problems for other richlistboxes, as they too are vertically oriented, and none of them use listheaders.
Attachment #281843 - Flags: approval1.9?
This bug has been marked as blocking.
Comment on attachment 281843 [details] [diff] [review]
Proposed patch

(In reply to comment #24)
> This bug has been marked as blocking.

Ah, indeed.  In that case canceling approval request.  I'll check this in.
Attachment #281843 - Flags: approval1.9?
I have reverted the original patch:

Checking in toolkit/content/widgets/richlistbox.xml;
/cvsroot/mozilla/toolkit/content/widgets/richlistbox.xml,v  <--  richlistbox.xml
new revision: 1.45; previous revision: 1.44
done

I haven't yet checked in the new patch, however, because of the following message at the top of toolkit/content/xul.css:

   THIS FILE IS LOCKED DOWN.  YOU ARE NOT ALLOWED TO MODIFY IT WITHOUT FIRST 
   HAVING YOUR CHANGES REVIEWED BY mconnor@steelgryphon.com
Whiteboard: old patch needs to be backed out
Attachment #281843 - Flags: review?(mconnor)
Keywords: checkin-needed
Duplicate of this bug: 399012
Comment on attachment 281843 [details] [diff] [review]
Proposed patch

mconnor gave this r+ over IRC. I'll land it now.
Attachment #281843 - Flags: review?(mconnor)
Checking in toolkit/content/xul.css;
/cvsroot/mozilla/toolkit/content/xul.css,v  <--  xul.css
new revision: 1.104; previous revision: 1.103
done
Status: NEW → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → FIXED
Verified fixed in Minefield/3.0a9pre ID:2007101214
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.