Skip to content

Commit

Permalink
fixes #18973, resolve cross-domain computed style issue and regression
Browse files Browse the repository at this point in the history
  • Loading branch information
rorticus authored and dylans committed Feb 24, 2017
1 parent dba041b commit 33505b8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dom-style.js
Expand Up @@ -45,10 +45,12 @@ define(["./sniff", "./dom", "./_base/window"], function(has, dom, win){
};
}else{
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) : {};
if(node.nodeType === 1 /* ELEMENT_NODE*/){
var dv = node.ownerDocument.defaultView,
w = dv.opener ? dv : win.global.window;
return w.getComputedStyle(node, null);
}
return {};
};
}
style.getComputedStyle = getComputedStyle;
Expand Down

0 comments on commit 33505b8

Please sign in to comment.