webapis-shadydom.umd.js 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. 'use strict';
  2. /**
  3. * @license Angular v<unknown>
  4. * (c) 2010-2022 Google LLC. https://angular.io/
  5. * License: MIT
  6. */
  7. (function (factory) {
  8. typeof define === 'function' && define.amd ? define(factory) :
  9. factory();
  10. })((function () {
  11. 'use strict';
  12. Zone.__load_patch('shadydom', function (global, Zone, api) {
  13. // https://github.com/angular/zone.js/issues/782
  14. // in web components, shadydom will patch addEventListener/removeEventListener of
  15. // Node.prototype and WindowPrototype, this will have conflict with zone.js
  16. // so zone.js need to patch them again.
  17. var HTMLSlotElement = global.HTMLSlotElement;
  18. var prototypes = [
  19. Object.getPrototypeOf(window), Node.prototype, Text.prototype, Element.prototype,
  20. HTMLElement.prototype, HTMLSlotElement && HTMLSlotElement.prototype, DocumentFragment.prototype,
  21. Document.prototype
  22. ];
  23. prototypes.forEach(function (proto) {
  24. if (proto && proto.hasOwnProperty('addEventListener')) {
  25. proto[Zone.__symbol__('addEventListener')] = null;
  26. proto[Zone.__symbol__('removeEventListener')] = null;
  27. api.patchEventTarget(global, api, [proto]);
  28. }
  29. });
  30. });
  31. }));