mirror of
https://github.com/swc-project/swc.git
synced 2024-12-22 13:11:31 +03:00
218 lines
6.2 KiB
HTML
218 lines
6.2 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<title>Party Coffee Cake</title>
|
|
<!--[if lte IE 8]><script>
|
|
|
|
|
|
alert("ie8!" + "test")
|
|
|
|
|
|
</script><![endif]-->
|
|
<script type="application/ld+json">
|
|
{
|
|
"@context": "https://schema.org/",
|
|
"@type": "Recipe",
|
|
"name": "Party Coffee Cake",
|
|
"author": {
|
|
"@type": "Person",
|
|
"name": "Mary Stone"
|
|
},
|
|
"datePublished": "2018-03-10",
|
|
"description": "This coffee cake is awesome and perfect for parties.",
|
|
"prepTime": "PT20M"
|
|
}
|
|
</script>
|
|
<script type="application/ld+json" crossorigin="anonymous">
|
|
{
|
|
"@context": "https://schema.org/",
|
|
"@type": "Recipe",
|
|
"name": "Party Coffee Cake",
|
|
"author": {
|
|
"@type": "Person",
|
|
"name": "Mary Stone"
|
|
},
|
|
"datePublished": "2018-03-10",
|
|
"description": "This coffee cake is awesome and perfect for parties.",
|
|
"prepTime": "PT20M"
|
|
}
|
|
</script>
|
|
<script type="application/ld+json" crossorigin="anonymous">
|
|
{
|
|
broken
|
|
</script>
|
|
<script type="unknown">
|
|
{
|
|
"@context": "https://schema.org/",
|
|
"@type": "Recipe",
|
|
"name": "Party Coffee Cake",
|
|
"author": {
|
|
"@type": "Person",
|
|
"name": "Mary Stone"
|
|
},
|
|
"datePublished": "2018-03-10",
|
|
"description": "This coffee cake is awesome and perfect for parties.",
|
|
"prepTime": "PT20M"
|
|
}
|
|
</script>
|
|
<script type="speculationrules">
|
|
{
|
|
"prerender": [
|
|
{
|
|
"source": "list",
|
|
"urls": ["/page/2"],
|
|
"score": 0.5
|
|
},
|
|
{
|
|
"source": "document",
|
|
"if_href_matches": ["https://*.wikipedia.org/**"],
|
|
"if_not_selector_matches": [".restricted-section *"],
|
|
"score": 0.1
|
|
}
|
|
]
|
|
}
|
|
</script>
|
|
<script type="importmap">
|
|
{
|
|
"imports": {
|
|
"moment": "/node_modules/moment/src/moment.js",
|
|
"lodash": "/node_modules/lodash-es/lodash.js"
|
|
}
|
|
}
|
|
</script>
|
|
<script type="application/json" src="data.json"></script>
|
|
<script type="application/json" src="data.json">
|
|
|
|
|
|
</script>
|
|
<script id="data" type="application/json">
|
|
{
|
|
"foo" : "bar"
|
|
}
|
|
</script>
|
|
<script>
|
|
broken broken
|
|
</script>
|
|
<script type="application/ecmascript">
|
|
var a = 1 + 2;
|
|
</script>
|
|
<script type="application/ecmascript">
|
|
var a = 3 + 6;
|
|
</script>
|
|
<script type="module">
|
|
import foo from "foo.js";
|
|
|
|
const test = 140 * 420;
|
|
const test1 = "test" + "test";
|
|
</script>
|
|
<script>
|
|
let d = new Date();
|
|
alert("Today's date is " + d);
|
|
</script>
|
|
<script src="javascript.js">
|
|
|
|
|
|
|
|
</script>
|
|
|
|
<script src="javascript.js">
|
|
|
|
var q = "WRONG" ;
|
|
|
|
</script>
|
|
<script>
|
|
<!-- test -->
|
|
const foo = "test" + "test";
|
|
</script>
|
|
<script>alert('<!--')</script>
|
|
<script>alert('<!-- foo -->')</script>
|
|
<script>alert('-->')</script>
|
|
<script><!-- alert(1) --></script>
|
|
<script type="text/javascript">
|
|
// <![CDATA[
|
|
alert("test" + "test");
|
|
// ]]>
|
|
</script>
|
|
<script>function test(){ var foo = 1; var bar = 2; alert(foo + " " + bar); }</script>
|
|
<script>"test" + "test"</script>
|
|
</head>
|
|
<body>
|
|
<h2>Party coffee cake recipe</h2>
|
|
<p>
|
|
<i>by Mary Stone, 2018-03-10</i>
|
|
</p>
|
|
<p>
|
|
This coffee cake is awesome and perfect for parties.
|
|
</p>
|
|
<p>
|
|
Preparation time: 20 minutes
|
|
</p>
|
|
<svg>
|
|
<script>
|
|
alert("test")
|
|
</script>
|
|
<script type="application/javascript;version=1.8">alert(1)</script>
|
|
</svg>
|
|
<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
|
|
<script>
|
|
// <![CDATA[
|
|
window.addEventListener('DOMContentLoaded', () => {
|
|
function getColor () {
|
|
const R = Math.round(Math.random() * 255).toString(16).padStart(2,'0')
|
|
const G = Math.round(Math.random() * 255).toString(16).padStart(2,'0')
|
|
const B = Math.round(Math.random() * 255).toString(16).padStart(2,'0')
|
|
return `#${R}${G}${B}`
|
|
}
|
|
|
|
document.querySelector('circle').addEventListener('click', (e) => {
|
|
e.target.style.fill = getColor()
|
|
})
|
|
})
|
|
// ]]>
|
|
</script>
|
|
|
|
<circle cx="5" cy="5" r="4" />
|
|
</svg>
|
|
<math>
|
|
<script>
|
|
// This is not script
|
|
|
|
|
|
alert('test')
|
|
</script>
|
|
</math>
|
|
<script blocking="render a">console.log("block");</script>
|
|
<script>(function(test){ var test = "test" + Math.random() + test; var foo = 1; var bar = 2 + Math.random(); alert(foo + " " + bar); console.log(Math.random()) })("test")</script>
|
|
<script>window.jQuery || document.write('<script src="jquery.js"><\/script>')</script>
|
|
<div>test</div>
|
|
<script></script>
|
|
<div>topLevel - script</div>
|
|
<script>
|
|
/* Should keep top level stuff */
|
|
var topLevel = function test() {
|
|
let foo = "bar";
|
|
|
|
if (foo) {
|
|
foo += "baz";
|
|
}
|
|
|
|
console.log(foo);
|
|
};
|
|
</script>
|
|
<div>topLevel - module</div>
|
|
<script type="module">
|
|
/* Should keep top level stuff */
|
|
var topLevel = function test() {
|
|
let foo = "bar";
|
|
|
|
if (foo) {
|
|
foo += "baz";
|
|
}
|
|
|
|
console.log(foo);
|
|
};
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|