Skip to content

Support pseudoelements in CSS scoping #25270

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

Merged
merged 5 commits into from
Aug 28, 2020

Conversation

SteveSandersonMS
Copy link
Member

@SteveSandersonMS SteveSandersonMS commented Aug 26, 2020

Fixes #25268

Without this, the new test cases HandlesPseudoElements and HandlesSingleColonPseudoElements (added in this PR) would fail.

Note that the new test case HandlesPseudoClasses (also added in this PR) would pass even without the implementation change, but it's good to have more test cases explicitly about pseudoclasses to make sure the pseudoelement support doesn't trip them up.

Ask-mode template

Description

The new CSS scoping feature, first shipped in 5.0-preview8, contains a bug whereby a particular kind of CSS rule doesn't get scoped properly.

Customer Impact

This was reported by a customer: https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-5-preview-8/#comment-2540

The impact is that CSS pseudoelements don't work with CSS scoping, so the application UI doesn't render with the intended styling.

The only workaround would be for the developer to change their CSS to avoid having this combination of features, which probably means not using scoping.

It's very desirable to include the fix in RC1 because we want to be sure the CSS scoping feature is totally robust by the time it ships. If we don't include the fix, then customers won't get a ship-ready-candidate version of the feature until RC2, and then there will be very little time left for remaining feedback.

Regression?

No, this is a new feature

Risk

In the worst case, this might theoretically introduce some other new bug into the CSS scoping feature. However, test coverage is pretty good, and it doesn't have interactions with other features.

@SteveSandersonMS SteveSandersonMS added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates area-blazor Includes: Blazor, Razor Components labels Aug 26, 2020
@SteveSandersonMS SteveSandersonMS self-assigned this Aug 26, 2020
@SteveSandersonMS SteveSandersonMS linked an issue Aug 26, 2020 that may be closed by this pull request
Copy link
Member

@javiercn javiercn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, it might be good to compile a table of the things "we care" about to make sure we didn't forget anything else.

Just saying this because it's hard for me to think of all the possible cases we need to handle without listing them.

@SteveSandersonMS
Copy link
Member Author

Looks great, it might be good to compile a table of the things "we care" about to make sure we didn't forget anything else.

It's a good point. The unit tests are meant to be the statement of what cases are relevant, but it's definitely useful to get a secondary confirmation that they are broad enough. To do this I've just compared against the cases supported by Vue, and it turns out we already did cover all of them with one exception (leading pseudoelements) that I've now added in the latest commit.

@SteveSandersonMS SteveSandersonMS added this to the 5.0.0-rc1 milestone Aug 26, 2020
@SteveSandersonMS SteveSandersonMS added ask-mode This issue / PR is a patch candidate which we will bar-check internally before patching it. Servicing-consider Shiproom approval is required for the issue labels Aug 26, 2020
@ghost
Copy link

ghost commented Aug 26, 2020

Hello human! Please make sure you've included the Shiproom Template in a comment or (preferably) the PR description. Also, make sure this PR is not marked as a draft and is ready-to-merge.

@pranavkm pranavkm added bug This issue describes a behavior which is not expected - a bug. Working and removed Servicing-consider Shiproom approval is required for the issue labels Aug 26, 2020
@Pilchie Pilchie added the Servicing-approved Shiproom has approved the issue label Aug 27, 2020
@Pilchie
Copy link
Member

Pilchie commented Aug 27, 2020

Approved for RC1 pending CI completion.

@mkArtakMSFT mkArtakMSFT merged commit d793f47 into release/5.0 Aug 28, 2020
@mkArtakMSFT mkArtakMSFT deleted the stevesa/css-rewrite-pseudoelements branch August 28, 2020 15:37
@SteveSandersonMS SteveSandersonMS added Done This issue has been fixed and removed Working Done This issue has been fixed labels Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates ask-mode This issue / PR is a patch candidate which we will bar-check internally before patching it. bug This issue describes a behavior which is not expected - a bug. Servicing-approved Shiproom has approved the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSS isolation doesn't support pseudoelements
5 participants