Menu

#1027 Infinite recursion when event fired

2.7
open
nobody
None
5
2014-11-03
2010-02-18
Mikhail
No

Getting java.lang.StackOverflowError , when following HTML loaded:

<html>
<body>
<script language=javascript>
var c=0;
</script>
<input id=txt1 type=text value=":)" onfocus="this.value=c;c++;txt2.focus();" />
<input id=txt2 type=text value=":)" onfocus="this.value=c;c++;txt1.focus();" />
<script language=javascript>
var txt1 = document.getElementById("txt1");
var txt2 = document.getElementById("txt2");
txt1.focus();
</script>
</body>
</html>

Discussion

  • Mikhail

    Mikhail - 2010-02-18

    Sample HTML

     
  • Mikhail

    Mikhail - 2010-02-18

    Tried 2.7 - it hangs

     
  • Mikhail

    Mikhail - 2010-02-18

    It hangs sometimes, but not always

     
  • Mikhail

    Mikhail - 2010-02-18

    patch

     
  • Marc Guillemot

    Marc Guillemot - 2010-02-20

    Not sure if we should fix it.

    From my tests:
    - IE6 hangs
    - FF seems to perform 2 focus events and then stops
    - Chrome performs a lot of focus events and then stops when field values have reached 6134 and 6136

    Did you test with other IE versions?

     
  • Mikhail

    Mikhail - 2010-02-22

    IE8 hangs too, Chrome throws uncaught RangeError exception ("Maximum call stack size exceeded"), when values have reached 3067 and 3065, Firefox performs 2 focus events and then stops. I think it should be fixed at least for FF

     
  • Mikhail

    Mikhail - 2010-02-22

    BTW: Found out, that Chromium throws 1024 Uncaught exceptions

     
  • RBRi

    RBRi - 2013-09-22
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,5 +1,6 @@
     Getting java.lang.StackOverflowError , when following HTML loaded:
    
    +~~~~~~~~~~~~~~~~~~~
     <html>
     <body>
     <script language=javascript>
    @@ -14,3 +15,4 @@
     </script>
     </body>
     </html>
    +~~~~~~~~~~~~~~~~~~~
    
     

Log in to post a comment.