Bug Report: 176873 Date: 2005-08-09 Note: Fixed in 9.00p1 build 8031. Note: Broken again in 9.00 build 8501. The
and elements make no difference anymore. Version: Opera 8.10/Windows98/PC Build: 7685 Brief Summary: Bizarre correlation between Javascript/DOM focus() method, an external stylesheet and certain HTML elements. Severity: Significant Part affected: ECMAScript URL: http://home.swipnet.se/sigsegv/opera/bugs/js-focus-stylesheet.html Detailed description: The page uses Javascript to set keyboard focus to the second form control on the test page. This fails under peculiar circumstances. (The script executes successfully but does not set focus to the form control. The alert() is never shown). This bug report applies to the following versions: * 8.01 (7642) * 8.02p1(7668) * 8.02 (7680) * 8.10p2(7685) The bug DOES occur when: * the page is reloaded (F5 or Reload button). The bug does NOT occur: * when the page is /initially/ loaded, * when the page is refreshed from cache, or * in versions before 8.01. The bug disappears when: * the element is removed(!), * the element is removed, * the
element is removed, or * the Javascript calls an alert() or changes the document through the DOM tree (the latter occured on a much larger page). Workarounds: * Call the focus() method from an event handler (load), * Call the focus() method from setTimeout() (see source), Further notes: * The stylesheet must exist for the bug to occur, but its contents doesn't matter (it's empty in the test page). * The threshold in setTimeout() seems to be 170ms on my computer (500Mhz Pentium III), regardless of load. The focus works almost every time at 170ms, and fails quite a few times at 169ms. Steps to reproduce the bug: 1. Visit URL. 2. Reload page. E-mail: See: mailto.txt