[cssom-view] unrestricted double in ScrollToOptions

The CSSOM View spec uses `double` in ScrollToOptions top/left dictionary  
members, which means that non-finite numbers throw TypeError per WebIDL.

http://dev.w3.org/csswg/cssom-view/#dictdef-scrolltooptions

The spec uses `unrestricted double` (and converts non-finite numbers to  
zero) for the arguments that were traditionally `long`, since it matches  
the traditional `long` behavior.

Example: scrollTo(0, NaN); // same as x.scrollTo(0, 0);

The ScrollToOptions dictionary is new so there is no Web compat to worry  
about.

Example: scrollTo({top: NaN}); // throws TypeError per spec

However, in Gecko and Blink they are implemented as `unrestricted double`;  
non-finite numbers do not throw TypeError. (Blink doesn't convert Infinity  
to zero, this is a known bug.) Should we change the spec to make  
ScrollToOptions top/left `unrestricted double`, so that the dictionary  
behaves more like the old arguments? Or do people think it is more useful  
to throw for non-finite numbers in the dictionary?

-- 
Simon Pieters
Opera Software

Received on Friday, 27 February 2015 09:25:43 UTC