Skip to content

DOMRect normalizes NaN and negative zero to zero #58240

Description

@OskarEichler

Description

The shared numeric conversion used by DOMRectReadOnly construction and mutable DOMRect setters defaults all falsy values to 0. Valid NaN is therefore replaced with zero and -0 loses its sign.

Expected behavior

Only omitted/nullish optional values should receive the zero default. Supplied numeric values should undergo normal Number conversion while preserving NaN and signed zero.

React Native Version

0.87.1 and current main

Affected Platforms

JavaScript runtime - All

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions