Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
@johnwest80

Description

@johnwest80
Issue body actions

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

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.