You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calculate depth for node happens each time the "Gather active observations at depth" steps are run.
This implies that callback that changes the depth can trigger that observer getting called multiple times in one set of ResizeObserver notifications. For example, a call back could modify the DOM to add an element in its ancestor chain. This could lead to the steps never exiting.
One way to avoid this would be to compute the depth once per element at the start of firing ResizeObserver notifications.
The text was updated successfully, but these errors were encountered:
I do not think this edge case is a problem.
For each additional loop, callback would have to add an Element to ancestor chain. This is unlikely to happen by accident. If it happens intentionally, user agent will be in an infinite loop, and also run out of memory,
https://drafts.csswg.org/resize-observer-1/#html-event-loop
Calculate depth for node happens each time the "Gather active observations at depth" steps are run.
This implies that callback that changes the depth can trigger that observer getting called multiple times in one set of ResizeObserver notifications. For example, a call back could modify the DOM to add an element in its ancestor chain. This could lead to the steps never exiting.
One way to avoid this would be to compute the depth once per element at the start of firing ResizeObserver notifications.
The text was updated successfully, but these errors were encountered: