Last Comment Bug 360188 - select1 keyboard navigation problems
: select1 keyboard navigation problems
Status: RESOLVED FIXED
: fixed1.8.0.12, fixed1.8.1.4
Product: Core Graveyard
Classification: Graveyard
Component: XForms (show other bugs)
: Trunk
: x86 All
: -- normal (vote)
: ---
Assigned To: aaronr
: Stephen Pride
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-11-09 16:05 PST by aaronr
Modified: 2016-07-15 14:46 PDT (History)
2 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
external instance data (127 bytes, text/xml)
2006-11-09 16:32 PST, aaronr
no flags Details
testcase (2.78 KB, application/xhtml+xml)
2006-11-09 16:35 PST, aaronr
no flags Details
testcase2 (3.39 KB, application/xhtml+xml)
2007-02-21 16:35 PST, aaronr
no flags Details
patch (3.54 KB, patch)
2007-02-22 18:39 PST, aaronr
surkov.alexander: review+
doronr: review+
Details | Diff | Splinter Review
patch for 1.8 and 1.8.0 (2.62 KB, patch)
2007-04-10 15:11 PDT, aaronr
no flags Details | Diff | Splinter Review

Description aaronr 2006-11-09 16:05:11 PST
It is possible to get xf:select1 in such a state that it will not allow keydown or keyup navigation.  It seems to be an issue with replacing/rebuilding the instance the select1 binds to when it contains a xf:itemset.
Comment 1 aaronr 2006-11-09 16:32:22 PST
Created attachment 245160 [details]
external instance data

external instance data for the testcase
Comment 2 aaronr 2006-11-09 16:35:08 PST
Created attachment 245161 [details]
testcase
Comment 3 aaronr 2006-11-09 16:36:05 PST
The following appears in the error console:

Error: parent has no properties
Source File: chrome://xforms/content/select1.xml
Line: 354
Comment 4 aaronr 2006-11-13 11:15:50 PST
The problem is with the rebuild.  At the point of xforms-ready, select1 has a selected item which lives in the itemset.  The rebuild is causing the xf:itemset to remove its old content and repopulate with new xf:items.  And when it does this, then select1 is refreshed, but since the currently selected item (the one itemset removed) already has the correct value, we think we are saving ourselves a lot of work and we just return.  So this._selected will always be the old, removed item.  Any function that then tries to use the DOM based of this selected item will run into troubles since the item no longer lives in the DOM.  That is why we are getting the "parent has no properties" error.

The way to fix this is probably to clear the select/select1's cache of selected value(s) when xf:itemset is refreshed.  That should be safe because anytime this happens, we should force the select/select1 to refresh again.  I'll work on this fix.
Comment 5 aaronr 2007-02-21 16:35:32 PST
Created attachment 255965 [details]
testcase2

Getting some bad behavior from select, too.
Comment 6 aaronr 2007-02-22 16:31:20 PST
(In reply to comment #5)
> Created an attachment (id=255965) [details]
> testcase2
> 
> Getting some bad behavior from select, too.
> 

unrelated problem, but I'll fix it in this patch, too, since the fix is minor.  Problem is that the new removeNativeElm() method had some bugs in it.
Comment 7 aaronr 2007-02-22 18:39:05 PST
Created attachment 256123 [details] [diff] [review]
patch

I fixed this using the mutation handler that alex put in select1.xml.  If we detect that an item is getting removed, we check to see if it is the currently selected item.  If it is, then we'll null it out so that it isn't remembered when select1 refreshes the next time.
Comment 8 aaronr 2007-02-24 14:03:22 PST
checked into trunk
Comment 9 aaronr 2007-04-07 16:09:37 PDT
crap, looks like this patch won't work on FF2.  I never see the DOMNodeRemoved handler firing.  Maybe this was fixed by bug 367164, but that never made it into the branches.
Comment 10 aaronr 2007-04-10 15:11:06 PDT
Created attachment 261189 [details] [diff] [review]
patch for 1.8 and 1.8.0

this patch works around the limitation of DOMNodeRemoved not working on the branch.  This approach won't be needed once we do the performance re-write where itemset insertions and deletions of items will be handled much cleaner.
Comment 11 aaronr 2007-04-23 16:35:59 PDT
checked into 1.8 branch on 2007-04-12
checked into 1.8.0 branch on 2007-04-16

Note You need to log in before you can comment on or make changes to this bug.