{@inheritDoc}
<p/>
<p>This version also clamps the scrolling to the bounds of our child.
12746
public void scrollTo(int x, int y) {
        // we rely on the fact the View.scrollBy calls scrollTo.
        if (getChildCount() > 0) {
            View child = getChildAt(0);
            x = clamp(x, getWidth() - getPaddingRight() - getPaddingLeft(), child.getWidth());
            y = clamp(y, getHeight() - getPaddingBottom() - getPaddingTop(), child.getHeight());
            if (x != getScrollX() || y != getScrollY()) {
                super.scrollTo(x, y);
            }
        }
    }
1157951
public boolean isWithinBoundsOfWindow() throws WidgetException {
		
		JavascriptExecutor js = ((JavascriptExecutor) getGUIDriver().getWrappedDriver());
		
		// execute javascript to get scroll values
		Object top = js.executeScript("return document.body.scrollTop;");
		Object left = js.executeScript("return document.body.scrollLeft;");
		
		int scrollTop;
		int scrollLeft;
		try {
			scrollTop = Integer.parseInt(top+"");
			scrollLeft = Integer.parseInt(left+"");
		}
		catch(NumberFormatException e) {
			throw new WidgetException("There was an error parsing the scroll values from the page", getByLocator());
		}
		
		// calculate bounds
		Dimension dim = getGUIDriver().getWrappedDriver().manage().window().getSize();
		int windowWidth = dim.getWidth();
		int windowHeight = dim.getHeight();
		int x = ((Locatable)getWebElement()).getCoordinates().onPage().getX();
		int y = ((Locatable)getWebElement()).getCoordinates().onPage().getY();
		int relX = x - scrollLeft;
		int relY = y - scrollTop;
		return relX + findElement().getSize().getWidth() <= windowWidth && 
				relY + findElement().getSize().getHeight() <= windowHeight && 
					relX >= 0 && relY >= 0;
	}
842734
public void addScrollListener(@NonNull final ScrollListener listener) {
        Condition.INSTANCE.ensureNotNull(listener, "The listener may not be null");
        this.scrollListeners.add(listener);
    }
3273
function getScrollParent(parent, child) {
  let element = child;
  let scrollTop = 0;

  while (element && element !== parent) {
    element = element.parentNode;
    scrollTop += element.scrollTop;
  }
  return scrollTop;
}
196299
@Override
    public boolean onScroll(ScrollEvent event) {
        lastMovement = System.currentTimeMillis();
        needsDataRefresh = true;
        return false;
    }
1045603
function checkInfiniteBounds() {
    if (self.isLoading) return;
    var maxScroll = {};

    if (self.jsScrolling) {
      maxScroll = self.getJSMaxScroll();
      var scrollValues = self.scrollView.getValues();
      if ((maxScroll.left !== -1 && scrollValues.left >= maxScroll.left) ||
        (maxScroll.top !== -1 && scrollValues.top >= maxScroll.top)) {
        onInfinite();
      }
    } else {
      maxScroll = self.getNativeMaxScroll();
      if ((
        maxScroll.left !== -1 &&
        self.scrollEl.scrollLeft >= maxScroll.left - self.scrollEl.clientWidth
        ) || (
        maxScroll.top !== -1 &&
        self.scrollEl.scrollTop >= maxScroll.top - self.scrollEl.clientHeight
        )) {
        onInfinite();
      }
    }
  }
590408
public void setBounds(int x, int y, int w, int h) {

        super.setBounds(x, y, w, h);

        iSbHeight = sbHoriz.getPreferredSize().height;
        iSbWidth  = sbVert.getPreferredSize().width;
        iHeight   = h - iSbHeight;
        iWidth    = w - iSbWidth;

        sbHoriz.setBounds(0, iHeight, iWidth, iSbHeight);
        sbVert.setBounds(iWidth, 0, iSbWidth, iHeight);
        adjustScroll();

        iImage = null;

        repaint();
    }
594797
void scrollByInternal(int x, int y) {
        int overscrollX = 0, overscrollY = 0;
        consumePendingUpdateOperations();
        if (mAdapter != null) {
            eatRequestLayout();
            if (x != 0) {
                final int hresult = mLayout.scrollHorizontallyBy(x, mRecycler, mState);
                overscrollX = x - hresult;
            }
            if (y != 0) {
                final int vresult = mLayout.scrollVerticallyBy(y, mRecycler, mState);
                overscrollY = y - vresult;
            }
            resumeRequestLayout(false);
        }

        if (!mItemDecorations.isEmpty()) {
            invalidate();
        }
        if (ViewCompat.getOverScrollMode(this) != ViewCompat.OVER_SCROLL_NEVER) {
            pullGlows(overscrollX, overscrollY);
        }
        if (mScrollListener != null && (x != 0 || y != 0)) {
            mScrollListener.onScrolled(x, y);
        }
        if (!awakenScrollBars()) {
            invalidate();
        }
    }
