From d3e3726ac42bf623572ff06405e12f4ee72873dd Mon Sep 17 00:00:00 2001 From: Bogdan Chadkin Date: Sat, 6 Mar 2021 11:21:47 +0300 Subject: [PATCH] Keep markers with display: none --- plugins/removeHiddenElems.js | 4 +++- test/regression.js | 19 +++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/plugins/removeHiddenElems.js b/plugins/removeHiddenElems.js index efa1be430..513568350 100644 --- a/plugins/removeHiddenElems.js +++ b/plugins/removeHiddenElems.js @@ -72,7 +72,9 @@ exports.fn = function (item, params) { params.displayNone && computedStyle.display && computedStyle.display.type === 'static' && - computedStyle.display.value === 'none' + computedStyle.display.value === 'none' && + // markers with display: none still rendered + item.isElem('marker') === false ) { return false; } diff --git a/test/regression.js b/test/regression.js index 13de8c616..8cc5c49ee 100644 --- a/test/regression.js +++ b/test/regression.js @@ -97,23 +97,26 @@ const runTests = async ({ svgFiles }) => { name.startsWith('animate-') || // breaks because of optimisation despite of script name === 'interact-pointer-04-f' || - // other cases which require complex changes - name === 'painting-marker-07-f' || + // messed gradients name === 'pservers-grad-18-b' || + // animated filter + name === 'filters-light-04-f' || + // removing wrapping breaks :first-child pseudo-class + name === 'styling-pres-04-f' || + // messed case insensitivity while inlining styles + name === 'styling-css-10-f' || + // rect is converted to path which matches wrong styles + name === 'styling-css-08-f' || + // other cases which require complex changes name === 'struct-image-02-b' || name === 'struct-use-10-f' || name === 'struct-use-11-f' || name === 'styling-css-01-b' || name === 'styling-css-03-b' || name === 'styling-css-04-f' || - name === 'styling-css-08-f' || - // unstable test - name === 'filters-light-04-f' || // mismatched draft cases name === 'struct-cond-overview-03-f' || - name === 'struct-use-07-b' || - name === 'styling-css-10-f' || - name === 'styling-pres-04-f' + name === 'struct-use-07-b' ) { console.info(`${name} is skipped`); skipped += 1;