id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc 9224,[IE9/Opera] focus test passes randomly,Olek Nowodziński,Garry Yao,"The problem is here: http://ckeditor4.t/dt/core/focus.html ({{{test add focus targets}}}) If we consider the following example: {{{ // Run on http://ckeditor4.t/ckeditor/samples/replacebycode.html var e1 = CKEDITOR.instances.editor1; var e2 = CKEDITOR.instances.editor2; function assTrue( cnd ) { console.log( !cnd ? 'Nope!' : 'Passed.' ); } for( var i = 0 ; i < 5 ; i++ ) { e1.focus(); assTrue( e1.focusManager.hasFocus && !e2.focusManager.hasFocus ); e2.focus(); assTrue( !e1.focusManager.hasFocus && e2.focusManager.hasFocus ); } }}} and put some logs in {{{focusManager.focus|blur()}}}, we can observe that IE9 works synchronously (correctly) and Opera is the only, truly asynchronous one. I guess that the ""timeout-nesting-thing"" in this test was initially to deal w/ Opera as i.e. Chrome passes it w/o any timeouts. For unknown reason, IE9 behaves worse than Opera if we deal w/ {{{editor.focusManager.add( element )}}}. The browser requires extended timeouts, e.g. if we set them to 300ms, it always passes this test. Otherwise, most likely depending on the lunar phase and the humidity of the air, it either passes or fails. I guess that we can simply extend those timeouts to get rid of this problem as, IMO, it doesn't impact on a real-life usage. Unless someone got some idea, of course. PS. MS says that onfocus/onblur events are async. in all their products which confuses me even more: http://msdn.microsoft.com/en-us/library/ie/ms536909(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/ie/ms536934(v=vs.85).aspx",Task,closed,Normal,CKEditor 4.0,General,4.0,fixed,,