mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Fix bug with 'not' selectors in specifity.js
This commit is contained in:
6
vendor/specificity.js
vendored
6
vendor/specificity.js
vendored
@@ -1,10 +1,12 @@
|
||||
// source: MooTools DOM branch -> https://raw.github.com/arian/DOM/matcher-specificity/Source/specificity.js
|
||||
// changed to be compatible with our require system
|
||||
// change line
|
||||
// for (var ii = nots.length; ii--;) s += this.specificity(nots[ii]);
|
||||
// for (var ii = nots.length; ii--;) s += nots[ii];
|
||||
|
||||
var Slick = require('slick');
|
||||
|
||||
module.exports = function(selector){
|
||||
|
||||
var parsed = Slick.parse(selector);
|
||||
var expressions = parsed.expressions;
|
||||
var specificity = -1;
|
||||
@@ -25,7 +27,7 @@ module.exports = function(selector){
|
||||
}
|
||||
}
|
||||
s = b * 1e6 + c * 1e3 + d;
|
||||
for (var ii = nots.length; ii--;) s += this.specificity(nots[ii]);
|
||||
for (var ii = nots.length; ii--;) s += nots[ii];
|
||||
if (s > specificity) specificity = s;
|
||||
}
|
||||
return specificity;
|
||||
|
||||
Reference in New Issue
Block a user