Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#18973 closed defect (fixed)

dom-style regression

Reported by: dylan Owned by: dylan
Priority: blocker Milestone: 1.11.4
Component: Core Version: 1.12.1
Keywords: Cc:
Blocked By: Blocking:

Description

Per two reports on the mailing list:

From Jan Misker:

I noticed a bug in dojo/dom-style in combination with Firefox (51.0.1). When I call getComputedStyle execution halts, and I get a warning

Permission denied to access property "getComputedStyle"

Note that this happens only cross-domain, so check this test-case (difficult to create one on JSFiddle): http://dev.prettigparkeren.nl/test-embed/test.html The issues seems to be resolved by not referencing window.parent but just the window (which makes sense from a same-origin perspective). I described it here as well https://github.com/dojo/dojo/commit/bfea978ffd6e7a0606ad677e457e7079e42a937d#commitcomment-20895564

But I don't know whether the code references .parent for a reason?

and:

From Nick Fenwick:

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

Change History (4)

comment:1 Changed 2 years ago by Dylan Schiemann <dylan@…>

Resolution: fixed
Status: newclosed

In 33505b8/dojo:

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

comment:2 Changed 2 years ago by dylans <dylan@…>

In 5e1c752/dojo:

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

comment:3 Changed 2 years ago by dylans <dylan@…>

In aaaedd1/dojo:

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

comment:4 Changed 2 years ago by dylan

Milestone: 1.12.21.11.4
Note: See TracTickets for help on using tickets.