mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Beging implementing reftests
This commit is contained in:
18
tests/reftests/images/svg/base64.html
Normal file
18
tests/reftests/images/svg/base64.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Base64 svg</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<script type="text/javascript" src="../../../test.js"></script>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
Inline svg image: <br />
|
||||
<img width="200" height="200" src="data:image/svg+xml;base64,PHN2ZyB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjMwNiIgaGVpZ2h0PSIyOTYiPjxkZWZzIGlkPSJkZWZzNCIgLz48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTYyLjQ2OTk1LC00NzcuMjg2MykiIGlkPSJsYXllcjEiPjxwYXRoIGQ9Im0gMzE0LjE1NzQ1LDQ4MS42OTU1OCBjIC01OS4yMDA4OSwwLjUzNzc0IC0xMTQuODA5NzksMzYuNzIyMTkgLTEzNy4zMTI1LDk1LjM0Mzc1IC0yOS4zOTEyOSw3Ni41NjY5MyA4LjgzOTMyLDE2Mi40NTI0NiA4NS40MDYyNSwxOTEuODQzNzUgbCAzNC4wMzEyNSwtODguNjg3NSBjIC0yMC4wNjc4LC03LjcxMzU4IC0zNC4zMTI1LC0yNy4xNTMyNCAtMzQuMzEyNSwtNDkuOTM3NSAwLC0yOS41NDcyMyAyMy45NTI3NywtNTMuNSA1My41LC01My41IDI5LjU0NzIzLDAgNTMuNSwyMy45NTI3NyA1My41LDUzLjUgMCwyMi43ODQyNiAtMTQuMjQ0Nyw0Mi4yMjM5MiAtMzQuMzEyNSw0OS45Mzc1IGwgMzQuMDMxMjUsODguNjg3NSBjIDM5LjI5MDg1LC0xNS4wODIzNCA3MC4zMjM5LC00Ni4xMTU0IDg1LjQwNjI1LC04NS40MDYyNSAyOS4zOTEyOSwtNzYuNTY2OTMgLTguODM5MzIsLTE2Mi40ODM3MSAtODUuNDA2MjUsLTE5MS44NzUgLTE3Ljk0NTM3LC02Ljg4ODU5IC0zNi40MDg1MywtMTAuMDcwODcgLTU0LjUzMTI1LC05LjkwNjI1IHoiIGlkPSJwYXRoMjgzMCIgc3R5bGU9ImZpbGw6IzQwYWE1NDtmaWxsLW9wYWNpdHk6MTtzdHJva2U6IzIwNTUyYTtzdHJva2Utd2lkdGg6Ny45OTk5OTk1MjtzdHJva2UtbWl0ZXJsaW1pdDo0O3N0cm9rZS1vcGFjaXR5OjE7c3Ryb2tlLWRhc2hhcnJheTpub25lIiAvPjwvZz48L3N2Zz4=" /></div>
|
||||
</body>
|
||||
</html>
|
||||
9
tests/reftests/images/svg/base64.txt
Normal file
9
tests/reftests/images/svg/base64.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
Window: [800, 600]
|
||||
Rectangle: [0, 0, 800, 600] rgba(0,0,0,0)
|
||||
Opacity: 1
|
||||
Text: rgb(0,0,0) normal normal 400 16px Arial
|
||||
[8, 8]: Inline
|
||||
[51, 8]: svg
|
||||
[80, 8]: image:
|
||||
Clip: Path (Vector(x: 8, y: 26) > Vector(x: 208, y: 26) > Vector(x: 208, y: 226) > Vector(x: 8, y: 226))
|
||||
Draw image: Image ("/svg+xml;base64,PHN2ZyB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxucz0iaHR0cDovL3d3dy53") (source: [0, 0, 306, 296]) (destination: [0, 0, 306, 296])
|
||||
17
tests/reftests/images/svg/external.html
Normal file
17
tests/reftests/images/svg/external.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Image tests</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<script type="text/javascript" src="../../../test.js"></script>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
SVG taints image:<br /> <!-- http://fi.wikipedia.org/wiki/Tiedosto:Svg.svg -->
|
||||
<img src="../../../assets/image.svg" />
|
||||
</body>
|
||||
</html>
|
||||
9
tests/reftests/images/svg/external.txt
Normal file
9
tests/reftests/images/svg/external.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
Window: [800, 600]
|
||||
Rectangle: [0, 0, 800, 600] rgba(0,0,0,0)
|
||||
Opacity: 1
|
||||
Text: rgb(0,0,0) normal normal 400 16px Arial
|
||||
[8, 8]: SVG
|
||||
[46, 8]: taints
|
||||
[89, 8]: image:
|
||||
Clip: Path (Vector(x: 8, y: 26) > Vector(x: 666, y: 26) > Vector(x: 666, y: 363) > Vector(x: 8, y: 363))
|
||||
Draw image: Image ("/tests/assets/image.svg") (source: [0, 0, 658, 337]) (destination: [0, 0, 658, 337])
|
||||
19
tests/reftests/images/svg/inline.html
Normal file
19
tests/reftests/images/svg/inline.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Inline svg</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<script type="text/javascript" src="../../../test.js"></script>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
Inline svg image: <br />
|
||||
<img width="200" height="200" src='data:image/svg+xml,<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" width="306" height="296"><defs id="defs4" /><g transform="translate(-162.46995,-477.2863)" id="layer1"><path d="m 314.15745,481.69558 c -59.20089,0.53774 -114.80979,36.72219 -137.3125,95.34375 -29.39129,76.56693 8.83932,162.45246 85.40625,191.84375 l 34.03125,-88.6875 c -20.0678,-7.71358 -34.3125,-27.15324 -34.3125,-49.9375 0,-29.54723 23.95277,-53.5 53.5,-53.5 29.54723,0 53.5,23.95277 53.5,53.5 0,22.78426 -14.2447,42.22392 -34.3125,49.9375 l 34.03125,88.6875 c 39.29085,-15.08234 70.3239,-46.1154 85.40625,-85.40625 29.39129,-76.56693 -8.83932,-162.48371 -85.40625,-191.875 -17.94537,-6.88859 -36.40853,-10.07087 -54.53125,-9.90625 z" id="path2830" style="fill:#40aa54;fill-opacity:1;stroke:#20552a;stroke-width:7.99999952;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /></g></svg>' />
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
7
tests/reftests/images/svg/inline.txt
Normal file
7
tests/reftests/images/svg/inline.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
Window: [800, 600]
|
||||
Rectangle: [0, 0, 800, 600] rgba(0,0,0,0)
|
||||
Opacity: 1
|
||||
Text: rgb(0,0,0) normal normal 400 16px Arial
|
||||
[8, 8]: Inline
|
||||
[51, 8]: svg
|
||||
[80, 8]: image:
|
||||
30
tests/reftests/images/svg/native_only.html
Normal file
30
tests/reftests/images/svg/native_only.html
Normal file
@@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Native svg only</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<script>
|
||||
var noFabric = true;
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../test.js"></script>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<img src="../../../assets/image.svg" />
|
||||
<img width="200" height="200" src='data:image/svg+xml,<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" width="306" height="296"><defs id="defs4" /><g transform="translate(-162.46995,-477.2863)" id="layer1"><path d="m 314.15745,481.69558 c -59.20089,0.53774 -114.80979,36.72219 -137.3125,95.34375 -29.39129,76.56693 8.83932,162.45246 85.40625,191.84375 l 34.03125,-88.6875 c -20.0678,-7.71358 -34.3125,-27.15324 -34.3125,-49.9375 0,-29.54723 23.95277,-53.5 53.5,-53.5 29.54723,0 53.5,23.95277 53.5,53.5 0,22.78426 -14.2447,42.22392 -34.3125,49.9375 l 34.03125,88.6875 c 39.29085,-15.08234 70.3239,-46.1154 85.40625,-85.40625 29.39129,-76.56693 -8.83932,-162.48371 -85.40625,-191.875 -17.94537,-6.88859 -36.40853,-10.07087 -54.53125,-9.90625 z" id="path2830" style="fill:#40aa54;fill-opacity:1;stroke:#20552a;stroke-width:7.99999952;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /></g></svg>' />
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="306" height="296" id="svg2">
|
||||
<defs id="defs4"/>
|
||||
<g transform="translate(-162.46995,-477.2863)" id="layer1">
|
||||
<path d="m 314.15745,481.69558 c -59.20089,0.53774 -114.80979,36.72219 -137.3125,95.34375 -29.39129,76.56693 8.83932,162.45246 85.40625,191.84375 l 34.03125,-88.6875 c -20.0678,-7.71358 -34.3125,-27.15324 -34.3125,-49.9375 0,-29.54723 23.95277,-53.5 53.5,-53.5 29.54723,0 53.5,23.95277 53.5,53.5 0,22.78426 -14.2447,42.22392 -34.3125,49.9375 l 34.03125,88.6875 c 39.29085,-15.08234 70.3239,-46.1154 85.40625,-85.40625 29.39129,-76.56693 -8.83932,-162.48371 -85.40625,-191.875 -17.94537,-6.88859 -36.40853,-10.07087 -54.53125,-9.90625 z"
|
||||
id="path2830"
|
||||
style="fill:#40aa54;fill-opacity:1;stroke:#20552a;stroke-width:7.99999952;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"/>
|
||||
</g>
|
||||
</svg>
|
||||
<img width="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k6MTtzdHJva2U6IzIwNTUyYTtzdHJva2Utd2lkdGg6Ny45OTk5OTk1MjtzdHJva2UtbWl0ZXJsaW1pdDo0O3N0cm9rZS1vcGFjaXR5OjE7c3Ryb2tlLWRhc2hhcnJheTpub25lIiAvPjwvZz48L3N2Zz4=" /></div>
|
||||
</body>
|
||||
</html>
|
||||
7
tests/reftests/images/svg/native_only.txt
Normal file
7
tests/reftests/images/svg/native_only.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
Window: [800, 656]
|
||||
Rectangle: [0, 0, 800, 656] rgba(0,0,0,0)
|
||||
Opacity: 1
|
||||
Clip: Path (Vector(x: 8, y: 8) > Vector(x: 666, y: 8) > Vector(x: 666, y: 345) > Vector(x: 8, y: 345))
|
||||
Draw image: Image ("/tests/assets/image.svg") (source: [0, 0, 658, 337]) (destination: [0, 0, 658, 337])
|
||||
Clip: Path (Vector(x: 523, y: 445) > Vector(x: 723, y: 445) > Vector(x: 723, y: 645) > Vector(x: 523, y: 645))
|
||||
Draw image: Image ("/svg+xml;base64,PHN2ZyB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxucz0iaHR0cDovL3d3dy53") (source: [0, 0, 306, 296]) (destination: [0, 0, 306, 296])
|
||||
25
tests/reftests/images/svg/node.html
Normal file
25
tests/reftests/images/svg/node.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>SVG node</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<script type="text/javascript" src="../../../test.js"></script>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body><div>
|
||||
SVG node image: <br/>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="306" height="296" id="svg2">
|
||||
<defs id="defs4"/>
|
||||
<g transform="translate(-162.46995,-477.2863)" id="layer1">
|
||||
<path d="m 314.15745,481.69558 c -59.20089,0.53774 -114.80979,36.72219 -137.3125,95.34375 -29.39129,76.56693 8.83932,162.45246 85.40625,191.84375 l 34.03125,-88.6875 c -20.0678,-7.71358 -34.3125,-27.15324 -34.3125,-49.9375 0,-29.54723 23.95277,-53.5 53.5,-53.5 29.54723,0 53.5,23.95277 53.5,53.5 0,22.78426 -14.2447,42.22392 -34.3125,49.9375 l 34.03125,88.6875 c 39.29085,-15.08234 70.3239,-46.1154 85.40625,-85.40625 29.39129,-76.56693 -8.83932,-162.48371 -85.40625,-191.875 -17.94537,-6.88859 -36.40853,-10.07087 -54.53125,-9.90625 z"
|
||||
id="path2830"
|
||||
style="fill:#40aa54;fill-opacity:1;stroke:#20552a;stroke-width:7.99999952;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"/>
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
7
tests/reftests/images/svg/node.txt
Normal file
7
tests/reftests/images/svg/node.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
Window: [800, 600]
|
||||
Rectangle: [0, 0, 800, 600] rgba(0,0,0,0)
|
||||
Opacity: 1
|
||||
Text: rgb(0,0,0) normal normal 400 16px Arial
|
||||
[8, 8]: SVG
|
||||
[46, 8]: node
|
||||
[86, 8]: image:
|
||||
Reference in New Issue
Block a user