jysBlack2
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

35 lines
1.0 KiB

import env from '../core/env';
var urn = 'urn:schemas-microsoft-com:vml';
var win = typeof window === 'undefined' ? null : window;
var vmlInited = false;
export var doc = win && win.document;
export function createNode(tagName) {
return doCreateNode(tagName);
}
var doCreateNode;
if (doc && !env.canvasSupported) {
try {
!doc.namespaces.zrvml && doc.namespaces.add('zrvml', urn);
doCreateNode = function (tagName) {
return doc.createElement('<zrvml:' + tagName + ' class="zrvml">');
};
}
catch (e) {
doCreateNode = function (tagName) {
return doc.createElement('<' + tagName + ' xmlns="' + urn + '" class="zrvml">');
};
}
}
export function initVML() {
if (vmlInited || !doc) {
return;
}
vmlInited = true;
var styleSheets = doc.styleSheets;
if (styleSheets.length < 31) {
doc.createStyleSheet().addRule('.zrvml', 'behavior:url(#default#VML)');
}
else {
styleSheets[0].addRule('.zrvml', 'behavior:url(#default#VML)');
}
}