From 6c536b10636024c2094519e45224a17e884adcff Mon Sep 17 00:00:00 2001 From: HoonDongKang Date: Sat, 25 Jul 2026 22:41:15 +0900 Subject: [PATCH] buffer: use Clamp conversion in Blob slice Align Blob.prototype.slice() with the File API Web IDL definition by using [Clamp] conversion for the start and end arguments. This fixes the Blob-slice.any.js WPT expected failures for fractional start and end values. Refs: https://www.w3.org/TR/FileAPI/#dfn-Blob Signed-off-by: HoonDongKang --- lib/internal/blob.js | 4 ++-- test/wpt/status/FileAPI/blob.cjs | 12 ------------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/lib/internal/blob.js b/lib/internal/blob.js index 68071a5f5645e7..41c7f61da7902d 100644 --- a/lib/internal/blob.js +++ b/lib/internal/blob.js @@ -261,11 +261,11 @@ class Blob { start = converters['long long']( start, - { __proto__: null, context: 'start' }, + { __proto__: null, context: 'start', clamp: true }, ); end = converters['long long']( end, - { __proto__: null, context: 'end' }, + { __proto__: null, context: 'end', clamp: true }, ); if (start < 0) { diff --git a/test/wpt/status/FileAPI/blob.cjs b/test/wpt/status/FileAPI/blob.cjs index 99ec7dd22cea5f..bf40df1b842588 100644 --- a/test/wpt/status/FileAPI/blob.cjs +++ b/test/wpt/status/FileAPI/blob.cjs @@ -36,16 +36,4 @@ module.exports = { 'Blob-in-worker.worker.js': { skip: 'Depends on Web Workers API', }, - 'Blob-slice.any.js': { - fail: { - expected: [ - 'Slicing test: slice (1,1).', - 'Slicing test: slice (1,3).', - 'Slicing test: slice (1,5).', - 'Slicing test: slice (1,7).', - 'Slicing test: slice (1,8).', - 'Slicing test: slice (1,9).', - ], - }, - }, };