MCPcopy
hub / github.com/ampproject/amphtml / getLayoutBox

Method getLayoutBox

src/service/resource.js:606–616  ·  view source on GitHub ↗

* Returns a previously measured layout box adjusted to the viewport. This * mainly affects fixed-position elements that are adjusted to be always * relative to the document position in the viewport. * The returned layoutBox is: * - relative to the top of the document for non fixed elemen

()

Source from the content-addressed store, hash-verified

604 * @return {!../layout-rect.LayoutRectDef}
605 */
606 getLayoutBox() {
607 if (!this.isFixed_) {
608 return this.layoutBox_;
609 }
610 const viewport = Services.viewportForDoc(this.element);
611 return moveLayoutRect(
612 this.layoutBox_,
613 viewport.getScrollLeft(),
614 viewport.getScrollTop()
615 );
616 }
617
618 /**
619 * Returns the first measured layout box.

Callers 9

completeCollapseMethod · 0.95
isDisplayedMethod · 0.95
overlapsMethod · 0.95
dirtyElementMethod · 0.45
mutateWork_Method · 0.45
elementNearBottom_Method · 0.45
discoverWork_Method · 0.45
calcTaskScore_Method · 0.45

Calls 3

moveLayoutRectFunction · 0.90
getScrollLeftMethod · 0.45
getScrollTopMethod · 0.45

Tested by

no test coverage detected