resolve panic when extending certain psuedo selectors containing combinators without rhs selector
This commit is contained in:
parent
5c8e88d16b
commit
b2e7270681
@ -186,7 +186,13 @@ fn weave_parents(
|
|||||||
for group in lcs {
|
for group in lcs {
|
||||||
choices.push(
|
choices.push(
|
||||||
chunks(&mut groups_one, &mut groups_two, |sequence| {
|
chunks(&mut groups_one, &mut groups_two, |sequence| {
|
||||||
complex_is_parent_superselector(sequence.get(0).unwrap().clone(), group.clone())
|
complex_is_parent_superselector(
|
||||||
|
match sequence.get(0) {
|
||||||
|
Some(v) => v.clone(),
|
||||||
|
None => return true,
|
||||||
|
},
|
||||||
|
group.clone(),
|
||||||
|
)
|
||||||
})
|
})
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|chunk| chunk.into_iter().flatten().collect())
|
.map(|chunk| chunk.into_iter().flatten().collect())
|
||||||
|
@ -1874,6 +1874,14 @@ test!(
|
|||||||
}",
|
}",
|
||||||
"foo, a:current(foo),\n:current(foo) {\n color: black;\n}\n"
|
"foo, a:current(foo),\n:current(foo) {\n color: black;\n}\n"
|
||||||
);
|
);
|
||||||
|
test!(
|
||||||
|
extend_pseudo_selector_class_containing_combinator_without_rhs_selector,
|
||||||
|
":has(a >) b {
|
||||||
|
@extend b;
|
||||||
|
color: red;
|
||||||
|
}",
|
||||||
|
":has(a >) b, :has(a >) :has(a >) :has(a >) b, :has(a >) :has(a >) :has(a >) b {\n color: red;\n}\n"
|
||||||
|
);
|
||||||
|
|
||||||
// todo: extend_loop (massive test)
|
// todo: extend_loop (massive test)
|
||||||
// todo: extend tests in folders
|
// todo: extend tests in folders
|
||||||
|
Loading…
x
Reference in New Issue
Block a user