From 0ef3f4742e2aecd87d71f4f973f708522b8f5838 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Tue, 13 Oct 2026 23:03:27 +0800 Subject: [PATCH 1/3] fix(compiler): match Angular 22.2.2 emit for img/video src sanitizers and namespaced block tags --- .../src/component/metadata.rs | 30 +++++ .../src/pipeline/ingest.rs | 30 ++++- .../src/schema/dom_security_schema.rs | 127 +++++++++++++++--- .../tests/element_name_case_test.rs | 34 +++-- .../tests/integration_test.rs | 69 +++++++--- 5 files changed, 233 insertions(+), 57 deletions(-) diff --git a/crates/oxc_angular_compiler/src/component/metadata.rs b/crates/oxc_angular_compiler/src/component/metadata.rs index 2a6440eb1..7f2cee5b3 100644 --- a/crates/oxc_angular_compiler/src/component/metadata.rs +++ b/crates/oxc_angular_compiler/src/component/metadata.rs @@ -159,6 +159,36 @@ impl AngularVersion { false } + /// Check if this version is `major.minor.patch` or newer. + pub fn is_at_least(&self, major: u32, minor: u32, patch: u32) -> bool { + (self.major, self.minor, self.patch) >= (major, minor, patch) + } + + /// Check if this version drops `img|src` and `video|src` from the URL + /// security context (v22.2.2+ / v22.3.0-next.1+; prereleases compare by + /// triple only, so 22.3.0-next.0 already counts). + /// + /// `angular/angular@439ff1bdf4` ("refactor(compiler): remove img/video src + /// attribute from the URL security context") landed only on the v22 line, + /// so a bound `src` on ``/`