move custom_rhino out of plotkit
[dygraphs.git] / plotkit_v091 / tests / testsvg.js
CommitLineData
6a1aa64f
DV
1function testsvg() {
2 var isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);
3 var ieVersion = navigator.appVersion.match(/MSIE (\d\.\d)/);
4 var safariVersion = navigator.userAgent.match(/AppleWebKit\/(\d+)/);
5 var operaVersion = navigator.userAgent.match(/Opera\/(\d*\.\d*)/);
6 var mozillaVersion = navigator.userAgent.match(/rv:(\d*\.\d*).*Gecko/);
7
8
9 if (ieVersion && (ieVersion[1] >= 6) && !isOpera) {
10 var dummysvg = document.createElement('<svg:svg width="1" height="1" baseProfile="full" version="1.1" id="dummy">');
11 try {
12 dummysvg.getSVGDocument();
13 dummysvg = null;
14 return true;
15 }
16 catch (e) {
17 return false;
18 }
19 }
20
21 if (safariVersion && (safariVersion[1] > 419))
22 return true;
23
24 if (operaVersion && (operaVersion[1] > 8.9))
25 return true
26
27 if (mozillaVersion && (mozillaVersion > 1.7))
28 return true;
29
30 return false;
31}