Open TimvdLippe opened 6 years ago
From @CITguy on April 24, 2017 22:45
childNodes
is a read-only property. Its length doesn't change, so you never reach your exit condition for your while
loop.
Try iterating over div.children
instead.
var children = div.children;
for (var i = 0; i < children.length; i++) {
svg.appendChild(children[i]);
}
From @peterjosling on April 24, 2017 22:57
The code works fine in all of Chrome, Safari and Edge without webcomponents.js installed — is it not specified behaviour?
The actual code in question isn't owned by my team so we weren't able to modify it. We instead decided to remove webcomponents.js entirely as we didn't need it any longer.
From @e111077 on April 24, 2017 23:52
@notwaldorf (I'm not a part of the org so I can't tag) this is a source:hooli
bug.
This is an issue in ShadyDOM still: http://jsbin.com/muyivurufe/1/edit?html,js,console
Is https://github.com/webcomponents/shadydom/pull/226 related? What about https://github.com/webcomponents/shadydom/pull/286?
This may be fixed in ShadyDOM after the refactoring.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
From @peterjosling on October 3, 2016 13:6
I've got some code using an IE-specific hack to set innerHTML on an SVG element. The hack works fine in Chrome (always), but breaks in Edge when the full webcomponents.js is included. (Code words fine with -lite). JSbin here. In Chrome/Safari, the loop body executes once. In Edge, it loops infinitely.
As far as I'm aware, the
children
NodeList should be live, as it's active in the DOM - and that's how it behaves in all browsers including Edge when webcomponents.js is not included.Copied from original issue: webcomponents/webcomponentsjs#630