add iframe tests and update urls in test file
This commit is contained in:
@@ -47,10 +47,10 @@ function serializeNode(n: Node, doc: Document): serializedNode | false {
|
|||||||
attributes[name] = value;
|
attributes[name] = value;
|
||||||
}
|
}
|
||||||
// remote css
|
// remote css
|
||||||
if (tagName === 'link' && attributes.hasOwnProperty('href')) {
|
if (tagName === 'link') {
|
||||||
const stylesheet = Array.from(doc.styleSheets).find(
|
const stylesheet = Array.from(doc.styleSheets).find(s => {
|
||||||
s => s.href === attributes.href,
|
return s.href === (n as HTMLLinkElement).href;
|
||||||
);
|
});
|
||||||
const cssText = getCssRulesString(stylesheet as CSSStyleSheet);
|
const cssText = getCssRulesString(stylesheet as CSSStyleSheet);
|
||||||
if (cssText) {
|
if (cssText) {
|
||||||
attributes = {
|
attributes = {
|
||||||
|
|||||||
1
test/html/iframe-inner.html
Normal file
1
test/html/iframe-inner.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<button>inner iframe button</button>
|
||||||
12
test/html/iframe.html
Normal file
12
test/html/iframe.html
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<title>iframe</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<iframe src="/html/iframe-inner.html" width="100" height="50"></iframe>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<script src="http://localhost:3030/js/a.js"></script>
|
<script src="/js/a.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var a = 1 + 1;
|
var a = 1 + 1;
|
||||||
</script>
|
</script>
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<noscript src="http://localhost:3030/js/a.js"></noscript>
|
<noscript src="/js/a.js"></noscript>
|
||||||
<noscript></noscript>
|
<noscript></noscript>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
<title>with style sheet</title>
|
<title>with style sheet</title>
|
||||||
<link rel="stylesheet" href="http://localhost:3030/css/style.css">
|
<link rel="stylesheet" href="/css/style.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
Reference in New Issue
Block a user