MCPcopy Index your code
hub / github.com/docker/getting-started / getOffsetParent

Function getOffsetParent

app/src/static/js/react-bootstrap.js:3170–3196  ·  view source on GitHub ↗

* Returns the offset parent of the given element * @method * @memberof Popper.Utils * @argument {Element} element * @returns {Element} offset parent

(element)

Source from the content-addressed store, hash-verified

3168
3169
3170function getOffsetParent(element) {
3171 if (!element) {
3172 return document.documentElement;
3173 }
3174
3175 var noOffsetParent = isIE(10) ? document.body : null; // NOTE: 1 DOM access here
3176
3177 var offsetParent = element.offsetParent || null; // Skip hidden elements which don't have an offsetParent
3178
3179 while (offsetParent === noOffsetParent && element.nextElementSibling) {
3180 offsetParent = (element = element.nextElementSibling).offsetParent;
3181 }
3182
3183 var nodeName = offsetParent && offsetParent.nodeName;
3184
3185 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
3186 return element ? element.ownerDocument.documentElement : document.documentElement;
3187 } // .offsetParent will return the closest TH, TD or TABLE in case
3188 // no offsetParent is present, I hate this job...
3189
3190
3191 if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
3192 return getOffsetParent(offsetParent);
3193 }
3194
3195 return offsetParent;
3196}
3197
3198function isOffsetContainer(element) {
3199 var nodeName = element.nodeName;

Callers 4

isOffsetContainerFunction · 0.85
findCommonOffsetParentFunction · 0.85
computeStyleFunction · 0.85
preventOverflowFunction · 0.85

Calls 2

isIEFunction · 0.85
getStyleComputedPropertyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…