MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / getPosY

Method getPosY

src/main/java/org/htmlunit/html/HtmlElement.java:1616–1632  ·  view source on GitHub ↗

Returns this element's Y position. @return this element's Y position

()

Source from the content-addressed store, hash-verified

1614 * @return this element's Y position
1615 */
1616 public int getPosY() {
1617 int cumulativeOffset = 0;
1618 final WebWindow webWindow = getPage().getEnclosingWindow();
1619
1620 HtmlElement element = this;
1621 while (element != null) {
1622 cumulativeOffset += element.getOffsetTop();
1623 if (element != this) {
1624 final ComputedCssStyleDeclaration style =
1625 webWindow.getComputedStyle(element, null);
1626 cumulativeOffset += style.getBorderTopValue();
1627 }
1628 element = element.getOffsetParentInternal(false);
1629 }
1630
1631 return cumulativeOffset;
1632 }
1633
1634 /**
1635 * {@inheritDoc}

Callers

nothing calls this directly

Calls 6

getOffsetTopMethod · 0.95
getComputedStyleMethod · 0.95
getBorderTopValueMethod · 0.95
getEnclosingWindowMethod · 0.65
getPageMethod · 0.65

Tested by

no test coverage detected