🌐 AI搜索 & 代理 主页
Skip to content

Commit 90d828b

Browse files
Martin Naumannmgol
authored andcommitted
CSS: Work around an IE11 fullscreen dimensions bug
Fixes gh-1764 Closes gh-2401
1 parent 63a577a commit 90d828b

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 only
117+
// Fix for edge case in IE 11. See gh-1764
118+
if ( document.msFullscreenElement && window.top !== window ) {
119+
// Support: IE11 only
120+
// Running getBoundingClientRect on a disconnected node
121+
// 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)