-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Style node management causes blocking error in ShadowDOM application. #4975
Comments
This is affecting our application as well. |
I am having the same error too. |
Confirmed an issue. I think the queryselector should be changed to |
The more I review my code in #4976, the more I think the easier answer would be to use something like:
Obviously, the variable naming should be updated to match, but this covers for more corner cases around |
The real issue is that the processing should only occur on HTML styles and exclude SVG styles, which I think is what @TimvdLippe was angling for. However, the However, I see a couple additional issues. This code assumes template.content.insertBefore(s, lastStyle); To correctly insert it before the last style, the code would need to be changed to this: lastStyle.parentNode.insertBefore(s, lastStyle); @azakus BUT, I'm actually confused how the existing logic around |
Ok, was slightly wrong there. Confirmed we don't actually need to separate SVG styles from HTML styles; once the |
Find the correct spot to add "included" styles in the template by keeping track of which "concrete" style in the template we have encountered and inserting the "included" styles before them. Fixes #4975
I had this same issue affecting an element which contained within it two style tags, one at the top of the template, and one in the middle of the template. |
Fixed in #4979 and pushed as 2.3.1 |
The changes found here (819652eb#diff-41695d1bc0c64b86f0e5a7878f58df0f) throw the following error:
Uncaught DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
When there is an
<svg>
element with a<style>
tag inside of the template of an element that has styles included from a shared source.Live Demo
http://jsbin.com/lumapiquda/1/edit?html,console,output
Steps to Reproduce
my-element
Expected Results
No errors throw.
Actual Results
Uncaught DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
Browsers Affected
Versions
The text was updated successfully, but these errors were encountered: