Wrong algorithm of selection in listbox seltype="multiple"

RESOLVED FIXED

Status

()

Core
XUL
RESOLVED FIXED
13 years ago
9 years ago

People

(Reporter: surkov, Unassigned)

Tracking

Trunk
x86
Windows 2000
Points:
---
Bug Flags:
blocking1.8.1 -

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(3 attachments)

(Reporter)

Description

13 years ago
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).
(Reporter)

Comment 1

13 years ago
Created attachment 164692 [details]
testcase
(Reporter)

Comment 2

13 years ago
Expected results:
Indexes of selected items should evaluate from i to n.

Comment 3

13 years ago
Anyone fixing this might consider looking at tree.xml and nsTreeSelection.cpp
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: helpwanted

Comment 4

13 years ago
seems to be a "live" value in listbox.xml to me, I will check and test

Comment 5

13 years ago
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...

Comment 6

13 years ago
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.

Comment 7

13 years ago
Created attachment 166360 [details]
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.

Comment 8

13 years ago
hmm, my minor (potential) fix did not work in my FF build, from current aviary
tree...I'll investigate further I suspect later on.

Comment 9

12 years ago
Created attachment 198305 [details] [diff] [review]
reset _selectionStart more often

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)

Updated

12 years ago
Flags: blocking1.8.1?

Comment 10

11 years ago
Not going to block 1.8.1 for this bug.
Flags: blocking1.8.1? → blocking1.8.1-

Updated

11 years ago
Attachment #198305 - Flags: review?(bryner) → review?(mconnor)

Comment 11

11 years ago
This fix has been included together with the changes in bug 298371. -> FIXED
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Keywords: helpwanted
Resolution: --- → FIXED

Updated

11 years ago
Attachment #198305 - Flags: review?(mconnor)

Updated

9 years ago
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.