You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having a simple element with a method named childrenChanged in its prototype, when in Firefox or Safai (curiously not Chrome), calls the childrenChanged method hundreds of times per second, resulting in slow/unresponsive scripts and frozen pages.
Test Case
I've put a simple reduced test case up here: http://jsbin.com/cuvap/2 - to which the contents are:
Loading this page in Chrome seems fine, but loading it in Safari or Firefox and checking the log, one can see childrenChanged seems to be recursively called:
The text was updated successfully, but these errors were encountered:
Polymer examines your prototype for methods of the form <name>Changed and automatically creates a binding that calls <name>Changed every time property <name> changes.
The children property is a native accessor, and apparently appears to Polymer to be changing continually. We'll have to investigate exactly why this is true, but it's not going to work properly in any case (native accessors are not generally observable).
If you are purposefully trying to watch for changes to children, you should use a MutationObserver instead. Otherwise, you should use a different name for your method.
We have an outstanding issue to resolve one facet of this problem here: #123.
Abstract
Having a simple element with a method named
childrenChanged
in its prototype, when in Firefox or Safai (curiously not Chrome), calls the childrenChanged method hundreds of times per second, resulting in slow/unresponsive scripts and frozen pages.Test Case
I've put a simple reduced test case up here: http://jsbin.com/cuvap/2 - to which the contents are:
Loading this page in Chrome seems fine, but loading it in Safari or Firefox and checking the log, one can see childrenChanged seems to be recursively called:
The text was updated successfully, but these errors were encountered: