-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[Gecko Bug 1975531] Adjust web-platform-tests for & being replaced by :where(:scope) in @scope. #53831
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
base: master
Are you sure you want to change the base?
Conversation
…scope. This is as per the CSSWG resolution [1]. * scope-invalidation.html: Adjust for `&` no longer inheriting scope start selector's specificity. * scope-specificity.html: Now equate `@scope(#main) { & .b {} }` with `:where(#main) .b` in terms of specificity. * scope-nesting.html: * `test_nest_scope_end`: Now behaves identically to `test_nest_scope_end_implicit_scope` * `test_inner_nest`: Now behaves identically to `test_parent_in_pseudo_scope` * `test_parent_pseudo_in_nested_scope_end`: Removed; there's no equivalence with implicit `:scope` * `test_insert_ampersand_rule_within_scope`: Insert the selector using & before and after the selector using implicit scope selector, since order of apperance matters. [1] w3c/csswg-drafts#9740 Differential Revision: https://phabricator.services.mozilla.com/D257704 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1975531 gecko-commit: b7593b87da93868f2b9302b5de723110eb96428d gecko-reviewers: firefox-style-system-reviewers, emilio
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The review process for this patch is being conducted in the Firefox project.
cc @mdubet to review from WebKit |
@mdubet, could you take a look? |
css/css-cascade/scope-nesting.html
Outdated
@scope (.a) to (& > &) { | ||
* { z-index:1; } | ||
/* (.b) behaves like (:where(:scope) .b), due & mapping to :where(:scope).*/ | ||
@scope (.a) to (& .b) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to remove the >
child selector here ?
css/css-cascade/scope-nesting.html
Outdated
</div> | ||
</template> | ||
<script> | ||
test((t) => { | ||
t.add_cleanup(() => main.replaceChildren()); | ||
main.append(test_inner_nest.content.cloneNode(true)); | ||
|
||
assert_equals(getComputedStyle(inner1).zIndex, 'auto'); | ||
assert_equals(getComputedStyle(inner2).zIndex, '1'); | ||
assert_equals(getComputedStyle(div).zIndex, '2'); | ||
}, 'Nesting-selector in the scope\'s <stylesheet>'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the new goal of the test to verify that scoped element are inclusive descendant of the scoping root ? If so, should we rename the test ?
cc @lilles for Chromium review too |
Test changes LGTM, but like I said in the CSSWG discussion, we may not actually be able to make this change for web compat reasons. By default, this should cause the affected tests to be dropped from interop. web-platform-tests/interop#604 |
This is precisely what I'm trying to assess here by pinging individual vendors :) If there's consensus that the change is OK, then we can include it. If this change is not OK, we should revert the spec resolution as well as this WPT change. |
The change is probably OK; |
@dshin-moz @emilio Could you look at the comments above? Seems OK to merge given everyone's comments here, but just want to make sure you see them before I do |
Sorry, this fell off my radar. Due to me not having push permissions, I've created #54268 addressing the comments. |
Differential Revision: https://phabricator.services.mozilla.com/D262990 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1975531 gecko-commit: 3ab10e3da283b493106f9f3c4e03d87afcf60c3d gecko-reviewers: firefox-style-system-reviewers, emilio
This is as per the CSSWG resolution [1].
&
no longer inheriting scope startselector's specificity.
@scope(#main) { & .b {} }
with:where(#main) .b
in terms of specificity.test_nest_scope_end
: Now behaves identically totest_nest_scope_end_implicit_scope
test_inner_nest
: Now behaves identically totest_parent_in_pseudo_scope
test_parent_pseudo_in_nested_scope_end
: Removed; there's no equivalencewith implicit
:scope
test_insert_ampersand_rule_within_scope
: Insert the selector using &before and after the selector using implicit scope selector, since
order of apperance matters.
[1] w3c/csswg-drafts#9740
Differential Revision: https://phabricator.services.mozilla.com/D257704
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1975531
gecko-commit: b7593b87da93868f2b9302b5de723110eb96428d
gecko-reviewers: firefox-style-system-reviewers, emilio