MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / getOverflowStyles

Function getOverflowStyles

javascript/atoms/typescript/is-displayed.ts:283–304  ·  view source on GitHub ↗
(current: Element)

Source from the content-addressed store, hash-verified

281 }
282
283 function getOverflowStyles(current: Element): OverflowStyles {
284 var overflowElem = current;
285 if (htmlOverflowStyle === 'visible') {
286 if (current === htmlElem && bodyElem) {
287 overflowElem = bodyElem;
288 } else if (current === bodyElem) {
289 return { x: 'visible', y: 'visible' };
290 }
291 }
292
293 var overflow = {
294 x: getEffectiveStyle(overflowElem, 'overflow-x') || 'visible',
295 y: getEffectiveStyle(overflowElem, 'overflow-y') || 'visible',
296 };
297
298 if (current === htmlElem) {
299 overflow.x = overflow.x === 'visible' ? 'auto' : overflow.x;
300 overflow.y = overflow.y === 'visible' ? 'auto' : overflow.y;
301 }
302
303 return overflow;
304 }
305
306 function getScroll(current: Element): Coordinate {
307 if (current === htmlElem) {

Callers 1

getOverflowStateFunction · 0.70

Calls 1

getEffectiveStyleFunction · 0.85

Tested by

no test coverage detected