Properly apply pending DOM changes when a transaction is dispatched #9

Closed
opened 2018-08-28 14:36:14 +02:00 by marijnh · 1 comment
marijnh commented 2018-08-28 14:36:14 +02:00 (Migrated from github.com)

Right now, if the view is updated precisely between the point where DOM changes happen and the point where the mutation observer is called, those DOM changes are ignored. It is possible to store them and apply them after the update (mapping the change objects) though, so that's what we should do.

Right now, if the view is updated precisely between the point where DOM changes happen and the point where the mutation observer is called, those DOM changes are ignored. It is possible to store them and apply them after the update (mapping the change objects) though, so that's what we should do.
marijnh commented 2018-10-27 19:00:22 +02:00 (Migrated from github.com)

Due to the way mutation observers call their callbacks (in a microtask), dispatching a transaction with dom changes pending is not actually something that can happen during sensible use (you'd have to have caused those changes in the same task that dispatched the transaction), so I've decided this is too much extra code for no concrete gain, and discarding such DOM mutations is okay.

Due to the way mutation observers call their callbacks (in a microtask), dispatching a transaction with dom changes pending is not actually something that can happen during sensible use (you'd have to have caused those changes in the same task that dispatched the transaction), so I've decided this is too much extra code for no concrete gain, and discarding such DOM mutations is okay.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/dev#9
No description provided.