Fix bug with css guards. Fixes #1750. Fixes #1613. Fixes #1813

This commit is contained in:
Luke Page
2014-02-01 19:13:56 +00:00
parent eba67deddf
commit eb19ae4cfa
5 changed files with 21 additions and 6 deletions

View File

@@ -59,8 +59,8 @@ tree.mixin.Call.prototype = {
}
if (conditionResult[0] || conditionResult[1]) {
if (conditionResult[0] != conditionResult[1]) {
candidate.group = conditionResult[1]
? defTrue : defFalse;
candidate.group = conditionResult[1] ?
defTrue : defFalse;
}
candidates.push(candidate);

View File

@@ -144,6 +144,9 @@ tree.Ruleset.prototype = {
},
matchCondition: function (args, env) {
var lastSelector = this.selectors[this.selectors.length-1];
if (!lastSelector.evaldCondition) {
return false;
}
if (lastSelector.condition &&
!lastSelector.condition.eval(
new(tree.evalEnv)(env,

View File

@@ -25,7 +25,7 @@ tree.Selector.prototype = {
},
createDerived: function(elements, extendList, evaldCondition) {
evaldCondition = (evaldCondition != null) ? evaldCondition : this.evaldCondition;
var newSelector = new(tree.Selector)(elements, extendList || this.extendList, this.condition, this.index, this.currentFileInfo, this.isReferenced);
var newSelector = new(tree.Selector)(elements, extendList || this.extendList, null, this.index, this.currentFileInfo, this.isReferenced);
newSelector.evaldCondition = evaldCondition;
return newSelector;
},