angular/packages/compiler/test
Matt Lewis 880a57d4b3 fix(compiler): prevent shimCssText from adding extra blank lines per CSS comment
The comment placeholder restoration in `shimCssText` appended an unconditional
`+ '\n'` to each non-hash comment replacement. Because `_commentRe` does not
consume the newline that follows a comment in the source, that newline already
remains in `cssText`. The extra `'\n'` was therefore inserted on top of the
existing one, shifting every line after each comment down by one. In files with
many comments (e.g. large SCSS preambles) this shifts all subsequent CSS rules
far enough that the CSS sourcemap — generated before `shimCssText` runs —
points to completely wrong source locations in browser DevTools.

The fix is to drop the `+ '\n'`; internal newlines within a multi-line comment
are still preserved via `_newLinesRe`, and the trailing newline that follows the
comment in `cssText` is already present without any extra injection.

(cherry picked from commit 5a712d42d1)
2026-03-20 15:17:35 -07:00
..
expression_parser build: update Jasmine to 6.0.0 2026-02-09 12:15:57 -08:00
i18n build: update Jasmine to 6.0.0 2026-02-09 12:15:57 -08:00
ml_parser fix(compiler): parse named HTML entities containing digits 2026-03-17 12:54:45 -07:00
output build: update Jasmine to 6.0.0 2026-02-09 12:15:57 -08:00
render3 fix(compiler): prevent mutation of children array in RecursiveVisitor 2026-03-04 22:41:36 +00:00
schema fix(compiler): disallow translations of iframe src 2026-03-12 10:01:31 -07:00
selector refactor(compiler): remove zone-based testing utilities 2026-02-09 07:55:12 -08:00
shadow_css fix(compiler): prevent shimCssText from adding extra blank lines per CSS comment 2026-03-20 15:17:35 -07:00
BUILD.bazel test(compiler): remove zone-based testing utilities 2026-02-05 16:56:55 -08:00
compiler_facade_interface_spec.ts docs: set syntax highlighting of code examples MD code blocks (#59026) 2024-12-04 17:30:28 +01:00
integration_spec.ts test(compiler): remove zone-based testing utilities 2026-02-05 16:56:55 -08:00
style_url_resolver_spec.ts refactor(compiler): convert scripts within packages/compiler to relative imports (#60625) 2025-04-01 11:57:53 +00:00
util_spec.ts refactor(compiler): remove unused code (#61668) 2025-05-26 12:21:09 +00:00