Properly handle extended pseudos.

There was a logic bug when we created a new selector that injected
extended pseudo-selectors into a previous selector. We would overwrite
the last selector after the original pseudo rather than overwriting the
pseudo itself.
This commit is contained in:
Natalie Weizenbaum 2016-12-29 12:28:20 -08:00
parent f17edb83d8
commit beb1a0bd09

View File

@ -271,8 +271,8 @@ class Extender {
compound.components.length - 1 + extendedPseudo.length); compound.components.length - 1 + extendedPseudo.length);
simples.setRange(0, i, compound.components); simples.setRange(0, i, compound.components);
simples.setRange(i, i + extendedPseudo.length, extendedPseudo); simples.setRange(i, i + extendedPseudo.length, extendedPseudo);
simples.setRange( simples.setRange(i + extendedPseudo.length, simples.length,
i + extendedPseudo.length, simples.length, compound.components, i); compound.components, i + 1);
original = new CompoundSelector(simples); original = new CompoundSelector(simples);
} }