angular/packages/core/src/sanitization
Kristiyan Kostadinov 513a4fe05e refactor(core): replace usages of removeChild (#57203)
These changes replace most usages of `removeChild` with `remove`. The latter has the advantage of not having to look up the `parentNode` and ensure that the child being removed actually belongs to the specific parent.

The refactor should be fairly safe since all the browsers we cover support `remove`. [Something similar was done in Components](https://github.com/angular/components/pull/23592) some time ago and there haven't been any bug reports as a result.

PR Close #57203
2024-08-07 16:46:09 +00:00
..
bypass.ts refactor: migrate core to prettier formatting (#55488) 2024-04-29 09:49:19 -07:00
html_sanitizer.ts refactor(core): replace usages of removeChild (#57203) 2024-08-07 16:46:09 +00:00
iframe_attrs_validation.ts refactor: migrate core to prettier formatting (#55488) 2024-04-29 09:49:19 -07:00
inert_body.ts refactor(core): replace usages of removeChild (#57203) 2024-08-07 16:46:09 +00:00
readme.md refactor(core): move sanitization into core (#22540) 2018-03-07 18:24:06 -08:00
sanitization.ts refactor: migrate core to prettier formatting (#55488) 2024-04-29 09:49:19 -07:00
sanitizer.ts refactor: migrate core to prettier formatting (#55488) 2024-04-29 09:49:19 -07:00
security.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
url_sanitizer.ts feat(core): change the URL sanitization to only block javascript: URLs (#49659) 2023-04-04 15:01:13 -07:00

Sanitization

This folder contains sanitization related code.

History

It used to be that sanitization related code used to be in @angular/platform-browser since it is platform related. While this is true, in practice the compiler schema is permanently tied to the DOM and hence the fact that sanitizer could in theory be replaced is not used in practice.

In order to better support tree shaking we need to be able to refer to the sanitization functions from the Ivy code. For this reason the code has been moved into the @angular/core.