From 37b4275089ee1be961a76bcf79069f4cd7ffc7ad Mon Sep 17 00:00:00 2001 From: "Alexander J. Vincent" Date: Sat, 2 Mar 2019 05:21:16 -0800 Subject: [PATCH] #5530, Support Fabric in XML documents. (#5531) --- HEADER.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/HEADER.js b/HEADER.js index 2c9ab4d1417..f9a157f47b2 100644 --- a/HEADER.js +++ b/HEADER.js @@ -10,7 +10,10 @@ else if (typeof define === 'function' && define.amd) { } /* _AMD_END_ */ if (typeof document !== 'undefined' && typeof window !== 'undefined') { - fabric.document = document; + if (document instanceof HTMLDocument) + fabric.document = document; + else + fabric.document = document.implementation.createHTMLDocument(""); fabric.window = window; } else {