]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Use the element's window in getComputedstyle (#10608)
authorJon Dufresne <jon.dufresne@gmail.com>
Mon, 22 Aug 2022 15:29:36 +0000 (08:29 -0700)
committerGitHub <noreply@github.com>
Mon, 22 Aug 2022 15:29:36 +0000 (17:29 +0200)
src/helpers/helpers.dom.js

index 60ffb77d1ea1e57816b40a563fdc86aaac60ae0b..215e8f2f31838fa084dcfcf77357c4452d8895a1 100644 (file)
@@ -46,7 +46,7 @@ function parseMaxStyle(styleValue, node, parentProperty) {
   return valueInPixels;
 }
 
-const getComputedStyle = (element) => window.getComputedStyle(element, null);
+const getComputedStyle = (element) => element.ownerDocument.defaultView.getComputedStyle(element, null);
 
 export function getStyle(el, property) {
   return getComputedStyle(el).getPropertyValue(property);