[webkit-dev] ScrollableArea::scrollSize() vs ScrollableArea::maximumScrollPosition()

Xianzhu Wang wangxianzhu at chromium.org
Mon Apr 1 15:37:04 PDT 2013


On Mon, Apr 1, 2013 at 3:14 PM, Simon Fraser <simon.fraser at apple.com> wrote:

>
> On Apr 1, 2013, at 2:47 PM, Xianzhu Wang <wangxianzhu at chromium.org> wrote:
>
> > Hi,
> >
> > ScrollableArea::scrollSize() and ScrollableArea::maximumScrollPosition()
> seem to return the same value if the parameters of the scrollbars are
> updated. Can we remove one of them?
>
> I don't understand the " if the parameters of the scrollbars are updated"
> part.
>

I mean updateScrollbars() that is called after sth e.g. visibleContentSize
changed.
maximumScrollPosition() doesn't depend on updateSrollbars() while
scrollSize() does.


> Do they return the same thing if scrollOrigin is not 0,0? This happens in
> RTL contexts.
>

Yes this is what I missed :)

So my question changes to: can we let scrollSize() not depend on the
scrollbars? For example, just let it return clamp(contentsSize -
visibleSize)? And give it a better name.

Simon
>
> >
> > I think the benefits are:
> > - no redundancy;
> > - ScrollableArea could be independent on scrollbars;
> > - maximumScrollPosition() is more up-to-date without the need of
> updateScrollbars;
> > - the ambiguity of the name scrollSize (e.g. RenderLayer::m_scrollSize
> and RenderLayer::scrollSize() are totally different things) can be
> eliminated
> >
> > What do you think? Am I missing anything?
> >
> > Xianzhu
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20130401/d48a629f/attachment.html>


More information about the webkit-dev mailing list