@@ -8691,11 +8691,7 @@ mod tests {
86918691 }
86928692 "#,
86938693 indoc! {r#"
8694- [foo="bar"] {
8695- color: red;
8696- }
8697-
8698- .bar {
8694+ [foo="bar"], .bar {
86998695 color: red;
87008696 }
87018697 "#},
@@ -9335,6 +9331,174 @@ mod tests {
93359331 }
93369332 "#},
93379333 );
9334+
9335+ prefix_test(
9336+ r#"
9337+ :hover, :focus-visible {
9338+ color: red;
9339+ }
9340+ "#,
9341+ indoc! {r#"
9342+ :hover {
9343+ color: red;
9344+ }
9345+
9346+ :focus-visible {
9347+ color: red;
9348+ }
9349+ "#},
9350+ Browsers {
9351+ safari: Some(13 << 16),
9352+ ..Browsers::default()
9353+ },
9354+ );
9355+
9356+ prefix_test(
9357+ r#"
9358+ .foo {
9359+ color: red;
9360+ }
9361+
9362+ :hover, :focus-visible {
9363+ color: red;
9364+ }
9365+ "#,
9366+ indoc! {r#"
9367+ .foo, :hover {
9368+ color: red;
9369+ }
9370+
9371+ :focus-visible {
9372+ color: red;
9373+ }
9374+ "#},
9375+ Browsers {
9376+ safari: Some(13 << 16),
9377+ ..Browsers::default()
9378+ },
9379+ );
9380+
9381+ prefix_test(
9382+ r#"
9383+ :hover, :focus-visible {
9384+ margin-inline-start: 24px;
9385+ }
9386+ "#,
9387+ indoc! {r#"
9388+ :hover:not(:lang(ae, ar, arc, bcc, bqi, ckb, dv, fa, glk, he, ku, mzn, nqo, pnb, ps, sd, ug, ur, yi)) {
9389+ margin-left: 24px;
9390+ }
9391+
9392+ :hover:lang(ae, ar, arc, bcc, bqi, ckb, dv, fa, glk, he, ku, mzn, nqo, pnb, ps, sd, ug, ur, yi) {
9393+ margin-right: 24px;
9394+ }
9395+
9396+ :focus-visible:not(:lang(ae, ar, arc, bcc, bqi, ckb, dv, fa, glk, he, ku, mzn, nqo, pnb, ps, sd, ug, ur, yi)) {
9397+ margin-left: 24px;
9398+ }
9399+
9400+ :focus-visible:lang(ae, ar, arc, bcc, bqi, ckb, dv, fa, glk, he, ku, mzn, nqo, pnb, ps, sd, ug, ur, yi) {
9401+ margin-right: 24px;
9402+ }
9403+ "#},
9404+ Browsers {
9405+ safari: Some(11 << 16),
9406+ ..Browsers::default()
9407+ },
9408+ );
9409+
9410+ prefix_test(
9411+ r#"
9412+ :focus-within, :focus-visible {
9413+ color: red;
9414+ }
9415+ "#,
9416+ indoc! {r#"
9417+ :focus-within {
9418+ color: red;
9419+ }
9420+
9421+ :focus-visible {
9422+ color: red;
9423+ }
9424+ "#},
9425+ Browsers {
9426+ safari: Some(9 << 16),
9427+ ..Browsers::default()
9428+ },
9429+ );
9430+
9431+ prefix_test(
9432+ r#"
9433+ :hover, :focus-visible {
9434+ color: red;
9435+ }
9436+ "#,
9437+ indoc! {r#"
9438+ :is(:hover, :focus-visible) {
9439+ color: red;
9440+ }
9441+ "#},
9442+ Browsers {
9443+ safari: Some(14 << 16),
9444+ ..Browsers::default()
9445+ },
9446+ );
9447+
9448+ prefix_test(
9449+ r#"
9450+ a::after:hover, a::after:focus-visible {
9451+ color: red;
9452+ }
9453+ "#,
9454+ indoc! {r#"
9455+ a:after:hover {
9456+ color: red;
9457+ }
9458+
9459+ a:after:focus-visible {
9460+ color: red;
9461+ }
9462+ "#},
9463+ Browsers {
9464+ safari: Some(14 << 16),
9465+ ..Browsers::default()
9466+ },
9467+ );
9468+
9469+ prefix_test(
9470+ r#"
9471+ a:not(:hover), a:not(:focus-visible) {
9472+ color: red;
9473+ }
9474+ "#,
9475+ indoc! {r#"
9476+ :is(a:not(:hover), a:not(:focus-visible)) {
9477+ color: red;
9478+ }
9479+ "#},
9480+ Browsers {
9481+ safari: Some(14 << 16),
9482+ ..Browsers::default()
9483+ },
9484+ );
9485+
9486+ prefix_test(
9487+ r#"
9488+ a:has(:hover), a:has(:focus-visible) {
9489+ color: red;
9490+ }
9491+ "#,
9492+ indoc! {r#"
9493+ :is(a:has(:hover), a:has(:focus-visible)) {
9494+ color: red;
9495+ }
9496+ "#},
9497+ Browsers {
9498+ safari: Some(14 << 16),
9499+ ..Browsers::default()
9500+ },
9501+ );
93389502 }
93399503
93409504 #[test]
0 commit comments