720428
public void configureListView(ListView listView) {
		this.listView = listView;
		this.listView.setOnScrollListener(new OnScrollListener() {

			int scrollPosition;

			@Override
			public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
				notifyScrollToAdditionalScrollListener(view, firstVisibleItem, visibleItemCount, totalItemCount);
				View topChild = view.getChildAt(0);

				int newScrollPosition;
				if (topChild == null) {
					newScrollPosition = 0;
				} else {
					newScrollPosition = view.getFirstVisiblePosition() * topChild.getHeight() - topChild.getTop();
				}
				if (Math.abs(newScrollPosition - scrollPosition) >= SCROLL_DIRECTION_CHANGE_THRESHOLD) {
					onScrollPositionChanged(scrollPosition, newScrollPosition);
				}

				scrollPosition = newScrollPosition;
			}

			@Override
			public void onScrollStateChanged(AbsListView view, int scrollState) {
				notifyScrollStateChangedToAdditionalScrollListener(view, scrollState);

			}
		});
	}
1152405
@Override
    public boolean hasNext()
    {
        currentObject = fetchObject();
        if (count < fetchSize && fetchSize > 0 && currentObject != null)
        {
            count++;
            return true;
        }
        scrollComplete = true;
        return false;
    }
332708
public void ensureSurrounds(CmsPositionBean child, int padding) {

        // increase the size of the outer rectangle
        if ((getLeft() + padding) > child.getLeft()) {
            int diff = getLeft() - child.getLeft();
            // ensure padding
            diff += padding;
            setLeft(getLeft() - diff);
            setWidth(getWidth() + diff);
        }
        if ((getTop() + padding) > child.getTop()) {
            int diff = getTop() - child.getTop();
            diff += padding;
            setTop(getTop() - diff);
            setHeight(getHeight() + diff);
        }
        if ((getLeft() + getWidth()) < (child.getLeft() + child.getWidth() + padding)) {
            int diff = (child.getLeft() + child.getWidth()) - (getLeft() + getWidth());
            diff += padding;
            setWidth(getWidth() + diff);
        }
        if ((getTop() + getHeight()) < (child.getTop() + child.getHeight() + padding)) {
            int diff = (child.getTop() + child.getHeight()) - (getTop() + getHeight());
            diff += padding;
            setHeight(getHeight() + diff);
        }
    }
405930
function bindParent (sticky) {
  if (!sticky instanceof Sticky) {
    return
  }
  const scroller = sticky.component.getParentScroller()
  let pt
  if (scroller) {
    pt = sticky.parent = scroller
    sticky.parentElement = pt.node
  }
  else {
    pt = sticky.parent = sticky.component.getRootContainer()
    sticky.parentElement = pt
  }
}
331695
@UiThread
    protected void expandView() {
        setExpanded(true);
        onExpansionToggled(false);

        if (mParentViewHolderExpandCollapseListener != null) {
            mParentViewHolderExpandCollapseListener.onParentExpanded(getAdapterPosition());
        }
    }
773070
@Override
    public boolean hasNext()
    {
        if (checkOnFetchSize())
        {
            onCheckRelation();
            if (!checkOnEmptyResult())
            {
                scrollComplete = true;
                return false;
            }
            return true;
        }
        return false;
    }
686864
@Override
	public void resetBoundingBox() {
		super.resetBoundingBox();
		final GISLayerContainer<?> parent = getContainer();
		if (parent != null) {
			parent.resetBoundingBox();
		}
	}
1368762
@Override
	public int computeVerticalScrollRange() {
		final int count = getChildCount();
		final int contentHeight = getHeight() - getPaddingBottom() - getPaddingTop();
		if (count == 0) {
			return contentHeight;
		}

		int scrollRange = getChildAt(0).getBottom();
		final int scrollY = getScrollY();
		final int overscrollBottom = Math.max(0, scrollRange - contentHeight);
		if (scrollY < 0) {
			scrollRange -= scrollY;
		} else if (scrollY > overscrollBottom) {
			scrollRange += scrollY - overscrollBottom;
		}

		return scrollRange;
	}
581392
public void scrollDown() {
        logger.entering();
        WebElement webElement = this.findElement(By.className(SCROLLVIEW_CLASS));
        swipeDown(webElement);
        logger.exiting();
    }