MCPcopy Create free account
hub / github.com/breck7/scroll / contains

Function contains

external/.scrollLibs.js:584–600  ·  view source on GitHub ↗
(parent, child)

Source from the content-addressed store, hash-verified

582 }
583
584 function contains(parent, child) {
585 if (child.nodeType == 3) {
586 // Android browser always returns false when child is a textnode
587 child = child.parentNode
588 }
589 if (parent.contains) {
590 return parent.contains(child)
591 }
592 do {
593 if (child.nodeType == 11) {
594 child = child.host
595 }
596 if (child == parent) {
597 return true
598 }
599 } while ((child = child.parentNode))
600 }
601
602 function activeElt() {
603 // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement.

Callers 5

widgetHeightFunction · 0.70
selectionSnapshotFunction · 0.70
restoreSelectionFunction · 0.70
.scrollLibs.jsFile · 0.70
locateNodeInLineViewFunction · 0.70

Calls 1

containsMethod · 0.80

Tested by

no test coverage detected