Firefox ignores Javascript code

Bug #120868 reported by Kelumden
8
Affects Status Importance Assigned to Milestone
firefox (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: firefox

Version: Firefox 2.0.0.4 on Ubuntu 7.04

No warning is issued.

The code below worked then ceased to work without warning. When the cursor moves over the DIV.scroller, the opacity must be set back to 1 (fully opaque) and a click on the revealed area should execute the associated function (which move DIV#area aroud).

Toggling the switch for Javascript in Preferences did solve twice the problem then it reappeared. Closing Firefox and restarting it does not cure the problem !

I also tried the same code with the Javascript stored in an external file, but again, no difference.

I had various add-ons installed (Firebug 1.05, Web Developer 1.1.4 along with EasyGesture and FireColor). To find out why, I completely uninstalled those add-ons without result.

Even if it looks stupid to say (every user says so), I didn't change Preferences prior to the problem, I just installed the above add-ons ! The reason I submit here is because the code worked sometimes then abruptly ceased to work.

If I dare to guess, I would say aither one add-on or Firefox has changed one inner flag which tells Firefox to ignore events and/or Javascript.

If the trouble is due to a fault I made in the code, I deeply apologize for taking your time !

Page: each DIV is positioned on the page

<html>

  <head>

    <link rel='stylesheet' href='layout.css' type='text/css' />

    <title>Test Lay-out (2)</title>
    <script type="text/javascript" language="javascript" >
      function toTop(e)
        {
          var tref = document.getElementById("area") ;
              tref.style.top = 125 ;
        }
      function moveView(e,dir)
        {
          var tref = document.getElementById("area") ;
              var abtm = tref.style.top + tref.style.height ;
          var trf2 = document.getElementById("view") ;
              var vbtm = trf2.style.top + trf2.style.height ;

          if( dir < 0 && abtm < vbtm )
            tref.style.top -= 1 ;
          if( dir > 0 && tref.style.top < 125 )
            tref.style.top += 1 ;
        }
    </script>
  </head>

  <body>
    <div class="mask upper">&nbsp;</div>

    <div class="mask lower">&nbsp;</div>

    <div class="hdr back">&nbsp;</div>

    <div class="hdr band">&nbsp;</div>

    <div class="hdr label">&nbsp;</div>

    <div class="logo"><img src="station.png" height=130></div>

    <div class="menu mnback">&nbsp;</div>

    <div class="mnbar mb1">&nbsp;</div>

    <div class="mnbar mb2">&nbsp;</div>

    <div class="mnbar mb3">&nbsp;</div>

    <div class="mnloc">Home</div>

    <div id="gotop" class="scroller"
                     onmouseover="this.style.opacity=1;"
                     onmouseout="this.style.opacity=0.5;"
                     onclick="javascript:toTop();" >
      <img src="top.png" width=24></div>

    <div id="goup" class="scroller"
                     onmouseover="this.style.opacity=1;"
                     onmouseout="this.style.opacity=0.5;"
                     onmousedown="javascript:moveView(-1);" >
      <img src="upward.png" width=24></div>

    <div id="godown" class="scroller"
                     onmouseover="this.style.opacity=1;"
                     onmouseout="this.style.opacity=0.5;"
                     onmousedown="javascript:moveView(1);" >
      <img src="downward.png" width=24></div>

    <div id="view"></div>

    <div id="area">&nbsp;</div>
  </body>

</html>

ProblemType: Bug
Architecture: i386
Date: Sun Jun 17 19:53:19 2007
DistroRelease: Ubuntu 7.04
Package: firefox 2.0.0.4+1-0ubuntu1
PackageArchitecture: i386
SourcePackage: firefox
Uname: Linux tsikinga 2.6.20-16-generic #2 SMP Thu Jun 7 20:19:32 UTC 2007 i686 GNU/Linux

Revision history for this message
Kelumden (dumont-v) wrote :
Revision history for this message
Alexander Jones (alex-weej) wrote :

Having trouble understanding what this code is supposed to do. Please provide a watered down test case. You may also wish to file this bug upstream at http://bugzilla.mozilla.org/ instead.

Revision history for this message
Kelumden (dumont-v) wrote :

The various DIV divide the page in as many elements, each one positioned through a stylesheet.

The trouble is not really the HTML and the way it is put together with a stylesheet.

Another problem arised on the same page when I changed the behaviour of DIV#area from overflow:hidden to overflow:auto: the scrollbar does not operate !

However, I will report this to bugzilla. Sorry for the inconvenience !

Revision history for this message
Alexander Jones (alex-weej) wrote :

No need to apologise, it's just there's not too much we can do. If I can offer you any advice myself, however, it's to use standards mode by using HTML 4.01 Strict or XHTML 1.0 Strict - you're less likely to hit weird "quirks" this way.

Revision history for this message
Alexander Sack (asac) wrote :

does the same script tag moved to a different place work? If not, the bug is most likely in your script.

Revision history for this message
Kelumden (dumont-v) wrote :

Thanks all !

I reviewed the code I submitted and discovered that Firefox was NOT involved in the problem: I just moved the DIV#view to the top. This DIV intercepted all mouse events so that the expected behaviour can not be achieved.

I deeply apologize for the trouble of reporting a bug that was not existing !

The case may be closed !

Revision history for this message
Hilario J. Montoliu (hjmf) (hmontoliu) wrote :

Thank you Kelumden, closing the report.

Changed in firefox:
status: Unconfirmed → Rejected
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.