aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Naumann <martin@geekonaut.de>2015-06-16 23:55:21 +0200
committerMichał Gołębiowski <m.goleb@gmail.com>2015-06-23 00:53:00 +0200
commit90d828bad0d6d318d73d6cf6209d9dc7ac13878c (patch)
treef71e6092398b7d93d3b363c912be246dc82f7e83 /src
parent63a577aa0bcb439c1730c3825407d86c128b17be (diff)
downloadjquery-90d828bad0d6d318d73d6cf6209d9dc7ac13878c.tar.gz
jquery-90d828bad0d6d318d73d6cf6209d9dc7ac13878c.zip
CSS: Work around an IE11 fullscreen dimensions bug
Fixes gh-1764 Closes gh-2401
Diffstat (limited to 'src')
-rw-r--r--src/css.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/css.js b/src/css.js
index 566f5a0fd..922f44162 100644
--- a/src/css.js
+++ b/src/css.js
@@ -113,6 +113,17 @@ function getWidthOrHeight( elem, name, extra ) {
styles = getStyles( elem ),
isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
+ // Support: IE11 only
+ // Fix for edge case in IE 11. See gh-1764
+ if ( document.msFullscreenElement && window.top !== window ) {
+ // Support: IE11 only
+ // Running getBoundingClientRect on a disconnected node
+ // in IE throws an error.
+ if ( elem.getClientRects().length ) {
+ val = Math.round( elem.getBoundingClientRect()[ name ] * 100 );
+ }
+ }
+
// Some non-html elements return undefined for offsetWidth, so check for null/undefined
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668