Sha256: 3752d958263860875e8879ca20eeae61e1ed73cc41c2e5f6dab4d0133e915f5c

Contents?: true

Size: 1.8 KB

Versions: 18

Compression:

Stored size: 1.8 KB

Contents

(function() {
  var OldSelector;

  OldSelector = (function() {
    function OldSelector(selector, prefix1) {
      var i, len, prefix, ref;
      this.prefix = prefix1;
      this.prefixed = selector.prefixed(this.prefix);
      this.regexp = selector.regexp(this.prefix);
      this.prefixeds = [];
      ref = selector.possible();
      for (i = 0, len = ref.length; i < len; i++) {
        prefix = ref[i];
        this.prefixeds.push([selector.prefixed(prefix), selector.regexp(prefix)]);
      }
      this.unprefixed = selector.name;
      this.nameRegexp = selector.regexp();
    }

    OldSelector.prototype.isHack = function(rule) {
      var before, i, index, len, ref, ref1, regexp, rules, some, string;
      index = rule.parent.index(rule) + 1;
      rules = rule.parent.nodes;
      while (index < rules.length) {
        before = rules[index].selector;
        if (!before) {
          return true;
        }
        if (before.indexOf(this.unprefixed) !== -1 && before.match(this.nameRegexp)) {
          return false;
        }
        some = false;
        ref = this.prefixeds;
        for (i = 0, len = ref.length; i < len; i++) {
          ref1 = ref[i], string = ref1[0], regexp = ref1[1];
          if (before.indexOf(string) !== -1 && before.match(regexp)) {
            some = true;
            break;
          }
        }
        if (!some) {
          return true;
        }
        index += 1;
      }
      return true;
    };

    OldSelector.prototype.check = function(rule) {
      if (rule.selector.indexOf(this.prefixed) === -1) {
        return false;
      }
      if (!rule.selector.match(this.regexp)) {
        return false;
      }
      if (this.isHack(rule)) {
        return false;
      }
      return true;
    };

    return OldSelector;

  })();

  module.exports = OldSelector;

}).call(this);

Version data entries

18 entries across 18 versions & 8 rubygems

Version Path
ilog-0.4.1 node_modules/autoprefixer/lib/old-selector.js
ilog-0.4.0 node_modules/autoprefixer/lib/old-selector.js
ilog-0.3.3 node_modules/autoprefixer/lib/old-selector.js
optimacms-0.4.3 spec/dummy/node_modules/autoprefixer/lib/old-selector.js
optimacms-0.4.2 spec/dummy/node_modules/autoprefixer/lib/old-selector.js
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/autoprefixer/lib/old-selector.js
lux_assets-0.2.11 ./node_modules/autoprefixer/lib/old-selector.js
lux_assets-0.2.9 ./node_modules/autoprefixer/lib/old-selector.js
lux_assets-0.2.4 ./node_modules/autoprefixer/lib/old-selector.js
lux_assets-0.2.2 ./node_modules/autoprefixer/lib/old-selector.js
lux_assets-0.2.1 ./node_modules/autoprefixer/lib/old-selector.js
locomotivecms-3.4.0 app/javascript/node_modules/autoprefixer/lib/old-selector.js
cortex-0.1.3 spec/dummy/node_modules/cssnano/node_modules/autoprefixer/lib/old-selector.js
lanes-0.8.0 node_modules/autoprefixer/lib/old-selector.js
blackboard-3.1.9 lib/site_template/node_modules/autoprefixer/lib/old-selector.js
gulp_assets-1.0.0.pre.5 template/node_modules/autoprefixer/lib/old-selector.js
gulp_assets-1.0.0.pre.4 template/node_modules/autoprefixer/lib/old-selector.js
gulp_assets-1.0.0.pre.3 template/node_modules/autoprefixer/lib/old-selector.js