{"action":"created","issue":{"url":"https://api.github.com/repos/basic-web-components/basic-carousel/issues/2","labels_url":"https://api.github.com/repos/basic-web-components/basic-carousel/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/basic-web-components/basic-carousel/issues/2/comments","events_url":"https://api.github.com/repos/basic-web-components/basic-carousel/issues/2/events","html_url":"https://github.com/basic-web-components/basic-carousel/issues/2","id":106055531,"number":2,"title":"Memory leak if toggling element style between display block and none multiple times","user":{"login":"kristfal","id":5638107,"avatar_url":"https://avatars.githubusercontent.com/u/5638107?v=3","gravatar_id":"","url":"https://api.github.com/users/kristfal","html_url":"https://github.com/kristfal","followers_url":"https://api.github.com/users/kristfal/followers","following_url":"https://api.github.com/users/kristfal/following{/other_user}","gists_url":"https://api.github.com/users/kristfal/gists{/gist_id}","starred_url":"https://api.github.com/users/kristfal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kristfal/subscriptions","organizations_url":"https://api.github.com/users/kristfal/orgs","repos_url":"https://api.github.com/users/kristfal/repos","events_url":"https://api.github.com/users/kristfal/events{/privacy}","received_events_url":"https://api.github.com/users/kristfal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-11T17:19:00Z","updated_at":"2015-09-21T17:02:14Z","closed_at":null,"body":"Hey,\r\n\r\ngetting a memory leak with this component. The current setup is:\r\n\r\n\r\n```html\r\n\r\n<fullscreen-overlay>\r\n\r\n  <basic-carousel>\r\n    (items)\r\n  </basic-carousel>\r\n\r\n<fullscreen-overlay>\r\n\r\n\r\n```\r\n\r\n\r\nThe fullscreen-overlay:\r\n\r\n\r\n```html\r\n\r\n<dom-module id=\"fullscreen-overlay\">\r\n  <style>\r\n    :host {\r\n      display: block;\r\n      position: fixed;\r\n      top: 0;\r\n      left: 0;\r\n      right: 0;\r\n      bottom: 0;\r\n      margin: 0;\r\n      padding: 0;\r\n      background-color: black;\r\n      z-index: 12;\r\n    }\r\n  </style>\r\n  <template>\r\n    <content></content>\r\n  </template>\r\n</dom-module>\r\n<script>\r\n(function() {\r\n  Polymer({\r\n    is: 'fullscreen-overlay',\r\n    behaviors: [Polymer.NeonAnimationRunnerBehavior],\r\n    properties: {\r\n      opened: {\r\n        type: Boolean,\r\n        value: false,\r\n        reflectToAttribute: true,\r\n        notify: true\r\n      },\r\n      animationConfig: {\r\n        value: function() {\r\n          return {\r\n            'entry': {\r\n              name: 'scale-up-animation',\r\n              node: this,\r\n              axis: '',\r\n              timing: {duration: 500}\r\n            },\r\n            'exit': {\r\n              name: 'fade-out-animation',\r\n              node: this,\r\n              timing: {duration: 500}\r\n            }\r\n          };\r\n        }\r\n      }\r\n    },\r\n    observers: [\r\n      '_displayHandler(opened)'\r\n    ],\r\n    listeners: {\r\n      'neon-animation-finish': '_onNeonAnimationFinish'\r\n    },\r\n    toggleOverlay: function() {\r\n      this.opened = !this.opened;\r\n    },\r\n    open: function() {\r\n      this.opened = true;\r\n    },\r\n    close: function() {\r\n      this.opened = false;\r\n    },\r\n    _displayHandler: function() {\r\n      if (this.opened === true) {\r\n        this.playAnimation('entry');\r\n        this.style.display = 'block';\r\n      } else {\r\n        this.playAnimation('exit');\r\n      }\r\n    },\r\n    _onNeonAnimationFinish: function() {\r\n      if (this.opened === false) {\r\n        this.style.display = 'none';\r\n      }\r\n    }\r\n  });\r\n})();\r\n</script>\r\n\r\n\r\n```\r\n\r\nCalling open and close on the full screen element for 6-8 times completely freezes the app. This behavior is repeated consistently on Chrome, Safari, Safari mobile, FF and Opera.\r\n\r\nDisabling animations in the fullscreen-overlay and just toggling between display none/block causes the same leak.\r\n\r\nRemoving the basic-carousel and just showing the inner content doesn't trigger any leaks."},"comment":{"url":"https://api.github.com/repos/basic-web-components/basic-carousel/issues/comments/142043489","html_url":"https://github.com/basic-web-components/basic-carousel/issues/2#issuecomment-142043489","issue_url":"https://api.github.com/repos/basic-web-components/basic-carousel/issues/2","id":142043489,"user":{"login":"JanMiksovsky","id":86139,"avatar_url":"https://avatars.githubusercontent.com/u/86139?v=3","gravatar_id":"","url":"https://api.github.com/users/JanMiksovsky","html_url":"https://github.com/JanMiksovsky","followers_url":"https://api.github.com/users/JanMiksovsky/followers","following_url":"https://api.github.com/users/JanMiksovsky/following{/other_user}","gists_url":"https://api.github.com/users/JanMiksovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/JanMiksovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanMiksovsky/subscriptions","organizations_url":"https://api.github.com/users/JanMiksovsky/orgs","repos_url":"https://api.github.com/users/JanMiksovsky/repos","events_url":"https://api.github.com/users/JanMiksovsky/events{/privacy}","received_events_url":"https://api.github.com/users/JanMiksovsky/received_events","type":"User","site_admin":false},"created_at":"2015-09-21T17:02:14Z","updated_at":"2015-09-21T17:02:14Z","body":"I could use help reproducing this problem.\r\n\r\nI've created a [basic-carousel-issue-2](https://github.com/JanMiksovsky/basic-carousel-issue-2) repo that includes your code and the scenario as I understand it. Running this locally, I use the debugger to manually invoke the open() and close() methods on the fullscreen-overlay element. However, I'm unable to reproduce the problem. I tried invoking open/close 10 times, with no apparent result. I tried this in both Mac Chrome and Safari.\r\n\r\nCan you please clone the repro, and amend the code so that it reproduces the problem you're seeing?"}}