Closed
Bug 407453
Opened 17 years ago
Closed 17 years ago
Column reordering broken when ordinal > 9 (comparing numbers as strings)
Categories
(Toolkit :: XUL Widgets, defect)
Toolkit
XUL Widgets
Tracking
()
RESOLVED
FIXED
mozilla1.9beta3
People
(Reporter: skrulx, Assigned: skrulx)
References
Details
Attachments
(1 file, 3 obsolete files)
(deleted),
patch
|
enndeakin
:
review+
mtschrep
:
approval1.9+
|
Details | Diff | Splinter Review |
The ordinal attribute on the tree column binding is always returned as a string, which causes comparisons to produce unexpected results when reordering columns which the ordinal value exceeds 9.
Assignee | ||
Updated•17 years ago
|
Attachment #292170 -
Flags: review?(enndeakin)
Comment 1•17 years ago
|
||
Comment on attachment 292170 [details] [diff] [review] patch The second change here isn't really needed, as strings versions will compare equal as well. There's also two cases where 2 is added/subtracted from the ordinal. This should be fixed up as well. Tests would be nice too, added to the existing tree tests in tree_shared.js
Attachment #292170 -
Flags: review?(enndeakin) → review-
Assignee | ||
Comment 2•17 years ago
|
||
I also added a fix (and test) for an addition problem when moving a column directly after itself (STR: moue down on the left half of a column, drag to the right half of the same column, moue up).
Assignee: nobody → skrulx
Attachment #292170 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #292677 -
Flags: review?(enndeakin)
Assignee | ||
Comment 3•17 years ago
|
||
Needed to use tabs and not spaces in that makefile :)
Attachment #292677 -
Attachment is obsolete: true
Attachment #292699 -
Flags: review?(enndeakin)
Attachment #292677 -
Flags: review?(enndeakin)
Comment 4•17 years ago
|
||
>+function testtag_tree_column_reorder() >+{ >+ // Make sure the tree is scrolled into the view, otherwise the test will >+ // fail >+ window.parent.document.getElementById("testframe").scrollIntoView(); This causes an exception when the test is run separately as there is no testframe. >+ synthesizeMouse(down, 10, 10, { type: "mousedown"}); Is there a reason 10 was used for these values (and others)? >+ else { >+ // If this is an after move and the column we're moving is >+ // the same as the target column, don't move. >+ if (!before && col == col.mTargetCol) { >+ move = false; >+ } > } You can just merge this into an 'else if'. Otherwise, this looks good. Can you describe what the additional problem you mention in comment 2 is in this bug?
Assignee | ||
Comment 5•17 years ago
|
||
(In reply to comment #4) > >+function testtag_tree_column_reorder() > >+{ > >+ // Make sure the tree is scrolled into the view, otherwise the test will > >+ // fail > >+ window.parent.document.getElementById("testframe").scrollIntoView(); > > This causes an exception when the test is run separately as there is no > testframe. Fixed. > > >+ synthesizeMouse(down, 10, 10, { type: "mousedown"}); > > Is there a reason 10 was used for these values (and others)? I cleaned this up a bit. This purpose of the first "10" was to avoid the extra hit test space given to the splitter -- but simply starting the first mousedown in the middle of the column is a more sensible approach. The second "10" was not needed and I removed it. > > >+ else { > >+ // If this is an after move and the column we're moving is > >+ // the same as the target column, don't move. > >+ if (!before && col == col.mTargetCol) { > >+ move = false; > >+ } > > } > > You can just merge this into an 'else if'. Fixed. > > Otherwise, this looks good. Can you describe what the additional problem you > mention in comment 2 is in this bug? > It is a problem with dragging a column on to itself. If you go to about:config, and start your mouse drag on the left hand of the "Preference Name" column header, drag to the right and release on the right hand side of the same column, the column will remain in its drag mode. I also noticed that this test will fail if the page is zoomed in (ctrl +) -- however, I've found this to be the case with the widget tests in general.
Attachment #292699 -
Attachment is obsolete: true
Attachment #295259 -
Flags: review?(enndeakin)
Attachment #292699 -
Flags: review?(enndeakin)
Updated•17 years ago
|
Attachment #295259 -
Flags: review?(enndeakin) → review+
Updated•17 years ago
|
Attachment #295259 -
Flags: approval1.9?
Updated•17 years ago
|
Attachment #295259 -
Flags: approval1.9? → approval1.9+
Updated•17 years ago
|
Keywords: checkin-needed
Comment 6•17 years ago
|
||
Checking in toolkit/content/tests/widgets/Makefile.in; /cvsroot/mozilla/toolkit/content/tests/widgets/Makefile.in,v <-- Makefile.in new revision: 1.45; previous revision: 1.44 done RCS file: /cvsroot/mozilla/toolkit/content/tests/widgets/test_tree_column_reorder.xul,v done Checking in toolkit/content/tests/widgets/test_tree_column_reorder.xul; /cvsroot/mozilla/toolkit/content/tests/widgets/test_tree_column_reorder.xul,v <-- test_tree_column_reorder.xul initial revision: 1.1 done Checking in toolkit/content/tests/widgets/tree_shared.js; /cvsroot/mozilla/toolkit/content/tests/widgets/tree_shared.js,v <-- tree_shared.js new revision: 1.6; previous revision: 1.5 done Checking in toolkit/content/widgets/tree.xml; /cvsroot/mozilla/toolkit/content/widgets/tree.xml,v <-- tree.xml new revision: 1.54; previous revision: 1.53 done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9 M11
Comment 8•16 years ago
|
||
The issue mentioned in Comment #2 is most probably the one that was filed as Bug 338889 before. Thanks for fixing.
You need to log in
before you can comment on or make changes to this bug.
Description
•