Skip to content

Commit 8986055

Browse files
committed
Fix whitespace handling in view transition pseudos
Closes #1087
1 parent 32f1f52 commit 8986055

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6972,6 +6972,10 @@ mod tests {
69726972
&format!(":root::{}(.foo.bar) {{position: fixed}}", name),
69736973
&format!(":root::{}(.foo.bar){{position:fixed}}", name),
69746974
);
6975+
minify_test(
6976+
&format!(":root::{}( .foo.bar ) {{position: fixed}}", name),
6977+
&format!(":root::{}(.foo.bar){{position:fixed}}", name),
6978+
);
69756979
error_test(
69766980
&format!(":root::{}(foo):first-child {{position: fixed}}", name),
69776981
ParserError::SelectorError(SelectorError::InvalidPseudoClassAfterPseudoElement),

src/selector.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,10 +1090,14 @@ impl<'i> Parse<'i> for ViewTransitionPartSelector<'i> {
10901090
_ => return Err(input.new_custom_error(ParserError::SelectorError(SelectorError::InvalidState))),
10911091
}
10921092
} else {
1093-
return Err(input.new_custom_error(ParserError::SelectorError(SelectorError::InvalidState)));
1093+
break;
10941094
}
10951095
}
10961096

1097+
if !input.is_exhausted() || (name.is_none() && classes.is_empty()) {
1098+
return Err(input.new_custom_error(ParserError::SelectorError(SelectorError::InvalidState)));
1099+
}
1100+
10971101
Ok(ViewTransitionPartSelector { name, classes })
10981102
}
10991103
}

0 commit comments

Comments
 (0)