Currently document.activeElement may return the input element inside type="file".
Content JS gets then an exception when it tries to access the element.
This is causing problems for us in jQuery UI. We wrap elements for certain animations, and the wrapping causes elements to lose focus, so we reset focus after wrapping. However, if a file input has focus, then we try setting the focus on the exposed text input, which is no longer in the document (not sure why).
jQuery UI bug: http://bugs.jqueryui.com/ticket/8288
Reduced test case using jQuery UI: http://jsfiddle.net/2efq2/8/
Created attachment 620830 [details] [diff] [review]
Comment on attachment 620830 [details] [diff] [review]
Bah, the patch revealed another bug.
Created attachment 621005 [details] [diff] [review]
+fix to test_bug430351.html
Neil, the patch doesn't change the focusing behavior, but it is just that
test_bug430351.html tests currently the_native_anon_button_inside_file_input != <input type="file">
With the patch that becomes <input type="file"> != <input type="file">