From a0b9ffe15d6804ca070baa4133c18e0043554588 Mon Sep 17 00:00:00 2001 From: kurkle Date: Tue, 29 Oct 2019 21:05:43 +0200 Subject: [PATCH] Use `document` when `getRootNode` is unsupported --- src/platforms/platform.dom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/platform.dom.js b/src/platforms/platform.dom.js index 03f8486be43..457cc7c90f8 100644 --- a/src/platforms/platform.dom.js +++ b/src/platforms/platform.dom.js @@ -339,7 +339,7 @@ module.exports = { // If the canvas is in a shadow DOM, then the styles must also be inserted // into the same shadow DOM. // https://github.com/chartjs/Chart.js/issues/5763 - var root = canvas.getRootNode(); + var root = canvas.getRootNode ? canvas.getRootNode() : document; var targetNode = root.host ? root : document.head; injectCSS(targetNode, stylesheet); }