Skip to content

Commit

Permalink
fix #1779 Chrome 61 has document.scrollingElement = document.document…
Browse files Browse the repository at this point in the history
…Element

In Chrome 61, as specified in
https://blog.chromium.org/2017/08/chrome-61-beta-javascript-modules.html:
To align with the spec and preserve browser consistency,
the scrollingElement is now the documentElement in standards mode.

This commit fixes the problems caused by this change in Chrome 61 by first
using document.scrollingElement before relying on a browser-dependent
logic to determine which is the scrolling element.
  • Loading branch information
divdavem committed Sep 29, 2017
1 parent 46396d1 commit 13e6cea
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/aria/utils/Dom.js
Expand Up @@ -1224,9 +1224,13 @@ module.exports = Aria.classDefinition({
if (document == null) {
document = Aria.$window.document;
}
return ((!(ariaCoreBrowser.isSafari || ariaCoreBrowser.isChrome || ariaCoreBrowser.isEdge || ariaCoreBrowser.isOpera) && (document.compatMode == "CSS1Compat"))
? document.documentElement
: document.body);
var result = document.scrollingElement;
if (!result) {
result = ((!(ariaCoreBrowser.isSafari || ariaCoreBrowser.isChrome || ariaCoreBrowser.isEdge || ariaCoreBrowser.isOpera) && (document.compatMode == "CSS1Compat"))
? document.documentElement
: document.body);
}
return result;
},

/**
Expand Down

0 comments on commit 13e6cea

Please sign in to comment.