Uploaded image for project: 'FireBreath Core'
  1. FireBreath Core
  2. FIREBREATH-11

Using a DOCTYPE definition in the HTML page breaks IE 9

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: FireBreath-1.3.2, FireBreath 1.4.1 (1.4.0), FireBreath 1.4.2, FireBreath 1.5.0rc1
    • Operating System:
      Windows
    • Web Browser:
      Internet Explorer 9

      Description

      At present (1.4.x) there appears to be a problem with using a FireBreath based plugin if your HTML document includes a DOCTYPE. The following is known to work: (Example assumes plugin has a pluginVersion property and a sayHello method.)

      <html>
      <head>
          <title>Extremely basic test page</title>
          <script type="text/javascript">
              var pluginLoaded = function(obj) {
                  if (console) {
                      console.log(obj);
                      console.log(obj.pluginVersion);
                      console.log(obj.sayHello("foo"));
                  }
              };
          </script>
      </head>
      <body>
          <object id="plugin" type="application/x-your-mime-type">
              <param name="onload" value="pluginLoaded" />
          </object>
      </body>
      </html>
      

      If your document were to include a DOCTYPE definition the plugin will fail to work as expected. In IE 9 with a DOCTYPE set instead of getting a scriptable object when doing things like document.getElementById("plugin") you will be returned an [object HTMLObjectElement]. The object which is returned to you in IE 9 has all of the properties and methods that your scriptable object should have and you can freely access the properties as expected. Calling methods on the object results in an extra parameter being sent to the plugin and since FireBreath validates the number of parameters you will get an error indicating that you passed too many parameters. In the example above your plugin would think that you called sayHello with 2 parameters. This behavior is unique to IE 9 as Firefox 3.x, Firefox 4.x, Chrome, Safari, IE 7, and IE 8 all continue to return you a scriptable object. Hopefully a future version of FireBreath will be able to deal with whatever IE is now doing to us. Until then just avoid using DOCTYPE definitions in your HTML documents.

      <!DOCTYPE html> <!-- your plugin is now broken in IE 9 -->
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                richard Richard Bateman
                Reporter:
                jloveridge Jarom Loveridge
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: