mirror of
https://github.com/less/less.js.git
synced 2026-01-23 06:07:56 -05:00
a few minor selector match fixes...
This commit is contained in:
@@ -170,9 +170,9 @@ tree.Ruleset.prototype = {
|
||||
if (rule !== self) {
|
||||
for (var j = 0; j < rule.selectors.length; j++) {
|
||||
if (match = selector.match(rule.selectors[j])) {
|
||||
if (selector.elements.length > rule.selectors[j].elements.length) {
|
||||
if (selector.elements.length > match) {
|
||||
Array.prototype.push.apply(rules, rule.find(
|
||||
new(tree.Selector)(selector.elements.slice(rule.selectors[j].elements.length)), self));
|
||||
new(tree.Selector)(selector.elements.slice(match)), self));
|
||||
} else {
|
||||
rules.push(rule);
|
||||
}
|
||||
|
||||
@@ -35,15 +35,15 @@ tree.Selector.prototype = {
|
||||
max = Math.min(len, olen);
|
||||
|
||||
if (olen === 0 || len < olen) {
|
||||
return false;
|
||||
return 0;
|
||||
} else {
|
||||
for (i = 0; i < max; i++) {
|
||||
if (elements[i].value !== oelements[i].value) {
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return max; // return number of matched selectors
|
||||
},
|
||||
eval: function (env) {
|
||||
var evaldCondition = this.condition && this.condition.eval(env);
|
||||
|
||||
Reference in New Issue
Block a user