Issue 733: Calling gears_init.js from an SVG file fails in Chrome
http://code.google.com/p/gears/issues/detail?id=733

New issue report by [EMAIL PROTECTED]:
What steps will reproduce the problem?
1. Include: <script type="text/javascript" xlink:href="gears_init.js" />
in a SVG file - not HTML.

2. In Firefox it works fine.

3. In Chrome you get the error:
Uncaught TypeError: Cannot set property 'display' of null
http://localhost/xxx/xxx/gears_init.js (line 59)

After this the call to:

var db = google.gears.factory.create('beta.database');

Fails because:
Uncaught ReferenceError: google is not defined
http://localhost/tmp/sqlite/tasmania_gears.js (line 19

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.

It appears gears_init.js does not have a fallback for Chrome.  The fallback
is for Safari.  The error occurs because of the following lines:

    } catch (e) {
      // Safari
      if ((typeof navigator.mimeTypes != 'undefined')
           && navigator.mimeTypes["application/x-googlegears"]) {
        factory = document.createElement("object");
        factory.style.display = "none";
        factory.width = 0;
        factory.height = 0;
        factory.type = "application/x-googlegears";
        document.documentElement.appendChild(factory);
      }
    }

 Chrome falls through to this section.  In an HTML page,
document.createElement("object") is an valid object in the DOM and it works
fine but in an SVG file document.createElement("object") returns null.  The
next line throws the first error since you cannot set the 'display'
property of a null.  Factory is never defined and gears cannot start.  Can
we catch Chrome upfront like IE and Firefox?

Is there a workaround?
Thanks



Issue attributes:
        Status: New
        Owner: ----
        Labels: Type-Defect Priority-Medium

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

Reply via email to