Skip to content

Commit 6df1bf9

Browse files
Martin Naumannmgol
authored andcommitted
CSS: Work around an IE11 fullscreen dimensions bug
(cherry-picked from 90d828b) Fixes gh-1764 Closes gh-2401
1 parent 453738a commit 6df1bf9

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
@@ -120,6 +120,17 @@ function getWidthOrHeight( elem, name, extra ) {
120120
styles = getStyles( elem ),
121121
isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
122122

123+
// Support: IE11 only
124+
// Fix for edge case in IE 11. See gh-1764
125+
if ( document.msFullscreenElement && window.top !== window ) {
126+
// Support: IE11 only
127+
// Running getBoundingClientRect on a disconnected node
128+
// in IE throws an error.
129+
if ( elem.getClientRects().length ) {
130+
val = Math.round( elem.getBoundingClientRect()[ name ] * 100 );
131+
}
132+
}
133+
123134
// some non-html elements return undefined for offsetWidth, so check for null/undefined
124135
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
125136
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668

0 commit comments

Comments
 (0)