Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix css-nesting parsing typo #41172

Merged
merged 1 commit into from Jul 26, 2023

Conversation

mdubet
Copy link
Contributor

@mdubet mdubet commented Jul 25, 2023

@wpt-pr-bot
Copy link
Collaborator

There are no reviewers for this pull request. Please reach out on the chat room to get help with this. Thank you!

@tabatkins tabatkins enabled auto-merge (squash) July 26, 2023 00:12
@tabatkins tabatkins merged commit 8d4bc62 into web-platform-tests:master Jul 26, 2023
19 checks passed
@tabatkins
Copy link
Contributor

I swear I made that edit already, but in any case, thanks!

@emilio
Copy link
Contributor

emilio commented Jul 27, 2023

@tabatkins are the expectations here correct? At the very least this probably needs:

diff --git a/testing/web-platform/tests/css/css-nesting/parsing.html b/testing/web-platform/tests/css/css-nesting/parsing.html
index b189190f41257..3ef3811b311cb 100644
--- a/testing/web-platform/tests/css/css-nesting/parsing.html
+++ b/testing/web-platform/tests/css/css-nesting/parsing.html
@@ -42,7 +42,7 @@
   testNestedSelector("&.bar");
   testNestedSelector("& .bar");
   testNestedSelector("& > .bar");
-  testNestedSelector("> & .bar");
+  testNestedSelector("> & .bar", {expected: "& > & .bar" });
   testNestedSelector("> .bar", {expected:"& > .bar"});
   testNestedSelector("+ .bar &", {expected:"& + .bar &"});
   testNestedSelector(".test > & .bar");

As otherwise the selector is invalid in non-nested contexts?

But this also expects that ampersands are introduced if not there already for non-relative selectors, in some cases even for non-relative selectors, which is very weird?

E.g, the test expects: .bar, .foo & to get turned into & .bar, .foo &, which doesn't seem necessary? All browsers right now serializes that as .bar, .foo & which seems fine, since it's not an invalid selector list in any context.

Just wanted to double-check the expectations before changing behavior here...

@emilio
Copy link
Contributor

emilio commented Jul 27, 2023

Also testNestedSelector(":is(.bar, .baz)", {expected:"&:is(.bar, .baz)"}); should probably be & :is(.bar, .baz) (note the extra space)?

@emilio
Copy link
Contributor

emilio commented Jul 27, 2023

(If we want to do that, which per my previous comment we might not...)

@tabatkins
Copy link
Contributor

...sigh, the reason I was so confused is that I did fix a lot of these issues in #41050, but that never merged.

@tabatkins tabatkins mentioned this pull request Jul 27, 2023
@tabatkins
Copy link
Contributor

-  testNestedSelector("> & .bar");
+  testNestedSelector("> & .bar", {expected: "& > & .bar" });

Yup.

But this also expects that ampersands are introduced if not there already for non-relative selectors, in some cases even for non-relative selectors, which is very weird?

Hm, you're right, I just misinterpreted the resolution. Curiously enough, I wrote the spec correctly, matching the resolution.

Both of these are fixed in #41213.

@emilio
Copy link
Contributor

emilio commented Jul 28, 2023

Thanks!

Lightning00Blade pushed a commit to Lightning00Blade/wpt that referenced this pull request Dec 11, 2023
Co-authored-by: Matthieu Dubet <matthieu.dubet@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants