From bc270bb2116480a8ae08d3d9601f2b6118b44da3 Mon Sep 17 00:00:00 2001 From: Niklas von Hertzen Date: Fri, 10 May 2019 22:51:31 -0700 Subject: [PATCH] fix: CSSKeyframesRule cssText Permission Denied on Internet Explorer 11 (#1830) --- src/dom/document-cloner.ts | 2 +- tests/reftests/animation.html | 50 +++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 tests/reftests/animation.html diff --git a/src/dom/document-cloner.ts b/src/dom/document-cloner.ts index fc7434196..d427ba303 100644 --- a/src/dom/document-cloner.ts +++ b/src/dom/document-cloner.ts @@ -130,7 +130,7 @@ export class DocumentCloner { const sheet = node.sheet as CSSStyleSheet | undefined; if (sheet && sheet.cssRules) { const css: string = [].slice.call(sheet.cssRules, 0).reduce((css: string, rule: CSSRule) => { - if (rule && rule.cssText) { + if (rule && typeof rule.cssText === 'string') { return css + rule.cssText; } return css; diff --git a/tests/reftests/animation.html b/tests/reftests/animation.html new file mode 100644 index 000000000..55b35720f --- /dev/null +++ b/tests/reftests/animation.html @@ -0,0 +1,50 @@ + + + + Animation + + + + + + +
Some inline text followed by text in span followed by more inline text. +

Then a block level element.

+ Then more inline text.
+ +