Closed
Bug 97421
Opened 23 years ago
Closed 6 years ago
Default outliner xbl key event handler causes invalid selection
Categories
(Core :: XUL, defect, P3)
Tracking
()
RESOLVED
WONTFIX
mozilla1.0.1
People
(Reporter: mike, Assigned: janv)
References
Details
Attachments
(1 file)
764 bytes,
patch
|
Details | Diff | Splinter Review |
When tracking down a mailnews polish bug, I found that the outliner's default
key event handler can set an invalid selection.
The current code (outliner.xml:411) grabs the index of the current selection,
and if it is not selected, toggles it. The problem is when there is nothing
selected, the current selection is -1 and the handler will cause the outliner
select the -1'th row, via toggleSelect().
This causes a bunch of hassles with anything using nsOutlinerSelection - there
will be a selected row with an index of -1. There is one selection range, but
the range's start and end index is -1. Etc, etc.
I've got a patch, will attach it.
Reporter | ||
Comment 1•23 years ago
|
||
Comment 2•23 years ago
|
||
bryner, can you have a look at this patch for outliner.xml
Reporter | ||
Comment 3•23 years ago
|
||
This blocks bug 44572, the invalid selection range is causing the delete button
to remain disabled.
Blocks: 44572
Reporter | ||
Comment 4•23 years ago
|
||
CC'ing some more people. Guys, can you have a look at the patch?
Assignee | ||
Comment 5•23 years ago
|
||
looks good, r=varga
Comment 6•23 years ago
|
||
Shouldn't you be building this error-handling right into the toggleSelect
method? I assume this can happen through other code paths, so having
toggleSelect error-check would bullet-proof all of them.
Reporter | ||
Comment 7•23 years ago
|
||
The question is, where would be the best place to put such a check?
ToggleSelect ends up calling a bunch of other methods, like Select,
SetCurrentIndex, etc, etc. So, you'd want to put the check up the top of
ToggleSelect. But then these methods should also check the given index to make
sure it is valid. So, a call to ToggleSelect with a valid index could end up
checking the index several times over. Bearing in mind that the check should
verify the index against both the upper and lower bounds of valid indexes, I'm
not sure what the performance hit would be like. Probably not all that great.
Anyway, because of this I though it was probably best to just check the index
before giving it to the outliner. That way, nothing else expecting the incorrect
behaviour would break.
I'll put together a patch which adds a check to the appropriate
nsOutlinerSelection methods, if you think it's worthwhile.
Updated•23 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.0
Updated•23 years ago
|
Target Milestone: mozilla1.0 → mozilla1.0.1
Assignee | ||
Updated•23 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: mozilla1.0.1 → mozilla1.0
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla1.0 → mozilla1.0.1
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
Assignee | ||
Comment 10•6 years ago
|
||
I don't think anyone is going to work on this given the plan to remove XUL tree widget in bug 1446335.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•