From 3ecf793eb2974e782b0af492d8ae3f76ee7c35b3 Mon Sep 17 00:00:00 2001
From: MoyuScript <i@moyu.moe>
Date: Sun, 26 Jan 2014 20:43:50 +0200
Subject: [PATCH] Fix IE issues

---
 src/imagecontainer.js | 3 +++
 src/nodecontainer.js  | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/imagecontainer.js b/src/imagecontainer.js
index d0a1fca..07bb26a 100644
--- a/src/imagecontainer.js
+++ b/src/imagecontainer.js
@@ -9,5 +9,8 @@ function ImageContainer(src, cors) {
             image.crossOrigin = "anonymous";
         }
         image.src = src;
+        if (image.complete === true) {
+            resolve(image);
+        }
     });
 }
diff --git a/src/nodecontainer.js b/src/nodecontainer.js
index a4fed48..d428048 100644
--- a/src/nodecontainer.js
+++ b/src/nodecontainer.js
@@ -28,12 +28,12 @@ NodeContainer.prototype.css = function(attribute) {
 
 NodeContainer.prototype.cssInt = function(attribute) {
     var value = parseInt(this.css(attribute), 10);
-    return (Number.isNaN(value)) ? 0 : value; // borders in old IE are throwing 'medium' for demo.html
+    return (isNaN(value)) ? 0 : value; // borders in old IE are throwing 'medium' for demo.html
 };
 
 NodeContainer.prototype.cssFloat = function(attribute) {
     var value = parseFloat(this.css(attribute));
-    return (Number.isNaN(value)) ? 0 : value;
+    return (isNaN(value)) ? 0 : value;
 };
 
 NodeContainer.prototype.fontWeight = function() {