Closed Bug 267866 Opened 16 years ago Closed 14 years ago

Wrong algorithm of selection in listbox seltype="multiple"


(Core :: XUL, defect)

Windows 2000
Not set





(Reporter: surkov, Unassigned)





(3 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040616
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040616

I get invalid selection when I select items in the following way. Let m<i<n is
indexes of listitems

Reproducible: Always
Steps to Reproduce:
1. Select m item
2. Select n item keeping shift key
3. Select i item
4. Select n item keeping shift key
Actual Results:  
Indexes of selected items evaluate from m to n.

Expected Results:  
If we replace m by n in this algorithm (note: m<i<n) then selection is wrong
(also from m to n).
Attached file testcase
Expected results:
Indexes of selected items should evaluate from i to n.
Anyone fixing this might consider looking at tree.xml and nsTreeSelection.cpp
Ever confirmed: true
Keywords: helpwanted
seems to be a "live" value in listbox.xml to me, I will check and test
I guess we have three multiple selection implementations, for <html:select>
<xul:tree> and <xul:listbox>, and they need to all work the same way...
Updated URL for a data: html|select textcase (html trans -- quirks; in this case)

If someone can create a testcase for xul|tree  I will look into it as well, I
dont know our xul tree code well enough.
Attached file tree testcase
So on the face of it it looks like the code paths used by <select> and <tree>
are correct, at least in this case.
hmm, my minor (potential) fix did not work in my FF build, from current aviary
tree...I'll investigate further I suspect later on.
This patch should correctly reset _selectionStart whenever addItemToSelection
and removeItemFromSelection are called outside of range selecting code (with
the minor exception of toggleItemSelection which might be considered syntactic
sugar for the other two).
Attachment #198305 - Flags: review?(bryner)
Flags: blocking1.8.1?
Not going to block 1.8.1 for this bug.
Flags: blocking1.8.1? → blocking1.8.1-
Attachment #198305 - Flags: review?(bryner) → review?(mconnor)
This fix has been included together with the changes in bug 298371. -> FIXED
Closed: 14 years ago
Keywords: helpwanted
Resolution: --- → FIXED
Attachment #198305 - Flags: review?(mconnor)
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.