Steps to reproduce: (1) Open a tab and navigate to any URL; (2) Run the following code in the Console of Devtools: ``` new MouseEvent('',{screenX: NaN}); ``` (3) This code would be evaluated successfully without any exceptions thrown. Actual results: This code would be evaluated successfully without any exceptions thrown. Expected results: In Chome, this code would throw an exception: `Uncaught TypeError: Failed to construct 'MouseEvent': The provided double value is non-finite.`. It seems reasonable to throw such an exception since the type of the screenX param is double.
As https://docs.w3cub.com/dom/mouseevent/screenx says, screenX is `A double floating point value. Early versions of the spec defined this as an integer referring to the number of pixels`.
Looks like the latest version of UIEvents still has this as a long: https://w3c.github.io/uievents/#idl-mouseeventinit.
(In reply to Sam Weinig from comment #2) > Looks like the latest version of UIEvents still has this as a long: > > https://w3c.github.io/uievents/#idl-mouseeventinit. Indeed, we are matching the specification and Firefox. Maybe this a bug should be filed against Chrome? They are the only ones not aligned here.
<rdar://problem/79282818>
We are aligned with Firefox and the specification here. I don't think we should make this change for now.