@angular/core 15.2.0-next.3 → 15.2.0-rc.0

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.
package/fesm2020/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.2.0-next.3
2
+ * @license Angular v15.2.0-rc.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -6973,70 +6973,18 @@ class DOMParserHelper {
6973
6973
  }
6974
6974
  }
6975
6975
  /**
6976
- * Use an HTML5 `template` element, if supported, or an inert body element created via
6977
- * `createHtmlDocument` to create and fill an inert DOM element.
6976
+ * Use an HTML5 `template` element to create and fill an inert DOM element.
6978
6977
  * This is the fallback strategy if the browser does not support DOMParser.
6979
6978
  */
6980
6979
  class InertDocumentHelper {
6981
6980
  constructor(defaultDoc) {
6982
6981
  this.defaultDoc = defaultDoc;
6983
6982
  this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert');
6984
- if (this.inertDocument.body == null) {
6985
- // usually there should be only one body element in the document, but IE doesn't have any, so
6986
- // we need to create one.
6987
- const inertHtml = this.inertDocument.createElement('html');
6988
- this.inertDocument.appendChild(inertHtml);
6989
- const inertBodyElement = this.inertDocument.createElement('body');
6990
- inertHtml.appendChild(inertBodyElement);
6991
- }
6992
6983
  }
6993
6984
  getInertBodyElement(html) {
6994
- // Prefer using <template> element if supported.
6995
6985
  const templateEl = this.inertDocument.createElement('template');
6996
- if ('content' in templateEl) {
6997
- templateEl.innerHTML = trustedHTMLFromString(html);
6998
- return templateEl;
6999
- }
7000
- // Note that previously we used to do something like `this.inertDocument.body.innerHTML = html`
7001
- // and we returned the inert `body` node. This was changed, because IE seems to treat setting
7002
- // `innerHTML` on an inserted element differently, compared to one that hasn't been inserted
7003
- // yet. In particular, IE appears to split some of the text into multiple text nodes rather
7004
- // than keeping them in a single one which ends up messing with Ivy's i18n parsing further
7005
- // down the line. This has been worked around by creating a new inert `body` and using it as
7006
- // the root node in which we insert the HTML.
7007
- const inertBody = this.inertDocument.createElement('body');
7008
- inertBody.innerHTML = trustedHTMLFromString(html);
7009
- // Support: IE 11 only
7010
- // strip custom-namespaced attributes on IE<=11
7011
- if (this.defaultDoc.documentMode) {
7012
- this.stripCustomNsAttrs(inertBody);
7013
- }
7014
- return inertBody;
7015
- }
7016
- /**
7017
- * When IE11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1'
7018
- * attribute to declare ns1 namespace and prefixes the attribute with 'ns1' (e.g.
7019
- * 'ns1:xlink:foo').
7020
- *
7021
- * This is undesirable since we don't want to allow any of these custom attributes. This method
7022
- * strips them all.
7023
- */
7024
- stripCustomNsAttrs(el) {
7025
- const elAttrs = el.attributes;
7026
- // loop backwards so that we can support removals.
7027
- for (let i = elAttrs.length - 1; 0 < i; i--) {
7028
- const attrib = elAttrs.item(i);
7029
- const attrName = attrib.name;
7030
- if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {
7031
- el.removeAttribute(attrName);
7032
- }
7033
- }
7034
- let childNode = el.firstChild;
7035
- while (childNode) {
7036
- if (childNode.nodeType === Node.ELEMENT_NODE)
7037
- this.stripCustomNsAttrs(childNode);
7038
- childNode = childNode.nextSibling;
7039
- }
6986
+ templateEl.innerHTML = trustedHTMLFromString(html);
6987
+ return templateEl;
7040
6988
  }
7041
6989
  }
7042
6990
  /**
@@ -8437,7 +8385,7 @@ class Version {
8437
8385
  /**
8438
8386
  * @publicApi
8439
8387
  */
8440
- const VERSION = new Version('15.2.0-next.3');
8388
+ const VERSION = new Version('15.2.0-rc.0');
8441
8389
 
8442
8390
  // This default value is when checking the hierarchy for a token.
8443
8391
  //