The cssom-view-1 spec currently specifies both scrollTo and scrollBy as if they both invoke the scroll method with the left and top set accordingly. However, I think that we should differentiate these APIs as relative directional scrolls and absolute scrolls as far as they affect several other APIs. The legacy scrollLeft and scrollTop should probably be treated as absolute scrolls as that is usually what they are used for.
Absolute scrolls:
Relative / directional scrolls:
Proposed resolution:
Define a consistent distinction between absolute scrolls and relative scrolls that can be implemented and shared across these affected specs.
Absolute scrolls: scrollTo, scrollLeft, scrollTop, scrollIntoView, anchor fragment scrolls, scroll anchoring, find in page scrolls, focus scroll into view, scroll thumb dragging?
Relative scrolls: scrollBy, arrow key, page up/down, spacebar, home/end?, scrollbar track clicks, scrollbar buttons
Any other ways of scrolling we need to categorize?
@tabatkins
The cssom-view-1 spec currently specifies both scrollTo and scrollBy as if they both invoke the scroll method with the left and top set accordingly. However, I think that we should differentiate these APIs as relative directional scrolls and absolute scrolls as far as they affect several other APIs. The legacy
scrollLeftandscrollTopshould probably be treated as absolute scrolls as that is usually what they are used for.Absolute scrolls:
Relative / directional scrolls:
scrollBy(0, 10)scroll always scroll 10px down rather than potentially scrolling up if there was an ongoing fling scroll.Proposed resolution:
Define a consistent distinction between absolute scrolls and relative scrolls that can be implemented and shared across these affected specs.
Absolute scrolls: scrollTo, scrollLeft, scrollTop, scrollIntoView, anchor fragment scrolls, scroll anchoring, find in page scrolls, focus scroll into view, scroll thumb dragging?
Relative scrolls: scrollBy, arrow key, page up/down, spacebar, home/end?, scrollbar track clicks, scrollbar buttons
Any other ways of scrolling we need to categorize?
@tabatkins