add iframe tests and update urls in test file

This commit is contained in:
Yanzhen Yu
2018-10-06 10:13:33 +08:00
parent 8b82981b62
commit bfe431e99a
5 changed files with 20 additions and 7 deletions

View File

@@ -47,10 +47,10 @@ function serializeNode(n: Node, doc: Document): serializedNode | false {
attributes[name] = value;
}
// remote css
if (tagName === 'link' && attributes.hasOwnProperty('href')) {
const stylesheet = Array.from(doc.styleSheets).find(
s => s.href === attributes.href,
);
if (tagName === 'link') {
const stylesheet = Array.from(doc.styleSheets).find(s => {
return s.href === (n as HTMLLinkElement).href;
});
const cssText = getCssRulesString(stylesheet as CSSStyleSheet);
if (cssText) {
attributes = {