Previously, this was attached to the traversable navigable. Using a singleton instead allows us to use the context for detached documents.
11 lines
241 B
HTML
11 lines
241 B
HTML
<!DOCTYPE html>
|
|
<body>
|
|
<script>
|
|
var doc = document.implementation.createHTMLDocument('');
|
|
var canvas = doc.createElement('canvas');
|
|
canvas.width = 100;
|
|
canvas.height = 100;
|
|
doc.body.appendChild(canvas);
|
|
canvas.toDataURL();
|
|
</script>
|
|
</body>
|