-
Notifications
You must be signed in to change notification settings - Fork 7
Support Shadow DOM registries #3
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
Comments
Hey @bedeoverend sorry I missed this. I think you're definitely right. |
I'm not at a computer right now but plan to try this later. |
@matthewp no worries - see the PR I've made, I'm using it in something I'm working on, and works so far. Though haven't added any tests for it yet. |
Adds support for multiple registries. Fixes #3
Hello guys, I have the shadow boundary problem. I want to register some attributes, and I want them to work on all elements in the app (even if they are in a shadow root). What's the recommended pattern to make this happen? Do I have to create the registry on each root and re-define the attribute for that root? |
I haven't attempted this personally. Is there not a way to make MutationObservers |
Unfortunately MO
Sure! #3 |
Given the MutationObserver targets the main
document
, it won't observe mutations inside any Shadow Tree. It's a bit of a niche, but be interested to see whether it's worthwhile supporting.As far as I can tell, it would take just changing this line to be
var root = document;
rather thandocument.documentElement
I don't believe there's any repercussions, given the MO target just needs to be a Node? Then you can pass a Shadow Tree or any document fragment to the
CustomAttributeRegistry
constructor.That would also mean having to make the
CustomAttributeRegistry
class public to define your own registries.Thoughts?
The text was updated successfully, but these errors were encountered: