@angular/core 15.2.0-next.3 → 15.2.0-next.4

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 v15.2.0-next.3
2
+ * @license Angular v15.2.0-next.4
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -7257,70 +7257,18 @@ class DOMParserHelper {
7257
7257
  }
7258
7258
  }
7259
7259
  /**
7260
- * Use an HTML5 `template` element, if supported, or an inert body element created via
7261
- * `createHtmlDocument` to create and fill an inert DOM element.
7260
+ * Use an HTML5 `template` element to create and fill an inert DOM element.
7262
7261
  * This is the fallback strategy if the browser does not support DOMParser.
7263
7262
  */
7264
7263
  class InertDocumentHelper {
7265
7264
  constructor(defaultDoc) {
7266
7265
  this.defaultDoc = defaultDoc;
7267
7266
  this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert');
7268
- if (this.inertDocument.body == null) {
7269
- // usually there should be only one body element in the document, but IE doesn't have any, so
7270
- // we need to create one.
7271
- const inertHtml = this.inertDocument.createElement('html');
7272
- this.inertDocument.appendChild(inertHtml);
7273
- const inertBodyElement = this.inertDocument.createElement('body');
7274
- inertHtml.appendChild(inertBodyElement);
7275
- }
7276
7267
  }
7277
7268
  getInertBodyElement(html) {
7278
- // Prefer using <template> element if supported.
7279
7269
  const templateEl = this.inertDocument.createElement('template');
7280
- if ('content' in templateEl) {
7281
- templateEl.innerHTML = trustedHTMLFromString(html);
7282
- return templateEl;
7283
- }
7284
- // Note that previously we used to do something like `this.inertDocument.body.innerHTML = html`
7285
- // and we returned the inert `body` node. This was changed, because IE seems to treat setting
7286
- // `innerHTML` on an inserted element differently, compared to one that hasn't been inserted
7287
- // yet. In particular, IE appears to split some of the text into multiple text nodes rather
7288
- // than keeping them in a single one which ends up messing with Ivy's i18n parsing further
7289
- // down the line. This has been worked around by creating a new inert `body` and using it as
7290
- // the root node in which we insert the HTML.
7291
- const inertBody = this.inertDocument.createElement('body');
7292
- inertBody.innerHTML = trustedHTMLFromString(html);
7293
- // Support: IE 11 only
7294
- // strip custom-namespaced attributes on IE<=11
7295
- if (this.defaultDoc.documentMode) {
7296
- this.stripCustomNsAttrs(inertBody);
7297
- }
7298
- return inertBody;
7299
- }
7300
- /**
7301
- * When IE11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1'
7302
- * attribute to declare ns1 namespace and prefixes the attribute with 'ns1' (e.g.
7303
- * 'ns1:xlink:foo').
7304
- *
7305
- * This is undesirable since we don't want to allow any of these custom attributes. This method
7306
- * strips them all.
7307
- */
7308
- stripCustomNsAttrs(el) {
7309
- const elAttrs = el.attributes;
7310
- // loop backwards so that we can support removals.
7311
- for (let i = elAttrs.length - 1; 0 < i; i--) {
7312
- const attrib = elAttrs.item(i);
7313
- const attrName = attrib.name;
7314
- if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {
7315
- el.removeAttribute(attrName);
7316
- }
7317
- }
7318
- let childNode = el.firstChild;
7319
- while (childNode) {
7320
- if (childNode.nodeType === Node.ELEMENT_NODE)
7321
- this.stripCustomNsAttrs(childNode);
7322
- childNode = childNode.nextSibling;
7323
- }
7270
+ templateEl.innerHTML = trustedHTMLFromString(html);
7271
+ return templateEl;
7324
7272
  }
7325
7273
  }
7326
7274
  /**
@@ -8803,7 +8751,7 @@ class Version {
8803
8751
  /**
8804
8752
  * @publicApi
8805
8753
  */
8806
- const VERSION = new Version('15.2.0-next.3');
8754
+ const VERSION = new Version('15.2.0-next.4');
8807
8755
 
8808
8756
  // This default value is when checking the hierarchy for a token.
8809
8757
  //