Apply styles to XML documents
This commit is contained in:
parent
c061268aeb
commit
4d143a03dc
2
apply.js
2
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');
|
||||
|
|
Loading…
Reference in New Issue
Block a user