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

Unit tests confirm that css generated with attribute selector on host is incorrect as of a16 #51743

Closed
johnwest80 opened this issue Sep 12, 2023 · 2 comments

Comments

@johnwest80
Copy link

Which @angular/* package(s) are the source of the bug?

compiler

Is this a regression?

Yes

Description

Below is the css and unit test i wrote to confirm it's generated incorrectly.

original css

:host[size=full]>espresso-modal-container>espresso-modal-content-container {
min-width: 100vw;
max-width: 100vw;
width: 100vw;
min-height: 100%;
max-height: 100%;
height: 100%
}

expected css

[size=full][HOSTA]>espresso-modal-container[CONTENTA]>espresso-modal-content-container[CONTENTA] {
min-width: 100vw;
max-width: 100vw;
width: 100vw;
min-height: 100%;
max-height: 100%;
height: 100%
}

actual css

[size=full]>espresso-modal-container>espresso-modal-content-container[HOSTA] {
min-width: 100vw;
max-width: 100vw;
width: 100vw;
min-height: 100%;
max-height: 100%;
height: 100%
}

angular unit test i added to shadow_css_spec.ts

describe('ShadowCss', () => {
it('should handle attribute before host', () => {
const css = ':host[size=full]>espresso-modal-container>espresso-modal-content-container{min-width:100vw;max-width:100vw;width:100vw;min-height:100%;max-height:100%;height:100%}';
const expected = '[size=full][HOSTA]>espresso-modal-container[CONTENTA]>espresso-modal-content-container[CONTENTA]{min-width:100vw;max-width:100vw;width:100vw;min-height:100%;max-height:100%;height:100%}';
expect(shim(css, 'CONTENTA', 'HOSTA')).toEqualCss(expected);
});

Please provide a link to a minimal reproduction of the bug

all is in above details

Please provide the exception or error you saw

incorrect css generated as shown and reproduced via the unit test above

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 16.1.15
Node: 18.13.0
Package Manager: yarn 1.22.19
OS: darwin x64

Anything else?

confirmed this works as expected in 14, not sure about 15

@JeanMeche
Copy link
Member

JeanMeche commented Sep 12, 2023

Hi, there is a pending PR to fix this regression : #49118

Dupe of #49100

@JeanMeche JeanMeche closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2023
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants