From 1dac67ff54fbcdc0c16bd9e9b808c433ea99bd7f Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Tue, 12 May 2026 19:59:44 +0200 Subject: [PATCH] Use FeatureTest.isCanvasFilterSupported in _bakeSMaskCanvas --- src/display/canvas.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/display/canvas.js b/src/display/canvas.js index 442b12e9c..c06f5a4be 100644 --- a/src/display/canvas.js +++ b/src/display/canvas.js @@ -1437,16 +1437,15 @@ class CanvasGraphics { } const preparedEntry = this.canvasFactory.create(w, h); const pCtx = preparedEntry.context; - // Pre-assign read: undefined means no canvas filter API (assigning - // would just set a JS property and post-assign read would lie). // Post-assign "none"/"" means the URL was rejected (Firefox // normalizes accepted url(#id) to an absolute URL). - const filterSupported = pCtx.filter !== undefined; pCtx.filter = filterSpec.url; const filterApplied = - filterSupported && pCtx.filter !== "none" && pCtx.filter !== ""; + FeatureTest.isCanvasFilterSupported && + pCtx.filter !== "none" && + pCtx.filter !== ""; pCtx.drawImage(srcEntry.canvas, 0, 0); - if (filterSupported) { + if (FeatureTest.isCanvasFilterSupported) { pCtx.filter = "none"; } if (!filterApplied) {