[Bug 20640] checking for infinity and nan values in window.scroll

https://www.w3.org/Bugs/Public/show_bug.cgi?id=20640

Simon Pieters <simonp@opera.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |simonp@opera.com
         Resolution|---                         |FIXED

--- Comment #1 from Simon Pieters <simonp@opera.com> ---
(In reply to comment #0)
> Hello,
> 
> Step 1 of window.scroll algorithm
> (http://www.w3.org/TR/cssom-view/#dom-window-scroll) is to check whether the
> coordinates x and y are infinite or nan. However, the signature of the
> scroll method indicates that the type of those variables is "long", making
> infinite and nan values impossible.

I think that step predated WebIDL throwing for those values. Fixed:

https://dvcs.w3.org/hg/csswg/rev/9b737ecc8598
https://dvcs.w3.org/hg/csswg/rev/d1dbf4fde303

> Is it possible that the original intention was to make the coordinate values
> float or double? Otherwise, should this step exist at all?

float and double also disallow NaN/infinity per WebIDL.

> The survey of the major browsers shows that this step is ignored (tested
> IE9, Chrome, Firefox).

Opera implements this step. Firefox/Chrome/IE9 seem to treat
NaN/-Infinity/Infinity as 0. I'd like to see if throwing TypeError instead is
Web-compatible before using "unrestricted long" in the spec.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Tuesday, 23 April 2013 10:44:27 UTC