Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#18871 closed defect (fixed)

Firefox not loading DOJO in iframe with display:none

Reported by: jfduffy Owned by: Dylan Schiemann <dylan@…>
Priority: low Milestone: 1.11.3
Component: Core Version: 1.10.4
Keywords: Cc:
Blocked By: Blocking:

Description

We are experiencing an issue with DOJO 1.10.4 where DOJO content will not load if it's in an iframe that is loaded with display:none. This only happens in Firefox (tested with ESR 45.2).

Steps:

  1. Create an iframe DOM with a DOJO screen and display:none.
  2. Load the page with this DOM
  3. After the page is loaded, javascript to remove the "display:none".

Result: The iframe is blank

Notes:

  1. IE and Chrome work fine in this scenario
  2. There isn't an error when this happens in our app, but there is an error when I reproduced this outside of our app (below)
  3. This doesn't happen with any of our other iframe content (struts, angular)

Related tickets: JS Error during load of iframe with style "display:none" in Firefox - This may be the same issue, but I don't believe it is. I am not getting the same error they noted, either in my below case OR in our app. Additionally, adding the fix that is noted there to dojo/dom-style.js did not fix the issue in our app. dom-style.js (the file they are fixing) didn't even seem to be loaded up at any point in our app.

Reproduced case outside of our app (I'm not sure if this is the same problem as our app, the behavior is exactly the same but there is a javascript error with this case, whereas our app does not show an error at all):

<!doctype html>
<html>
  <body>
    <iframe id="test" frameborder="0" border="0" seamless="seamless" src="http://dojotoolkit.org/documentation/tutorials/1.10/charting/demo/basic-declarative.html" style="display:none; width: 1200px; height: 900px;"></iframe>
    <button onclick="document.getElementById('test').style.removeProperty('display')">Click</button>
  </body>
</html>

Run the above, and then click the button. The button will remove the display:none, but the iframe won't show it's content, which is the bug I'm reporting.

Running the above produces this error:

dojo/parser::parse() error
TypeError: d is null

Change History (7)

comment:1 Changed 3 years ago by dylan

Milestone: tbd1.12
Version: 1.11.21.10.4

Will investigate for 1.12 if time permits.

comment:2 Changed 3 years ago by jfduffy

This turned out to be caused by the Firefox issue where "getComputedStyle()" returns null. Googling that will return many results. We do not currently have a fix, as returning an empty "getComputedStyle()" still causes our tables to display incorrectly. However I'm not sure why, because Chrome returns a getComputedStyle() as empty instead of null, and that works just fine to display our tables.

comment:3 Changed 3 years ago by dylan

Milestone: 1.121.12.1

comment:4 Changed 3 years ago by Dylan Schiemann <dylan@…>

Owner: set to Dylan Schiemann <dylan@…>
Resolution: fixed
Status: newclosed

In bfea978/dojo:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:5 Changed 3 years ago by Dylan Schiemann <dylan@…>

In 20a7a33/dojo:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:6 Changed 3 years ago by dylan

Component: GeneralCore
Milestone: 1.12.11.11.3
Priority: undecidedlow

comment:7 Changed 3 years ago by dylan

Note this change has been backported to 1.11.3. It does not cleanly backport to 1.10 from master, but I'd accept a PR for that change if you anyone has time to create one.

Note: See TracTickets for help on using tickets.