Skip to content
This repository has been archived by the owner on Nov 11, 2019. It is now read-only.

attachShadow action should be observable / recorded by MutationObserver #119

Open
gullerya opened this issue Apr 6, 2017 · 6 comments
Open
Milestone

Comments

@gullerya
Copy link

gullerya commented Apr 6, 2017

AFAIK, MutationObserver set on some element with correct options is effectively able to notify any change to that element's subtree including nodes manipulations and attributes changes.

But in case of creating shadow DOM, there appears new citizen in the DOM tree, which is transparent to the MutationObserver set on any upper element in the DOM.
Therefore we need to observe the shadowRoot itself, but how can an application know that the root is attached in first place. It was suggested somewhere else to override attachShadow method, but I must say that I don't feel that it's a right way to go.

Proposal: attachShadow should by recorded be the MutationObserver and delivered as one of it's records (either of an existing type or a new, dedicated one).

@yongsheng
Copy link
Collaborator

thanks. shadow dom may not be addressed in 4.1. Need to align with other specs like HTML.

@gullerya
Copy link
Author

So, are you saying that this functionality is on the list but deferred and if yes - any rough estimation when it will become relevant?

@yongsheng
Copy link
Collaborator

Need to check with other specs, no detailed plan yet.

@chaals
Copy link
Collaborator

chaals commented May 9, 2017

To elaborate a bit, the plan is to get DOM 4.1 to Candidate Recommendation in the next couple of months or so, and Shadow DOM does not appear to have sufficient implementation to pass CR yet.

On the other hand it seems that it should make it into the branch more or less when the CR is ready.

As @yongsheng noted, this is in line with the HTML 5.2 Recommendation not incorporating Custom Elements, although it seems likely that they will be ready for later this year, in the Working Drafts for the next version...

@yongsheng
Copy link
Collaborator

@gullerya shadow DOM is now in draft. any comments is welcome.

@yongsheng yongsheng added this to the m5 milestone Jan 16, 2018
@gullerya
Copy link
Author

gullerya commented Jan 17, 2018

I just took a brief look onto the draft and couldn't find anything related to this specific issue (there are mentions of tracking mutations within the ShadowDom as we as slotting changes, but not the attachment of the ShadowDom itself.
Am I missing something or are you aware of any plans to define it in near future?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants