Apply styles to XML documents

This commit is contained in:
tophf 2017-04-06 16:02:38 +03:00
parent c061268aeb
commit 4d143a03dc

View File

@ -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');