Skip to content

Commit f9f2891

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

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/css.js

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

116+
// Fix for edge case in IE 11. See https://github.com/jquery/jquery/issues/1764
117+
if ( window.top !== window.self && document.msFullscreenElement &&
118+
elem.getBoundingClientRect().width > elem.offsetWidth ) {
119+
val = name === "width" ?
120+
Math.round(elem.getBoundingClientRect().width * 100) :
121+
Math.round(elem.getBoundingClientRect().height * 100);
122+
}
123+
116124
// Some non-html elements return undefined for offsetWidth, so check for null/undefined
117125
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
118126
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668

0 commit comments

Comments
 (0)