Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    FireFox/iFrame, getComputedStyle() bug

    SmartClient Version v8.3p_2013-06-04 (2013-06-04)
    FireFox 22.0


    Is there a way to work around this issue? What suggestions could you give us that might be a possible fix? We must get this to work on FireFox.

    The Problem: It seems the issue is due to an unhandled error originated after getComputedStyle() returns null, which stops all javascript from running and therefore the whole page initialization fails. Somewhere in the code, there's a script being loaded from inside an iframe which has its visibility set to hidden, or display set to none. The script in the iframe fails because it can't find a valid computed style for some of the elements in the iframe. That's because FireFox does not compute those elements' geometry until the iframe is computed and therefore the getComputedStyle() returns null. This bug was first identified by the opensource community with jQuery, and has been fixed.



    Some time ago I opened a topic here describing this bug and got the following response:
    http://forums.smartclient.com/showthread.php?t=27038

    After doing some research on the Mozilla bug report database, the following has been found:
    https://bugzilla.mozilla.org/show_bug.cgi?id=795520

    I have tried setting the visibility of the iFrames and their children elements (visibility and display properties), no effect taken. (http://www.sencha.com/forum/showthre...x-and-Ext-JS-4)

    You will find some more info about the jQuery issue here:
    http://bugs.jquery.com/ticket/8763
    https://drupal.org/node/182569
    http://linux.m2osw.com/jquery-and-hidden-iframe-bug
    Last edited by ueng; 31 Jul 2013, 05:26.

    #2
    To recap: if an iframe is hidden in Firefox, getComputedStyle() is broken - it always returns null.

    The JQuery "fix" was not to rely on getComputedStyle(), because they happen to use it only during some initialization checks.

    But we provide a much broader set of features, and in order to do so, we need getComputedStyle() to actually work.

    Your options are:
    1. don't hide the iframe - place it offscreen instead
    2. get the Firefox team to address the bug

    Comment


      #3
      I have a similar issue when embedding a SmartGWT application on a Salesforce.com Canvas context and using FF as a browser (any version). This does not happen on other browsers though...

      Comment

      Working...
      X