-
Notifications
You must be signed in to change notification settings - Fork 377
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
Template batch mutations and side effects #906
Comments
Because |
It's specifically about script and iframe insertions and they have their own queue as you can insert multiple together, but you don't want to execute them before they are all inserted. (Let's assume mutation events are completely disabled as that seems like a solid plan.) |
Wow, I see there's a lot of history in whatwg/dom#808. But I think those are separate issues from the parts batch commit(), and they can be tackled independently. For the batching concept, can we view the subtree where all the parts are being committed as a DocumentFragment, for the duration of the commit()? Therefore, DOM insertions of scripts and iframes don't run immediately. Only after all the DOM mutations have been completed, does the UA initiate script execution and iframe loading, in the parts order inside a PartGroup. This way, each browser's behavior will be exactly as @annevk outline in the example, issue/575. You can think of it as adding scripts and iframes to a DocumentFragment and inserting its content into the DOM. This is just a conceptual framework. We don't need to make the whole subtree a DocumentFragment, then reinsert back into DOM. But it's to highlight the expected behavior. UA can hold references to these part values and execute them afterward. I think it may be necessary to define the two phases of batch commit: Phase_Mutation & Phase_Script. What do you think? |
I suspect that's roughly what we have to do, but given that user agents are not interoperable on those phases I don't think it can be tackled independently. We need to actually get agreement on that model. |
With whatwg/dom#808 still unsolved it seems somewhat hard to figure out how batch mutations would have to change that "unknown" model. (Because even if we disable mutation events, script and iframe insertions and such probably have to remain functioning.)
The text was updated successfully, but these errors were encountered: