aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOleg Gaidarenko <markelog@gmail.com>2014-06-16 01:26:49 +0400
committerOleg Gaidarenko <markelog@gmail.com>2014-06-16 03:21:34 +0400
commit76294e1e9e25665b22467c099ed406402f784e2a (patch)
treec86fc3e16047472b6cb3bd56ecd2cd0d06bcc4b9 /src
parentd05f4bda1cc0b1ef76dce41a53c17f75c105a377 (diff)
downloadjquery-76294e1e9e25665b22467c099ed406402f784e2a.tar.gz
jquery-76294e1e9e25665b22467c099ed406402f784e2a.zip
CSS: Do not throw on frame elements in FF
IE9-10 throws on elements created in popups (see #14150), FF meanwhile throws on frame elements through "defaultView.getComputedStyle" (see #15098) Use "defaultView" if in the popup which would fix IE issue, use "window.getComputedStyle" which would fix FF issue. And everybody wins, except performance, but who cares right? Fixes #15098 Ref e488d985cfb10ab8c684bbc6a9b8ff3eae23bf83
Diffstat (limited to 'src')
-rw-r--r--src/css/curCSS.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/css/curCSS.js b/src/css/curCSS.js
index 1f3b73428..9ab4f1126 100644
--- a/src/css/curCSS.js
+++ b/src/css/curCSS.js
@@ -11,7 +11,14 @@ var getStyles, curCSS,
if ( window.getComputedStyle ) {
getStyles = function( elem ) {
- return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
+ // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
+ // IE throws on elements created in popups
+ // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
+ if ( elem.ownerDocument.defaultView.opener ) {
+ return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
+ }
+
+ return window.getComputedStyle( elem, null );
};
curCSS = function( elem, name, computed ) {