From 4eb425f889ccde6a155c86ea605f17ef22db1bda Mon Sep 17 00:00:00 2001 From: Craig Date: Mon, 9 Sep 2013 13:09:21 -0400 Subject: [PATCH] feature-detect for VML Detect if VML (Vector Markup Language) is supported. --- feature-detects/vml.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 feature-detects/vml.js diff --git a/feature-detects/vml.js b/feature-detects/vml.js new file mode 100644 index 0000000000..d46dd8b021 --- /dev/null +++ b/feature-detects/vml.js @@ -0,0 +1,24 @@ +/*! +{ + "name": "VML", + "property": "vml", + "caniuse": "vml", + "tags": ["vml"], + "authors": ["Craig Andrews (@candrews)"] +} +!*/ +/* DOC + +Detects support for VML. + +*/ +define(['Modernizr', 'createElement'], function( Modernizr, createElement ) { + Modernizr.addTest('vml', function() { + var containerDiv = createElement('div'); + containerDiv.innerHTML = ''; + var shape = containerDiv.firstChild; + shape.style.behavior = "url(#default#VML)"; + var supportsVml = shape ? typeof shape.adj == "object": true; + return supportsVml; + }); +});