Skip to content

[resize-observer] Behavior when the callback modifies depth #3704

@smfr

Description

@smfr

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions