MCPcopy Index your code
hub / github.com/ampproject/amphtml / getIntersectionChangeEntry

Function getIntersectionChangeEntry

src/utils/intersection-observer-3p-host.js:50–56  ·  view source on GitHub ↗
(element, owner, hostViewport)

Source from the content-addressed store, hash-verified

48 * @return {!IntersectionObserverEntry} A change entry.
49 */
50export function getIntersectionChangeEntry(element, owner, hostViewport) {
51 const intersection =
52 rectIntersection(element, owner, hostViewport) ||
53 layoutRectLtwh(0, 0, 0, 0);
54 const ratio = intersectionRatio(intersection, element);
55 return calculateChangeEntry(element, hostViewport, intersection, ratio);
56}
57
58/**
59 * A class to help amp-iframe and amp-ad nested iframe listen to intersection

Callers 3

getInObEntryFunction · 0.90

Calls 4

rectIntersectionFunction · 0.90
layoutRectLtwhFunction · 0.90
intersectionRatioFunction · 0.85
calculateChangeEntryFunction · 0.85

Tested by

no test coverage detected