mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
CSS: Work around an IE11 fullscreen dimensions bug
(cherry-picked from 90d828bad0
)
Fixes gh-1764
Closes gh-2401
This commit is contained in:
parent
453738ab85
commit
6df1bf9be8
11
src/css.js
11
src/css.js
@ -120,6 +120,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
|
||||
|
Loading…
Reference in New Issue
Block a user