11"use strict" ;
22
3- var lib = require ( "./lib" )
3+ var lib = require ( "./lib" ) ;
44
55var SCROLL_DIR_NAME = {
66 top : "scrollTop" ,
@@ -152,19 +152,19 @@ exports.createDebugLogger = function createDebugLogger(opts) {
152152 try {
153153 log += JSON . stringify ( arguments [ i ] , null , 2 ) + "\n" ;
154154 } catch ( e ) {
155- log += ' failed to log message due to an error: ' + e ;
155+ log += " failed to log message due to an error: " + e ;
156156 }
157157 } else {
158158 log += arguments [ i ] + "\n" ;
159159 }
160160 }
161161
162162 return log ;
163- }
163+ } ;
164164 }
165165
166166 return function ( ) { } ;
167- }
167+ } ;
168168
169169function getParentNode ( node ) {
170170 if ( ! node ) return null ;
@@ -174,7 +174,7 @@ function getParentNode(node) {
174174 return node . parentElement || ( root instanceof ShadowRoot ? root . host : null ) ;
175175 }
176176 return node . parentNode ; // for Text/Comment nodes
177- } ;
177+ }
178178
179179exports . getScrollParent = function getScrollParent ( element , logger ) {
180180 if ( element === null ) {
@@ -192,46 +192,55 @@ exports.getScrollParent = function getScrollParent(element, logger) {
192192 return getScrollParent ( getParentNode ( element ) , logger ) ;
193193 }
194194
195- var canBeScrolled = computedStyleOverflowY === 'auto' || computedStyleOverflowY === 'scroll' || computedStyleOverflowY === 'overlay' ;
195+ var canBeScrolled =
196+ computedStyleOverflowY === "auto" ||
197+ computedStyleOverflowY === "scroll" ||
198+ computedStyleOverflowY === "overlay" ;
196199
197200 if ( hasOverflow && canBeScrolled ) {
198- if ( element . tagName === ' BODY' ) {
201+ if ( element . tagName === " BODY" ) {
199202 return window ;
200203 }
201204 return element ;
202205 } else {
203206 return getScrollParent ( getParentNode ( element ) , logger ) ;
204207 }
205- }
208+ } ;
206209
207210exports . isRootElement = function ( element ) {
208211 return element === window || element . parentElement === null ;
209- }
212+ } ;
210213
211214/* Returns an element relative to which given absolutely positioned element is positioned */
212215exports . findContainingBlock = function findContainingBlock ( element ) {
213216 var parent = element . parentElement ;
214217 while ( parent ) {
215218 var style = lib . getComputedStyle ( parent ) ;
216- if ( [ "relative" , "absolute" , "fixed" , "sticky" ] . includes ( style . position ) || style . transform !== "none" || style . perspective !== "none" ) {
219+ if (
220+ [ "relative" , "absolute" , "fixed" , "sticky" ] . includes ( style . position ) ||
221+ style . transform !== "none" ||
222+ style . perspective !== "none"
223+ ) {
217224 return parent ;
218225 }
219226 parent = parent . parentElement ;
220227 }
221228 return document . documentElement ;
222- }
229+ } ;
223230
224231function _isCreatingStackingContext ( computedStyle ) {
225232 var position = computedStyle . position ;
226233 var zIndexStr = computedStyle . zIndex ;
227234
228- return ( position !== 'static' && zIndexStr !== 'auto' ) ||
235+ return (
236+ ( position !== "static" && zIndexStr !== "auto" ) ||
229237 parseFloat ( computedStyle . opacity ) < 1 ||
230- computedStyle . transform !== 'none' ||
231- computedStyle . filter !== 'none' ||
232- computedStyle . perspective !== 'none' ||
233- position === 'fixed' ||
234- position === 'sticky' ;
238+ computedStyle . transform !== "none" ||
239+ computedStyle . filter !== "none" ||
240+ computedStyle . perspective !== "none" ||
241+ position === "fixed" ||
242+ position === "sticky"
243+ ) ;
235244}
236245
237246function _getStackingContextRoot ( element ) {
@@ -257,7 +266,7 @@ function _getEffectiveZIndex(element) {
257266 var zIndexStr = style . zIndex ;
258267 var createsStackingContext = _isCreatingStackingContext ( style ) ;
259268
260- if ( zIndexStr !== ' auto' ) {
269+ if ( zIndexStr !== " auto" ) {
261270 var num = parseFloat ( zIndexStr ) ;
262271
263272 return isNaN ( num ) ? 0 : num ;
@@ -291,7 +300,7 @@ exports.buildZChain = function buildZChain(element) {
291300 }
292301
293302 return chain ;
294- }
303+ } ;
295304
296305exports . isChainBehind = function isChainBehind ( candChain , targetChain ) {
297306 // Algorithm:
@@ -307,4 +316,4 @@ exports.isChainBehind = function isChainBehind(candChain, targetChain) {
307316 }
308317
309318 return false ;
310- }
319+ } ;
0 commit comments