Skip to content

Commit

Permalink
CSS: Work around an IE11 fullscreen dimensions bug
Browse files Browse the repository at this point in the history
Fixes gh-1764
Closes gh-2401
  • Loading branch information
Martin Naumann authored and mgol committed Jun 22, 2015
1 parent 63a577a commit 90d828b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 90d828b

Please sign in to comment.