Skip to content

Commit a3e3ca1

Browse files
committed
Merge pull request processing-js#35 from guilhermef/master
unit and parser checks pass, ref tests result identical to master - this looks fine to me.
2 parents 2f20180 + c945972 commit a3e3ca1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

processing.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
var isDOMPresent = ("document" in this) && !("fake" in this.document);
2929

3030
// document.head polyfill for the benefit of Firefox 3.6
31-
document.head = document.head || document.getElementsByTagName('head')[0];
31+
if (!document.head) {
32+
document.getElementsByTagName('head')[0];
33+
}
3234

3335
// Typed Arrays: fallback to WebGL arrays or Native JS arrays if unavailable
3436
function setupTypedArray(name, fallback) {
@@ -2072,7 +2074,7 @@
20722074
curElement = typeof aCanvas === "string" ? document.getElementById(aCanvas) : aCanvas;
20732075
}
20742076

2075-
if (!(curElement instanceof HTMLCanvasElement)) {
2077+
if (!('getContext' in curElement)) {
20762078
throw("called Processing constructor without passing canvas element reference or id.");
20772079
}
20782080

0 commit comments

Comments
 (0)