Commit graph

10 commits

Author SHA1 Message Date
Matthew Berry
4fce3cad5e test(compiler): fix a @keyframes style encapsulation test (#64036)
I've updated the test to assert what I believe it was trying to assert
before. Without this change, the CSS is invalid so it's unclear what
behavior we're demonstrating.

PR Close #64036
2025-10-09 05:16:18 -07:00
Joey Perrott
9dbe6fc18b refactor: update license text to point to angular.dev (#57901)
Update license text to point to angular.dev instead of angular.io

PR Close #57901
2024-09-24 15:33:00 +02:00
Daniel Puckowski
387e1cbf89 fix(compiler): fix CSS animation rule scope (#56800)
It is valid CSS to list keyframe names in an animation declaration only
separating the names with a comma and no whitespace. This is typical of
production builds. Updated a couple of regexes and added a couple of
tests to account for this scenario.

Fixes #53038

PR Close #56800
2024-07-09 09:44:50 +02:00
Joey Perrott
8f69c83b84 refactor: migrate compiler to prettier formatting (#55398)
Migrate formatting to prettier for compiler from clang-format

PR Close #55398
2024-04-18 14:18:08 -07:00
dario-piotrowicz
61023b563d refactor(compiler): refactor the shadow css specs (#48443)
apply different quality of life improvements to the shadow
css unit tests:

- refactor the tests so that they are nicely divided in multiple files
   in a logical manner instead of having most of them all in a single big file

- remove the css normalization logic inconsistently used throughout  the tests, which
  causes tests to be inconsistent and it also introduced unintuitive checks

- provide a shared shim utility function (instead of re-defining it
  multiple times)

- add a `toEqualCss` matcher that can be used in the tests in order to
  match css strings without caring about spacing and indentation

PR Close #48443
2023-01-11 14:55:52 -08:00
dario-piotrowicz
051f75648d fix(compiler): scope css keyframes in emulated view encapsulation (#42608)
Ensure that keyframes rules, defined within components with emulated
view encapsulation, are scoped to avoid collisions with keyframes in
other components.

This is achieved by renaming these keyframes to add a prefix that makes
them unique across the application.

In order to enable the handling of keyframes names defined as strings
the previous strategy of replacing quoted css content with `%QUOTED%`
(introduced in commit 7f689a2) has been removed and in its place now
only specific characters inside quotes are being replaced with
placeholder text (those are `;`, `:` and `,`, more can be added in
the future if the need arises).

Closes #33885

BREAKING CHANGE:

Keyframes names are now prefixed with the component's "scope name".
For example, the following keyframes rule in a component definition,
whose "scope name" is host-my-cmp:

   @keyframes foo { ... }

will become:

   @keyframes host-my-cmp_foo { ... }

Any TypeScript/JavaScript code which relied on the names of keyframes rules
will no longer match.

The recommended solutions in this case are to either:
- change the component's view encapsulation to the `None` or `ShadowDom`
- define keyframes rules in global stylesheets (e.g styles.css)
- define keyframes rules programmatically in code.

PR Close #42608
2022-09-29 15:49:51 -07:00
Dylan Hunn
58e8f4b708 Revert "fix(compiler): scope css keyframes in emulated view encapsulation (#42608)" (#45786)
This reverts commit 4d6a1d6722.

PR Close #45786
2022-04-27 15:00:41 -07:00
dario-piotrowicz
4d6a1d6722 fix(compiler): scope css keyframes in emulated view encapsulation (#42608)
Ensure that keyframes rules, defined within components with emulated
view encapsulation, are scoped to avoid collisions with keyframes in
other components.

This is achieved by renaming these keyframes to add a prefix that makes
them unique across the application.

In order to enable the handling of keyframes names defined as strings
the previous strategy of replacing quoted css content with `%QUOTED%`
(introduced in commit 7f689a2) has been removed and in its place now
only specific characters inside quotes are being replaced with
placeholder text (those are `;`, `:` and `,`, more can be added in
the future if the need arises).

Closes #33885

BREAKING CHANGE:

Keyframes names are now prefixed with the component's "scope name".
For example, the following keyframes rule in a component definition,
whose "scope name" is host-my-cmp:

   @keyframes foo { ... }

will become:

   @keyframes host-my-cmp_foo { ... }

Any TypeScript/JavaScript code which relied on the names of keyframes rules
will no longer match.

The recommended solutions in this case are to either:
- change the component's view encapsulation to the `None` or `ShadowDom`
- define keyframes rules in global stylesheets (e.g styles.css)
- define keyframes rules programmatically in code.

PR Close #42608
2022-04-27 10:27:17 -07:00
Dylan Hunn
801d11dd8a Revert "fix(compiler): scope css keyframes in emulated view encapsulation (#42608)" (#45466)
This reverts commit f03e313f24.

PR Close #45466
2022-03-29 09:12:19 -07:00
dario-piotrowicz
f03e313f24 fix(compiler): scope css keyframes in emulated view encapsulation (#42608)
Ensure that keyframes rules, defined within components with emulated
view encapsulation, are scoped to avoid collisions with keyframes in
other components.

This is achieved by renaming these keyframes to add a prefix that makes
them unique across the application.

In order to enable the handling of keyframes names defined as strings
the previous strategy of replacing quoted css content with `%QUOTED%`
(introduced in commit 7f689a2) has been removed and in its place now
only specific characters inside quotes are being replaced with
placeholder text (those are `;`, `:` and `,`, more can be added in
the future if the need arises).

Closes #33885

BREAKING CHANGE:

Keyframes names are now prefixed with the component's "scope name".
For example, the following keyframes rule in a component definition,
whose "scope name" is host-my-cmp:

   @keyframes foo { ... }

will become:

   @keyframes host-my-cmp_foo { ... }

Any TypeScript/JavaScript code which relied on the names of keyframes rules
will no longer match.

The recommended solutions in this case are to either:
- change the component's view encapsulation to the `None` or `ShadowDom`
- define keyframes rules in global stylesheets (e.g styles.css)
- define keyframes rules programmatically in code.

PR Close #42608
2022-03-28 17:12:25 -07:00