Skip to content

Commit be824b9

Browse files
author
Martin Naumann
committed
CSS: dimensions workaround for IE11 fullscreen quirk
Fixes #1764
1 parent b041242 commit be824b9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/css.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,17 @@ function getWidthOrHeight( elem, name, extra ) {
113113
styles = getStyles( elem ),
114114
isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
115115

116+
// Support: IE11
117+
// Fix for edge case in IE 11. See gh-1764
118+
if ( document.msFullscreenElement && window.top !== window ) {
119+
// Support: IE11
120+
// Running getBoundingClientRect on a
121+
// disconnected node in IE throws an error
122+
if ( elem.getClientRects().length ) {
123+
val = Math.round( elem.getBoundingClientRect()[ name ] * 100 );
124+
}
125+
}
126+
116127
// Some non-html elements return undefined for offsetWidth, so check for null/undefined
117128
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
118129
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668

0 commit comments

Comments
 (0)