-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
WebIDL conversion to clamped i64 is incorrect #41638
Description
Specification: https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
Gecko's implementation: https://searchfox.org/firefox-main/rev/aee7c0f24f488cd7f5a835803b48dd0c0cb2fd5f/dom/bindings/PrimitiveConversions.h#225-269
Servo's implementation: https://github.com/servo/mozjs/blob/4d290e8a270f1bf6cc18aa5860427243a39cc128/mozjs/src/conversions.rs#L227-L244
We just end up using f32 as i64, which is incorrect. We should port the rest of the logic from Gecko; the resulting implementation should make the remaining tests in
servo/tests/wpt/tests/FileAPI/blob/Blob-slice.any.js
Lines 103 to 116 in 9ca7628
| // Test double start/end values | |
| [ | |
| ["abcd"], | |
| [{start: 0.5, contents: "abcd"}, | |
| {start: 1.5, contents: "cd"}, | |
| {start: 2.5, contents: "cd"}, | |
| {start: 3.5, contents: ""}, | |
| {start: 0, end: 0.5, contents: ""}, | |
| {start: 0, end: 1.5, contents: "ab"}, | |
| {start: 0, end: 2.5, contents: "ab"}, | |
| {start: 0, end: 3.5, contents: "abcd"}, | |
| {start: 1.5, end: 2.5, contents: ""}, | |
| {start: 1.5, end: 3.5, contents: "cd"}] | |
| ], |
Tests: ./mach test-wpt tests/wpt/tests/FileAPI/blob/Blob-slice.any.js