RESOLVED FIXED 227146
[WebIDL] Assigning a value outside the float range to a 'float' attribute should throw a TypeError
https://bugs.webkit.org/show_bug.cgi?id=227146
Summary [WebIDL] Assigning a value outside the float range to a 'float' attribute sho...
Chris Dumez
Reported 2021-06-17 14:44:27 PDT
Assigning a value outside the float range to a 'float' attribute should throw a TypeError, as per: https://heycam.github.io/webidl/#es-float Blink follows the specification but WebKit just casts the double to a float.
Attachments
Patch (12.00 KB, patch)
2021-06-17 14:47 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2021-06-17 14:47:52 PDT
Sam Weinig
Comment 2 2021-06-17 20:37:24 PDT
We might want to fix the canvas IDLs still using float that should be double before doing this to avoid accidental fallout.
Cameron McCormack (:heycam)
Comment 3 2021-06-17 21:18:32 PDT
It looks like almost all uses of floats in our canvas IDLs are `unrestricted float`, which will at least saturate out of range Number values to +/-Infinity.
Chris Dumez
Comment 4 2021-06-17 22:25:56 PDT
(In reply to Cameron McCormack (:heycam) from comment #3) > It looks like almost all uses of floats in our canvas IDLs are `unrestricted > float`, which will at least saturate out of range Number values to > +/-Infinity. Right, the behavior change in this patch for unrestricted float is not large and a strict progression. I would be more concerned about APIs where we use (restricted) float instead of double.
Sam Weinig
Comment 5 2021-06-18 12:54:11 PDT
Fair (just trying to bully people into fixing that because I keep forgetting to).
EWS
Comment 6 2021-06-18 19:16:26 PDT
Committed r279047 (238967@main): <https://commits.webkit.org/238967@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 431723 [details].
Radar WebKit Bug Importer
Comment 7 2021-06-18 19:17:30 PDT
Note You need to log in before you can comment on or make changes to this bug.