Closed
Bug 319066
Opened 18 years ago
Closed 18 years ago
Failure switching tabs when first user is selected (tree includes -1 in selection range)
Categories
(Other Applications :: ChatZilla, defect)
Other Applications
ChatZilla
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: bugzilla-mozilla-20000923, Assigned: bugzilla-mozilla-20000923)
References
Details
(Keywords: regression, Whiteboard: [cz-0.9.69.1])
Attachments
(1 file, 1 obsolete file)
1.03 KB,
patch
|
samuel
:
review+
|
Details | Diff | Splinter Review |
If you select an item or two in the userlist, then scroll it so at least one is not visible, then try to change tab, the content tree dies: [ERROR] Internal error dispatching command “set-current-view”. [ERROR] NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsITreeContentView.getItemAtIndex] @ <chrome://chatzilla/content/static.js> 1445 Apparently items that aren't visible aren't in its list. What sort of crap that is I don't know, but I propose just wrapping the call in a try/catch until we can re-implement a better solution.
Assignee | ||
Comment 1•18 years ago
|
||
Attachment #204976 -
Flags: review?(samuel)
Comment 2•18 years ago
|
||
Comment on attachment 204976 [details] [diff] [review] Squash stupid tree errors for now *mumbles something about this sort of defeating the purpose of this ugly piece of code I wrote. Alas there's not much better. addl. r+
Attachment #204976 -
Flags: review+
Comment 3•18 years ago
|
||
I don't see this problem on Seamonkey, but I noticed there's a builderView as well as a contentView. Could you test if using the builderView instead works as you would expect? It appears to work the same way for me.
Assignee | ||
Comment 4•18 years ago
|
||
It seems there is a bit more to this that just visibility; if I select the top item, change view, change back, then try to change away again - it dies. If, after changing back to the view with 1 item selected, I deselect and reselect that one item, it works. (In reply to comment #3) > I don't see this problem on Seamonkey, but I noticed there's a builderView as > well as a contentView. Could you test if using the builderView instead works > as you would expect? It appears to work the same way for me. The code is common to both Mozilla and Firefox: http://lxr.mozilla.org/seamonkey/source/layout/xul/base/src/tree/src/nsTreeContentView.cpp#693 It doesn't make any sense that it would behave differently. However, builderView seems to work fine - which also makes no sense. Either the damn content element exists or it doesn't!
Assignee | ||
Comment 5•18 years ago
|
||
Even stranger is that the use of contentView in the *set* code is fine! I'll change that to a builderView too, and test, though.
Assignee | ||
Comment 6•18 years ago
|
||
Hm, I accidentally tested the builderView with the try/catch change, so it appeared to work - the builderView fails with the same errors as the contentView, which makes a damn sight more sense.
Assignee | ||
Comment 7•18 years ago
|
||
(FWIW, tree.builderView == tree.contentView is true)
Assignee | ||
Comment 8•18 years ago
|
||
Hm, this is slightly weird. The failure, with Firefox 1.5, only occurs if I select the top item, and something then changes the tree (switch to another view and back, I think joins do it too). After that, it becomes "broken", and I know why. The tree's first select block becomes a range from -1 to A, instead of 0 to A! Man oh man do I hate trees. I'm going to try running with a patch to correct only the -1 -> A range thing, and see if that helps.
Assignee | ||
Updated•18 years ago
|
Attachment #204976 -
Attachment is obsolete: true
Attachment #204976 -
Flags: review?(samuel)
Assignee | ||
Comment 9•18 years ago
|
||
Assignee | ||
Comment 10•18 years ago
|
||
FWIW, it is the select(-1) in the code that is causing there to be a -1 to -1 range at all, and then for it to become a -1 to 0 range when selecting item 0. This was used instead of clearSelection() to (suprise suprise!) work around another tree bug, in bug 197667.
Assignee | ||
Updated•18 years ago
|
Summary: Content tree fails when some items not visible → Tree includes -1 in selection range
Updated•18 years ago
|
Attachment #205029 -
Flags: review?(samuel) → review+
Assignee | ||
Comment 11•18 years ago
|
||
Checked in --> FIXED.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Summary: Tree includes -1 in selection range → Failure switching tabs when first user is selected (tree includes -1 in selection range)
Comment 12•18 years ago
|
||
Maybe a cleaner solution would be to call .select(-1) then .clearSelection()?
Assignee | ||
Comment 13•18 years ago
|
||
*** Bug 320749 has been marked as a duplicate of this bug. ***
Assignee | ||
Updated•18 years ago
|
Whiteboard: [cz-0.9.69.1]
You need to log in
before you can comment on or make changes to this bug.
Description
•