@Test public void testScrollToWithThreeArguments() { final HTMLElement target = mock(HTMLElement.class); final HTMLElement container = mock(HTMLElement.class); target.offsetTop = 8; container.offsetTop = 4; scrollHelper.scrollTo(target, container, 2); final Double expectedScrollTop = 2d; final Double actualScrollTop = container.scrollTop; assertEquals(expectedScrollTop, actualScrollTop); }
public void scrollTo(final Element target, final Element container, final int padding) { final double targetOffsetTop = ((HTMLElement) target).offsetTop; final double containerOffsetTop = ((HTMLElement) container).offsetTop; container.scrollTop = targetOffsetTop - containerOffsetTop - padding; }
ScrollHelper { public void scrollTo(final Element target, final Element container, final int padding) { final double targetOffsetTop = ((HTMLElement) target).offsetTop; final double containerOffsetTop = ((HTMLElement) container).offsetTop; container.scrollTop = targetOffsetTop - containerOffsetTop - padding; } }
ScrollHelper { public void scrollTo(final Element target, final Element container, final int padding) { final double targetOffsetTop = ((HTMLElement) target).offsetTop; final double containerOffsetTop = ((HTMLElement) container).offsetTop; container.scrollTop = targetOffsetTop - containerOffsetTop - padding; }  }
ScrollHelper { public void scrollTo(final Element target, final Element container, final int padding) { final double targetOffsetTop = ((HTMLElement) target).offsetTop; final double containerOffsetTop = ((HTMLElement) container).offsetTop; container.scrollTop = targetOffsetTop - containerOffsetTop - padding; }  void animatedScrollToBottom(final Element element); void scrollToBottom(final Element element); void scrollTo(final Element target,
                         final Element container,
                         final int padding); void scrollTo(final Element target,
                         final Element container); }
ScrollHelper { public void scrollTo(final Element target, final Element container, final int padding) { final double targetOffsetTop = ((HTMLElement) target).offsetTop; final double containerOffsetTop = ((HTMLElement) container).offsetTop; container.scrollTop = targetOffsetTop - containerOffsetTop - padding; }  void animatedScrollToBottom(final Element element); void scrollToBottom(final Element element); void scrollTo(final Element target,
                         final Element container,
                         final int padding); void scrollTo(final Element target,
                         final Element container);  }