-
Notifications
You must be signed in to change notification settings - Fork 18
attachShadow action should be observable / recorded by MutationObserver #119
Comments
thanks. shadow dom may not be addressed in 4.1. Need to align with other specs like HTML. |
So, are you saying that this functionality is on the list but deferred and if yes - any rough estimation when it will become relevant? |
Need to check with other specs, no detailed plan yet. |
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... |
@gullerya shadow DOM is now in draft. any comments is welcome. |
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. |
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).The text was updated successfully, but these errors were encountered: