Skip to content

Commit b9513bb

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

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/css.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ 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+
val = name === "width" ?
119+
Math.round(elem.getBoundingClientRect().width * 100) :
120+
Math.round(elem.getBoundingClientRect().height * 100);
121+
}
122+
116123
// Some non-html elements return undefined for offsetWidth, so check for null/undefined
117124
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
118125
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668

0 commit comments

Comments
 (0)