Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-9825

This is the Reason why... IE7 hangs when a page has <OBJECT> tags!

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.8.1
    • Fix Version/s: 1.8.1
    • Component/s: General
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE

      Description

      Sorry for a new ticket... but I am not sure which of the many others to attach it to...

      Basically... all the pages that have object in them... should be okay... it is the UFO.JS file that is the problem...

      ====================

      For those that are interested....

      This is the Reason why... IE7 hangs when a page has <OBJECT> tags!

      It is not the pages themselves... it is a javascript file... ufo.js

      I have worked it all out... just needs the programmer people to sort it out...

      I decided to do a line by line trace of the code... and narrowed it down as follows...

      ============

      I took a HTML source dump of the output from policy.php (ie) made it into
      test.html

      I then deleted a line at a time... and tried it... see if it crashed... or
      not... put the line back... and then moved onto the next line.

      When the line below was deleted... it stops crashing...

      <script type="text/javascript"
      src="http://www.tbshs.herts.sch.uk/moodle/lib/ufo.js"></script>

      I am now going function by function in this file... to see what is happening...

      ============

      So I decided to do a really simple page... called... o.htm

      ============

      <html>
      <head>
      <script type="text/javascript" src="http://www.tbshs.herts.sch.uk/moodle/lib/ufo.js"></script>
      </head>
      <body>

      <p>Mooo</p>

      <object id="sss" data="http://www.tbshs.herts.sch.uk/tbshsdis.htm" type="text/html" height=200 width=200>
      Your browser does not appear to support the <code><object></code> element,
      the document that is supposed to be here is <a href="tbshsdis.htm">tbshsdis.htm</a>.
      </object>

      <p>Mooo</p>

      </body>
      </html>
      ============

      Even this simple page crashed when you moved onto another page... so... time to look at ufo.js

      ============

      In moodle/lib/ufo.js the 2nd to last line is...

      window.attachEvent("onunload", UFO.cleanupIELeaks);

      this is the killer... take that out... it does not crash...

      ============

      So I put it back in... and then amended the function to look like this...

      cleanupIELeaks: function() {
      var _o = document.getElementsByTagName("object");
      var _l = _o.length
      alert("Msg 1...");
      for (var i = 0; i < _l; i++) {
      alert("Msg 2...");
      _o[i].style.display = "none";
      for (var x in _o[i]) {
      alert("Msg 3...");
      if (typeof _o[i][x] == "function")

      { alert("Msg 4..."); _o[i][x] = null; }

      }
      }
      }

      ============

      When you leave/unload my "o.htm" page... it shows...

      ============

      Msg 1...

      Msg 2...

      Msg 3...
      Msg 3...
      Msg 3...
      Msg 3...
      Msg 3...
      Msg 3...
      Msg 3...
      FOREVER AND FOREVER...

      The Inner loop is going infinite... and never gets to Msg 4...

      ============

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Jun/07