Fix a multi-combinator extend edge case.

This commit is contained in:
Natalie Weizenbaum 2017-02-03 16:49:55 -08:00
parent 73be343be5
commit b32e5f96ce
2 changed files with 4 additions and 2 deletions

View File

@ -69,6 +69,8 @@
* Don't consider browser-prefixed selector pseudos to be superselectors of
differently- or non-prefixed selector pseudos with the same base name.
* Fix an `@extend` edge case involving multiple combinators in a row.
## 1.0.0-alpha.8
* Add the `content-exists()` function.

View File

@ -302,9 +302,9 @@ List<List<List<ComplexSelectorComponent>>> _mergeFinalCombinators(
// is a supersequence of the other, use that, otherwise give up.
var lcs = longestCommonSubsequence(combinators1, combinators2);
if (listEquals(lcs, combinators1)) {
result.add([new List.from(combinators2.reversed)]);
result.addFirst([new List.from(combinators2.reversed)]);
} else if (listEquals(lcs, combinators2)) {
result.add([new List.from(combinators1.reversed)]);
result.addFirst([new List.from(combinators1.reversed)]);
}
return result;
}