@angular/compiler 19.2.16 → 19.2.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.2.16
2
+ * @license Angular v19.2.17
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -440,6 +440,7 @@ var SecurityContext;
440
440
  SecurityContext[SecurityContext["SCRIPT"] = 3] = "SCRIPT";
441
441
  SecurityContext[SecurityContext["URL"] = 4] = "URL";
442
442
  SecurityContext[SecurityContext["RESOURCE_URL"] = 5] = "RESOURCE_URL";
443
+ SecurityContext[SecurityContext["ATTRIBUTE_NO_BINDING"] = 6] = "ATTRIBUTE_NO_BINDING";
443
444
  })(SecurityContext || (SecurityContext = {}));
444
445
  var MissingTranslationStrategy;
445
446
  (function (MissingTranslationStrategy) {
@@ -3100,6 +3101,10 @@ class Identifiers {
3100
3101
  // sanitization-related functions
3101
3102
  static sanitizeHtml = { name: 'ɵɵsanitizeHtml', moduleName: CORE };
3102
3103
  static sanitizeStyle = { name: 'ɵɵsanitizeStyle', moduleName: CORE };
3104
+ static validateAttribute = {
3105
+ name: 'ɵɵvalidateAttribute',
3106
+ moduleName: CORE,
3107
+ };
3103
3108
  static sanitizeResourceUrl = {
3104
3109
  name: 'ɵɵsanitizeResourceUrl',
3105
3110
  moduleName: CORE,
@@ -3115,10 +3120,6 @@ class Identifiers {
3115
3120
  name: 'ɵɵtrustConstantResourceUrl',
3116
3121
  moduleName: CORE,
3117
3122
  };
3118
- static validateIframeAttribute = {
3119
- name: 'ɵɵvalidateIframeAttribute',
3120
- moduleName: CORE,
3121
- };
3122
3123
  // type-checking
3123
3124
  static InputSignalBrandWriteType = { name: 'ɵINPUT_SIGNAL_BRAND_WRITE_TYPE', moduleName: CORE };
3124
3125
  static UnwrapDirectiveSignalInputs = { name: 'ɵUnwrapDirectiveSignalInputs', moduleName: CORE };
@@ -19479,7 +19480,6 @@ function interleave(left, right) {
19479
19480
  // =================================================================================================
19480
19481
  //
19481
19482
  // DO NOT EDIT THIS LIST OF SECURITY SENSITIVE PROPERTIES WITHOUT A SECURITY REVIEW!
19482
- // Reach out to mprobst for details.
19483
19483
  //
19484
19484
  // =================================================================================================
19485
19485
  /** Map from tagName|propertyName to SecurityContext. Properties applying to all tags use '*'. */
@@ -19497,6 +19497,7 @@ function SECURITY_SCHEMA() {
19497
19497
  'area|ping',
19498
19498
  'audio|src',
19499
19499
  'a|href',
19500
+ 'a|xlink:href',
19500
19501
  'a|ping',
19501
19502
  'blockquote|cite',
19502
19503
  'body|background',
@@ -19510,6 +19511,74 @@ function SECURITY_SCHEMA() {
19510
19511
  'track|src',
19511
19512
  'video|poster',
19512
19513
  'video|src',
19514
+ // MathML namespace
19515
+ // https://crsrc.org/c/third_party/blink/renderer/core/sanitizer/sanitizer.cc;l=753-768;drc=b3eb16372dcd3317d65e9e0265015e322494edcd;bpv=1;bpt=1
19516
+ 'annotation|href',
19517
+ 'annotation|xlink:href',
19518
+ 'annotation-xml|href',
19519
+ 'annotation-xml|xlink:href',
19520
+ 'maction|href',
19521
+ 'maction|xlink:href',
19522
+ 'malignmark|href',
19523
+ 'malignmark|xlink:href',
19524
+ 'math|href',
19525
+ 'math|xlink:href',
19526
+ 'mroot|href',
19527
+ 'mroot|xlink:href',
19528
+ 'msqrt|href',
19529
+ 'msqrt|xlink:href',
19530
+ 'merror|href',
19531
+ 'merror|xlink:href',
19532
+ 'mfrac|href',
19533
+ 'mfrac|xlink:href',
19534
+ 'mglyph|href',
19535
+ 'mglyph|xlink:href',
19536
+ 'msub|href',
19537
+ 'msub|xlink:href',
19538
+ 'msup|href',
19539
+ 'msup|xlink:href',
19540
+ 'msubsup|href',
19541
+ 'msubsup|xlink:href',
19542
+ 'mmultiscripts|href',
19543
+ 'mmultiscripts|xlink:href',
19544
+ 'mprescripts|href',
19545
+ 'mprescripts|xlink:href',
19546
+ 'mi|href',
19547
+ 'mi|xlink:href',
19548
+ 'mn|href',
19549
+ 'mn|xlink:href',
19550
+ 'mo|href',
19551
+ 'mo|xlink:href',
19552
+ 'mpadded|href',
19553
+ 'mpadded|xlink:href',
19554
+ 'mphantom|href',
19555
+ 'mphantom|xlink:href',
19556
+ 'mrow|href',
19557
+ 'mrow|xlink:href',
19558
+ 'ms|href',
19559
+ 'ms|xlink:href',
19560
+ 'mspace|href',
19561
+ 'mspace|xlink:href',
19562
+ 'mstyle|href',
19563
+ 'mstyle|xlink:href',
19564
+ 'mtable|href',
19565
+ 'mtable|xlink:href',
19566
+ 'mtd|href',
19567
+ 'mtd|xlink:href',
19568
+ 'mtr|href',
19569
+ 'mtr|xlink:href',
19570
+ 'mtext|href',
19571
+ 'mtext|xlink:href',
19572
+ 'mover|href',
19573
+ 'mover|xlink:href',
19574
+ 'munder|href',
19575
+ 'munder|xlink:href',
19576
+ 'munderover|href',
19577
+ 'munderover|xlink:href',
19578
+ 'semantics|href',
19579
+ 'semantics|xlink:href',
19580
+ 'none|href',
19581
+ 'none|xlink:href',
19513
19582
  ]);
19514
19583
  registerContext(SecurityContext.RESOURCE_URL, [
19515
19584
  'applet|code',
@@ -19526,6 +19595,29 @@ function SECURITY_SCHEMA() {
19526
19595
  'object|data',
19527
19596
  'script|src',
19528
19597
  ]);
19598
+ // Keep this in sync with SECURITY_SENSITIVE_ELEMENTS in packages/core/src/sanitization/sanitization.ts
19599
+ // Unknown is the internal tag name for unknown elements example used for host-bindings.
19600
+ // These are unsafe as `attributeName` can be `href` or `xlink:href`
19601
+ // See: http://b/463880509#comment7
19602
+ registerContext(SecurityContext.ATTRIBUTE_NO_BINDING, [
19603
+ 'animate|attributeName',
19604
+ 'set|attributeName',
19605
+ 'animateMotion|attributeName',
19606
+ 'animateTransform|attributeName',
19607
+ 'unknown|attributeName',
19608
+ 'iframe|sandbox',
19609
+ 'iframe|allow',
19610
+ 'iframe|allowFullscreen',
19611
+ 'iframe|referrerPolicy',
19612
+ 'iframe|csp',
19613
+ 'iframe|fetchPriority',
19614
+ 'unknown|sandbox',
19615
+ 'unknown|allow',
19616
+ 'unknown|allowFullscreen',
19617
+ 'unknown|referrerPolicy',
19618
+ 'unknown|csp',
19619
+ 'unknown|fetchPriority',
19620
+ ]);
19529
19621
  }
19530
19622
  return _SECURITY_SCHEMA;
19531
19623
  }
@@ -19533,32 +19625,6 @@ function registerContext(ctx, specs) {
19533
19625
  for (const spec of specs)
19534
19626
  _SECURITY_SCHEMA[spec.toLowerCase()] = ctx;
19535
19627
  }
19536
- /**
19537
- * The set of security-sensitive attributes of an `<iframe>` that *must* be
19538
- * applied as a static attribute only. This ensures that all security-sensitive
19539
- * attributes are taken into account while creating an instance of an `<iframe>`
19540
- * at runtime.
19541
- *
19542
- * Note: avoid using this set directly, use the `isIframeSecuritySensitiveAttr` function
19543
- * in the code instead.
19544
- */
19545
- const IFRAME_SECURITY_SENSITIVE_ATTRS = new Set([
19546
- 'sandbox',
19547
- 'allow',
19548
- 'allowfullscreen',
19549
- 'referrerpolicy',
19550
- 'csp',
19551
- 'fetchpriority',
19552
- ]);
19553
- /**
19554
- * Checks whether a given attribute name might represent a security-sensitive
19555
- * attribute of an <iframe>.
19556
- */
19557
- function isIframeSecuritySensitiveAttr(attrName) {
19558
- // The `setAttribute` DOM API is case-insensitive, so we lowercase the value
19559
- // before checking it against a known security-sensitive attributes.
19560
- return IFRAME_SECURITY_SENSITIVE_ATTRS.has(attrName.toLowerCase());
19561
- }
19562
19628
 
19563
19629
  class ElementSchemaRegistry {
19564
19630
  }
@@ -24098,6 +24164,7 @@ const sanitizerFns = new Map([
24098
24164
  [SecurityContext.SCRIPT, Identifiers.sanitizeScript],
24099
24165
  [SecurityContext.STYLE, Identifiers.sanitizeStyle],
24100
24166
  [SecurityContext.URL, Identifiers.sanitizeUrl],
24167
+ [SecurityContext.ATTRIBUTE_NO_BINDING, Identifiers.validateAttribute],
24101
24168
  ]);
24102
24169
  /**
24103
24170
  * Map of security contexts to their trusted value function.
@@ -24111,7 +24178,6 @@ const trustedValueFns = new Map([
24111
24178
  */
24112
24179
  function resolveSanitizers(job) {
24113
24180
  for (const unit of job.units) {
24114
- const elements = createOpXrefMap(unit);
24115
24181
  // For normal element bindings we create trusted values for security sensitive constant
24116
24182
  // attributes. However, for host bindings we skip this step (this matches what
24117
24183
  // TemplateDefinitionBuilder does).
@@ -24132,8 +24198,8 @@ function resolveSanitizers(job) {
24132
24198
  let sanitizerFn = null;
24133
24199
  if (Array.isArray(op.securityContext) &&
24134
24200
  op.securityContext.length === 2 &&
24135
- op.securityContext.indexOf(SecurityContext.URL) > -1 &&
24136
- op.securityContext.indexOf(SecurityContext.RESOURCE_URL) > -1) {
24201
+ op.securityContext.includes(SecurityContext.URL) &&
24202
+ op.securityContext.includes(SecurityContext.RESOURCE_URL)) {
24137
24203
  // When the host element isn't known, some URL attributes (such as "src" and "href") may
24138
24204
  // be part of multiple different security contexts. In this case we use special
24139
24205
  // sanitization function and select the actual sanitizer at runtime based on a tag name
@@ -24144,43 +24210,11 @@ function resolveSanitizers(job) {
24144
24210
  sanitizerFn = sanitizerFns.get(getOnlySecurityContext(op.securityContext)) ?? null;
24145
24211
  }
24146
24212
  op.sanitizer = sanitizerFn !== null ? importExpr(sanitizerFn) : null;
24147
- // If there was no sanitization function found based on the security context of an
24148
- // attribute/property, check whether this attribute/property is one of the
24149
- // security-sensitive <iframe> attributes (and that the current element is actually an
24150
- // <iframe>).
24151
- if (op.sanitizer === null) {
24152
- let isIframe = false;
24153
- if (job.kind === CompilationJobKind.Host || op.kind === OpKind.HostProperty) {
24154
- // Note: for host bindings defined on a directive, we do not try to find all
24155
- // possible places where it can be matched, so we can not determine whether
24156
- // the host element is an <iframe>. In this case, we just assume it is and append a
24157
- // validation function, which is invoked at runtime and would have access to the
24158
- // underlying DOM element to check if it's an <iframe> and if so - run extra checks.
24159
- isIframe = true;
24160
- }
24161
- else {
24162
- // For a normal binding we can just check if the element its on is an iframe.
24163
- const ownerOp = elements.get(op.target);
24164
- if (ownerOp === undefined || !isElementOrContainerOp(ownerOp)) {
24165
- throw Error('Property should have an element-like owner');
24166
- }
24167
- isIframe = isIframeElement(ownerOp);
24168
- }
24169
- if (isIframe && isIframeSecuritySensitiveAttr(op.name)) {
24170
- op.sanitizer = importExpr(Identifiers.validateIframeAttribute);
24171
- }
24172
- }
24173
24213
  break;
24174
24214
  }
24175
24215
  }
24176
24216
  }
24177
24217
  }
24178
- /**
24179
- * Checks whether the given op represents an iframe element.
24180
- */
24181
- function isIframeElement(op) {
24182
- return op.kind === OpKind.ElementStart && op.tag?.toLowerCase() === 'iframe';
24183
- }
24184
24218
  /**
24185
24219
  * Asserts that there is only a single security context and returns it.
24186
24220
  */
@@ -30947,7 +30981,7 @@ function publishFacade(global) {
30947
30981
  * @description
30948
30982
  * Entry point for all public APIs of the compiler package.
30949
30983
  */
30950
- const VERSION = new Version('19.2.16');
30984
+ const VERSION = new Version('19.2.17');
30951
30985
 
30952
30986
  class CompilerConfig {
30953
30987
  defaultEncapsulation;
@@ -32804,7 +32838,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
32804
32838
  function compileDeclareClassMetadata(metadata) {
32805
32839
  const definitionMap = new DefinitionMap();
32806
32840
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
32807
- definitionMap.set('version', literal('19.2.16'));
32841
+ definitionMap.set('version', literal('19.2.17'));
32808
32842
  definitionMap.set('ngImport', importExpr(Identifiers.core));
32809
32843
  definitionMap.set('type', metadata.type);
32810
32844
  definitionMap.set('decorators', metadata.decorators);
@@ -32822,7 +32856,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
32822
32856
  callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
32823
32857
  callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
32824
32858
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
32825
- definitionMap.set('version', literal('19.2.16'));
32859
+ definitionMap.set('version', literal('19.2.17'));
32826
32860
  definitionMap.set('ngImport', importExpr(Identifiers.core));
32827
32861
  definitionMap.set('type', metadata.type);
32828
32862
  definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
@@ -32917,7 +32951,7 @@ function createDirectiveDefinitionMap(meta) {
32917
32951
  const definitionMap = new DefinitionMap();
32918
32952
  const minVersion = getMinimumVersionForPartialOutput(meta);
32919
32953
  definitionMap.set('minVersion', literal(minVersion));
32920
- definitionMap.set('version', literal('19.2.16'));
32954
+ definitionMap.set('version', literal('19.2.17'));
32921
32955
  // e.g. `type: MyDirective`
32922
32956
  definitionMap.set('type', meta.type.value);
32923
32957
  if (meta.isStandalone !== undefined) {
@@ -33333,7 +33367,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
33333
33367
  function compileDeclareFactoryFunction(meta) {
33334
33368
  const definitionMap = new DefinitionMap();
33335
33369
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
33336
- definitionMap.set('version', literal('19.2.16'));
33370
+ definitionMap.set('version', literal('19.2.17'));
33337
33371
  definitionMap.set('ngImport', importExpr(Identifiers.core));
33338
33372
  definitionMap.set('type', meta.type.value);
33339
33373
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -33368,7 +33402,7 @@ function compileDeclareInjectableFromMetadata(meta) {
33368
33402
  function createInjectableDefinitionMap(meta) {
33369
33403
  const definitionMap = new DefinitionMap();
33370
33404
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
33371
- definitionMap.set('version', literal('19.2.16'));
33405
+ definitionMap.set('version', literal('19.2.17'));
33372
33406
  definitionMap.set('ngImport', importExpr(Identifiers.core));
33373
33407
  definitionMap.set('type', meta.type.value);
33374
33408
  // Only generate providedIn property if it has a non-null value
@@ -33419,7 +33453,7 @@ function compileDeclareInjectorFromMetadata(meta) {
33419
33453
  function createInjectorDefinitionMap(meta) {
33420
33454
  const definitionMap = new DefinitionMap();
33421
33455
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
33422
- definitionMap.set('version', literal('19.2.16'));
33456
+ definitionMap.set('version', literal('19.2.17'));
33423
33457
  definitionMap.set('ngImport', importExpr(Identifiers.core));
33424
33458
  definitionMap.set('type', meta.type.value);
33425
33459
  definitionMap.set('providers', meta.providers);
@@ -33452,7 +33486,7 @@ function createNgModuleDefinitionMap(meta) {
33452
33486
  throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
33453
33487
  }
33454
33488
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
33455
- definitionMap.set('version', literal('19.2.16'));
33489
+ definitionMap.set('version', literal('19.2.17'));
33456
33490
  definitionMap.set('ngImport', importExpr(Identifiers.core));
33457
33491
  definitionMap.set('type', meta.type.value);
33458
33492
  // We only generate the keys in the metadata if the arrays contain values.
@@ -33503,7 +33537,7 @@ function compileDeclarePipeFromMetadata(meta) {
33503
33537
  function createPipeDefinitionMap(meta) {
33504
33538
  const definitionMap = new DefinitionMap();
33505
33539
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
33506
- definitionMap.set('version', literal('19.2.16'));
33540
+ definitionMap.set('version', literal('19.2.17'));
33507
33541
  definitionMap.set('ngImport', importExpr(Identifiers.core));
33508
33542
  // e.g. `type: MyPipe`
33509
33543
  definitionMap.set('type', meta.type.value);