demo · v150
Mutation Timing
The other half of the v150 change: cloning is now deferred until after the surrounding insertion / removal / move steps complete. Move the select around, watch the mutation log — observers can no longer fire mid-step.
Source select & mirrors. Mutations to the <option> tree should only clone after each DOM step completes.
container A
container B
Move the whole select here. Its descendant mirrors move with it, so observers stay attached to the native clone targets.
what changed
Before v150 the browser cloned the selected option's content during the insertion / removal / move steps of the surrounding <select>. That meant a MutationObserver on a descendant <selectedcontent> could fire midway through a structural change, observing a partially-updated tree. In v150 the clone is queued so observers only see the final state.
const mo = new MutationObserver(records => {
// before v150: could fire mid-step.
// v150+: only after the outer DOM step completes.
});
mo.observe(document.querySelector('selectedcontent'),
{ childList: true, subtree: true, characterData: true });
see also
- Clone into all descendant selectedcontent — feature index
- Multiple Mirrors — companion demo
- ChromeStatus entry
- OpenUI customisable select
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