This is a function used to detect VML support in browsers. It's part of an html component file for giving border-radius and drop-shadow functionality to older versions of IE. I would like this explained to me, the step-by-step logic of it:
function supportsVml() {
if (typeof supportsVml.supported == "undefined"){
var a = document.body.appendChild(document.createElement('div'));
a.innerHTML = '<v:shape id="vml_flag1" adj="1" />';
var b = a.firstChild;
b.style.behavior = "url(#default#VML)";
supportsVml.supported = b ? typeof b.adj == "object": true;
a.parentNode.removeChild(a);
}
return supportsVml.supported
}
Where I am confused:
- What is supporstVml.supported? Is this a variable, I don't see it declared anywhere else int he file...
- what is the url(#default#VML) behavior?
- supportsVml.supported is reassigned a new value based on the conditional, but I have no idea what or why...
Thanks!