2011-11-07 13:45:42 -08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<!-- This test checks to be sure we can render SVG-as-an-image
|
2012-01-12 02:36:03 -08:00
|
|
|
from a MozBlobBuilder-generated 'blob' URI. -->
|
2011-11-07 13:45:42 -08:00
|
|
|
<html class="reftest-wait">
|
|
|
|
<head>
|
|
|
|
<script>
|
|
|
|
function go() {
|
2012-01-12 02:36:03 -08:00
|
|
|
// Generate a blob URL encoding of an SVG document
|
2011-11-07 13:45:42 -08:00
|
|
|
var filedataURL = generateMozFiledataURL();
|
|
|
|
|
|
|
|
// Tell our img element to render the URL
|
|
|
|
var img = document.getElementsByTagName("img")[0]
|
|
|
|
img.src = filedataURL;
|
|
|
|
|
|
|
|
// Once our img loads, take reftest snapshot.
|
|
|
|
img.addEventListener("load", function() {
|
|
|
|
document.documentElement.removeAttribute("class");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2012-01-12 02:36:03 -08:00
|
|
|
// Helper function -- returns a blob URL representing a
|
2011-11-07 13:45:42 -08:00
|
|
|
// 100x100 fully-lime SVG document.
|
|
|
|
function generateMozFiledataURL() {
|
|
|
|
var blobBuilder = new self.MozBlobBuilder;
|
|
|
|
var svg =
|
|
|
|
'<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">' +
|
|
|
|
'<rect height="100%" width="100%" fill="lime"/>' +
|
|
|
|
'</svg>';
|
|
|
|
blobBuilder.append(svg);
|
|
|
|
return self.URL.createObjectURL(blobBuilder.getBlob("image/svg+xml"));
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body onload="go()">
|
|
|
|
<img src="">
|
|
|
|
</body>
|
|
|
|
</html>
|