diff --git a/apply.js b/apply.js index d0302891..73a4e3a9 100644 --- a/apply.js +++ b/apply.js @@ -246,6 +246,8 @@ function applySections(styleId, sections) { if (document.documentElement instanceof SVGSVGElement) { // SVG document, make an SVG style element. el = document.createElementNS('http://www.w3.org/2000/svg', 'style'); + } else if (document instanceof XMLDocument) { + el = document.createElementNS('http://www.w3.org/1999/xhtml', 'style'); } else { // This will make an HTML style element. If there's SVG embedded in an HTML document, this works on the SVG too. el = document.createElement('style');