js实现完整的css3选择器.
等同”selectorAPI”, 基于状态机,每个css指令调用其对应的特定函数 if (!String.prototype.trim) String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ”); }; if (!Array.prototype.indexOf) Array.prototype.indexOf = function(searchElement /*, fromIndex */) { var n, k, t = Object(this), len = t.length >>> 0; if (len === 0) return -1; n = 0; if (arguments.length > 1) { n = Number(arguments[1]); if (n != n) { n […]