diff --git a/src/dom/document-cloner.ts b/src/dom/document-cloner.ts index 07bc560..d520e01 100644 --- a/src/dom/document-cloner.ts +++ b/src/dom/document-cloner.ts @@ -443,12 +443,17 @@ const iframeLoader = (iframe: HTMLIFrameElement): Promise => }); }; +const ignoredStyleProperties = [ + 'all', // #2476 + 'd', // #2483 + 'content' // Safari shows pseudoelements if content is set +]; + export const copyCSSStyles = (style: CSSStyleDeclaration, target: T): T => { // Edge does not provide value for cssText for (let i = style.length - 1; i >= 0; i--) { const property = style.item(i); - // Safari shows pseudoelements if content is set - if (property !== 'content' && property !== 'all') { + if (ignoredStyleProperties.indexOf(property) === -1) { target.style.setProperty(property, style.getPropertyValue(property)); } } diff --git a/tests/reftests/images/svg/native_only.html b/tests/reftests/images/svg/native_only.html index 341258c..af50eac 100644 --- a/tests/reftests/images/svg/native_only.html +++ b/tests/reftests/images/svg/native_only.html @@ -40,5 +40,13 @@ canvas + + + + + + + +