Elements Dynamically added to the DOM don't get styled if they are added outside of a `requestAnimationFrame`
This is more of a clarification question than an issue. I've run into a problem where if you add a full custom element tree to the DOM dynamically, and that tree also has dynamic DOM creation going on inside of it, the styles of the child's DOM aren't correctly updated. Sometimes this results in no scoping, and in other times this results in incorrect scoping. This is, as far as I can tell, very similar if not identical to what's going on in this polymer issue. Everything however behaves as expected if the DOM additions are done within a requestAnimationFrame. I've created a simplish reproducer that you can see here (open in firefox or ie).
Is this behavior expected? The documentation just says I have to call ShadyCSS.styleSubtree(element) when dynamically adding DOM however that doesn't seem to be enough.
Thanks!
Turns out that this was a bad timing issue caused by CodePen. So the reproducer isn't valid. That being said the polymer issue still stands. I've got a PR that I believe solves the problem in the polymer issue and what was intended here.
I'm closing this issue since the reproducer is and I believe I've found a solution to the root problem of nodes being incorrectly scoped.