• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

emdgroup-liquid / liquid / 4373309431

pending completion
4373309431

push

github

Boris Diakur
docs(ld-table): add ld-table-col docs

1846 of 2132 branches covered (86.59%)

Branch coverage included in aggregate %.

2626 of 2814 relevant lines covered (93.32%)

150.28 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

60.0
/src/liquid/utils/scroll.ts
1
/**
2
 * Returns the scroll parent (the first scrollable ancestor of a given element).
3
 * This is a vanilla JS port of the jQuery UI scrollParent method:
4
 * https://github.com/jquery/jquery-ui/blob/main/ui/scroll-parent.js
5
 */
6
export function getScrollParent(element: HTMLElement, includeHidden?: boolean) {
2✔
7
  let style = getComputedStyle(element)
12✔
8
  if (style.position === 'fixed') {
12!
9
    return document.scrollingElement
×
10
  }
11

12
  const excludeStaticParent = style.position === 'absolute'
12✔
13
  const overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/
12!
14

15
  // Using for loop instead of recursion in order to save memory.
16
  for (let parent = element; (parent = parent.parentElement); ) {
12✔
17
    style = getComputedStyle(parent)
40✔
18
    if (excludeStaticParent && style.position === 'static') {
40!
19
      continue
×
20
    }
21
    if (
40!
22
      overflowRegex.test(style.overflow + style.overflowY + style.overflowX)
23
    ) {
24
      return parent
×
25
    }
26
  }
27

28
  return document.scrollingElement
12✔
29
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc