element-container.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.ElementContainer = void 0;
  4. var index_1 = require("../css/index");
  5. var bounds_1 = require("../css/layout/bounds");
  6. var node_parser_1 = require("./node-parser");
  7. var debugger_1 = require("../core/debugger");
  8. var ElementContainer = /** @class */ (function () {
  9. function ElementContainer(context, element) {
  10. this.context = context;
  11. this.textNodes = [];
  12. this.elements = [];
  13. this.flags = 0;
  14. if (debugger_1.isDebugging(element, 3 /* PARSE */)) {
  15. debugger;
  16. }
  17. this.styles = new index_1.CSSParsedDeclaration(context, window.getComputedStyle(element, null));
  18. if (node_parser_1.isHTMLElementNode(element)) {
  19. if (this.styles.animationDuration.some(function (duration) { return duration > 0; })) {
  20. element.style.animationDuration = '0s';
  21. }
  22. if (this.styles.transform !== null) {
  23. // getBoundingClientRect takes transforms into account
  24. element.style.transform = 'none';
  25. }
  26. }
  27. this.bounds = bounds_1.parseBounds(this.context, element);
  28. if (debugger_1.isDebugging(element, 4 /* RENDER */)) {
  29. this.flags |= 16 /* DEBUG_RENDER */;
  30. }
  31. }
  32. return ElementContainer;
  33. }());
  34. exports.ElementContainer = ElementContainer;
  35. //# sourceMappingURL=element-container.js.map