Quantcast

Permission Denied in dom-style.js getComputedStyle using parent window from iframe on IE with Dojo 1.12

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Permission Denied in dom-style.js getComputedStyle using parent window from iframe on IE with Dojo 1.12

neekfenwick
Hi guys,

I upgraded to Dojo 1.12 from 1.10 recently and have found an exception
in Internet Explorer (I'm running 11.0.9600).  We embed our app in an
iframe and the attempt to access the parent window object is throwing
Permission Denied.  This seems like a legitimate exception and since
it's in core Dojo code I'm not sure of the best way forward.  In
dom-style.js:

         getComputedStyle = function(node){
             var dv = node.ownerDocument.defaultView,
                 w = dv.opener ? dv : win.global.window.parent;
             return node.nodeType == 1 /* ELEMENT_NODE*/ ?
                 w.getComputedStyle(node, null) : {};
         };

When this is executed, w is assigned to the parent window object, then
the call to w.getComputedStyle() causes the Permission Denied exception.

I have put together a very simple example
http://cvt.winwebconnect.com/ui_src/test/iframetest.html - it loads a
simple Dojo test page from a different domain (qat.winwebconnect.com).  
The attempt to getComputedStyle for the '#thediv' element crashes.  If I
change the dojo version to 1.11 or 1.10 there is no exception.

I can try replacing or wrapping domStyle.getComputedStyle() to avoid
this behaviour but this is a workaround to what feels like a genuine
bug.  I've yet to dig back in Dojo history to see how/why it used to work.

Is there something I'm missing about IE that can work around this
problem, or should I raise a Trac ticket?

Advice greatly appreciated :)

Nick

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Loading...