See: http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#float-nan This should apply to methods taking double arguments too.
Note that, in general, it doesn't apply to canvas.
Atul, you might be interested by this? The code might be close to some code you already know. Though, it requires digging into the specs to know which attributes are excluded by this rule.