What is the order of MutationRecords received by MutationObservers?

风格不统一 提交于 2019-12-06 02:31:16

In the spec, section 4.3.2 Queuing a mutation record, step 4.8:

Append record to observer’s record queue.

Then, if you search the spec for "queue a mutation record", you will see every action that can initiate the "queue a mutation record" algorithm.

From this you can tell that, for example, if you remove a node from the DOM, a mutation record will be queued (appended to the MutationRecords list).

Therefore, i believe it is safe to infer that MutationRecords are in the order in which they happened.

(You can easily do a test to verify this, add and remove some nodes synchronously, then inspect the MutationRecord)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!