Re: [cssom-view] Add a "smooth" parameter to scrollTo and scrollBy functions

On Sun, 19 May 2013 06:03:16 +0200, Garrett Smith <dhtmlkitchen@gmail.com>  
wrote:

>> If one wants smooth scrolling for all navigations, then a CSS property
>> seems better. If one wants instant scrolling in general and just smooth
>> scrolling for the "scroll to top", an API seems better.
>
> You see "CSS vs an API" but I see it as CSS vs Parameter. This is
> because the CSS style.transition is accessible through a scriptable
> API, and so it is an API.
>
> I'm wondering about feature testing. It is generally desirable to know
> what sort of values are acceptable. How would either approach provide
> for that?

So far the values would be just "smooth" or "instant" (or true/false). A  
possible future addition could be to support time and timing function like  
transitions.

If we add an argument to scroll(), we can make it throw for invalid  
values, which would allow testing different values. For a CSS property, it  
can be checked in the CSSOM if it exists and if a value gets parsed or  
not, or @supports or CSS.supports can be used.

-- 
Simon Pieters
Opera Software

Received on Monday, 20 May 2013 11:37:45 UTC