1 function constExpression(x) {
5 function simplifyCSSExpression() {
8 ss = document.styleSheets;
11 for (var i = 0; i < sl; i++) {
12 simplifyCSSBlock(ss[i]);
16 //alert("Got an error while processing css. The page should still work but might be a bit slower");
21 function simplifyCSSBlock(ss) {
24 for (var i = 0; i < ss.imports.length; i++)
25 simplifyCSSBlock(ss.imports[i]);
27 if (ss.cssText.indexOf("expression(constExpression(") == -1)
32 for (var j = 0; j < rl; j++)
33 simplifyCSSRule(rs[j]);
37 function simplifyCSSRule(r) {
38 var str = r.style.cssText;
43 str2 = simplifyCSSRuleHelper(lastStr);
44 } while (str2 != lastStr)
47 r.style.cssText = str2;
50 function simplifyCSSRuleHelper(str) {
52 i = str.indexOf("expression(constExpression(");
53 if (i == -1) return str;
54 i2 = str.indexOf("))", i);
55 var hd = str.substring(0, i);
56 var tl = str.substring(i2 + 2);
57 var exp = str.substring(i + 27, i2);
62 if (/msie/i.test(navigator.userAgent) && window.attachEvent != null) {
63 window.attachEvent("onload", function () {
64 simplifyCSSExpression();