@angular/platform-browser 12.0.0-rc.0 → 12.0.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v12.0.0-rc.0
2
+ * @license Angular v12.0.0
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
package/animations.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v12.0.0-rc.0
2
+ * @license Angular v12.0.0
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v12.0.0-rc.0
2
+ * @license Angular v12.0.0
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v12.0.0-rc.0
2
+ * @license Angular v12.0.0
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v12.0.0-rc.0
2
+ * @license Angular v12.0.0
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -385,6 +385,7 @@
385
385
  BrowserDomAdapter.prototype.isShadowRoot = function (node) {
386
386
  return node instanceof DocumentFragment;
387
387
  };
388
+ /** @deprecated No longer being used in Ivy code. To be removed in version 14. */
388
389
  BrowserDomAdapter.prototype.getGlobalEventTarget = function (doc, target) {
389
390
  if (target === 'window') {
390
391
  return window;
@@ -693,6 +694,7 @@
693
694
  * @param handler A function to call when the notification occurs. Receives the
694
695
  * event object as an argument.
695
696
  * @returns A callback function that can be used to remove the handler.
697
+ * @deprecated No longer being used in Ivy code. To be removed in version 14.
696
698
  */
697
699
  EventManager.prototype.addGlobalEventListener = function (target, eventName, handler) {
698
700
  var plugin = this._findPluginFor(eventName);
@@ -773,32 +775,39 @@
773
775
  function DomSharedStylesHost(_doc) {
774
776
  var _this = _super.call(this) || this;
775
777
  _this._doc = _doc;
776
- _this._hostNodes = new Set();
777
- _this._styleNodes = new Set();
778
- _this._hostNodes.add(_doc.head);
778
+ // Maps all registered host nodes to a list of style nodes that have been added to the host node.
779
+ _this._hostNodes = new Map();
780
+ _this._hostNodes.set(_doc.head, []);
779
781
  return _this;
780
782
  }
781
- DomSharedStylesHost.prototype._addStylesToHost = function (styles, host) {
783
+ DomSharedStylesHost.prototype._addStylesToHost = function (styles, host, styleNodes) {
782
784
  var _this = this;
783
785
  styles.forEach(function (style) {
784
786
  var styleEl = _this._doc.createElement('style');
785
787
  styleEl.textContent = style;
786
- _this._styleNodes.add(host.appendChild(styleEl));
788
+ styleNodes.push(host.appendChild(styleEl));
787
789
  });
788
790
  };
789
791
  DomSharedStylesHost.prototype.addHost = function (hostNode) {
790
- this._addStylesToHost(this._stylesSet, hostNode);
791
- this._hostNodes.add(hostNode);
792
+ var styleNodes = [];
793
+ this._addStylesToHost(this._stylesSet, hostNode, styleNodes);
794
+ this._hostNodes.set(hostNode, styleNodes);
792
795
  };
793
796
  DomSharedStylesHost.prototype.removeHost = function (hostNode) {
797
+ var styleNodes = this._hostNodes.get(hostNode);
798
+ if (styleNodes) {
799
+ styleNodes.forEach(removeStyle);
800
+ }
794
801
  this._hostNodes.delete(hostNode);
795
802
  };
796
803
  DomSharedStylesHost.prototype.onStylesAdded = function (additions) {
797
804
  var _this = this;
798
- this._hostNodes.forEach(function (hostNode) { return _this._addStylesToHost(additions, hostNode); });
805
+ this._hostNodes.forEach(function (styleNodes, hostNode) {
806
+ _this._addStylesToHost(additions, hostNode, styleNodes);
807
+ });
799
808
  };
800
809
  DomSharedStylesHost.prototype.ngOnDestroy = function () {
801
- this._styleNodes.forEach(function (styleNode) { return common.ɵgetDOM().remove(styleNode); });
810
+ this._hostNodes.forEach(function (styleNodes) { return styleNodes.forEach(removeStyle); });
802
811
  };
803
812
  return DomSharedStylesHost;
804
813
  }(SharedStylesHost));
@@ -808,6 +817,9 @@
808
817
  DomSharedStylesHost.ctorParameters = function () { return [
809
818
  { type: undefined, decorators: [{ type: i0.Inject, args: [common.DOCUMENT,] }] }
810
819
  ]; };
820
+ function removeStyle(styleNode) {
821
+ common.ɵgetDOM().remove(styleNode);
822
+ }
811
823
 
812
824
  var NAMESPACE_URIS = {
813
825
  'svg': 'http://www.w3.org/2000/svg',
@@ -2380,7 +2392,7 @@
2380
2392
  /**
2381
2393
  * @publicApi
2382
2394
  */
2383
- var VERSION = new i0.Version('12.0.0-rc.0');
2395
+ var VERSION = new i0.Version('12.0.0');
2384
2396
 
2385
2397
  /**
2386
2398
  * @license