Skip to content

[resize-observer] Should "resize loop error notification" be a warning instead of an error? #5488

@trusktr

Description

@trusktr

The spec says

Infinite loop is prevented by shrinking the set of nodes that can notify at every iteration. In each iteration, only nodes deeper than the shallowest node in previous iteration can notify.

An error is generated if notification loop completes, and there are undelivered notifications. Elements with undelivered notifications will be considered for delivery in the next loop.

which seems like the intent is for this to be a warning, because behavior is not to halt a program, but to advise that remaining resize observations will be fired in the next loop.

In Chrome the message is ResizeObserver loop limit exceeded. Valid error handling code (as a search for this on GitHub shows) gets caught up by this error and programs are unintentionally halted for what seems like a warning.

As an example (at time of writing this), https://lume.io/docs/#/examples/shadow-dom shows that this error can cause unexpected termination of a program (downside the window to trigger termination of the program in on the right of the code box).

Here are some GitHub issues showing users having issues with termination by 3rd libraries due to this "error": https://www.google.com/search?q=site%3Agithub.com%20ResizeObserver%20loop%20limit%20exceeded&cad=h

I think perhaps treating this as a warning might be a better deal; perhaps "resize loop warning notification".

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