From c0fc6f3ccac3475df01f0aae8cca46dd08b724aa Mon Sep 17 00:00:00 2001 From: junghwan-park Date: Thu, 9 May 2019 11:28:06 +0900 Subject: [PATCH 1/2] fix: Check HTMLDocument constructor exists first for IE10 (fixes: fabricjs/fabric.js#5677) --- HEADER.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/HEADER.js b/HEADER.js index 775c6a1e6b9..4c2b3db2910 100644 --- a/HEADER.js +++ b/HEADER.js @@ -10,7 +10,9 @@ else if (typeof define === 'function' && define.amd) { } /* _AMD_END_ */ if (typeof document !== 'undefined' && typeof window !== 'undefined') { - if (document instanceof HTMLDocument) { + var DocumentConstructor = typeof HTMLDocument !== 'undefined' ? HTMLDocument : Document; + + if (document instanceof DocumentConstructor) { fabric.document = document; } else { From 71e400e0d07fc7e369b69350706ed9b299803993 Mon Sep 17 00:00:00 2001 From: junghwan-park Date: Wed, 29 May 2019 11:53:46 +0900 Subject: [PATCH 2/2] fix: Remove 'var' definition & use ternary operation --- HEADER.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/HEADER.js b/HEADER.js index 4c2b3db2910..0e1cb443edf 100644 --- a/HEADER.js +++ b/HEADER.js @@ -10,9 +10,7 @@ else if (typeof define === 'function' && define.amd) { } /* _AMD_END_ */ if (typeof document !== 'undefined' && typeof window !== 'undefined') { - var DocumentConstructor = typeof HTMLDocument !== 'undefined' ? HTMLDocument : Document; - - if (document instanceof DocumentConstructor) { + if (document instanceof (typeof HTMLDocument !== 'undefined' ? HTMLDocument : Document)) { fabric.document = document; } else {